ETH Price: $2,899.35 (-0.89%)

Contract

0x4553E5CF08E8E5229caB9b092e76cB92cde672BA

Overview

ETH Balance

Linea Mainnet LogoLinea Mainnet LogoLinea Mainnet Logo0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
26989962024-03-05 15:51:46691 days ago1709653906
0x4553E5CF...2cde672BA
0 ETH
26989962024-03-05 15:51:46691 days ago1709653906
0x4553E5CF...2cde672BA
0 ETH
26989962024-03-05 15:51:46691 days ago1709653906
0x4553E5CF...2cde672BA
0 ETH
26989962024-03-05 15:51:46691 days ago1709653906
0x4553E5CF...2cde672BA
0 ETH
26989242024-03-05 15:46:58691 days ago1709653618
0x4553E5CF...2cde672BA
0 ETH
26989242024-03-05 15:46:58691 days ago1709653618
0x4553E5CF...2cde672BA
0 ETH
26989242024-03-05 15:46:58691 days ago1709653618
0x4553E5CF...2cde672BA
0 ETH
26989242024-03-05 15:46:58691 days ago1709653618
0x4553E5CF...2cde672BA
0 ETH
26988612024-03-05 15:42:46691 days ago1709653366
0x4553E5CF...2cde672BA
0 ETH
26988612024-03-05 15:42:46691 days ago1709653366
0x4553E5CF...2cde672BA
0 ETH
26988612024-03-05 15:42:46691 days ago1709653366
0x4553E5CF...2cde672BA
0 ETH
26988612024-03-05 15:42:46691 days ago1709653366
0x4553E5CF...2cde672BA
0 ETH
26986532024-03-05 15:28:54691 days ago1709652534
0x4553E5CF...2cde672BA
0 ETH
26986532024-03-05 15:28:54691 days ago1709652534
0x4553E5CF...2cde672BA
0 ETH
26986532024-03-05 15:28:54691 days ago1709652534
0x4553E5CF...2cde672BA
0 ETH
26986532024-03-05 15:28:54691 days ago1709652534
0x4553E5CF...2cde672BA
0 ETH
26985652024-03-05 15:23:02691 days ago1709652182
0x4553E5CF...2cde672BA
0 ETH
26985652024-03-05 15:23:02691 days ago1709652182
0x4553E5CF...2cde672BA
0 ETH
26985652024-03-05 15:23:02691 days ago1709652182
0x4553E5CF...2cde672BA
0 ETH
26985652024-03-05 15:23:02691 days ago1709652182
0x4553E5CF...2cde672BA
0 ETH
26984982024-03-05 15:18:34691 days ago1709651914
0x4553E5CF...2cde672BA
0 ETH
26984982024-03-05 15:18:34691 days ago1709651914
0x4553E5CF...2cde672BA
0 ETH
26984982024-03-05 15:18:34691 days ago1709651914
0x4553E5CF...2cde672BA
0 ETH
26984982024-03-05 15:18:34691 days ago1709651914
0x4553E5CF...2cde672BA
0 ETH
26982852024-03-05 15:04:22691 days ago1709651062
0x4553E5CF...2cde672BA
0 ETH
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WooV2Adapter

Compiler Version
v0.6.9+commit.3e3065ac

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at lineascan.build/ on 2023-08-16
*/

// File: contracts/intf/IERC20.sol



/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    function decimals() external view returns (uint8);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

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

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

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);
}

// File: contracts/SmartRoute/intf/IWooPPV2.sol



interface IWooPPV2 {
    function tokenInfos(address token) external returns(uint192 reserve, uint16 feeRate);

    function swap(address fromToken, address toToken, uint256 fromAmount, uint256 minToAmount, address rebateTo, address to) external returns(uint256 realToAmount);

    function balance(address token) external returns(uint256);
}

// File: contracts/lib/SafeMath.sol




