Run sFuzz with Customized EVM
Features should be supported by evm to integrate with sFuzz. Section 1 provides a high level of a required interface. Section 2 contains more details
1 Background
Normally, one contract in Ethereum
can call external contracts. It is root cause of all vulnerabilities and thus sFuzz
needs to keep track of all calls in call chain. E.g
A normal user call to withdraw()
, then Ethereum
will be sent back to that user at line 12. A call chain should be:
withdraw()
ofSimpleDao
-->fallback()
ofmsg.sender
We use above contracts to explain supporting features of evm
Deploy and execute contract directly without mining process,
E.g:
sFuzz
can directly set byte codes ofSimpleDAO
contract toevm
and execute bothconstructor
andwithdraw
functions.
Monitor all calls in a call chain.
E.g:
sFuzz
has to know the results of all functions:withdraw()
andfallback()
in above call chain. The result should contain exception whenever it happens.
Edit parameters in each call of call chain.
E.g: in line 8 of
ReentrancyAttacker.sol
file, parameter of call isbytes4(255)
. It is a trash value butsFuzz
changes it to signature of any function to trigger abnormal call chain.
Keep track of executed opcodes including program counter, stack, memory
2 Interface
These following methods should be supported by evm to make sFuzz fit to your system.
Last updated