Skip to content

Commit

Permalink
some param changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shouc committed Oct 13, 2023
1 parent e30259b commit bf1ffb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/evm/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ pub static mut ACTIVE_MATCH_EXT_CALL: bool = false;
const CONTROL_LEAK_DETECTION: bool = false;
const UNBOUND_CALL_THRESHOLD: usize = 3;

// if a PC transfers control to >2 addresses, we consider call at this PC to be unbounded
const CONTROL_LEAK_THRESHOLD: usize = 2;
// if a PC transfers control to >10 addresses, we consider call at this PC to be unbounded
const CONTROL_LEAK_THRESHOLD: usize = 10;

impl<VS, I, S, SC> FuzzHost<VS, I, S, SC>
where
Expand Down
2 changes: 1 addition & 1 deletion src/evm/oracles/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Oracle<EVMState, EVMAddress, Bytecode, Bytes, EVMAddress, EVMU256, Vec<u8>,

if exec_res.new_state.state.flashloan_data.earned
> exec_res.new_state.state.flashloan_data.owed
&& exec_res.new_state.state.flashloan_data.earned - exec_res.new_state.state.flashloan_data.owed > EVMU512::from(50_000_000_000_000_000_000_000_0u128) // > 0.5ETH
&& exec_res.new_state.state.flashloan_data.earned - exec_res.new_state.state.flashloan_data.owed > EVMU512::from(10_000_000_000_000_000_000_000_0u128) // > 0.1ETH
{
let net = exec_res.new_state.state.flashloan_data.earned
- exec_res.new_state.state.flashloan_data.owed;
Expand Down
5 changes: 2 additions & 3 deletions src/evm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,8 @@ where
| InstructionResult::ControlLeak
| InstructionResult::SelfDestruct
| InstructionResult::AddressUnboundedStaticCall
| InstructionResult::ArbitraryExternalCallAddressBounded(_, _, _) => false,
_ => true,
},
| InstructionResult::ArbitraryExternalCallAddressBounded(_, _, _)
),
new_state: StagedVMState::new_with_state(
VMStateT::as_any(&r.new_state)
.downcast_ref_unchecked::<VS>()
Expand Down

0 comments on commit bf1ffb8

Please sign in to comment.