ETH Price: $3,317.38 (-1.26%)

Contract

0x0921E4fA2F85B6461fa83961d28DC7e1f9A32B40
 

Overview

ETH Balance

0.239979353931300644 ETH

Eth Value

$796.10 (@ $3,317.38/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...168712032023-03-20 20:16:23613 days ago1679343383IN
0x0921E4fA...1f9A32B40
0 ETH0.0007028524.54872062
Set Settings168711992023-03-20 20:15:35613 days ago1679343335IN
0x0921E4fA...1f9A32B40
0 ETH0.0016977724.95629946
0x60806040168706182023-03-20 18:18:23613 days ago1679336303IN
 Create: BeefySwapperTreasury
0 ETH0.037960833.18301489

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
212263112024-11-20 3:37:472 days ago1732073867
0x0921E4fA...1f9A32B40
0.0021 ETH
212132612024-11-18 7:58:594 days ago1731916739
0x0921E4fA...1f9A32B40
0.0000955 ETH
211840352024-11-14 6:06:238 days ago1731564383
0x0921E4fA...1f9A32B40
0.0000868 ETH
211675382024-11-11 22:50:4711 days ago1731365447
0x0921E4fA...1f9A32B40
0.00001244 ETH
211675382024-11-11 22:50:4711 days ago1731365447
0x0921E4fA...1f9A32B40
0.00001716 ETH
211675382024-11-11 22:50:4711 days ago1731365447
0x0921E4fA...1f9A32B40
0.0000835 ETH
211675272024-11-11 22:48:3511 days ago1731365315
0x0921E4fA...1f9A32B40
0.000025 ETH
211675172024-11-11 22:46:3511 days ago1731365195
0x0921E4fA...1f9A32B40
0.00002 ETH
211652712024-11-11 15:15:1111 days ago1731338111
0x0921E4fA...1f9A32B40
0.000005 ETH
211441782024-11-08 16:40:2314 days ago1731084023
0x0921E4fA...1f9A32B40
0.0105197 ETH
211441682024-11-08 16:38:2314 days ago1731083903
0x0921E4fA...1f9A32B40
0.0000224 ETH
211436152024-11-08 14:47:3514 days ago1731077255
0x0921E4fA...1f9A32B40
0.0003443 ETH
211255132024-11-06 2:05:4716 days ago1730858747
0x0921E4fA...1f9A32B40
0.00008005 ETH
211108052024-11-04 0:49:4718 days ago1730681387
0x0921E4fA...1f9A32B40
0.0000026 ETH
211097352024-11-03 21:14:4719 days ago1730668487
0x0921E4fA...1f9A32B40
0.00001417 ETH
211065432024-11-03 10:33:2319 days ago1730630003
0x0921E4fA...1f9A32B40
0.0072493 ETH
211063212024-11-03 9:48:5919 days ago1730627339
0x0921E4fA...1f9A32B40
0.000005 ETH
210917242024-11-01 8:52:5921 days ago1730451179
0x0921E4fA...1f9A32B40
0.000006 ETH
210772882024-10-30 8:32:3523 days ago1730277155
0x0921E4fA...1f9A32B40
0.00025 ETH
210771582024-10-30 8:06:3523 days ago1730275595
0x0921E4fA...1f9A32B40
0.0017 ETH
210573112024-10-27 13:38:2326 days ago1730036303
0x0921E4fA...1f9A32B40
0.01266542 ETH
210573052024-10-27 13:37:1126 days ago1730036231
0x0921E4fA...1f9A32B40
0.01266542 ETH
210400942024-10-25 3:59:3528 days ago1729828775
0x0921E4fA...1f9A32B40
0.001 ETH
210095732024-10-20 21:48:1133 days ago1729460891
0x0921E4fA...1f9A32B40
0.00005876 ETH
209807542024-10-16 21:17:1137 days ago1729113431
0x0921E4fA...1f9A32B40
0.000135 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BeefySwapperTreasury

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : BeefySwapperTreasury.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin-4/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin-4/contracts/access/Ownable.sol";

// Built as the treasury to accept fees from Beefy Zap and deliver Native to feeBatch.
contract BeefySwapperTreasury is Ownable {
    using SafeERC20 for IERC20;

    // Addresses needed for the operation 
    address public treasury;
    address public stable;
    address public gelato;
    address public router;

    struct Settings {
        uint256 gasPriceLimit;
        uint256 threshold;
    }

    Settings public settings;

    event TokenSwapped(address indexed token, uint256 amount);
    event Harvest(uint256 amount);

    constructor(
        address _treasury,
        address _stable,
        address _gelato,
        address _router
    ) {
        stable = _stable;
        treasury = _treasury;
        gelato = _gelato;
        router = _router;
    }

    modifier onlyGelato() {
        require(msg.sender == gelato);
        _;
    }

    function swap(address[] calldata _tokens, bytes[] calldata _data) external onlyGelato {
        for (uint i; i < _data.length; ++i) {
            emit TokenSwapped(_tokens[i], IERC20(_tokens[i]).balanceOf(address(this)));
            _swapViaOneInch(_tokens[i], _data[i]);
        }
        uint256 amount = IERC20(stable).balanceOf(address(this));
        IERC20(stable).safeTransfer(treasury, amount);
        emit Harvest(amount);
    }

    function _swapViaOneInch(address _inputToken, bytes memory _callData) private {
        
        _approveTokenIfNeeded(_inputToken, address(router));

        (bool success, bytes memory retData) = router.call(_callData);

        propagateError(success, retData, "1inch");

        require(success == true, "calling 1inch got an error");
    }

    function _approveTokenIfNeeded(address _token, address _spender) private {
        if (IERC20(_token).allowance(address(this), _spender) == 0) {
            IERC20(_token).safeApprove(_spender, type(uint).max);
        }
    }

    function propagateError(
        bool success,
        bytes memory data,
        string memory errorMessage
    ) public pure {
        // Forward error message from call/delegatecall
        if (!success) {
            if (data.length == 0) revert(errorMessage);
            assembly {
                revert(add(32, data), mload(data))
            }
        }
    }

    function setSettings(Settings calldata _settings) external onlyOwner {
        settings = _settings;
    }

    function setAddresses(address _router, address _gelato, address _treasury) external onlyOwner {
        router = _router;
        gelato = _gelato;
        treasury = _treasury;
    }

    function inCaseTokensGetStuck(address _token, bool _native) external onlyOwner {
        if (_native) {
            uint256 _nativeAmount = address(this).balance;
            (bool sent,) = msg.sender.call{value: _nativeAmount}("");
            require(sent, "Failed to send Ether");
        } else {
            uint256 _amount = IERC20(_token).balanceOf(address(this));
            IERC20(_token).safeTransfer(msg.sender, _amount);
        }
    }
     receive() external payable {}
}

File 2 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

File 3 of 9 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 4 of 9 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 9 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

File 7 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.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 IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    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));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    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'
        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));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 8 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 9 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_stable","type":"address"},{"internalType":"address","name":"_gelato","type":"address"},{"internalType":"address","name":"_router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSwapped","type":"event"},{"inputs":[],"name":"gelato","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_native","type":"bool"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"string","name":"errorMessage","type":"string"}],"name":"propagateError","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_gelato","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"}],"internalType":"struct BeefySwapperTreasury.Settings","name":"_settings","type":"tuple"}],"name":"setSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settings","outputs":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stable","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b50604051620012fe380380620012fe8339810160408190526200003491620000fd565b6200003f3362000090565b600280546001600160a01b03199081166001600160a01b039586161790915560018054821695851695909517909455600380548516928416929092179091556004805490931691161790556200015a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080600080608085870312156200011457600080fd5b6200011f85620000e0565b93506200012f60208601620000e0565b92506200013f60408601620000e0565b91506200014f60608601620000e0565b905092959194509250565b611194806200016a6000396000f3fe6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033000000000000000000000000c9c61194682a3a5f56bf9cd5b59ee63028ab6041000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582

