-
Notifications
You must be signed in to change notification settings - Fork 6
total supply is not changing on deposit/withdrawal #6
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.
8000By 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
Comments
Hi @Georgi87 look at the implementation of
It is returning |
Ok, that makes sense. Thanks for pointing it out @gbalabasquer |
No problem! |
It is maybe still no ideal as there are ways to change the contract balance without triggering any contract function using selfdestruct(contract_address). So the totalSupply could be higher than the sum of all balances. |
I'm not getting you. Can you give me an exact example of it? |
Assuming I have a contract with an Ether balance > 0 and this contract has a selfdescruct function. I can call selfdestruct(eth_wrapper_token_address) sending all ETH to the eth wrapper contract without calling any function in the wrapper contract. Also the fallback function is not triggered. totalSupply() will return an increased balance but the ETH doesn't belong to anytone in the balance mapping. It is a minor thing. |
Oh yes I get what you mean now. It is a valid point, we will check in the next review. |
@Georgi87 Thanks for this observation, this is actually a "major" issue given how important this building block is. We do have 1 redeploy planned before we commit fully to an eth wrapper contract, so this is a really fortunate find. |
@nmushegian I'm reopening this issue and will make the change tomorrow. |
Fixed in #8 |
I would have expected totalSupply to keep track of the total ETH wrapper tokens. https://github.com/dapphub/ds-eth-token/blob/master/src/eth_wrapper.sol#L40 is increasing a user's balance without updating the totalSupply.
The text was updated successfully, but these errors were encountered: