-
Notifications
You must be signed in to change notification settings - Fork 115
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
CCTX is aborted and not refunded when the recipient of the withdrawal is a contract #1430
Comments
@andresaiello you mentioned that a contract is a valid target for withdrawal, is there anything wrong with the contract above? |
is a gas issue. call a contract needs more gas than a transfer. we should align with protocol how to send more gas there |
It would be a huge feature if we resolved gas issues when withdrawing to contracts. |
@lumtis @brewmaster012 I see this issue was added to v12. If we resolve the gas issue and make it possible to withdraw to contracts, would it also be possible to add arbitrary data passing? Or would it be out of scope for this issue? |
Out of scope for v12.
|
@brewmaster012 @fadeev can we create an issue for the specific feature on arbitrary data passing? Is the idea to allow
We need to consider general refund on ZetaChain for aborted cctx, this looks important, reported several times by code4rena participants. |
@brewmaster012 can we allow the user to provide to the withdraw method a custom fee amount they're willing to pay? For example, I'm writing an omnichain contract, and it is designed to withdraw to my contract on Polygon. I know how much gas on average my contract on Polygon requires, so I can pass this value in my withdraw call, to make sure it doesn't fail. It's up to the contract maintainer to keep this value up to date. IZRC20(targetTokenAddress).withdraw(recipientAddress, outputAmount, data, gas); Both |
@fadeev @lumtis : There is a tradeoff there between functionality and complexity/safety, and I think it can't be in scope of v12. |
Closing since the new contract architecture fix the issue |
I'm withdrawing ZRC-20 MATIC to Polygon and specifying a contract as a recipient address:
https://explorer.zetachain.com/cc/tx/0x07b11723443c8e3e9252f31fc6ef76e5712cc2adfba95031080601970ce488da
The contract on Polygon:
https://mumbai.polygonscan.com/address/0xFB30650AdE3C6793436758c1654AD646962a8DA1
(please, ignore one event in this contract, I was just testing it with a single-chain transfer, not cross-chain)
Expected one of the two outcomes:
What happened is an CCTX abort without a refund.
The text was updated successfully, but these errors were encountered: