140 lines
6.8 KiB
Plaintext
140 lines
6.8 KiB
Plaintext
// BSD 3-Clause License
|
|
//
|
|
// Copyright (c) 2020, The Ohio State Univerisity. All rights reserved.
|
|
//
|
|
// Redistribution and use in source and binary forms, with or without
|
|
// modification, are permitted provided that the following conditions are met:
|
|
//
|
|
// * Redistributions of source code must retain the above copyright notice, this
|
|
// list of conditions and the following disclaimer.
|
|
//
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
// and/or other materials provided with the distribution.
|
|
//
|
|
// * Neither the name of the copyright holder nor the names of its
|
|
// contributors may be used to endorse or promote products derived from
|
|
// this software without specific prior written permission.
|
|
//
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
// INPUT
|
|
|
|
.decl edge(h:Statement, t:Statement)
|
|
.decl def(var:Variable, stmt:Statement, loc:number, cd:number, cn:number)
|
|
.decl use(var:Variable, stmt:Statement, i:number, loc:number, cd:number, cn:number)
|
|
.decl op(stmt:Statement, op:Opcode, loc:number)
|
|
.decl value(var:Variable, val:Value)
|
|
|
|
.decl op_SLOAD(stmt:Statement, arg_loc:Variable, val:Variable, loc:number, call_depth: number, call_number:number)
|
|
|
|
.decl op_JUMPI(stmt:Statement, dest:Variable, cond:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_SSTORE(stmt:Statement, arg_addr:Variable, arg_val:Variable, loc:number, call_depth: number, call_number:number)
|
|
|
|
.decl op_LT(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_GT(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_SLT(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_SGT(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_EQ(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_SUB(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_ADD(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_MUL(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_EXP(stmt:Statement, left_var:Variable, right_var:Variable, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_CALLDATALOAD(stmt:Statement, index:Variable, res:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_EXTCODESIZE(stmt:Statement, addr:Variable, size:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_TIMESTAMP(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_NUMBER(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_COINBASE(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_DIFFICULTY(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_GASLIMIT(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_ORIGIN(stmt:Statement, res_var:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_CALL(stmt:Statement, gas:Variable, target:Variable, value:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_CALLCODE(stmt:Statement, gas:Variable, target:Variable, value:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_DELEGATECALL(stmt:Statement, gas:Variable, target:Variable, value:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_DELEGATE(stmt:Statement, gas:Variable, target:Variable, value:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
//.decl op_STATICCALL(stmt:Statement, gas:Variable, target:Variable, value:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number)
|
|
.decl op_STATICCALL(stmt:Statement, gas:Variable, target:Variable, data_start:Variable, data_length:Variable, return_start:Variable, return_length:Variable, success:Variable, loc:number, call_depth:number, call_number:number) // zoey - op_STATICCALL for testing
|
|
|
|
.decl op_SELFDESTRUCT(stmt:Statement, addr:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_REVERT(stmt:Statement, var1:Variable, var2:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl sc_addr(address:Value)
|
|
|
|
.decl op_STOP(stmt:Statement, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_RETURN(stmt:Statement, offset:Variable, length:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.decl op_CALLER(stmt:Statement, caller:Variable, loc:number, call_depth:number, call_number:number)
|
|
|
|
.input edge
|
|
.input def
|
|
.input use
|
|
.input op
|
|
.input value
|
|
.input op_SLOAD
|
|
.input op_JUMPI
|
|
.input op_SSTORE
|
|
.input op_LT
|
|
.input op_GT
|
|
.input op_SLT
|
|
.input op_SGT
|
|
.input op_EQ
|
|
|
|
.input op_SUB
|
|
.input op_ADD
|
|
.input op_MUL
|
|
.input op_EXP
|
|
.input op_CALLDATALOAD
|
|
|
|
.input op_EXTCODESIZE
|
|
|
|
.input op_TIMESTAMP
|
|
.input op_NUMBER
|
|
.input op_COINBASE
|
|
.input op_DIFFICULTY
|
|
.input op_GASLIMIT
|
|
.input op_ORIGIN
|
|
.input op_CALL
|
|
.input op_CALLCODE
|
|
.input op_DELEGATECALL
|
|
.input op_DELEGATE
|
|
.input op_STATICCALL
|
|
.input op_SELFDESTRUCT
|
|
.input op_REVERT
|
|
.input sc_addr
|
|
.input op_STOP
|
|
.input op_RETURN
|
|
.input op_CALLER
|