Open alexauroradev opened 2 years ago
@MaximusHaximus I don't have clear what to do if the contract doesn't have this view method available, and how this could scale (I suppose this "view" can be called once and easily cached, instead of using the indexer every time).
I'll have you take it from there for both analysis and handover to the team.
From a product standpoint, I see risks in the latency of the operation - but they are lower than having this annoying "double signature" behavior, that would be amplified in presence of 2FA, Ledger and (soon) external services
Problem Fungible token transfer sometimes requires signing two storage deposit transactions. Probably this is happening due to the decrease of the storage costs, while the old contracts were using the hardcoded 0.0125 NEAR for the storage (and the new ones -- 0.00125). Example: https://explorer.near.org/transactions/E2tC36DMkTWf6Uo4yxCJNMy7taFBhXiZb539CPCfwHZM -- failed https://explorer.near.org/transactions/8HXBq2QwVPup5wypfynWEgZRXudLxaeX3EhVT36u8vU6 -- succeeded
Expected Behavior Single storage deposit transaction.
Proposed solution Instead of guessing the amount of $NEAR to be deposited for the storage, one need to execute a view call to the token contract and check out the storage balance bounds. CLI version of the call:
From this data one can extract the needed balance