0

I wrote a smart contract and deployed it on the ethereum main chain, however in my rush to get it deployed I made a critical mistake in forgetting an edge case in the code. As a result when I called a function to move some ETH the transaction reverted and the ETH seemingly disappeared. When I called a redeem function in the contract thats supposed to redeem all ETH stored it was only 0.2ETH and not 0.6ETH. Where did the other 0.4 ETH go?

Here's the contract: https://etherscan.io/address/0xf0799e76a2eb926cbb9684675f6aeb6d31d1838c

Contract source code: https://pastebin.com/UxWZwX86

7
  • We can’t see the code
    – Majd TL
    Feb 11 at 20:53
  • apologies, heres the code pastebin.com/UxWZwX86 @MajdTL
    – user94081
    Feb 11 at 21:09
  • sry it is a Long probably complicated contract, add it in the question do people can see it :)
    – Majd TL
    Feb 11 at 22:12
  • thank you @MajdTL I just added it. I know its fairly long but the logic is quite simple
    – user94081
    Feb 11 at 22:36
  • Your 0.4 Eth has been moved in this (internal transaction) and then exchanged to weth I think. etherscan.io/tx/…
    – Majd TL
    Feb 12 at 11:19

1 Answer 1

0

I am unsure what the context of this question is but there is a function (devRedeem)

 function devRedeem() public {
    require(block.timestamp > 1643778000, "too early to call");
    require(address(this).balance > 0);
    require(msg.sender == address(0xd0fE3391600CbD0b8C055c27Fb269a74ae8f5ba9));
    payable(msg.sender).transfer(address(this).balance);//send remaining ether to dev wallet 
}

that means the funds can be withdrawn as of 10 days ago by 0xd0fE3391600CbD0b8C055c27Fb269a74ae8f5ba9

3
  • Yes I was able to successfully call that method and withdraw the ETH in the contract balance. However it's not the 0.6ETH that was originally entered, 0.4ETH is gone. I'm somewhat worried that it was burned when one of the functions, due to my design error, reverted. Would the 0.4ETH that was supposed to be moved in the reverted transaction be burned if this is the case? I thought no but now I'm not so sure @nemo
    – user94081
    Feb 12 at 0:40
  • I must admit this contract is all over the place and follows rather bad design practices so it is hard to understand the intention behind the contract. But the contract currently has 0eth in it, according to etherscan
    – nemo
    Feb 12 at 11:18
  • the contract was supposed to pay out 0.4ETH on call of the step3 function. Because of a missed edge case though the function never paid out the 0.4ETH to the first person who called the function (me). When the transaction reverted though the 0.4ETH just disappeared. To my understanding ETH is not burned on transaction revert correct? So I'm confused, where did that 0.4ETH go? @nemo
    – user94081
    Feb 12 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.