/**
 * @title SafeMath
 * @author DODO Breeder
 *
 * @notice Math operations with safety checks that revert on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "MUL_ERROR");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "DIVIDING_ERROR");
        return a / b;
    }

    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 quotient = div(a, b);
        uint256 remainder = a - quotient * b;
        if (remainder > 0) {
            return quotient + 1;
        } else {
            return quotient;
        }
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SUB_ERROR");
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "ADD_ERROR");
        return c;
    }

    function sqrt(uint256 x) internal pure returns (uint256 y) {
        uint256 z = x / 2 + 1;
        y = x;
        while (z < y) {
            y = z;
            z = (x / z + z) / 2;
        }
    }
}

// File: contracts/lib/SafeERC20.sol




/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
        );
    }

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// File: contracts/SmartRoute/lib/UniversalERC20.sol





library UniversalERC20 {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IERC20 private constant ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    // 1. skip 0 amount
    // 2. handle ETH transfer
    function universalTransfer(
        IERC20 token,
        address payable to,
        uint256 amount
    ) internal {
        if (amount > 0) {
            if (isETH(token)) {
                to.transfer(amount);
            } else {
                token.safeTransfer(to, amount);
            }
        }
    }

    function universalApproveMax(
        IERC20 token,
        address to,
        uint256 amount
    ) internal {
        uint256 allowance = token.allowance(address(this), to);
        if (allowance < amount) {
            if (allowance > 0) {
                token.safeApprove(to, 0);
            }
            token.safeApprove(to, uint256(-1));
        }
    }

    function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) {
        if (isETH(token)) {
            return who.balance;
        } else {
            return token.balanceOf(who);
        }
    }

    function tokenBalanceOf(IERC20 token, address who) internal view returns (uint256) {
        return token.balanceOf(who);
    }

    function isETH(IERC20 token) internal pure returns (bool) {
        return token == ETH_ADDRESS;
    }
}

// File: contracts/SmartRoute/intf/IDODOAdapter.sol



interface IDODOAdapter {
    
    function sellBase(address to, address pool, bytes memory data) external;

    function sellQuote(address to, address pool, bytes memory data) external;
}

// File: contracts/SmartRoute/adapter/WooV2Adapter.sol

/*

    Copyright 2022 DODO ZOO.
    SPDX-License-Identifier: Apache-2.0

*/

pragma solidity 0.6.9;





