-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: call exec_swap_nth instead of dup
- Loading branch information
Showing
9 changed files
with
126 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#![allow(unused_imports)] | ||
use ser::{ | ||
bvc, bvi, conversion::*, machine::*, memory::*, parser::*, stack::*, storage::*, traits::*, | ||
}; | ||
use z3::ast::*; | ||
/* | ||
SHOULD REVERT: | ||
PUSH1 0x42 | ||
PUSH1 0x00 | ||
PUSH2 0x5000 | ||
CALLDATASIZE | ||
SWAP2 | ||
PUSH1 0x0e // 14 | ||
JUMPI | ||
REVERT | ||
JUMPDEST | ||
PUSH1 0 | ||
RETURN | ||
SHOULD NOT REVERT: | ||
PUSH1 0x42 | ||
PUSH1 0x00 | ||
PUSH2 0x5000 | ||
PUSH1 0x40 | ||
SWAP3 | ||
PUSH1 0x0e // 14 | ||
JUMPI | ||
REVERT | ||
JUMPDEST | ||
PUSH1 0x10 | ||
RETURN | ||
*/ | ||
const SWAP2_JUMPI_REVERT: &str = r#"604260006150003691600d57fd5b6000f3"#; | ||
const SWAP3_JUMPI_RETURN_16: &str = r#"60426000615000604091600e57fd5b6000f3"#; | ||
fn main() { | ||
let pgm = Parser::with_pgm(SWAP2_JUMPI_REVERT).parse(); | ||
let mut evm = Evm::new(pgm); | ||
let execution = evm.exec(); | ||
eprintln!("Execution tree: {:#?}", execution.states); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters