Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x963f544dECE3b54D2fd4e144c92b42FC7EB0eAbF
Balance 0 ETH
Nonce 1
Code Size 4273 bytes
Last Active
Indexed Transactions 56 (24,321,53224,321,542)
Gas Used (indexed) 302,852
External Etherscan · Sourcify

Contract Bytecode

4273 bytes
0x608060405260043610610073575f3560e01c80638da5cb5b1161004d5780638da5cb5b146100e4578063999d56401461010e578063a85ef67814610136578063f2fde38b1461014c5761007a565b806303105b041461007e57806351cff8d9146100a6578063715018a6146100ce5761007a565b3661007a57005b5f5ffd5b348015610089575f5ffd5b506100a4600480360381019061009f9190610aa0565b610174565b005b3480156100b1575f5ffd5b506100cc60048036038101906100c79190610ade565b61021c565b005b3480156100d9575f5ffd5b506100e261040f565b005b3480156100ef575f5ffd5b506100f8610422565b6040516101059190610b18565b60405180910390f35b348015610119575f5ffd5b50610134600480360381019061012f9190610bc5565b610449565b005b348015610141575f5ffd5b5061014a6107a1565b005b348015610157575f5ffd5b50610172600480360381019061016d9190610ade565b61081c565b005b61017c6108a0565b8173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016101d7929190610c58565b6020604051808303815f875af11580156101f3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102179190610cb4565b505050565b6102246108a0565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361030c575f610260610422565b73ffffffffffffffffffffffffffffffffffffffff164760405161028390610d0c565b5f6040518083038185875af1925050503d805f81146102bd576040519150601f19603f3d011682016040523d82523d5f602084013e6102c2565b606091505b5050905080610306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102fd90610d7a565b60405180910390fd5b5061040c565b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103469190610b18565b602060405180830381865afa158015610361573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103859190610dac565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6103ab610422565b836040518363ffffffff1660e01b81526004016103c9929190610c58565b6020604051808303815f875af11580156103e5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104099190610cb4565b50505b50565b6104176108a0565b6104205f610927565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6104516108a0565b6104596109e8565b5f8573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104939190610b18565b602060405180830381865afa1580156104ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d29190610dac565b905084811015610517576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050e90610e21565b60405180910390fd5b5f3073ffffffffffffffffffffffffffffffffffffffff16848460405161053f929190610e71565b5f604051808303815f865af19150503d805f8114610578576040519150601f19603f3d011682016040523d82523d5f602084013e61057d565b606091505b50509050806105c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b890610ed3565b60405180910390fd5b5f8773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105fb9190610b18565b602060405180830381865afa158015610616573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061063a9190610dac565b905085836106489190610f1e565b8111610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068090610f9b565b60405180910390fd5b5f8684836106979190610fb9565b6106a19190610fb9565b90505f871115610755574173ffffffffffffffffffffffffffffffffffffffff16876040516106cf90610d0c565b5f6040518083038185875af1925050503d805f8114610709576040519150601f19603f3d011682016040523d82523d5f602084013e61070e565b606091505b50508093505082610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074b90611036565b60405180910390fd5b5b7f8b0f55e69ade63b7d1a0762f1bcb57d2b87800f408b79156f154dccf62b4e3da8188604051610786929190611054565b60405180910390a15050505061079a610a2e565b5050505050565b6107a96108a0565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004015f604051808303818588803b158015610803575f5ffd5b505af1158015610815573d5f5f3e3d5ffd5b5050505050565b6108246108a0565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610894575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161088b9190610b18565b60405180910390fd5b61089d81610927565b50565b6108a8610a37565b73ffffffffffffffffffffffffffffffffffffffff166108c6610422565b73ffffffffffffffffffffffffffffffffffffffff1614610925576108e9610a37565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161091c9190610b18565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600260015403610a24576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b60018081905550565b5f33905090565b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a6f82610a46565b9050919050565b610a7f81610a65565b8114610a89575f5ffd5b50565b5f81359050610a9a81610a76565b92915050565b5f5f60408385031215610ab657610ab5610a3e565b5b5f610ac385828601610a8c565b9250506020610ad485828601610a8c565b9150509250929050565b5f60208284031215610af357610af2610a3e565b5b5f610b0084828501610a8c565b91505092915050565b610b1281610a65565b82525050565b5f602082019050610b2b5f830184610b09565b92915050565b5f819050919050565b610b4381610b31565b8114610b4d575f5ffd5b50565b5f81359050610b5e81610b3a565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610b8557610b84610b64565b5b8235905067ffffffffffffffff811115610ba257610ba1610b68565b5b602083019150836001820283011115610bbe57610bbd610b6c565b5b9250929050565b5f5f5f5f5f60808688031215610bde57610bdd610a3e565b5b5f610beb88828901610a8c565b9550506020610bfc88828901610b50565b9450506040610c0d88828901610b50565b935050606086013567ffffffffffffffff811115610c2e57610c2d610a42565b5b610c3a88828901610b70565b92509250509295509295909350565b610c5281610b31565b82525050565b5f604082019050610c6b5f830185610b09565b610c786020830184610c49565b9392505050565b5f8115159050919050565b610c9381610c7f565b8114610c9d575f5ffd5b50565b5f81519050610cae81610c8a565b92915050565b5f60208284031215610cc957610cc8610a3e565b5b5f610cd684828501610ca0565b91505092915050565b5f81905092915050565b50565b5f610cf75f83610cdf565b9150610d0282610ce9565b5f82019050919050565b5f610d1682610cec565b9150819050919050565b5f82825260208201905092915050565b7f455448207472616e73666572206661696c6564000000000000000000000000005f82015250565b5f610d64601383610d20565b9150610d6f82610d30565b602082019050919050565b5f6020820190508181035f830152610d9181610d58565b9050919050565b5f81519050610da681610b3a565b92915050565b5f60208284031215610dc157610dc0610a3e565b5b5f610dce84828501610d98565b91505092915050565b7f496e73756666696369656e74207374617274696e672062616c616e63650000005f82015250565b5f610e0b601d83610d20565b9150610e1682610dd7565b602082019050919050565b5f6020820190508181035f830152610e3881610dff565b9050919050565b828183375f83830152505050565b5f610e588385610cdf565b9350610e65838584610e3f565b82840190509392505050565b5f610e7d828486610e4d565b91508190509392505050565b7f496e7465726e616c207377617020657865637574696f6e206661696c656400005f82015250565b5f610ebd601e83610d20565b9150610ec882610e89565b602082019050919050565b5f6020820190508181035f830152610eea81610eb1565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610f2882610b31565b9150610f3383610b31565b9250828201905080821115610f4b57610f4a610ef1565b5b92915050565b7f5472616465206e6f742070726f66697461626c652061667465722062726962655f82015250565b5f610f85602083610d20565b9150610f9082610f51565b602082019050919050565b5f6020820190508181035f830152610fb281610f79565b9050919050565b5f610fc382610b31565b9150610fce83610b31565b9250828203905081811115610fe657610fe5610ef1565b5b92915050565b7f4272696265206661696c656400000000000000000000000000000000000000005f82015250565b5f611020600c83610d20565b915061102b82610fec565b602082019050919050565b5f6020820190508181035f83015261104d81611014565b9050919050565b5f6040820190506110675f830185610c49565b6110746020830184610c49565b939250505056fea26469706673582212203b23764e7341903e6026517af96fa749221c37325f23636244a774462224076b64736f6c63430008210033

