evm_cfg_builder
evm_cfg_builder copied to clipboard
Add unit tests
Do we have a standard unit test framework that we use?
I dont think so
@mossberg was working on a fork of solc that could output the edges of a smart contract We could build unit tests on top of it
Yup, the solc fork is here: https://github.com/trailofbits/solidity/tree/basic-block-edges
and some example current output:
[I] mark forge ~/c/e/s/corpus ❯ mysolc qq.sol --bin-runtime
0x7c -> [0x7d]
0xb -> [0xc, 0x3f]
0x3e -> [0x3f, 0x45]
0x4b -> [0x4c, 0x51]
0x57 -> [0x6e]
0x85 -> [0x86, 0x94]
0x93 -> [0x7d]
0x9b -> [0x58]
0xb -> [0xc, 0x11]
Warning: This is a pre-release compiler version, please do not use it in production.
qq.sol:1:1: Warning: Source file does not specify required compiler version!
contract C {
^ (Relevant source part starts here and spans across multiple lines).
qq.sol:3:1: Warning: Function state mutability can be restricted to pure
function x() public returns (uint){
^ (Relevant source part starts here and spans across multiple lines).