Near-One / rainbow-token-connector

ERC-20/NEP-141 Token Connector for Rainbow Bridge
62 stars 18 forks source link

Call to `mint` from `finish_deposit` if failing with not enough attached deposit. #52

Open mfornet opened 3 years ago

mfornet commented 3 years ago

As reported in #51, the transaction https://explorer.near.org/transactions/erDQKaeYvmjKaPQz7deNKqLxZy8RFB3tFeHNut3yTRa is failing with

The attached deposit is less than the mimimum storage balance

This means that attached deposit to mint call is not enough to register the user. This should never happen given that we have a check that verifies the attached deposit is enough: https://github.com/near/rainbow-token-connector/blob/master/bridge-token-factory/src/lib.rs#L194-L197

This is an important bug, since all failure on the mint function leads to loose funds given that the proof is already recorded.