Verified Source Code Full Match

Compiler: v0.8.33+commit.64118f21 EVM: osaka Optimization: No
HeroExecutor.sol 69 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.33;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

interface IWETH is IERC20 {
    function deposit() external payable;
}

contract HeroExecutor is Ownable, ReentrancyGuard {
    address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    event ArbExecuted(uint256 netProfit, uint256 bribe);

    constructor() Ownable(msg.sender) {}

    // 1. Helper to wrap ETH into WETH inside the contract
    function wrapETH() external onlyOwner {
        IWETH(WETH).deposit{value: address(this).balance}();
    }

    // 2. REQUIRED: Grant DEX routers permission to spend your tokens
    function approveToken(address token, address spender) external onlyOwner {
        IERC20(token).approve(spender, type(uint256).max);
    }

    function executeArb(
        address flashToken,
        uint256 flashAmount,
        uint256 bribeAmount,
        bytes calldata arbData 
    ) external onlyOwner nonReentrant {
        uint256 balanceBefore = IERC20(flashToken).balanceOf(address(this));
        require(balanceBefore >= flashAmount, "Insufficient starting balance");

        // Execute internal swap instructions (No 'bool' re-declaration to avoid warnings)
        (bool success, ) = address(this).call(arbData);
        require(success, "Internal swap execution failed");
        
        uint256 balanceAfter = IERC20(flashToken).balanceOf(address(this));
        
        // SLIPPAGE GUARD: Reverts if trade doesn't cover the bribe + profit
        require(balanceAfter > (balanceBefore + bribeAmount), "Trade not profitable after bribe");
        
        uint256 netProfit = balanceAfter - balanceBefore - bribeAmount;

        // 3. Pay the Flashbots Bribe (to the miner)
        if (bribeAmount > 0) {
            (success, ) = block.coinbase.call{value: bribeAmount}("");
            require(success, "Bribe failed");
        }

        emit ArbExecuted(netProfit, bribeAmount);
    }

    // 4. Withdrawal Logic
    function withdraw(address token) external onlyOwner {
        if (token == address(0)) {
            (bool success, ) = payable(owner()).call{value: address(this).balance}("");
            require(success, "ETH transfer failed");
        } else {
            uint256 amount = IERC20(token).balanceOf(address(this));
            IERC20(token).transfer(owner(), amount);
        }
    }

    receive() external payable {}
}
ReentrancyGuard.sol 87 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Read Contract

