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

Fund with token #504

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Fund with token #504

merged 4 commits into from
Jan 8, 2024

Conversation

cryptoAtwill
Copy link
Contributor

@cryptoAtwill cryptoAtwill commented Dec 25, 2023

Implement fund_with_token api for erc20 token transfers, see here.

to: Option<Address>,
amount: TokenAmount,
) -> anyhow::Result<ChainEpoch> {
let parent = subnet.parent().ok_or_else(|| anyhow!("no parent found"))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to perform a sanity check that the subnet indeed has a ERC20 supply source? If not, it will be caught anyway by the gateway actor, so probably not worth it. However, is this able to return the corresponding Solidity exception in a human-friendly form?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, should be able to. From past experience, in contract execution, errors are usually returned.

@cryptoAtwill cryptoAtwill merged commit 0c5f8f7 into main Jan 8, 2024
17 checks passed
@cryptoAtwill cryptoAtwill deleted the transfer-erc20 branch January 8, 2024 02:17
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

Successfully merging this pull request may close these issues.

2 participants