Deployed Bytecode

0x6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c9c61194682a3a5f56bf9cd5b59ee63028ab6041000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582

-----Decoded View---------------
Arg [0] : _treasury (address): 0xc9C61194682a3A5f56BF9Cd5B59EE63028aB6041
Arg [1] : _stable (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _gelato (address): 0x035066D430e5ca34e7BdB0756FCe82186CAfe1F0
Arg [3] : _router (address): 0x1111111254EEB25477B68fb85Ed929f73A960582

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000c9c61194682a3a5f56bf9cd5b59ee63028ab6041
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f0
Arg [3] : 0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Chain Token Portfolio % Price Amount Value
ETH29.69%$0.9999722,617.1428$2,617.07
ETH16.33%$0.995971,445.4397$1,439.61
ETH13.10%$11,153.9241$1,155.08
ETH
Ether (ETH)
9.03%$3,317.910.24$796.23
ETH5.87%$98,4620.00525358$517.28
ETH5.67%$0.998696500$499.35
ETH4.11%$3,317.910.1093$362.54
ETH2.33%$3,907.020.0526$205.69
ETH1.75%$0.995666154.5448$153.88
ETH1.64%$3,697.010.0392$144.95
ETH1.58%$0.999711139.6903$139.65
ETH1.14%$1.1389.1741$100.77
ETH1.04%$0.466588196.728$91.79
ETH0.85%$0.99700875.5318$75.31
ETH0.76%$3,470.030.0193$67.07
ETH0.70%$1.1255.1994$61.82
ETH0.66%$0.99621958.1797$57.96
ETH0.62%$3,318.490.0164$54.4
ETH0.57%$0.99982550.3144$50.31
ETH0.51%$3,303.570.0135$44.61
ETH0.43%$293.780.1291$37.93
ETH0.21%$3,499.450.00533375$18.67
ETH0.21%$0.99935318.1298$18.12
ETH0.20%$0.37843347.4155$17.94
ETH0.20%$0.99972417.9435$17.94
ETH0.19%$0.99351217.2991$17.19
ETH0.09%$3,669.740.00223277$8.19
ETH0.08%$0.999867.0432$7.04
ETH0.06%$3,592.160.00145344$5.22
ETH0.06%$1.194.1831$4.98
ETH0.05%$0.997114.177$4.16
ETH0.03%$3,281.010.00077762$2.55
ETH0.03%$12.3678$2.37
ETH0.03%$0.9975032.3331$2.33
ETH0.02%$0.5858063.4638$2.03
ETH0.02%$0.999032.0024$2
ETH0.02%$1.231.5104$1.86
ETH0.02%$0.02681958.9115$1.58
ETH0.01%$11.2497$1.25
ETH0.01%$0.1231839.966$1.23
ETH0.01%$98,5720.00001018$1
ETH<0.01%$0.2574423.1319$0.8062
ETH<0.01%$97,8460.00000619$0.6056
ETH<0.01%$7.250.0775$0.5615
ETH<0.01%$2.750.1838$0.5054
ETH<0.01%$10.10.0257$0.2595
ETH<0.01%$0.9960640.1827$0.1819
ETH<0.01%$0.0051224.5042$0.1254
ETH<0.01%$3,311.340.00003294$0.109
Loading...
Loading
[ Download: CSV Export  ]
[ 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.