owner 0x8da5cb5b → address

Write Contract 6 functions

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

approveToken 0x03105b04
address token
address spender
executeArb 0x999d5640
address flashToken
uint256 flashAmount
uint256 bribeAmount
bytes arbData
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x51cff8d9
address token
wrapETH 0xa85ef678
No parameters

Top Interactions

AddressTxnsSentReceived
0xe46f45bA...563C 10 10

Token Balances (1)

View Transfers →
WETH 1.25

Recent Transactions

CSV View All 56 Transactions →
|
Hash Method Block Age From/To Value Txn Fee Type
0xa52d23ab...b0d1e1 0x03105b04 24,321,542 IN 0xe46f45bA...563C 0 ETH 0.000072504808 ETH EIP-1559
0x709fefb7...934b77 0x03105b04 24,321,541 IN 0xe46f45bA...563C 0 ETH 0.000072409911 ETH EIP-1559
0x434f896b...d8ed8e Fail 0x03105b04 24,321,540 IN 0xe46f45bA...563C 0 ETH 0.000057547349 ETH EIP-1559
0xfb215734...1ead27 Fail 0x03105b04 24,321,538 IN 0xe46f45bA...563C 0 ETH 0.000057790084 ETH EIP-1559
0xea5d8a3a...b8fc47 Fail 0x03105b04 24,321,537 IN 0xe46f45bA...563C 0 ETH 0.000068333885 ETH EIP-1559
0x2304c46b...dc5394 Fail 0x03105b04 24,321,536 IN 0xe46f45bA...563C 0 ETH 0.000068418901 ETH EIP-1559
0xe567c9bc...cd1a68 Fail 0x03105b04 24,321,535 IN 0xe46f45bA...563C 0 ETH 0.000057859297 ETH EIP-1559
0xcaafd3c7...c0ceb1 Fail 0x03105b04 24,321,534 IN 0xe46f45bA...563C 0 ETH 0.000057936298 ETH EIP-1559
0x6b37147a...1a9669 Fail 0x03105b04 24,321,533 IN 0xe46f45bA...563C 0 ETH 0.000057911811 ETH EIP-1559
0x090fc5c2...38f825 Fail 0x03105b04 24,321,532 IN 0xe46f45bA...563C 0 ETH 0.000057988774 ETH EIP-1559