re2005 / ETHLottery-Client

Client for the ETHLottery
20 stars 8 forks source link

Regarding Ethereum Wallet Ownership and Potential Recovery of Unclaimed ETH #1

Open wVindice opened 4 weeks ago

wVindice commented 4 weeks ago

Dear @re2005, @renasboy

I hope this message finds you well.

I am reaching out to confirm if you are the owner of the Ethereum wallet address 0x3a44fc70077511f4ea72171dd000021a2133158e. If so, I would like to bring to your attention that I have identified three inactive smart contracts named ETHLottery that appear to have a balance totaling 2.017 ETH. The contract addresses are as follows:

If you are the owner of these contracts, it may be possible to recover the funds using the destruct() function, as outlined in the contract:

function destruct() isClosed isOwner {
    Destroy();
    selfdestruct(owner);
}

To execute this, the contract must satisfy the following condition for the isClosed modifier:

modifier isClosed() {
    require(!open);
    _;
}

This can be achieved by ensuring the contract balance exceeds the jackpot amount, through the following function:

function play(bytes1 _byte) payable isOpen isPaid returns (bool) {
    bettings[_byte].push(msg.sender);
    if (this.balance >= jackpot) {
        uint256 owner_fee_amount = (this.balance * owner_fee) / 100;
        if (!owner.send(owner_fee_amount)) {
            return false;
        }
        open = false;
        result_block = block.number + 10;
        Open(open);
    }
    Balance(this.balance);
    Play(msg.sender, _byte, now);
    return true;
}

In summary, when the contract balance meets the jackpot threshold, you can call the destruct() function to withdraw the ETH.

If you do not have enough ETH to meet the jackpot threshold, another option would be to create an intermediary smart contract to execute a flash loan. This would temporarily provide the required ETH to meet the balance requirement, allowing you to close and withdraw from the ETHLottery contracts. Afterward, you can repay the flash loan by withdrawing the ETH using the accumulate() function in the intermediary contract:


function accumulate() isOriginalOwner isClosed isAccumulated {
    accumulate_to = msg.sender;
    if (msg.sender.send(this.balance)) {
        Accumulate(msg.sender, this.balance);
    }
}

If needed, I can provide a suitable intermediary contract to handle this process, along with a demonstration using a forked network on Hardhat.

If this recovery is successful, I would be sincerely grateful if you could consider sharing a small portion as a token of appreciation for discovering this opportunity.

Thank you very much for your time and consideration, and please let me know if you would like to discuss further.

Best regards,

re2005 commented 4 weeks ago

Yes @wVindice you are absolutely right.

You can see in the past that I've tried already to destroy this contract:

https://etherscan.io/address/0x3a44fc70077511f4ea72171dd000021a2133158e

Would be interesting to see how can we recover the founds.