near-wallet
near-wallet copied to clipboard
`storage_deposit()` fails when transferring some fungible tokens
Problem
Now when transferring fungible token in NEAR Wallet, a fixed minimum FT storage balance is used to call storage_deposit()
https://github.com/near/near-wallet/blob/bbc258315eb41fba49e30387c79507e284ad4acd/packages/frontend/src/services/FungibleTokens.js#L29
In some cases, the required storage deposit amount is not the minimum, and the wallet need to query storage_balance_bounds()
method on the FT contract to get the required deposit.
$ NEAR_ENV=mainnet near view berryclub.ek.near storage_balance_bounds
View call: berryclub.ek.near.storage_balance_bounds()
{ min: '2560000000000000000000', max: '2560000000000000000000' }
A relevant issue is mentioned in https://github.com/near/near-wallet/issues/2338
Though this seems not to be a critical issue since most of the FT now uses the 0.00125 minimum storage balance, the current design will conflict with or restrict the usage of the fungible tokens that uses a custom implementation.
Expected Behavior
The storage_deposit()
NEAR amount should not be fixed. The wallet should respect the storage_balance_bounds()
function call result of the FT contract.
Steps to reproduce
- Transfer Banana (
berryclub.ek.near
) with NEAR Wallet - The
storage_deposit()
failed when calling FT transfer. Here is an example.
Issue has been created in Jira for tracking and prioritization: https://nearinc.atlassian.net/browse/WAL-204