4 ms·
Can someone explain this to me? He states that Optimism doesn’t have a native gas token and native currency, and eth balances are implemented using ERC20 token
by artdigital 5y ago
Can someone explain this to me?
He states that Optimism doesn’t have a native gas token and native currency, and eth balances are implemented using ERC20 tokens with OVM instead of the native balance mechanism
However the exploit is using selfdestruct to transfer and create the remaining balance to the target address, effectively creating new tokens out of thin air.
> This means that, when a contract self-destructs, its balance is BOTH given to the beneficiary AND ALSO KEPT. If the contract had 10 ETH, 10 ETH are CREATED from thin bits and handed to the beneficiary.
But I thought from this explanation that contracts don’t have a balance because ETH is stored in an ERC20 contract, and is set to 0. How can the contract have balance (10 ETH) to transfer on selfdestruct when optimism doesn’t have a native balance?
- saurik 5y agoWould it help if that paragraph had said "10 OETH"'instead of "10 ETH"? (I am going to go change it regardless, as that is probably at least theoretically less confusing; but, like: is that sufficient?)
- artdigital 5y agoBut selfdestruct only acts on balance held in the native token, if it's balance in ERC20 it wouldn't transfer it to the target account I still have trouble understanding how this exploit worked
- yeetard 5y agoIsn't that the actual bug? That balances are kept at two places? What actually happens in SetBalance() if rcfg.UsingOVM ==true? So... I guess what it boils down to is 'How does Optimism manage it's state trie'? I'd really enjoy a more in-depth explanation for this.