OasisDEX / eth2dai

Eth2Dai is a fully on-chain marketplace for Ether and Dai
https://eth2dai.com
GNU Affero General Public License v3.0
48 stars 10 forks source link

"unlocking" WETH tries to do something with an unbelievably large number of WETH #294

Closed mediocregopher closed 5 years ago

mediocregopher commented 5 years ago

I'm not actually sure what "unlocking" does, except that the frontend tells me I must do it in order to trade. I have 0.5 WETH in my metamask wallet, and when I hit the "unlock" toggle I get a popup that looks like this:

shot shot

Not totally sure where to go from here, am happy to provide any other debug info you need.

peculiarity commented 5 years ago

hey @mediocregopher . Glad to have you on board. Locking/Unlocking is basically giving approval of the OTC smart contract to execute trades on your behalf. If you checkout the internal logic of the smart contract you will gain more insight how things work.

The big number that you see comes from the value that is provided to the approve method. The value is the biggest possible value. This is the way in which "binary" switch for approval is simulated. It simply means that you don't have to worry about the amount you granted the contract to use on your behalf ever again since the number is reeeeallly big.

If you continue with the transaction you will see that you will be charged only the gas fee and nothing else.

Feel free to ask more question!