Skip to content
Verified contractExactMIT

EOAForwarderPassive

Address0x3e2b1f7c601300bd2a3c9a70edb1bbbf245cace0
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.34

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.34+commit.80d5c536
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,620,624
Creation transaction
0x8e6e1731c2…44aeb762ee

contracts/HelloWorld.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IERC20 {
    function transfer(address to, uint256 amount) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
}

contract EOAForwarderPassive {
    address payable public constant COLD_WALLET = payable(0x1F551538285D3E2D7f10Dd04D0B030ACA2900444);
    uint256 public constant MIN_ETH_FORWARD = 0.1 ether;

    event UpdateState(address indexed wallet, uint256 amount);

    receive() external payable {
        uint256 currentBalance = address(this).balance;
        if (currentBalance >= MIN_ETH_FORWARD) {
            emit UpdateState(address(this), currentBalance);
        }
    }

    function sweepETH() external {
        uint256 balance = address(this).balance;
        require(balance > 0, "Zero ETH balance");
        (bool success, ) = COLD_WALLET.call{value: balance}("");
        require(success, "ETH sweep failed");
    }

    function sweepERC20(address token) external {
        uint256 balance = IERC20(token).balanceOf(address(this));
        require(balance > 0, "Zero token balance");
        bool success = IERC20(token).transfer(COLD_WALLET, balance);
        require(success, "ERC-20 transfer failed");
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.