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

Withdrawing ONEs from Binance to 1wallet would always fail - the funds would be reverted back to Binance, but Binance would assume the transaction is successful and pocket the funds #71

Closed
polymorpher opened this issue Aug 10, 2021 · 3 comments

Comments

@polymorpher
Copy link
Owner

A user reported his withdrawal from Binance never arrived 1wallet. Upon my investigations, the transaction is https://explorer.harmony.one/tx/0x23a85ead531a1981f84d13911ff4d1424c2ac9ae31551e4ef9dbc8379ef16255

Although the transaction is reverted, Binance did not refund the user the balance. Therefore the 60 ONEs are deducted from the user's account and pocketed by Binance.

I tried to do the same by withdrawing ~165 ONEs from my Binance account to my own 1wallet account. Surprisingly, I encountered the same issue: Binance shows my transaction was successful, and deducted my 165 ONEs from my Binance account. In reality, the transaction was also reverted. The ONEs never reached my wallet. They went back to Binance's but they did not refund it to my account.

Here is the reason that withdrawal transactions from Binance are always reverted: Binance sets a gas limit of 21000 for the transaction. Since 21000 is precisely the amount of gas required to cover only the base transaction, it would not be enough for a smart contract wallet since the wallet needs to execute code when it receives the funds (e.g. emitting an event). It would not be a problem if you sent the payment from any other wallet (e.g. the Chrome extension wallet, or other 1wallet), since by default these wallets always set a slightly higher gas limit than 21000. For example the Chrome extension wallet sets a gas limit of 25000 by default.

I have reported this issue to Binance and Harmony. In the meantime, users are advised NOT to withdraw directly from Binance to 1wallet.

@polymorpher polymorpher changed the title Withdraw ONEs from Binance to 1wallet would always fail - the funds would be reverted back to Binance, but Binance would assume the transaction is successful and take away the funds Withdraw ONEs from Binance to 1wallet would always fail - the funds would be reverted back to Binance, but Binance would assume the transaction is successful and pocket the funds Aug 10, 2021
@polymorpher polymorpher changed the title Withdraw ONEs from Binance to 1wallet would always fail - the funds would be reverted back to Binance, but Binance would assume the transaction is successful and pocket the funds Withdrawing ONEs from Binance to 1wallet would always fail - the funds would be reverted back to Binance, but Binance would assume the transaction is successful and pocket the funds Aug 10, 2021
@polymorpher
Copy link
Owner Author

Note: I have also tried removing everything from receive function

receive() external payable {

It does not reduce the gas required to 21000. You will still need to use slightly more gas (e.g. 21100) to ensure the transaction is not reverted. Therefore, this problem has to be addressed on Binance's side.

@polymorpher
Copy link
Owner Author

Binance is aware of this and is working on a fix, but it may take some time.

@polymorpher
Copy link
Owner Author

I can confirm Binance fixed it. I tested withdrawal on both binance.com and binance.us and it worked for me.

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

1 participant