Skip to content

[Bug]: ERC20: insufficient allowance during avalanche ictt deploy #2721

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

Closed
leopaul36 opened this issue Apr 4, 2025 · 1 comment · Fixed by #2735
Closed

[Bug]: ERC20: insufficient allowance during avalanche ictt deploy #2721

leopaul36 opened this issue Apr 4, 2025 · 1 comment · Fixed by #2735
Assignees
Labels
bug Something isn't working

Comments

@leopaul36
Copy link

Describe the bug
It looks like there is a race condition in ERC20TokenHomeAddCollateral when running avalanche ictt deploy . I feel like there should be some kind of pause or verification of the allowance between approve and addCollateral

See the issue in the logs below but I had to try multiple times before succeeding.

To Reproduce
avalanche ictt deploy --mainnet --c-chain-home --deploy-erc20-home $HOME_ERC20--deploy-native-remote --remote-blockchain $REMOTE_BLOCKCHAIN --remote-rpc $REMOTE_RPC

Logs

Home RPC Endpoint: https://api.avax.network/ext/bc/C/rpc
✔ Get private key from an existing stored key (created from avalanche key create or avalanche key import)
✔ admin
✔ Get private key from an existing stored key (created from avalanche key create or avalanche key import)
✔ admin
Downloading Avalanche ICTT Contracts
Compiling Avalanche ICTT Contracts
Home Deployed to https://api.avax.network/ext/bc/C/rpc
Home Address: XXX

Which is the ICM Registry address for $REMOTE_BLOCKCHAIN: $REMOTE_BLOCKCHAIN_ICM
Remote Deployed to $REMOTE_RPC
Remote Address: XXX
Registering remote contract with home contract
Collateralizing remote contract on the home chain
Could not get debug trace for erc20 token home add collateral error on https://api.avax.network/ext/bc/C/rpc: failure tracing call for client &rpc.Client{idgen:(func() rpc.ID)(0x1eb8bc0), isHTTP:true, services:(*rpc.serviceRegistry)(0xc0006e9a90), idCounter:atomic.Uint32{_:atomic.noCopy{}, v:0x3}, reconnectFunc:(rpc.reconnectFunc)(0x1eb41e0), batchItemLimit:0, batchResponseMaxSize:0, writeConn:(*rpc.httpConn)(0xc000403270), close:(chan struct {})(0xc000dae0e0), closing:(chan struct {})(0xc000dae150), didClose:(chan struct {})(0xc000dae1c0), reconnected:(chan rpc.ServerCodec)(0xc000dae230), readOp:(chan rpc.readOp)(0xc000dae2a0), readErr:(chan error)(0xc000dae310), reqInit:(chan *rpc.requestOp)(0xc000dae380), reqSent:(chan error)(0xc00014b570), reqTimeout:(chan *rpc.requestOp)(0xc000dae3f0)}: the method debug_traceCall does not exist
Verify --debug flag value when calling 'blockchain create'
Error: execution reverted: ERC20: insufficient allowance
@leopaul36 leopaul36 added the bug Something isn't working label Apr 4, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Apr 4, 2025
@felipemadero felipemadero self-assigned this Apr 7, 2025
@felipemadero
Copy link
Collaborator

thanks for the feedback! looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done 🎉
2 participants