Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Encountered: "Only handling one map deep for now" When Forking Uniswap V3 Factory #979

Open
Akbar30Bill opened this issue May 28, 2024 · 0 comments

Comments

@Akbar30Bill
Copy link
Contributor

Problem

I am using Arbiter to fork a Uniswap V3 Factory. My goal is to subsequently use this fork to run some benchmarks with a newly created pool. To achieve this, I plan to call the createPool function of the Uniswap Factory. However, during the forking process, I encountered the following error:

Only handling one map deep for now. A map of a map was found and ignored.

Subsequently, when I try to use the contract, the transactions fail and do not work as expected.


Steps to reproduce

  1. Use arbiter to fork polygon mainnet
arbiter fork fork_conf.toml --overwrite
  1. Observe the error message: Only handling one map deep for now. A map of a map was found and ignored.
  2. Attempt to call the createPool function on the forked factory.
  3. Observe the revert transaction error

Expected behavior

The fork command should create a state on disk which is usable and the functions of the Uniswap V3 Factory could be called in the environment

Code snippets/links or screenshots

Here is my fork_conf.toml

# Basic configuration
output_directory = "fork/"
output_filename = "polygon.json"
provider = "<my-chain-provider>"
block_number = 57446120

# Contracts stored in a mapping
# Try this out with the weth contract
[contracts.UniswapV3Factory]
address = "0x1F98431c8aD98523631AE4a59f267346ea31F984"
artifacts_path = "out/UniswapV3Factory.sol/UniswapV3Factory.json"

[contracts.SwapRouter]
address = "0xE592427A0AEce92De3Edee1F18E0157C05861564"
artifacts_path = "out/SwapRouter.sol/SwapRouter.json"

# EOAs
[externally_owned_accounts]
vitalik = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" # vitalik.eth as of 10/2/2023


[contracts.UniswapV3Factory.mappings]
balanceOf = [
    "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", # vitalik.eth as of 10/2/2023
]

[contracts.SwapRouter.mappings]
balanceOf = [
    "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", # vitalik.eth as of 10/2/2023
]

Additional context

The error that i get while calling the create pool function:

called `Result::unwrap()` on an `Err` value: MiddlewareError { e: ExecutionRevert { gas_used: 24738, output: [] } }

the way that i load the contract using ethers rs

let cl = Arc::new(client);
let uni_v3_factory = uniswap_v3_factory::UniswapV3Factory::new(factory_address, cl);

the way that i call the createPool function

let create_pool_function = uni_v3_factory.create_pool(token1.address(), token0.address(), 500);
let pool_create_transaction_hash = create_pool_function.send().await.unwrap().await.expect("Could not create pool").unwrap().transaction_hash;

Note: that the token0 and token1 are being deployed in the same script


Provide an adequate title with tags and a brief description
The tags should be in the format of "tag:" Description. Since this is a bug report, please use:

  • "bug:" Forking complicated contracts with map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant