Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xB07155221e0D44B7eAf5c9E6B098BFc4AA57A9A8
Balance 0 ETH
Nonce 1
Code Size 1895 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1895 bytes
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806363a31bd4146100675780636be3f3e01461009f5780638da5cb5b146100b45780639a206ece146100df578063a6f9dae11461010b578063e6d66ac81461011e575b600080fd5b61008a610075366004610655565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6100b26100ad366004610688565b610131565b005b6000546100c7906001600160a01b031681565b6040516001600160a01b039091168152602001610096565b61008a6100ed366004610655565b6001600160a01b031660009081526001602052604090205460ff1690565b6100b2610119366004610655565b61023d565b6100b261012c3660046106bf565b61030b565b6000546001600160a01b031633146101805760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b60448201526064015b60405180910390fd5b6001600160a01b0382166101d65760405162461bcd60e51b815260206004820152601e60248201527f5370656e64657220616464726573732063616e6e6f74206265207a65726f00006044820152606401610177565b6001600160a01b038216600081815260016020908152604091829020805460ff1916851515908117909155825190815242918101919091527f4fb5317cc5e9845455acec7b7177ae2baa769f5e7df911a7d42c054d099517fc910160405180910390a25050565b6000546001600160a01b031633146102875760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610177565b6001600160a01b0381166102e95760405162461bcd60e51b8152602060048201526024808201527f4e6577206f776e65722063616e6e6f7420626520746865207a65726f206164646044820152637265737360e01b6064820152608401610177565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061033357503360009081526001602052604090205460ff165b6103705760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610177565b6002805460ff1690036103c55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610177565b6002805460ff1916811790556001600160a01b0383166104275760405162461bcd60e51b815260206004820152601c60248201527f546f6b656e20616464726573732063616e6e6f74206265207a65726f000000006044820152606401610177565b600081116104775760405162461bcd60e51b815260206004820181905260248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f6044820152606401610177565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156104bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104df91906106fb565b8111156105255760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606401610177565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390526000919085169063a9059cbb906044016020604051808303816000875af1158015610578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059c9190610714565b9050806105e35760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610177565b604080518381524260208201526001600160a01b038516917f6356739d963da01dc3533acba7203430fcc14f2175d48a8dd0973d7db49c785e910160405180910390a250506002805460ff191660011790555050565b80356001600160a01b038116811461065057600080fd5b919050565b60006020828403121561066757600080fd5b61067082610639565b9392505050565b801515811461068557600080fd5b50565b6000806040838503121561069b57600080fd5b6106a483610639565b915060208301356106b481610677565b809150509250929050565b6000806000606084860312156106d457600080fd5b6106dd84610639565b92506106eb60208501610639565b9150604084013590509250925092565b60006020828403121561070d57600080fd5b5051919050565b60006020828403121561072657600080fd5b81516106708161067756fea264697066735822122063de7ba62979d02a0f9537b129b512263abdd02920e83536ba6d6b658540f43c64736f6c63430008130033

Verified Source Code Partial Match

Compiler: v0.8.19+commit.7dd6d404 EVM: paris Optimization: Yes (200 runs)
EthereumSender.sol 90 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

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

contract EthereumSender {
    // Owner of the contract
    address public owner;

    // Mapping to manage spender role addresses
    mapping(address => bool) public spenders;

    // Status to prevent reentrancy attacks
    uint8 private status = 1;

    // Event emitted when tokens are sent
    event Sent(address indexed to, uint256 amount, uint256 timestamp);

    // Event emitted when a spender is added or removed
    event SpenderUpdated(address indexed spender, bool status, uint256 timestamp);

    // Modifier to restrict function access to the owner
    modifier onlyOwner() {
        require(msg.sender == owner, "Not the owner");
        _;
    }

    // Modifier to restrict function access to the owner or spenders
    modifier onlyOwnerOrSpender() {
        require(msg.sender == owner || spenders[msg.sender], "Not authorized");
        _;
    }

    // Modifier to prevent reentrancy attacks
    modifier nonReentrant() {
        require(status != 2, "ReentrancyGuard: reentrant call");
        status = 2;
        _;
        status = 1;
    }

    // Constructor to set the initial owner as the deployer
    constructor() {
        owner = msg.sender;
    }

    // Function to send tokens, callable by owner or spender, with anti-reentrancy guard
    function sendTokens(
        address token,
        address recipient,
        uint256 amount
    ) external onlyOwnerOrSpender nonReentrant {
        require(token != address(0), "Token address cannot be zero");
        require(amount > 0, "Amount must be greater than zero");
        require(
            amount <= IERC20(token).balanceOf(address(this)),
            "Insufficient balance"
        );

        bool success = IERC20(token).transfer(recipient, amount);
        require(success, "Token transfer failed");

        emit Sent(recipient, amount, block.timestamp);
    }

    // Function to transfer ownership, only callable by the current owner
    function changeOwner(address newOwner) external onlyOwner {
        require(newOwner != address(0), "New owner cannot be the zero address");
        owner = newOwner;
    }

    // Function to add or remove a spender
    function setSpender(address spender, bool isSpender) external onlyOwner {
        require(spender != address(0), "Spender address cannot be zero");
        spenders[spender] = isSpender;

        emit SpenderUpdated(spender, isSpender, block.timestamp);
    }

    // Function to check if an address is a spender
    function isSpender(address addr) external view returns (bool) {
        return spenders[addr];
    }
}

Read Contract

isSpender 0x9a206ece → bool
owner 0x8da5cb5b → address
spenders 0x63a31bd4 → bool

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

changeOwner 0xa6f9dae1
address newOwner
sendTokens 0xe6d66ac8
address token
address recipient
uint256 amount
setSpender 0x6be3f3e0
address spender
bool isSpender

Recent Transactions

No transactions found for this address