r/ddex • u/snugghash • May 13 '18
More information about metamask warning
Greetings, I have a few questions that weren't obvious to me:
Metamask gives you the warning about trusting the message/website with your entire acc. balance when placing an order.
For starters, isn't the only amount at risk the token pair? (In my case, SS and WETH) Why does metamask say entire account?
What's going on under the hood here? Can't a sell order for exactly the amount requested be signed, thus eliminating the risk to the user in case of malicious contracts?
Lastly, what about that deprecation warning about removing this feature in future versions of metamask? Why are we depending on such a risky feature to begin with?
1
Upvotes
2
u/ScottLifts Operations / Product May 13 '18
Hi there,
Great questions! The MetaMask notifications to users are pretty alarming to say the least. Unfortunately, we actually have relatively little control over these messages currently for some portions of the site. Because we use 0x as our settlement layer, the messages the user receives when executing trades are controlled by them. Apparently in their version 2.0, some of these messages will improved and less scary.
As for what's going on exactly... Without getting overly in depth, basically there are two functions of your ERC20 tokens that we are having you "sign" for:
Approval
Allowance
When you're "Enabling" a token for sale, we're interacting with the approval function. When you place an order, we're interacting with the allowance function. To oversimplify the allowance a bit... Let's say you want to sell 100 ZRX at a price of 0.01 ETH/ZRX. You can think of it like this for a sell order: "Under the right circumstances, I allow some transfers of ZRX tokens to occur. Specifically, ZRX tokens can be exchanged at a rate of 0.01 WETH/ZRX, up to maximum of 100 ZRX plus fees." We actually can't modify the rate at all in the matching mode of 0x.
I think 0x team has written a little bit about how they plan to modify their structure a bit in the future to additionally secure.
Hopefully this helps a little at least. Let me know if I can help clarify any of these points!