• dualmindblade [he/him]
    ·
    3 years ago

    Generally you interact with a smart contract by "calling methods", just like a normal API in any computer system. This one has a feature where you can get what you want (the contract will report you have a certain # of wETH) just by transferring ETH to it. It's much more efficient this way because transferring the native ETH token is the cheapest type of transaction, it's like a couple of bucks right now vs 50 or more. But a smart contract is just code, it can only take actions that were built in before hand. In this case, apparently, there's no method to call that would transfer erc-20 tokens back to address they came from, actually that would be possible and as far as I understand wouldn't result in extra gas costs for other transactions, although it would be more expensive to deploy, anyway probably a good idea overall but as they say hindsight is erc-20.

    This system is not user friendly and mistakes cannot be undone, even the creator of smart contracts still does things like quadruple checking all the stuff in his transactions and doing performing actions with tiny amounts of tokens before the full amount (costing double tx fees) even when he's 99.99% sure they're fine. This is pretty much necessary, no way around it for a maximally decentralized computer system, you have to agree to the rules before hand and stick to them 100%. You can make the rules more forgiving to mistakes but you have to anticipate these mistakes before you deploy your code.