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

enable contract deposit box usage via destination address #945

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

veloboot
Copy link

SKALE IMA currently supports interchain token transfers from external accounts only e.g. users with private keys and not smart contracts.

This pull request includes modifications that enable smart contracts to perform transfers among all chains.

The various DepositBox*.deposit* functions are not designed to be called from a contract since they rely on the destination address being the same as msg.sender. This modification is backward compatible, keeping the previous interface intact and extending with transfer* functions that explicitly pass the SChain destination address.

This modification will require existing interface definitions e.g.e. IDepositBoxEth, IDepositBoxERC20, ..., ITokenManagerEth, ITokenManagerERC20, ... to be extended with the additional overridden function signatures. These are defined in a different repository @skalenetwork/ima-interfaces.

@veloboot veloboot requested a review from payvint as a code owner January 12, 2022 20:32
@payvint
Copy link
Collaborator

payvint commented Jan 13, 2022

So we removed receiver field in RR 859, because it opens a security vulnerability of draining CommunityPool wallets. Address "A" on a SKALE Chain "B" can send 1 wei to everyone who recharged a CommunityPool wallet for a SKALE Chain "B".
So we recommend to write a contract for your purposes and connect it as a custom contract to your SKALE chain.
Also there is a way to change a reimbursement way - sender would pay for tx instead of receiver. But this solution would increase a size of message, which means the gas cost of transferring message would be increased.

I think to have a receiver field only in deposits would solve your issue. You can deposit by contracts, but for withdrawing back you need to have a custom contract or do it by addresses. Would it solve your issue?

@veloboot
Copy link
Author

veloboot commented Jan 13, 2022 via email

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.

3 participants