ETH Price: $1,936.66 (-7.24%)

Contract

0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b

Overview

ETH Balance

0.001812468898298958 ETH

ETH Value

$3.51 (@ $1,936.66/ETH)

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Swap4219768042026-01-16 13:38:1130 days ago1768570691IN
0x8Ccf8606...257eB148b
0 ETH0.000014770.02
Swap4219767602026-01-16 13:38:0030 days ago1768570680IN
0x8Ccf8606...257eB148b
0 ETH0.000007070.02
Swap4219766772026-01-16 13:37:3930 days ago1768570659IN
0x8Ccf8606...257eB148b
0 ETH0.000013350.02016
Swap4219766582026-01-16 13:37:3430 days ago1768570654IN
0x8Ccf8606...257eB148b
0 ETH0.000008730.020034
Swap4219766262026-01-16 13:37:2630 days ago1768570646IN
0x8Ccf8606...257eB148b
0 ETH0.000012230.020032
Swap4219765992026-01-16 13:37:2030 days ago1768570640IN
0x8Ccf8606...257eB148b
0 ETH0.000007010.020074
Swap4219765752026-01-16 13:37:1430 days ago1768570634IN
0x8Ccf8606...257eB148b
0 ETH0.000005420.020084
Swap4219765582026-01-16 13:37:0930 days ago1768570629IN
0x8Ccf8606...257eB148b
0 ETH0.000007560.020028
Swap4219765392026-01-16 13:37:0430 days ago1768570624IN
0x8Ccf8606...257eB148b
0 ETH0.000019790.020006
Swap4219765222026-01-16 13:37:0030 days ago1768570620IN
0x8Ccf8606...257eB148b
0 ETH0.00000990.020002
Swap4219764962026-01-16 13:36:5430 days ago1768570614IN
0x8Ccf8606...257eB148b
0 ETH0.000007020.020074
Swap4219764272026-01-16 13:36:3830 days ago1768570598IN
0x8Ccf8606...257eB148b
0 ETH0.000007780.020086
Swap4219763802026-01-16 13:36:2630 days ago1768570586IN
0x8Ccf8606...257eB148b
0 ETH0.000011490.02
Swap4219763592026-01-16 13:36:2130 days ago1768570581IN
0x8Ccf8606...257eB148b
0 ETH0.000012310.020058
Swap4219763222026-01-16 13:36:1130 days ago1768570571IN
0x8Ccf8606...257eB148b
0 ETH0.000011380.020062
Swap4219762952026-01-16 13:36:0530 days ago1768570565IN
0x8Ccf8606...257eB148b
0 ETH0.000005380.020082
Swap4219762592026-01-16 13:35:5630 days ago1768570556IN
0x8Ccf8606...257eB148b
0 ETH0.000004480.020392
Swap4219762452026-01-16 13:35:5230 days ago1768570552IN
0x8Ccf8606...257eB148b
0 ETH0.000010430.02001
Swap4219762192026-01-16 13:35:4630 days ago1768570546IN
0x8Ccf8606...257eB148b
0 ETH0.000007050.020074
Swap4219762072026-01-16 13:35:4330 days ago1768570543IN
0x8Ccf8606...257eB148b
0 ETH0.000005630.020102
Swap4219761782026-01-16 13:35:3530 days ago1768570535IN
0x8Ccf8606...257eB148b
0 ETH0.000010130.02003
Swap4219761252026-01-16 13:35:2230 days ago1768570522IN
0x8Ccf8606...257eB148b
0 ETH0.000006880.02
Swap4219761002026-01-16 13:35:1630 days ago1768570516IN
0x8Ccf8606...257eB148b
0 ETH0.000018130.020036
Swap4219760802026-01-16 13:35:1130 days ago1768570511IN
0x8Ccf8606...257eB148b
0 ETH0.00000690.020126
Swap4219760642026-01-16 13:35:0730 days ago1768570507IN
0x8Ccf8606...257eB148b
0 ETH0.00000570.020078
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
4224749982026-01-18 0:16:1228 days ago1768695372
0x8Ccf8606...257eB148b
0.00148415 ETH
4223190332026-01-17 13:24:4729 days ago1768656287
0x8Ccf8606...257eB148b
0.0000042 ETH
4222904822026-01-17 11:25:5729 days ago1768649157
0x8Ccf8606...257eB148b
0.00000525 ETH
4221976842026-01-17 4:58:5329 days ago1768625933
0x8Ccf8606...257eB148b
0.00009038 ETH
4220740872026-01-16 20:22:3929 days ago1768594959
0x8Ccf8606...257eB148b
0.00022846 ETH
4219799802026-01-16 13:51:2330 days ago1768571483
0x8Ccf8606...257eB148b
0.24086216 ETH
4219704572026-01-16 13:11:4630 days ago1768569106
0x8Ccf8606...257eB148b
0.00000101 ETH
4218512842026-01-16 4:55:2730 days ago1768539327
0x8Ccf8606...257eB148b
0 ETH
4218512842026-01-16 4:55:2730 days ago1768539327
0x8Ccf8606...257eB148b
0 ETH
4218210462026-01-16 2:49:2730 days ago1768531767
0x8Ccf8606...257eB148b
0.00001343 ETH
4217826772026-01-16 0:09:1930 days ago1768522159
0x8Ccf8606...257eB148b
0.00000857 ETH
4217108572026-01-15 19:08:3431 days ago1768504114
0x8Ccf8606...257eB148b
0.00000366 ETH
4217107022026-01-15 19:07:5531 days ago1768504075
0x8Ccf8606...257eB148b
0.00000366 ETH
4216508842026-01-15 14:59:1831 days ago1768489158
0x8Ccf8606...257eB148b
0.000015 ETH
4215531602026-01-15 8:12:5631 days ago1768464776
0x8Ccf8606...257eB148b
0.00014901 ETH
4214900802026-01-15 3:49:5631 days ago1768448996
0x8Ccf8606...257eB148b
0.00000297 ETH
4214394812026-01-15 0:19:1431 days ago1768436354
0x8Ccf8606...257eB148b
0.00000657 ETH
4214389012026-01-15 0:16:4931 days ago1768436209
0x8Ccf8606...257eB148b
0.00017523 ETH
4214195052026-01-14 22:56:0131 days ago1768431361
0x8Ccf8606...257eB148b
0.00000852 ETH
4214155752026-01-14 22:39:3931 days ago1768430379
0x8Ccf8606...257eB148b
0.0000009 ETH
4213728762026-01-14 19:41:3931 days ago1768419699
0x8Ccf8606...257eB148b
0.00025917 ETH
4213604332026-01-14 18:49:5332 days ago1768416593
0x8Ccf8606...257eB148b
0.00004638 ETH
4213252782026-01-14 16:23:4332 days ago1768407823
0x8Ccf8606...257eB148b
0.00016 ETH
4211299652026-01-14 2:50:4632 days ago1768359046
0x8Ccf8606...257eB148b
0.00000101 ETH
4210578212026-01-13 21:50:1232 days ago1768341012
0x8Ccf8606...257eB148b
0.00296 ETH
View All Internal Transactions

