Skip to content

Commit

Permalink
Remove redundant args (#379)
Browse files Browse the repository at this point in the history
* remove redundant args

* fmt

* clipppy
  • Loading branch information
shouc authored Nov 25, 2023
1 parent aa176f8 commit b40d850
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 184 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ItyFuzz is a blazing-fast EVM and MoveVM smart contract hybrid fuzzer that combi

## Example

Generating full exploit to steal funds from a [contract](https://polygonscan.com/address/0x5d6c48f05ad0fde3f64bab50628637d73b1eb0bb) with read-only reentrancy vulnerability on Polygon.
Generating full exploit to steal funds from a [contract](https://polygonscan.com/address/0x5d6c48f05ad0fde3f64bab50628637d73b1eb0bb) with flashloan + read-only reentrancy vulnerability on Polygon.

```bash
# Install ItyFuzz
Expand All @@ -23,7 +23,8 @@ ityfuzzup
# Fork Polygon at block 35718198 and fuzz the contract
ETH_RPC_URL=https://polygon-rpc.com ityfuzz evm\
-t 0xbcf6e9d27bf95f3f5eddb93c38656d684317d5b4,0x5d6c48f05ad0fde3f64bab50628637d73b1eb0bb\
-c polygon -i -p -o -f\
-c polygon\
--flashloan\
--onchain-block-number 35718198\
--onchain-etherscan-api-key TR24XDQF35QCNK9PZBV8XEH2XRSWTPWFWT # <-- Get your own API key at https://polygonscan.com/apis if this one is rate limited
```
Expand Down
5 changes: 1 addition & 4 deletions integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,13 @@ def test_onchain(test):
"5m",
"./target/release/ityfuzz",
"evm",
"-o",
"-t",
contract_addresses,
"-c",
chain,
"--onchain-block-number",
"-b",
str(block_number),
"-f",
"-i",
"-p",
"--onchain-etherscan-api-key",
etherscan_key,
"--work-dir",
Expand Down
16 changes: 5 additions & 11 deletions src/evm/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::evm::contract_utils::ContractLoader;
use crate::{
evm::{
blaz::builder::BuildJob,
onchain::endpoints::{OnChainConfig, PriceOracle},
onchain::endpoints::OnChainConfig,
oracles::erc20::IERC20OracleFlashloan,
types::EVMAddress,
},
Expand Down Expand Up @@ -64,17 +64,15 @@ pub struct Config<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI> {
pub concolic_caller: bool,
pub concolic_timeout: u32,
pub concolic_num_threads: usize,
pub fuzzer_type: FuzzerTypes,
pub contract_loader: ContractLoader,
pub oracle: Vec<Rc<RefCell<dyn Oracle<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI>>>>,
pub producers: Vec<Rc<RefCell<dyn Producer<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI>>>>,
pub price_oracle: Box<dyn PriceOracle>,
pub replay_file: Option<String>,
pub flashloan_oracle: Rc<RefCell<IERC20OracleFlashloan>>,
pub selfdestruct_oracle: bool,
pub reentrancy_oracle: bool,
pub state_comp_oracle: Option<String>,
pub state_comp_matching: Option<String>,
// pub state_comp_oracle: Option<String>,
// pub state_comp_matching: Option<String>,
pub work_dir: String,
pub write_relationship: bool,
pub run_forever: bool,
Expand All @@ -86,7 +84,6 @@ pub struct Config<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI> {
pub spec_id: String,
pub only_fuzz: HashSet<EVMAddress>,
pub typed_bug: bool,
pub selfdestruct_bug: bool,
pub arbitrary_external_call: bool,
pub math_calculate_oracle: bool,
pub builder: Option<BuildJob>,
Expand All @@ -104,16 +101,14 @@ impl<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI> Debug for Config<VS, Addr,
.field("flashloan", &self.flashloan)
.field("concolic", &self.concolic)
.field("concolic_caller", &self.concolic_caller)
// .field("fuzzer_type", &self.fuzzer_type)
.field("contract_loader", &self.contract_loader)
// .field("oracle", &self.oracle)
// .field("producers", &self.producers)
.field("price_oracle", &self.price_oracle)
.field("replay_file", &self.replay_file)
// .field("flashloan_oracle", &self.flashloan_oracle)
.field("selfdestruct_oracle", &self.selfdestruct_oracle)
.field("state_comp_oracle", &self.state_comp_oracle)
.field("state_comp_matching", &self.state_comp_matching)
// .field("state_comp_oracle", &self.state_comp_oracle)
// .field("state_comp_matching", &self.state_comp_matching)
.field("work_dir", &self.work_dir)
.field("write_relationship", &self.write_relationship)
.field("run_forever", &self.run_forever)
Expand All @@ -124,7 +119,6 @@ impl<VS, Addr, Code, By, Loc, SlotTy, Out, I, S, CI> Debug for Config<VS, Addr,
.field("spec_id", &self.spec_id)
.field("only_fuzz", &self.only_fuzz)
.field("typed_bug", &self.typed_bug)
.field("selfdestruct_bug", &self.selfdestruct_bug)
// .field("builder", &self.builder)
.finish()
}
Expand Down
Loading

0 comments on commit b40d850

Please sign in to comment.