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

claim_assets doesn't work if the trapped asset can't be used to pay for execution fees. #4433

Open
franciscoaguirre opened this issue May 10, 2024 · 2 comments
Labels
T6-XCM This PR/Issue is related to XCM.

Comments

@franciscoaguirre
Copy link
Contributor

The claim_assets extrinsics claims in the simplest way possible, it just grabs the asset, uses it to pay execution fees, and deposits it on the beneficiary account.
This assumes the asset can be used to pay for fees, which might not be the case, i.e. an NFT or a fungible token without a pool.

The extrinsic creates the following program:

  • ClaimAsset
  • BuyExecution // <- Here's the assumption the asset can be used to pay for fees
  • DepositAsset

It could be fixed by changing that to the following program:

  • WithdrawAsset(asset for fees)
  • BuyExecution // <- No longer assuming the trapped asset can be used to pay for fees
  • ClaimAsset
  • DepositAsset

We could probably pass in a fees parameter that could be None to use the same assets for fees.
Sadly, this would be a breaking change.
We could add a new extrinsic claim_assets_with (or claim_not_sufficient_assets) that takes this fees parameter (not necessarily an option since we already have the other extrinsic).

@franciscoaguirre franciscoaguirre added the T6-XCM This PR/Issue is related to XCM. label May 10, 2024
@dogwifdots
Copy link

Woof, just found this while researching for an upcoming token claimable airdrop for DOT holders that Dog wif dots (WIFD) is planning. Could I use this function for an embedded extrinsic function on our website to web3 login and click a claim your WIFD button to start the TX signature in the users wallet?

Many thanks in advance,
Dog wif dots dev

@franciscoaguirre
Copy link
Contributor Author

@dogwifdots This extrinsic is for claiming assets trapped during XCM execution. It's useful to get back your assets when an error occured. It's not for airdrops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T6-XCM This PR/Issue is related to XCM.
Projects
Status: Todo
Development

No branches or pull requests

2 participants