Cross-Chain 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
// 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 {}
}

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

// 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 {}
}

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

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

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

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

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

// 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

API
[{"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"}]

60806040523480156200001157600080fd5b50604051620012fe380380620012fe8339810160408190526200003491620000fd565b6200003f3362000090565b600280546001600160a01b03199081166001600160a01b039586161790915560018054821695851695909517909455600380548516928416929092179091556004805490931691161790556200015a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080600080608085870312156200011457600080fd5b6200011f85620000e0565b93506200012f60208601620000e0565b92506200013f60408601620000e0565b91506200014f60608601620000e0565b905092959194509250565b611194806200016a6000396000f3fe6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582

Deployed Bytecode

0x6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033

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

000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582

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

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a
Arg [1] : 000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8
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
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b
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.

`; } let ensZeroWidthWarningHtml = ""; if ($("#hdnIsEnsContainZeroWidthChars").val() == "true") { ensZeroWidthWarningHtml = `
${zeroWidthWarningMessage} Check the actual text at ENS.
`; } const ensOnL2NoteHtml = ensOnL2Note != "" ? `
  • ${ensOnL2Note}
  • ` : ""; const contentHtml = `
    Additional Info
    Full Name:
    ${ensNameForkIconSrc}


    Note:
    • Name tag is displayed due to forward and reverse resolution. Find out more.
    • ${ensOnL2NoteHtml}
    ${ensUnicodeWarningHtml} ${ensZeroWidthWarningHtml}
    `; $('#ensName').popover({ html: true, content: contentHtml, trigger: 'manual', placement: 'right' }); $('#ensName').click(function (event) { $("#udName").popover('hide') $("#ensName").popover('toggle'); event.stopPropagation(); }); $('#ensName').on('shown.bs.popover', async () => { //disable tooltip when hovering over ens name in the main page $("[rel='tooltipEns']").each(function () { $(this).tooltip('hide'); $(this).tooltip('disable'); }); //call ajax here to get result if (!otherENSNamesHtml) { const resolvedAddressesModel = await getEnsResolvedAddress($("#hdnAddress").val(), primaryDomainNameLabel); otherENSNamesHtml = generateEnsPopoverGrid(resolvedAddressesModel.d); if (!otherENSNamesHtml) { otherENSNamesHtml = "There are no other names resolving to this address." } } $(".popOverEnsOwnedAddressTable").html(otherENSNamesHtml); $("#divENSDisplayName").html(ensDisplayName); // append more copy button for ENS let domainName = $("#hdnEnsText").val(); const copyEnsButtonHtml = ` `; $("#spanCopyENSAddress").html(copyEnsButtonHtml); $("[data-bs-toggle='tooltip']").tooltip(); }); $('#ensName').on('hidden.bs.popover', () => { $("[rel='tooltipEns']").each(function () { $(this).tooltip('enable'); }); }); $('#ensName').on('hide.bs.popover', () => { $("[data-bs-toggle='tooltip']").tooltip('hide'); }); $(document).click(function (e) { const popoverElement = document.getElementById('popover-ens-preview'); const popoverTrigger = document.getElementById('ensName'); if (!popoverTrigger.contains(e.target) && (!popoverElement || !popoverElement.contains(e.target))) { $("#ensName").popover('hide'); } }) } async function getEnsResolvedAddress(address, currentEnsText) { try { const requestModel = { "lookupAddress": address, "primaryDomainName": currentEnsText, "provider": ensNameProvider }; const response = await $.ajax({ url: "/name-lookup-search.aspx/GetOtherDomainNameForAddress", type: "POST", contentType: "application/json", dataType: "json", data: JSON.stringify({ requestModel: requestModel }) }) return response; } catch { return ""; } } function generateEnsPopoverGrid(model) { if (!model || model.DomainNames.length == 0) { return ""; } let listOtherENSNames = ""; model.DomainNames.forEach(x => listOtherENSNames += x.Name); let moreOtherENSNames = ""; if (model.Total > 5) { moreOtherENSNames = `More ` } const result = `
    Other names resolving to this address:
    ${listOtherENSNames} ${moreOtherENSNames}
    `; return result; } // ===== UD name tag const displayUDName = ''; const primaryUDName = ''; const showUDPublicNote = 'false'; let otherUDNamesHtml = ""; function initUDNamePopOver() { //required to allow bootstrap popover to support table $.fn.popover.Constructor.Default.allowList.table = []; $.fn.popover.Constructor.Default.allowList.tr = []; $.fn.popover.Constructor.Default.allowList.td = []; $.fn.popover.Constructor.Default.allowList.th = []; $.fn.popover.Constructor.Default.allowList.div = []; $.fn.popover.Constructor.Default.allowList.tbody = []; $.fn.popover.Constructor.Default.allowList.thead = []; //allowList my inline styling for bootstrap $.fn.popover.Constructor.Default.allowList['*'].push('style') let unicodeWarningHtml = ""; if ($("#hdnIsUDContainUnicodeChars").val() == "true") { unicodeWarningHtml = `
    ${unicodeWarningMessage} Check the actual text at Unstoppable Domains.
    `; } let zeroWidthWarningHtml = ""; if ($("#hdnIsUDContainZeroWidthChars").val() == "true") { zeroWidthWarningHtml = `
    ${unicodeWarningMessage} Check the actual text at Unstoppable Domains.
    `; } const contentHtml = `
    Additional Info
    Full Name:
    Unstoppable Domains Name


    Note:
    • Name tag is displayed due to forward and reverse resolution. Find out more
    ${unicodeWarningHtml} ${zeroWidthWarningHtml}
    `; $('#udName').popover({ html: true, content: contentHtml, trigger: 'manual' }); $('#udName').click(function (event) { $("#ensName").popover('hide'); $("#udName").popover('toggle'); event.stopPropagation(); }); $('#udName').on('shown.bs.popover', async () => { //disable tooltip when hovering over SID name in the main page $("[rel='tooltipUDName']").each(function () { $(this).tooltip('hide'); $(this).tooltip('disable'); }); //call ajax here to get result if (!otherUDNamesHtml) { const resolvedAddressesModel = await getUDNamesResolvedAddress($("#hdnAddress").val(), primaryUDName); //format the ajax to otherUDNamesHtml otherUDNamesHtml = generateUDPopoverGrid(resolvedAddressesModel.d); if (!otherUDNamesHtml) { otherUDNamesHtml = "There are no other names resolving to this address." } } $(".popoverUDNamesOwnedByAddress").html(otherUDNamesHtml); $("#divDisplayUDName").html(displayUDName); if (showUDPublicNote == true) { $("#noteUD").html('The Unstoppable Domains NFT is minted on the Ethereum blockchain. View and verify its details on Etherscan.'); $("#noteUD").show(); } $("[data-bs-toggle='tooltip']").tooltip(); }); $('#udName').on('hidden.bs.popover', () => { $("[rel='tooltipUDName']").each(function () { $(this).tooltip('enable'); }); }); $('#udName').on('hide.bs.popover', () => { $("[data-bs-toggle='tooltip']").tooltip('hide'); }); // Hide Unstoppable Domains Name popover when click outside the popover popup. $(document).click(function () { $("#udName").popover('hide') }); } async function getUDNamesResolvedAddress(address, primaryUDName) { try { const requestModel = { "lookupAddress": address, "primaryDomainName": primaryUDName, "provider": "UD" }; const response = await $.ajax({ url: "/name-lookup-search.aspx/GetOtherDomainNameForAddress", type: "POST", contentType: "application/json", dataType: "json", data: JSON.stringify({ requestModel: requestModel }) }) return response; } catch { return ""; } } function generateUDPopoverGrid(model) { if (!model || model.DomainNames.length == 0) { return ""; } let listOtherUDNames = ""; model.DomainNames.forEach(x => listOtherUDNames += x.Name); let moreOtherUDNames = ""; if (model.Total > 5) { moreOtherUDNames = `More `; } const result = `
    Other names resolving to this address:
    ${listOtherUDNames} ${moreOtherUDNames}
    `; return result; } // ===== end UD name tag const tooltipForTokenHolding = 'More than 118 tokens found, listing and displaying the total balance of the first 100 tokens only. Click on the Coins icon to see the full list and balance.'; var adjustPosition = 0; $(document).ready(function () { switchAmountToValue(document.getElementById("headerAmountValue"), 'Value (USD)', 'Amount', true); switchAmountToValue(document.getElementById("headerIntAmountValue"), 'Value (USD)', 'Amount', true); switchMethodColumn(document.getElementById("headerMethod"), 'Method', 'Action', true); onDocumentReady(); $("[rel='tooltip']").tooltip(); $("[data-bs-toggle-second='tooltip']").tooltip({ trigger: 'hover' }); $("[rel='tooltipEns']").each(function () { $(this).tooltip({ title: $(this).attr("tooltip-title") }); }); if (hash != '') { activaTab(hash); }; onAddressDocReady(); // Note: this is causing "Copied" tooltip not showing when copy button is clicked in V3, and seems like not applicable to v3, comment out first in case there is issue //$('[data-bs-toggle="tooltip"]').click(function () { // $('[data-bs-toggle="tooltip"]').tooltip("hide"); //}); document.getElementById("copyaddressbutton").classList.remove("disabled"); if ($("#txtSearchContract").length) { initialiseKeyupOnDocReady(); } if (!!$('#ensName')[0]) { initEnsNamePopOver(); } if (!!$("#udName")[0]) { initUDNamePopOver(); } handleToggle(); if (window.matchMedia("(max-width: 767px)").matches) { // Mobile adjustPosition = 90; } else { // Others adjustPosition = 50; } if (tooltipForTokenHolding) { const dropdownMenuBalance = document.getElementById("dropdownMenuBalance"); if (dropdownMenuBalance) { const dropdownWrapper = dropdownMenuBalance.closest(".dropdown"); if (dropdownWrapper) { dropdownWrapper.setAttribute("title", tooltipForTokenHolding); new bootstrap.Tooltip(dropdownWrapper); } } } }); function displayAudit() { $('html, body').animate({ scrollTop: $("#auditReportId").offset().top - adjustPosition }); } var cThemeMode = getCookie('displaymode'); function handleToggle() { var className = document.getElementsByClassName('editor'); var classNameCount = className.length; for (var j = 0; j t.innerWidth()) { if (mb + d > tb) { t.css('padding-bottom', ((mb + d) - tb)); } } else { t.css('overflow', 'visible'); } }).on('hidden.bs.dropdown', function () { $(this).css({ 'padding-bottom': '', 'overflow': '' }); }); var btn_ERC20_sort = { count: 0, reminder_count: 2, list: [], default_list: [], ERC20_sort_start: function (count) { if (document.getElementsByClassName('list-custom-divider-ERC20')[0]) { var self = this if (count != undefined) { self.count = count } var before_el = document.getElementsByClassName('list-custom-divider-ERC20')[0] var parent_el = before_el.parentNode var element_selector = parent_el.querySelectorAll(".list-custom-ERC20"); if (self.list.length == 0) { element_selector.forEach(function (e) { self.list.push(e); self.default_list.push(e); }); } $(".list-custom-ERC20").remove() var type = self.count % self.reminder_count self.sortList(type, parent_el, before_el); self.count++ } }, sortList: function (type, parent_el, before_el) { var self = this var sorted_list = [] var icon_el = $(before_el).find('button').find('i') switch (type) { case 1: icon_el.attr("class", "fad fa-sort-up") sorted_list = self.sortUsdAsc() break; default: icon_el.attr("class", "fad fa-sort-down") sorted_list = self.sortUsdDesc() } for (var i = sorted_list.length - 1; i >= 0; i--) { before_el.insertAdjacentElement('afterend', sorted_list[i]) } }, sortUsdAsc: function () { var self = this var sort_list = self.list sort_list.sort(function (a, b) { var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1); var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1); if (target_a_value == -1 || target_b_value == -1) { return 1; } if (target_a_value target_b_value) { return 1; } return 0 }); return sort_list }, sortUsdDesc: function () { var self = this var sort_list = self.list sort_list.sort(function (a, b) { var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1); var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1); if (target_a_value target_b_value) { return -1; } return 0 }); return sort_list }, formatCurrencyToNumber: function (strCurrency) { if (typeof strCurrency == "number") return strCurrency else return Number(strCurrency.replace(/[^0-9.-]+/g, "")); }, } function hrefTokenHolding() { var location = "/tokenholdings?a=0x8ccf8606ccf0aff9937b68e0297967e257eb148b" var queryString = $("input.form-control.form-control-xs.search.mb-3")[0].value if (queryString) { location += "&q=" + queryString } window.location.href = location } $(document).ready(function () { $("#btn_ERC20_sort").on("click", function (event) { event.preventDefault(); setTimeout(function () { btn_ERC20_sort.ERC20_sort_start() }, 10) }) btn_ERC20_sort.ERC20_sort_start() var mainAddress = $("#hdnAddress").val(); // user search for method filters var searchFuncTimeOut; $("#ContentPlaceHolder1_inputMethodName").on("keyup", function ($event) { if (searchFuncTimeOut) { clearTimeout(searchFuncTimeOut) } var searchTerm = $(this).val(); searchFuncTimeOut = setTimeout(function () { searchFunctions( searchTerm); }, 350); }); var isSearchFunctions = false; $("#dropdownMethod").on("click", function (e) { if (isSearchFunctions === false) { searchFunctions(''); isSearchFunctions = true; } }); const litDefaultMethodFilterHtml = ''; function searchFunctions(searchTerm) { if (searchTerm === '' || searchTerm.length > 3) { const curPath = encodeURIComponent(window.location.search); $.ajax({ type: 'Get', url: `/functionSearchHandler.ashx?ca=${mainAddress}&func=${searchTerm ?? ''}&curPath=${curPath}`, success: function (response) { $("#searchFunctionResult").html(''); if (response && response.length > 0) { for (var i = 0; i ${response[i].name} ${response[i].methodId} ` ); } $("[data-bs-toggle='tooltip']").tooltip(); } else { $("#searchFunctionResult").append( `` ); } $("#inputMethodSpinner").hide(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { $("#searchFunctionResult").html(''); $("#inputMethodSpinner").hide(); } }); } else { $("#inputMethodSpinner").hide(); $("#searchFunctionResult").html(litDefaultMethodFilterHtml); } } // Resize window for analytic tab let isBusy = false; $(window).resize(function () { isBusy = true; if (isBusy) { let analyticFrame = document.getElementById('analytics_pageiframe'); if (analyticFrame && analyticFrame.contentWindow != undefined) { let navtab = analyticFrame.contentWindow.document.getElementsByClassName("nav_tabs1"); let hIframe = "0px"; if (navtab != null && navtab != undefined && navtab.length > 0) { let navH = Number(navtab[0].scrollHeight); hIframe = (Number(analyticFrame.contentWindow.document.getElementsByClassName("tab-content")[0].scrollHeight) + navH + 20) + 'px'; } else { hIframe = analyticFrame.contentWindow.document.body.scrollHeight + 'px'; } analyticFrame.style.height = hIframe } } }); // detect tooltip for token holding dropdown if ($(".addresses-tooltip-over").length > 0) { if (!isMobile()) { $(".addresses-tooltip-over").attr("data-bs-trigger", "hover"); let tooltip = bootstrap.Tooltip.getInstance(".addresses-tooltip-over"); if (tooltip !== null) { tooltip.dispose(); tooltip = new bootstrap.Tooltip($(".addresses-tooltip-over")); tooltip._config.trigger = 'hover'; tooltip.update(); } } } // Quick export transaction csv const quickExportCsvData = '[{"Txhash":"0xa0abfae6775bec1eb9829fc1b30c15fb994d8547e7791e7a7248137781c0cb6d","Status":"Success","Method":"Swap","Blockno":"421976804","DateTime":"2026-01-16 13:38:11","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001477"},{"Txhash":"0x3e6a9c3136c3b7bbcdd281874405ba72e6b1d41c4ccba96f57b17cc151ecab2a","Status":"Success","Method":"Swap","Blockno":"421976760","DateTime":"2026-01-16 13:38:00","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000707"},{"Txhash":"0x9ddb891d4ef790f86b2314d683e40e1562a55270ba0de28438c7b6fbce1c83a4","Status":"Success","Method":"Swap","Blockno":"421976677","DateTime":"2026-01-16 13:37:39","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001335"},{"Txhash":"0xa76b0ebd6bb7f45566d248d806f64405bbccf02d708317309ba82044da2b564b","Status":"Success","Method":"Swap","Blockno":"421976658","DateTime":"2026-01-16 13:37:34","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000873"},{"Txhash":"0xf1dd027ee611324ca45d17a4e5f6ed96d87c07386a49ef863d6fbacfe901dd90","Status":"Success","Method":"Swap","Blockno":"421976626","DateTime":"2026-01-16 13:37:26","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001223"},{"Txhash":"0xcf670f1695b0c34d7647120774a7f12c59db5216dd6c5d494f74f27d7ba7339c","Status":"Success","Method":"Swap","Blockno":"421976599","DateTime":"2026-01-16 13:37:20","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000701"},{"Txhash":"0xdc31c814be0603e4c3edb5fb614b13299ff04616a7c284cce05ee41870dd7378","Status":"Success","Method":"Swap","Blockno":"421976575","DateTime":"2026-01-16 13:37:14","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000542"},{"Txhash":"0xafe8d17a09abe7a70c619a61ba3fe9640ce199bfe2391e707b1042b655764529","Status":"Success","Method":"Swap","Blockno":"421976558","DateTime":"2026-01-16 13:37:09","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000756"},{"Txhash":"0xa2d231bd8d4829cecfa062ac45d09505c863431f3d5f6308ff5f64e08c8426a8","Status":"Success","Method":"Swap","Blockno":"421976539","DateTime":"2026-01-16 13:37:04","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001979"},{"Txhash":"0x41d62649f087e17abd35f9858834e72a6aa429e13b08994bdb917ab7ad3954cb","Status":"Success","Method":"Swap","Blockno":"421976522","DateTime":"2026-01-16 13:37:00","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.0000099"},{"Txhash":"0x59cece398e9c5ed4b54fb765e516f4e20ed54ab580c8b6828f3c4f8a230c4ccc","Status":"Success","Method":"Swap","Blockno":"421976496","DateTime":"2026-01-16 13:36:54","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000702"},{"Txhash":"0xd149c3d618bbd7484b99d7bf57f44a9ddbe2d6bda40850b44dd8d13c1b3f9b41","Status":"Success","Method":"Swap","Blockno":"421976427","DateTime":"2026-01-16 13:36:38","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000778"},{"Txhash":"0x62e803cc24ddee5d2cccd3c55d283bbb570a3bc3a5ca3b72082797b3e5a1a8ed","Status":"Success","Method":"Swap","Blockno":"421976380","DateTime":"2026-01-16 13:36:26","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001149"},{"Txhash":"0x478109dab9ae3ed735adaa392c4ac165585ee604a56cbfb07ac8926d405be928","Status":"Success","Method":"Swap","Blockno":"421976359","DateTime":"2026-01-16 13:36:21","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001231"},{"Txhash":"0x9f25fbe289c3ff922b687416fb9e72ff688209c830ea5823dbfeec3f42e338ab","Status":"Success","Method":"Swap","Blockno":"421976322","DateTime":"2026-01-16 13:36:11","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001138"},{"Txhash":"0xa8a747ad39eb19ff047ac08a0ca846bcdfb675722fd1ecdfe4bba92311027e2c","Status":"Success","Method":"Swap","Blockno":"421976295","DateTime":"2026-01-16 13:36:05","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000538"},{"Txhash":"0x4aa22fa6c89df768114eedb73e902e28280e1e0792bc697ca7bea9728d999926","Status":"Success","Method":"Swap","Blockno":"421976259","DateTime":"2026-01-16 13:35:56","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000448"},{"Txhash":"0x62e7faa74144840fe27706fe4f8ebad35f65615d1ee087e02f155a156e871557","Status":"Success","Method":"Swap","Blockno":"421976245","DateTime":"2026-01-16 13:35:52","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001043"},{"Txhash":"0xfe77af164847b4d59973186979d0dbbe51c059dbaba7187fe35ce1799662c491","Status":"Success","Method":"Swap","Blockno":"421976219","DateTime":"2026-01-16 13:35:46","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000705"},{"Txhash":"0xda95025c37ba463198d0bbc4ae790e93370deb1d10ab0a685efc40246ebb1d84","Status":"Success","Method":"Swap","Blockno":"421976207","DateTime":"2026-01-16 13:35:43","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000563"},{"Txhash":"0x02ed3e35079f59579b3927943c62ad49810d19e86ccc4201dfebf30177701b5c","Status":"Success","Method":"Swap","Blockno":"421976178","DateTime":"2026-01-16 13:35:35","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001013"},{"Txhash":"0x5ab940903681c2a02723502bd4470c157db6dd0c6e1c029baf34753c9820763f","Status":"Success","Method":"Swap","Blockno":"421976125","DateTime":"2026-01-16 13:35:22","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00000688"},{"Txhash":"0xb6252736f8b1895c08546cf3aa6eeb5b9b4419ee455815273d44495d1f897196","Status":"Success","Method":"Swap","Blockno":"421976100","DateTime":"2026-01-16 13:35:16","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.00001813"},{"Txhash":"0xb170a61378dd958899722374a09f9de7564b00c7b10a7bea586208fc7aa186a2","Status":"Success","Method":"Swap","Blockno":"421976080","DateTime":"2026-01-16 13:35:11","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.0000069"},{"Txhash":"0x41648394aa35ec9c1e869a856b1ef45c64717af63b1a1bb475b7831d9393c3f9","Status":"Success","Method":"Swap","Blockno":"421976064","DateTime":"2026-01-16 13:35:07","Sender":"0xAe30573368216963f9E9d765A7A7dE80ac199cEa","SenderLable":null,"Receiver":"0x8Ccf8606ccf0Aff9937B68e0297967e257eB148b","ReceiverLable":null,"Amount":"0 ETH","Value":"$0.00","TxnFee":"0.0000057"}]'; const quickExportCsvTitle = 'Transaction Hash,Status,Method,Blockno,"DateTime (UTC)",From,From_Nametag,To,To_Nametag,Amount,Value (USD),Txn Fee'; let isExportFinish = true; if ($("#btnExportQuickTableToCSV").length > 0 && quickExportCsvData) { $("#btnExportQuickTableToCSV").click(function () { if (isExportFinish == true) { isExportFinish = false; $("#btnExportQuickTableToCSV").append(''); let lstTxsObj = JSON.parse(quickExportCsvData); if (lstTxsObj.length > 0) { let csvRows = []; csvRows.push(quickExportCsvTitle.replace(/"/g, "")); for (let i = 0; i 0 && quickExportInternalTxsData) { $("#ContentPlaceHolder1_btnQuickExportInternalTxs").click(function () { if (isExportFinish == true) { isExportFinish = false; $("#ContentPlaceHolder1_btnQuickExportInternalTxs").append(''); let lstTxsObj = JSON.parse(quickExportInternalTxsData); if (lstTxsObj.length > 0) { let csvRows = []; csvRows.push(quickExportInternalTxsTitle.replace(/"/g, "")); for (let i = 0; i { if (x.startsWith("F")) { file = x.replace("F", ""); } else if (x.startsWith("L")) { line = x.replace("L", ""); } }) var editorId = "editor" + file var editorElem = $("#" + editorId); if (!editorElem.length) { return; } if (!line) { return; } var editor = ace.edit(editorId); editor.resize(true); editor.scrollToLine(line, true, true, function () { }); editor.gotoLine(line); var Range = ace.require('ace/range').Range $(document).scrollTop($("#" + editorId).offset().top - 95); //document.getElementById(editorId).scrollIntoView(); editor.session.addMarker(new Range(line - 1, 0, line - 1, 1), "myMarker", "fullLine"); //window.onbeforeunload = function () { $(document).scrollTop($("#" + editorId).offset().top); }; } setTimeout(function () { editorGoToLine(); }, 500); }); $("body,html").click(function (evt) { let elm = $(evt.target).attr("id"); let isClickedMode = elm === "darkModaBtn" || elm === "darkModaBtnIcon"; if (isClickedMode) { let isClickedSunMode = false; let clrBorder = "#112641"; if (elm === "darkModaBtn") isClickedSunMode = $(evt.target).find("#darkModaBtnIcon").hasClass("fa-moon"); if (elm === "darkModaBtnIcon") isClickedSunMode = $(evt.target).hasClass("fa-moon"); if (isClickedSunMode) { clrBorder = "#fff"; } let iframes = document.getElementById('analytics_pageiframe'); let heatcell = iframes.contentWindow.document.getElementsByClassName("ch-day").length; for (let i = 0; i