Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x68C1BfbfC8223Cf475DCB61257c97905225A3aa5
Balance 0 ETH
Nonce 1
Code Size 2811 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

2811 bytes
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806364586a34146100465780638da5cb5b14610076578063c72c4d1014610094575b600080fd5b610060600480360381019061005b91906104cb565b6100b2565b60405161006d91906105a2565b60405180910390f35b61007e6102cc565b60405161008b91906105cc565b60405180910390f35b61009c6102f2565b6040516100a991906105cc565b60405180910390f35b60006100bc610318565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461014c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014390610644565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff1663095ea7b38686600081811061017c5761017b610664565b5b90506020020160208101906101919190610693565b896040518363ffffffff1660e01b81526004016101af9291906106cf565b6020604051808303816000875af11580156101ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f29190610724565b508484600081811061020757610206610664565b5b905060200201602081019061021c9190610693565b73ffffffffffffffffffffffffffffffffffffffff166338ed173988600088888b61012c4261024b9190610780565b6040518763ffffffff1660e01b815260040161026c969594939291906108bc565b6000604051808303816000875af115801561028b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102b49190610a7c565b50600190506102c161035e565b979650505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260005403610354576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600081905550565b6001600081905550565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103a78261037c565b9050919050565b6103b78161039c565b81146103c257600080fd5b50565b6000813590506103d4816103ae565b92915050565b6000819050919050565b6103ed816103da565b81146103f857600080fd5b50565b60008135905061040a816103e4565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261043557610434610410565b5b8235905067ffffffffffffffff81111561045257610451610415565b5b60208301915083602082028301111561046e5761046d61041a565b5b9250929050565b60008083601f84011261048b5761048a610410565b5b8235905067ffffffffffffffff8111156104a8576104a7610415565b5b6020830191508360018202830111156104c4576104c361041a565b5b9250929050565b600080600080600080600060a0888a0312156104ea576104e9610372565b5b60006104f88a828b016103c5565b97505060206105098a828b016103fb565b965050604061051a8a828b016103c5565b955050606088013567ffffffffffffffff81111561053b5761053a610377565b5b6105478a828b0161041f565b9450945050608088013567ffffffffffffffff81111561056a57610569610377565b5b6105768a828b01610475565b925092505092959891949750929550565b60008115159050919050565b61059c81610587565b82525050565b60006020820190506105b76000830184610593565b92915050565b6105c68161039c565b82525050565b60006020820190506105e160008301846105bd565b92915050565b600082825260208201905092915050565b7f4e6f7420617574686f72697a6564000000000000000000000000000000000000600082015250565b600061062e600e836105e7565b9150610639826105f8565b602082019050919050565b6000602082019050818103600083015261065d81610621565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156106a9576106a8610372565b5b60006106b7848285016103c5565b91505092915050565b6106c9816103da565b82525050565b60006040820190506106e460008301856105bd565b6106f160208301846106c0565b9392505050565b61070181610587565b811461070c57600080fd5b50565b60008151905061071e816106f8565b92915050565b60006020828403121561073a57610739610372565b5b60006107488482850161070f565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061078b826103da565b9150610796836103da565b92508282019050808211156107ae576107ad610751565b5b92915050565b6000819050919050565b6000819050919050565b60006107e36107de6107d9846107b4565b6107be565b6103da565b9050919050565b6107f3816107c8565b82525050565b600082825260208201905092915050565b6000819050919050565b61081d8161039c565b82525050565b600061082f8383610814565b60208301905092915050565b600061084a60208401846103c5565b905092915050565b6000602082019050919050565b600061086b83856107f9565b93506108768261080a565b8060005b858110156108af5761088c828461083b565b6108968882610823565b97506108a183610852565b92505060018101905061087a565b5085925050509392505050565b600060a0820190506108d160008301896106c0565b6108de60208301886107ea565b81810360408301526108f181868861085f565b905061090060608301856105bd565b61090d60808301846106c0565b979650505050505050565b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61096182610918565b810181811067ffffffffffffffff821117156109805761097f610929565b5b80604052505050565b6000610993610368565b905061099f8282610958565b919050565b600067ffffffffffffffff8211156109bf576109be610929565b5b602082029050602081019050919050565b6000815190506109df816103e4565b92915050565b60006109f86109f3846109a4565b610989565b90508083825260208201905060208402830185811115610a1b57610a1a61041a565b5b835b81811015610a445780610a3088826109d0565b845260208401935050602081019050610a1d565b5050509392505050565b600082601f830112610a6357610a62610410565b5b8151610a738482602086016109e5565b91505092915050565b600060208284031215610a9257610a91610372565b5b600082015167ffffffffffffffff811115610ab057610aaf610377565b5b610abc84828501610a4e565b9150509291505056fea26469706673582212202277a5a485d49e0daddb86c9c9d4b740e721c66dae692d1b72f9229a12aa395b64736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: paris Optimization: No
FlashLoanArbitrage.sol 47 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface IUniswapV2Router {
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
}

contract FlashLoanArbitrage is ReentrancyGuard {
    address public owner;
    address public addressesProvider;  // ✅ Store Aave PoolAddressesProvider

    constructor(address _addressesProvider) {  // ✅ Accept provider address
        owner = msg.sender;
        addressesProvider = _addressesProvider;
    }

    function executeOperation(
        address asset,             
        uint256 amount,            
        address initiator,         
        address[] calldata route,  
        bytes calldata params      
    ) external nonReentrant returns (bool) {
        require(msg.sender == owner, "Not authorized");

        IERC20(asset).approve(route[0], amount);

        IUniswapV2Router(route[0]).swapExactTokensForTokens(
            amount,
            0,
            route,
            initiator,
            block.timestamp + 300
        );

        return true;
    }
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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);
}
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;
    }
}

Read Contract

addressesProvider 0xc72c4d10 → address
owner 0x8da5cb5b → address

Write Contract 1 functions

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

executeOperation 0x64586a34
address asset
uint256 amount
address initiator
address[] route
bytes params
returns: bool

Recent Transactions

No transactions found for this address