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

Proposal: add checking for minimum value in TokenWallet "transfer" and "transferToWallet" methods #2

Open
mnill opened this issue Nov 1, 2022 · 1 comment

Comments

@mnill
Copy link

mnill commented Nov 1, 2022

"transfer" and "transferToWallet" methods don't check the minimum required value to start the transfer.

For correctly finish the transfer user must attach at least:
require(msg.value > TokenGas.TARGET_WALLET_BALANCE * 2 + deployWalletValue);

Plus gas for the "transfer" and "acceptTransfer"

This must be explicitly described or checked before starting the transfer because smaller value can lead to the tokens lost.

Example:

  • TokenWallet was without transactions for a while.
  • Some dapp tried to call the transfer with attached amount 0.2 ever and deployWalletValue: 0.1 ever
  • This amount of value is enough for particular transfers, but in our case 0.07 evers will be taken as storage payment
  • Destination wallet will be deployed successfully, but "acceptTransfer" will be aborted with error "Out of gas" and a bounce message will not be created.

Example of token lost by out of gas:
https://everscan.io/messages/9ef01bb5a831d1286de67183197a7bb34b3cc2955ed719d9f79ec778b6c304e3

@pyAndr3w
Copy link

pyAndr3w commented Apr 5, 2024

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

No branches or pull requests

2 participants