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

[BUG] Arithmetic overflow when deploying contract on mainnet fork using forge create #560

Open
bxpana opened this issue Jan 23, 2025 · 0 comments
Assignees

Comments

@bxpana
Copy link

bxpana commented Jan 23, 2025

🐛 Bug Report for anvil-zksync

📝 Description

I’m encountering an issue when using forge create to deploy a contract on a fork of Mainnet. The deployment process initially appears to be successful, but it panics and shuts down while providing gas details. However, this same exact command works without issues when deployed to an Anvil-zksync fork of Testnet.

Additionally, I discovered that running anvil-zksync --fork-url without the -d flag resolves the issue for Mainnet. This behavior is inconsistent, as the -d flag works perfectly fine for Testnet.

🔄 Reproduction Steps

  1. anvil-zksync -d --fork-url <MAINNET_RPC_URL>
forge create src/Contract.sol:Contract \
  --rpc-url http://0.0.0.0:8011 \
  --zksync \
  --gas-price 45250000 \
  --priority-gas-price 4525000 \
  --private-key <PK>

🤔 Expected Behavior

successful show of gas summary

21:39:36  INFO 
21:39:36  INFO Validating 0xe0c7661bf5c33ba9e949973c9b3b46500f098d97cf5b47107ebbefa692b369f8
21:39:36  INFO Executing 0xe0c7661bf5c33ba9e949973c9b3b46500f098d97cf5b47107ebbefa692b369f8
21:39:37  INFO 
21:39:37  INFO ✅  [SUCCESS] Hash: 0xe0c7661bf5c33ba9e949973c9b3b46500f098d97cf5b47107ebbefa692b369f8
21:39:37  INFO Initiator: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
21:39:37  INFO Payer: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
21:39:37  INFO Gas Limit: 196_475_376 | Used: 40_728_118 | Refunded: 155_747_258
21:39:37  INFO Paid: 0.0018429473 ETH (40728118 gas * 0.04525000 gwei)
21:39:37  INFO Refunded: 0.0070475634 ETH
21:39:37  INFO 
21:39:37  INFO [Gas Details]
21:39:37  INFO     ├─ Gas Summary

😯 Current Behavior

Panics and shuts down

21:35:02  INFO Validating 0x054ce0988f60f2509c5707b33eebc914773887b22086500770dacd13c743c34a
21:35:02  INFO Executing 0x054ce0988f60f2509c5707b33eebc914773887b22086500770dacd13c743c34a
21:35:02  INFO 
21:35:02  INFO ✅  [SUCCESS] Hash: 0x054ce0988f60f2509c5707b33eebc914773887b22086500770dacd13c743c34a
21:35:02  INFO Initiator: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
21:35:02  INFO Payer: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
21:35:02  INFO Gas Limit: 176_883_008 | Used: 40_725_214 | Refunded: 136_157_794
21:35:02  INFO Paid: 0.0018428159 ETH (40725214 gas * 0.04525000 gwei)
21:35:02  INFO Refunded: 0.0061611402 ETH
21:35:02  INFO 
21:35:02  INFO [Gas Details]
21:35:02  INFO     ├─ Gas Summary
thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/primitive-types-0.12.2/src/lib.rs:38:1:
arithmetic operation overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

🖥️ Environment

  • Rust version: [e.g., rustc 1.52.0]
  • Operating System & Version: [e.g., Ubuntu 20.04]
  • Other relevant environment details:

📋 Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

📎 Log Output

Paste any relevant log output here.
@dutterbutter dutterbutter self-assigned this Jan 23, 2025
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

2 participants