Skip to content

Commit

Permalink
use private endpoint insteadof dexscreen to getPair (#190)
Browse files Browse the repository at this point in the history
* use private endpoint insteadof dexscreen to getPair

* add getPair cache and fix bug

* prioritize env as RPC url

* Compatible with hexadecimal and decimal block strings

* Restore Cargo.toml

* Compatible with pancake+uniswap on bsc

* remove unused decimals in PairData

* Prune inefficient pairs

* Error message reminder

* remove onchain bytecode swapping

* remove bytecode swapping in middleware

---------

Co-authored-by: Chaofan Shou <[email protected]>
  • Loading branch information
0xAWM and shouc authored Sep 12, 2023
1 parent 96756fe commit 487dd6e
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 179 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Caveats:

### Fuzz a Project (Online)

Ityfuzz will prioritize the use of environment variables `ETH_RPC_URL` as the RPC endpoint, otherwise it will use built-in public RPCs.

Rebuild with `flashloan_v2` (only supported in onchain) enabled to get better result.

```bash
Expand Down
3 changes: 3 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ ItyFuzz 将自动检测目录中的合约之间的关联(参见`tests/multi-co

### 在线 Fuzz 一个项目

Ityfuzz 将优先读取 `ETH_RPC_URL` 环境变量作为 RPC 地址,如果没有设置,将使用内置的公共 RPC 地址。


(可选)启用 flashloan_v2 重新构建以获得更好的结果。

```bash
Expand Down
2 changes: 1 addition & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub trait Cache {
fn load(&self, key: &str) -> Result<String, Box<dyn Error>>;
}

#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct FileSystemCache {
file_path: String,
}
Expand Down
2 changes: 1 addition & 1 deletion src/evm/contract_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl ContractLoader {
let result = builder.onchain_job(onchain.chain_name.clone(), addr);
if let Some(result) = result {
abi = Some(result.abi.clone());
bytecode = Some(to_analysed(Bytecode::new_raw(result.bytecodes.clone())));
bytecode = Some(onchain.get_contract_code(addr, false)); // Some(to_analysed(Bytecode::new_raw(result.bytecodes.clone())));
build_artifact = Some(result);
}
}
Expand Down
Loading

0 comments on commit 487dd6e

Please sign in to comment.