Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Contract creation code storage out of gas #96

Open
YellingOilbird opened this issue Oct 24, 2023 · 2 comments
Open

Contract creation code storage out of gas #96

YellingOilbird opened this issue Oct 24, 2023 · 2 comments

Comments

@YellingOilbird
Copy link

On sync UniswapV2, when solidity batcher contract tries to batch pool 0xc0ca776fe52ec92b1d5603caadf148dbd8c22a80, one of the tokens doesn't have decimals() method. Because of that, raw call of contract deployer results with Error: (code: -32000, message: contract creation code storage out of gas, data: None).
I tries:

  • modify foundry.toml config with gas_limit = u64::MAX and extended memory_limit
  • experiments with max size of batch if it included tokens like that (processed unsuccess call for decimals()). Maximum - 18 normal pools and 1 pool with token which doesn't have a decimals method. Also, its fine to call contract with a single [pool_address] where pool_address will be 0xc0ca776fe52ec92b1d5603caadf148dbd8c22a80. If we have [pool_address, usdc_weth_pool_address] there is also out of gas error.

In Remix it seems fine to deploy, but there is kinda other simulation.

@YellingOilbird
Copy link
Author

Seems it returns success even on revert. So we need to decode decimals as uint256 with more checks
Also for out of gas, I suggest made in foundry config gas_limit equal to u64::MAX, gas_price to zero and call for decimals can be rewritten with token.staticcall{gas: 50000}(…)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@YellingOilbird and others