contract WooV2Adapter is IDODOAdapter {
    using UniversalERC20 for IERC20;

    function _swap(address wooPPV2, address to, address fromToken, address toToken, address rebateTo) internal {
        (uint192 reserve, ) = IWooPPV2(wooPPV2).tokenInfos(fromToken);
        uint256 fromAmount = IWooPPV2(wooPPV2).balance(fromToken) - uint256(reserve);

        IWooPPV2(wooPPV2).swap(fromToken, toToken, fromAmount, 0, to, rebateTo);
    }
    
    function sellBase(address to, address pool, bytes memory moreInfo) external override {
        (address fromToken, address toToken, address rebateTo) = abi.decode(moreInfo, (address, address, address));
        _swap(pool, to, fromToken, toToken, rebateTo);
    }

    function sellQuote(address to, address pool, bytes memory moreInfo) external override {
        (address fromToken, address toToken, address rebateTo) = abi.decode(moreInfo, (address, address, address));
        _swap(pool, to, fromToken, toToken, rebateTo);
    }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes","name":"moreInfo","type":"bytes"}],"name":"sellBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes","name":"moreInfo","type":"bytes"}],"name":"sellQuote","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610323806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806330e6ae311461003b5780636f7929f21461003b575b600080fd5b6100fa6004803603606081101561005157600080fd5b6001600160a01b03823581169260208101359091169181019060608101604082013564010000000081111561008557600080fd5b82018360208201111561009757600080fd5b803590602001918460018302840111640100000000831117156100b957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100fc945050505050565b005b600080600083806020019051606081101561011657600080fd5b508051602082015160409092015190945090925090506101398587858585610141565b505050505050565b60408051635d23573960e11b81526001600160a01b03858116600483015282516000939189169263ba46ae7292602480830193919282900301818787803b15801561018b57600080fd5b505af115801561019f573d6000803e3d6000fd5b505050506040513d60408110156101b557600080fd5b50516040805163e3d670d760e01b81526001600160a01b03878116600483015291519293506000926001600160c01b038516928a169163e3d670d791602480830192602092919082900301818887803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b505050506040513d602081101561023b57600080fd5b505160408051633ee101c160e11b81526001600160a01b038981166004830152888116602483015293909203604483018190526000606484018190528a8516608485015287851660a48501529151909450928a1692637dc203829260c4808201936020939283900390910190829087803b1580156102b857600080fd5b505af11580156102cc573d6000803e3d6000fd5b505050506040513d60208110156102e257600080fd5b50505050505050505056fea2646970667358221220c2f98301c39bb97d05e992ae9c82e5ffc20f51446ee5fd60c6ee13873e9e0aab64736f6c63430006090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c806330e6ae311461003b5780636f7929f21461003b575b600080fd5b6100fa6004803603606081101561005157600080fd5b6001600160a01b03823581169260208101359091169181019060608101604082013564010000000081111561008557600080fd5b82018360208201111561009757600080fd5b803590602001918460018302840111640100000000831117156100b957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100fc945050505050565b005b600080600083806020019051606081101561011657600080fd5b508051602082015160409092015190945090925090506101398587858585610141565b505050505050565b60408051635d23573960e11b81526001600160a01b03858116600483015282516000939189169263ba46ae7292602480830193919282900301818787803b15801561018b57600080fd5b505af115801561019f573d6000803e3d6000fd5b505050506040513d60408110156101b557600080fd5b50516040805163e3d670d760e01b81526001600160a01b03878116600483015291519293506000926001600160c01b038516928a169163e3d670d791602480830192602092919082900301818887803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b505050506040513d602081101561023b57600080fd5b505160408051633ee101c160e11b81526001600160a01b038981166004830152888116602483015293909203604483018190526000606484018190528a8516608485015287851660a48501529151909450928a1692637dc203829260c4808201936020939283900390910190829087803b1580156102b857600080fd5b505af11580156102cc573d6000803e3d6000fd5b505050506040513d60208110156102e257600080fd5b50505050505050505056fea2646970667358221220c2f98301c39bb97d05e992ae9c82e5ffc20f51446ee5fd60c6ee13873e9e0aab64736f6c63430006090033

Deployed Bytecode Sourcemap

9431:999:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9886:266;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9886:266:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9886:266:0;;-1:-1:-1;9886:266:0;;-1:-1:-1;;;;;9886:266:0:i;:::-;;;9983:17;10002:15;10019:16;10050:8;10039:49;;;;;;;;;;;;;;;-1:-1:-1;10039:49:0;;;;;;;;;;;;;-1:-1:-1;10039:49:0;;-1:-1:-1;10039:49:0;-1:-1:-1;10099:45:0;10105:4;10111:2;10039:49;;;10099:5;:45::i;:::-;9886:266;;;;;;:::o;9516:358::-;9656:39;;;-1:-1:-1;;;9656:39:0;;-1:-1:-1;;;;;9656:39:0;;;;;;;;;9635:15;;9656:28;;;;;;:39;;;;;;;;;;;;9635:15;9656:28;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9656:39:0;;9727:36;;-1:-1:-1;;;9727:36:0;;-1:-1:-1;;;;;9727:36:0;;;;;;;;;9656:39;;-1:-1:-1;9706:18:0;;-1:-1:-1;;;;;9766:16:0;;;9727:25;;;;;:36;;;;;9656:39;;9727:36;;;;;;;9706:18;9727:25;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9727:36:0;9795:71;;;-1:-1:-1;;;9795:71:0;;-1:-1:-1;;;;;9795:71:0;;;;;;;;;;;;;;9727:55;;;;9795:71;;;;;;9850:1;9795:71;;;;;;;;;;;;;;;;;;;;;;9727:55;;-1:-1:-1;9795:22:0;;;;;;:71;;;;;9727:36;;9795:71;;;;;;;;;;:22;:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;9516:358:0:o

Swarm Source

ipfs://c2f98301c39bb97d05e992ae9c82e5ffc20f51446ee5fd60c6ee13873e9e0aab

Block Transaction Gas Used Reward
view all blocks sequenced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.