Contract

0xc45B55032caFeaff3b8057d52758D8f8211DA54D

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Vault Reward...5469062024-12-18 9:34:3422 hrs ago1734514474IN
0xc45B5503...8211DA54D
0 S0.000031571.1
Transfer Ownersh...5459912024-12-18 9:12:2622 hrs ago1734513146IN
0xc45B5503...8211DA54D
0 S0.00003141.1

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WooFeeManager

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 13 : WooFeeManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import "./interfaces/IWooRebateManager.sol";
import "./interfaces/IWooFeeManager.sol";
import "./interfaces/IWooVaultManager.sol";
import "./interfaces/IWooAccessManager.sol";

import "./libraries/TransferHelper.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/// @title Contract to collect transaction fee of WooPPV2.
contract WooFeeManager is Ownable, ReentrancyGuard, IWooFeeManager {
    /* ----- State variables ----- */

    mapping(address => uint256) public override feeRate; // decimal: 18; 1e16 = 1%, 1e15 = 0.1%, 1e14 = 0.01%
    uint256 public vaultRewardRate; // decimal: 18; 1e16 = 1%, 1e15 = 0.1%, 1e14 = 0.01%

    uint256 public rebateAmount;

    address public immutable override quoteToken;
    IWooRebateManager public rebateManager;
    IWooVaultManager public vaultManager;
    IWooAccessManager public accessManager;

    address public treasury;

    /* ----- Modifiers ----- */

    modifier onlyAdmin() {
        require(msg.sender == owner() || accessManager.isFeeAdmin(msg.sender), "WooFeeManager: !admin");
        _;
    }

    constructor(
        address _quoteToken,
        address _rebateManager,
        address _vaultManager,
        address _accessManager,
        address _treasury
    ) {
        quoteToken = _quoteToken;
        rebateManager = IWooRebateManager(_rebateManager);
        vaultManager = IWooVaultManager(_vaultManager);
        vaultRewardRate = 1e18;
        accessManager = IWooAccessManager(_accessManager);
        treasury = _treasury;
    }

    /* ----- Public Functions ----- */

    function collectFee(uint256 amount, address brokerAddr) external override nonReentrant {
        TransferHelper.safeTransferFrom(quoteToken, msg.sender, address(this), amount);
        uint256 rebateRate = rebateManager.rebateRate(brokerAddr);
        if (rebateRate > 0) {
            uint256 curRebateAmount = (amount * rebateRate) / 1e18;
            rebateManager.addRebate(brokerAddr, curRebateAmount);
            rebateAmount = rebateAmount + curRebateAmount;
        }
    }

    /* ----- Admin Functions ----- */

    function addRebates(address[] memory brokerAddrs, uint256[] memory amounts)
        external
        override
        nonReentrant
        onlyAdmin
    {
        require(amounts.length == brokerAddrs.length, "WooFeeManager: !length");

        uint256 totalAmount = 0;
        for (uint256 i = 0; i < brokerAddrs.length; ++i) {
            rebateManager.addRebate(brokerAddrs[i], amounts[i]);
            totalAmount = totalAmount + amounts[i];
        }

        rebateAmount = rebateAmount + totalAmount;
    }

    function distributeFees() external override nonReentrant onlyAdmin {
        uint256 balance = IERC20(quoteToken).balanceOf(address(this));
        require(balance > 0, "WooFeeManager: balance_ZERO");

        // Step 1: distribute the vault balance. Currently, 80% of fee (2 bps) goes to vault manager.
        uint256 vaultAmount = (balance * vaultRewardRate) / 1e18;
        if (vaultAmount > 0) {
            TransferHelper.safeTransfer(quoteToken, address(vaultManager), vaultAmount);
            balance = balance - vaultAmount;
        }

        // Step 2: distribute the rebate balance.
        if (rebateAmount > 0) {
            TransferHelper.safeTransfer(quoteToken, address(rebateManager), rebateAmount);

            // NOTE: if balance not enought: certain rebate rates are set incorrectly.
            balance = balance - rebateAmount;
            rebateAmount = 0;
        }

        // Step 3: balance left for treasury
        TransferHelper.safeTransfer(quoteToken, treasury, balance);
    }

    function setFeeRate(address token, uint256 newFeeRate) external override onlyAdmin {
        require(newFeeRate <= 1e16, "WooFeeManager: FEE_RATE>1%");
        feeRate[token] = newFeeRate;
        emit FeeRateUpdated(token, newFeeRate);
    }

    function setRebateManager(address newRebateManager) external onlyAdmin {
        require(newRebateManager != address(0), "WooFeeManager: rebateManager_ZERO_ADDR");
        rebateManager = IWooRebateManager(newRebateManager);
    }

    function setVaultManager(address newVaultManager) external onlyAdmin {
        require(newVaultManager != address(0), "WooFeeManager: newVaultManager_ZERO_ADDR");
        vaultManager = IWooVaultManager(newVaultManager);
    }

    function setVaultRewardRate(uint256 newVaultRewardRate) external onlyAdmin {
        require(newVaultRewardRate <= 1e18, "WooFeeManager: vaultRewardRate_INVALID");
        vaultRewardRate = newVaultRewardRate;
    }

    function setAccessManager(address newAccessManager) external onlyOwner {
        require(newAccessManager != address(0), "WooFeeManager: newAccessManager_ZERO_ADDR");
        accessManager = IWooAccessManager(newAccessManager);
    }

    function setTreasury(address newTreasury) external onlyOwner {
        require(newTreasury != address(0), "WooFeeManager: newTreasury_ZERO_ADDR");
        treasury = newTreasury;
    }

    function inCaseTokenGotStuck(address stuckToken) external onlyOwner {
        if (stuckToken == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
            TransferHelper.safeTransferETH(msg.sender, address(this).balance);
        } else {
            uint256 amount = IERC20(stuckToken).balanceOf(address(this));
            TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
        }
    }
}

File 2 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 4 of 13 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 5 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 7 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 9 of 13 : IWooAccessManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Reward manager interface for WooFi Swap.
/// @notice this is for swap rebate or potential incentive program
interface IWooAccessManager {
    /* ----- Events ----- */

    event FeeAdminUpdated(address indexed feeAdmin, bool flag);

    event VaultAdminUpdated(address indexed vaultAdmin, bool flag);

    event RebateAdminUpdated(address indexed rebateAdmin, bool flag);

    event ZeroFeeVaultUpdated(address indexed vault, bool flag);

    /* ----- External Functions ----- */

    function isFeeAdmin(address feeAdmin) external returns (bool);

    function isVaultAdmin(address vaultAdmin) external returns (bool);

    function isRebateAdmin(address rebateAdmin) external returns (bool);

    function isZeroFeeVault(address vault) external returns (bool);

    /* ----- Admin Functions ----- */

    /// @notice Sets feeAdmin
    function setFeeAdmin(address feeAdmin, bool flag) external;

    /// @notice Sets vaultAdmin
    function setVaultAdmin(address vaultAdmin, bool flag) external;

    /// @notice Sets rebateAdmin
    function setRebateAdmin(address rebateAdmin, bool flag) external;

    /// @notice Sets zeroFeeVault
    function setZeroFeeVault(address vault, bool flag) external;
}

File 10 of 13 : IWooFeeManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2022 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Contract to collect transaction fee of Woo private pool.
interface IWooFeeManager {
    /* ----- Events ----- */

    event FeeRateUpdated(address indexed token, uint256 newFeeRate);
    event Withdraw(address indexed token, address indexed to, uint256 amount);

    /* ----- External Functions ----- */

    /// @dev fee rate for the given base token:
    /// NOTE: fee rate decimal 18: 1e16 = 1%, 1e15 = 0.1%, 1e14 = 0.01%
    /// @param token the base token
    /// @return the fee rate
    function feeRate(address token) external view returns (uint256);

    /// @dev Sets the fee rate for the given token
    /// @param token the base token
    /// @param newFeeRate the new fee rate
    function setFeeRate(address token, uint256 newFeeRate) external;

    /// @dev Collects the swap fee to the given brokder address.
    /// @param amount the swap fee amount
    /// @param brokerAddr the broker address to rebate to
    function collectFee(uint256 amount, address brokerAddr) external;

    /// @dev get the quote token address
    /// @return address of quote token
    function quoteToken() external view returns (address);

    /// @dev Collects the fee and distribute to rebate and vault managers.
    function distributeFees() external;

    /// @dev Add the rebate amounts for the specified broker addresses.
    /// @param brokerAddrs the broker address for rebate
    /// @param amounts the rebate amount for each broker address
    function addRebates(address[] memory brokerAddrs, uint256[] memory amounts) external;
}

File 11 of 13 : IWooRebateManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Rebate manager interface for WooFi Swap.
/// @notice this is for swap rebate or potential incentive program

interface IWooRebateManager {
    event Withdraw(address indexed token, address indexed to, uint256 amount);
    event RebateRateUpdated(address indexed brokerAddr, uint256 rate);
    event ClaimReward(address indexed brokerAddr, uint256 amount);

    /// @dev Gets the rebate rate for the given broker.
    /// Note: decimal: 18;  1e16 = 1%, 1e15 = 0.1%, 1e14 = 0.01%
    /// @param brokerAddr the address for rebate
    /// @return The rebate rate (decimal: 18; 1e16 = 1%, 1e15 = 0.1%, 1e14 = 0.01%)
    function rebateRate(address brokerAddr) external view returns (uint256);

    /// @dev set the rebate rate
    /// @param brokerAddr the rebate address
    /// @param rate the rebate rate
    function setRebateRate(address brokerAddr, uint256 rate) external;

    /// @dev adds the pending reward for the given user.
    /// @param brokerAddr the address for rebate
    /// @param amountInUSD the pending reward amount
    function addRebate(address brokerAddr, uint256 amountInUSD) external;

    /// @dev Pending amount in reward token (e.g. $woo).
    /// @param brokerAddr the address for rebate
    function pendingRebateInReward(address brokerAddr) external view returns (uint256);

    /// @dev Pending amount in quote token (e.g. usdc).
    /// @param brokerAddr the address for rebate
    function pendingRebateInQuote(address brokerAddr) external view returns (uint256);

    /// @dev Claims the reward ($woo token will be distributed)
    function claimRebate() external;

    /// @dev get the quote token address
    /// @return address of quote token
    function quoteToken() external view returns (address);
}

File 12 of 13 : IWooVaultManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Vault reward manager interface for WooFi Swap.
interface IWooVaultManager {
    event VaultWeightUpdated(address indexed vaultAddr, uint256 weight);
    event RewardDistributed(address indexed vaultAddr, uint256 amount);

    /// @dev Gets the reward weight for the given vault.
    /// @param vaultAddr the vault address
    /// @return The weight of the given vault.
    function vaultWeight(address vaultAddr) external view returns (uint256);

    /// @dev Sets the reward weight for the given vault.
    /// @param vaultAddr the vault address
    /// @param weight the vault weight
    function setVaultWeight(address vaultAddr, uint256 weight) external;

    /// @dev Adds the reward quote amount.
    /// Note: The reward will be stored in this manager contract for
    ///       further weight adjusted distribution.
    /// @param quoteAmount the reward amount in quote token.
    function addReward(uint256 quoteAmount) external;

    /// @dev Pending amount in quote token for the given vault.
    /// @param vaultAddr the vault address
    function pendingReward(address vaultAddr) external view returns (uint256);

    /// @dev All pending amount in quote token.
    /// @return the total pending reward
    function pendingAllReward() external view returns (uint256);

    /// @dev Distributes the reward to all the vaults based on the weights.
    function distributeAllReward() external;

    /// @dev All the vaults
    /// @return the vault address array
    function allVaults() external view returns (address[] memory);

    /// @dev get the quote token address
    /// @return address of quote token
    function quoteToken() external view returns (address);
}

File 13 of 13 : TransferHelper.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;

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

/// @title TransferHelper
/// @notice Contains helper methods for interacting with ERC20 and native tokens that do not consistently return true/false
/// @dev implementation from https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/TransferHelper.sol
library TransferHelper {
    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "STF");
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "ST");
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "SA");
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, "STE");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_quoteToken","type":"address"},{"internalType":"address","name":"_rebateManager","type":"address"},{"internalType":"address","name":"_vaultManager","type":"address"},{"internalType":"address","name":"_accessManager","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"FeeRateUpdated","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":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"accessManager","outputs":[{"internalType":"contract IWooAccessManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"brokerAddrs","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"addRebates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"brokerAddr","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebateAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebateManager","outputs":[{"internalType":"contract IWooRebateManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAccessManager","type":"address"}],"name":"setAccessManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRebateManager","type":"address"}],"name":"setRebateManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newVaultManager","type":"address"}],"name":"setVaultManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newVaultRewardRate","type":"uint256"}],"name":"setVaultRewardRate","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"},{"inputs":[],"name":"vaultManager","outputs":[{"internalType":"contract IWooVaultManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b50604051620021fa380380620021fa833981016040819052620000349162000114565b6200003f33620000a7565b600180556001600160a01b03948516608052600580549486166001600160a01b03199586161790556006805493861693851693909317909255670de0b6b3a7640000600355600780549185169184169190911790556008805491909316911617905562000184565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200010f57600080fd5b919050565b600080600080600060a086880312156200012d57600080fd5b6200013886620000f7565b94506200014860208701620000f7565b93506200015860408701620000f7565b92506200016860608701620000f7565b91506200017860808701620000f7565b90509295509295909350565b608051612037620001c36000396000818161018101528181610a18015281816110f1015281816112110152818161126e01526112ca01526120376000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c8063942dc573116100d8578063d0254a2c1161008c578063f2fde38b11610066578063f2fde38b14610328578063fdcb60681461033b578063fea8dea31461035b57600080fd5b8063d0254a2c146102e2578063e1a4e72a14610302578063f0f442601461031557600080fd5b8063b543503e116100bd578063b543503e146102b4578063bb57ad20146102c7578063c9580804146102cf57600080fd5b8063942dc573146102985780639779c895146102ab57600080fd5b8063715018a61161012f578063850da5f611610114578063850da5f6146102435780638a4adf241461025a5780638da5cb5b1461027a57600080fd5b8063715018a6146102285780637ff7b0d21461023057600080fd5b8063395107ba11610160578063395107ba146101e25780635011e9ee146101f557806361d027b31461020857600080fd5b8063217a4b701461017c57806334fb4bab146101cd575b600080fd5b6101a37f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101e06101db366004611bf0565b61037b565b005b6101e06101f0366004611c12565b610585565b6101e0610203366004611d38565b61073d565b6008546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b6101e06109f7565b6101e061023e366004611df8565b610a0b565b61024c60045481565b6040519081526020016101c4565b6006546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff166101a3565b6101e06102a6366004611e24565b610ba6565b61024c60035481565b6101e06102c2366004611bf0565b610d98565b6101e0610f9d565b6101e06102dd366004611bf0565b611311565b61024c6102f0366004611bf0565b60026020526000908152604090205481565b6101e0610310366004611bf0565b611403565b6101e0610323366004611bf0565b6114e7565b6101e0610336366004611bf0565b6115d8565b6007546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b6005546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061043057506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af115801561040c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104309190611e4e565b61049b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f576f6f4665654d616e616765723a207265626174654d616e616765725f5a455260448201527f4f5f4144445200000000000000000000000000000000000000000000000000006064820152608401610492565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061063a57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190611e4e565b6106a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b670de0b6b3a7640000811115610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f576f6f4665654d616e616765723a207661756c74526577617264526174655f4960448201527f4e56414c494400000000000000000000000000000000000000000000000000006064820152608401610492565b600355565b61074561168c565b60005473ffffffffffffffffffffffffffffffffffffffff163314806107fa57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af11580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190611e4e565b610860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b81518151146108cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f576f6f4665654d616e616765723a20216c656e677468000000000000000000006044820152606401610492565b6000805b83518110156109d757600554845173ffffffffffffffffffffffffffffffffffffffff9091169063231bbff69086908490811061090e5761090e611e70565b602002602001015185848151811061092857610928611e70565b60200260200101516040518363ffffffff1660e01b815260040161096e92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600060405180830381600087803b15801561098857600080fd5b505af115801561099c573d6000803e3d6000fd5b505050508281815181106109b2576109b2611e70565b6020026020010151826109c59190611ece565b91506109d081611ee6565b90506108cf565b50806004546109e69190611ece565b600455506109f360018055565b5050565b6109ff6116ff565b610a096000611780565b565b610a1361168c565b610a3f7f00000000000000000000000000000000000000000000000000000000000000003330856117f5565b6005546040517f77ea464d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009216906377ea464d90602401602060405180830381865afa158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad49190611f1e565b90508015610b9c576000670de0b6b3a7640000610af18386611f37565b610afb9190611f74565b6005546040517f231bbff600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820184905292935091169063231bbff690604401600060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b5050505080600454610b979190611ece565b600455505b506109f360018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331480610c5b57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611e4e565b610cc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b662386f26fc10000811115610d32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f576f6f4665654d616e616765723a204645455f524154453e31250000000000006044820152606401610492565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602052604090819020839055517f98259702e6263eb2c9423b892e36fcaaaac8885fbeab7826218791df24d8498790610d8c9084815260200190565b60405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480610e4d57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190611e4e565b610eb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b73ffffffffffffffffffffffffffffffffffffffff8116610f56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f576f6f4665654d616e616765723a206e65775661756c744d616e616765725f5a60448201527f45524f5f414444520000000000000000000000000000000000000000000000006064820152608401610492565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610fa561168c565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061105a57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a9190611e4e565b6110c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561114d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111719190611f1e565b9050600081116111dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f576f6f4665654d616e616765723a2062616c616e63655f5a45524f00000000006044820152606401610492565b6000670de0b6b3a7640000600354836111f69190611f37565b6112009190611f74565b9050801561125a5760065461124d907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff168361196e565b6112578183611faf565b91505b600454156112c1576005546004546112ac917f00000000000000000000000000000000000000000000000000000000000000009173ffffffffffffffffffffffffffffffffffffffff9091169061196e565b6004546112b99083611faf565b600060045591505b600854611306907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff168461196e565b5050610a0960018055565b6113196116ff565b73ffffffffffffffffffffffffffffffffffffffff81166113bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f576f6f4665654d616e616765723a206e65774163636573734d616e616765725f60448201527f5a45524f5f4144445200000000000000000000000000000000000000000000006064820152608401610492565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61140b6116ff565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee03611449576114463347611ade565b50565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156114b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114da9190611f1e565b90506109f382338361196e565b6114ef6116ff565b73ffffffffffffffffffffffffffffffffffffffff8116611591576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f576f6f4665654d616e616765723a206e657754726561737572795f5a45524f5f60448201527f41444452000000000000000000000000000000000000000000000000000000006064820152608401610492565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6115e06116ff565b73ffffffffffffffffffffffffffffffffffffffff8116611683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610492565b61144681611780565b6002600154036116f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610492565b6002600155565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610492565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916118949190611fc6565b6000604051808303816000865af19150503d80600081146118d1576040519150601f19603f3d011682016040523d82523d6000602084013e6118d6565b606091505b50915091508180156119005750805115806119005750808060200190518101906119009190611e4e565b611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544600000000000000000000000000000000000000000000000000000000006044820152606401610492565b505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691611a059190611fc6565b6000604051808303816000865af19150503d8060008114611a42576040519150601f19603f3d011682016040523d82523d6000602084013e611a47565b606091505b5091509150818015611a71575080511580611a71575080806020019051810190611a719190611e4e565b611ad7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f53540000000000000000000000000000000000000000000000000000000000006044820152606401610492565b5050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051611b159190611fc6565b60006040518083038185875af1925050503d8060008114611b52576040519150601f19603f3d011682016040523d82523d6000602084013e611b57565b606091505b5050905080611bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544500000000000000000000000000000000000000000000000000000000006044820152606401610492565b505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611beb57600080fd5b919050565b600060208284031215611c0257600080fd5b611c0b82611bc7565b9392505050565b600060208284031215611c2457600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611ca157611ca1611c2b565b604052919050565b600067ffffffffffffffff821115611cc357611cc3611c2b565b5060051b60200190565b600082601f830112611cde57600080fd5b81356020611cf3611cee83611ca9565b611c5a565b82815260059290921b84018101918181019086841115611d1257600080fd5b8286015b84811015611d2d5780358352918301918301611d16565b509695505050505050565b60008060408385031215611d4b57600080fd5b823567ffffffffffffffff80821115611d6357600080fd5b818501915085601f830112611d7757600080fd5b81356020611d87611cee83611ca9565b82815260059290921b84018101918181019089841115611da657600080fd5b948201945b83861015611dcb57611dbc86611bc7565b82529482019490820190611dab565b96505086013592505080821115611de157600080fd5b50611dee85828601611ccd565b9150509250929050565b60008060408385031215611e0b57600080fd5b82359150611e1b60208401611bc7565b90509250929050565b60008060408385031215611e3757600080fd5b611e4083611bc7565b946020939093013593505050565b600060208284031215611e6057600080fd5b81518015158114611c0b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611ee157611ee1611e9f565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f1757611f17611e9f565b5060010190565b600060208284031215611f3057600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611f6f57611f6f611e9f565b500290565b600082611faa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600082821015611fc157611fc1611e9f565b500390565b6000825160005b81811015611fe75760208186018101518583015201611fcd565b81811115611ff6576000828501525b50919091019291505056fea26469706673582212209e670add065b31720f3656f4c6320b60e93ee13f7a4ed639b466b0ac7d37d0b464736f6c634300080e003300000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388940000000000000000000000007616614084e040028d6a61c0f3a9699c121a650000000000000000000000000032a1d9b2a85f2ef0516daabaa9c34325bc774cac000000000000000000000000af558f888e138ca9416111ec7ae8e28354cd92390000000000000000000000003d2f54bac9eb3bdb360bc3bab6e77243377a3586

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101775760003560e01c8063942dc573116100d8578063d0254a2c1161008c578063f2fde38b11610066578063f2fde38b14610328578063fdcb60681461033b578063fea8dea31461035b57600080fd5b8063d0254a2c146102e2578063e1a4e72a14610302578063f0f442601461031557600080fd5b8063b543503e116100bd578063b543503e146102b4578063bb57ad20146102c7578063c9580804146102cf57600080fd5b8063942dc573146102985780639779c895146102ab57600080fd5b8063715018a61161012f578063850da5f611610114578063850da5f6146102435780638a4adf241461025a5780638da5cb5b1461027a57600080fd5b8063715018a6146102285780637ff7b0d21461023057600080fd5b8063395107ba11610160578063395107ba146101e25780635011e9ee146101f557806361d027b31461020857600080fd5b8063217a4b701461017c57806334fb4bab146101cd575b600080fd5b6101a37f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889481565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101e06101db366004611bf0565b61037b565b005b6101e06101f0366004611c12565b610585565b6101e0610203366004611d38565b61073d565b6008546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b6101e06109f7565b6101e061023e366004611df8565b610a0b565b61024c60045481565b6040519081526020016101c4565b6006546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff166101a3565b6101e06102a6366004611e24565b610ba6565b61024c60035481565b6101e06102c2366004611bf0565b610d98565b6101e0610f9d565b6101e06102dd366004611bf0565b611311565b61024c6102f0366004611bf0565b60026020526000908152604090205481565b6101e0610310366004611bf0565b611403565b6101e0610323366004611bf0565b6114e7565b6101e0610336366004611bf0565b6115d8565b6007546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b6005546101a39073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061043057506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af115801561040c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104309190611e4e565b61049b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f576f6f4665654d616e616765723a207265626174654d616e616765725f5a455260448201527f4f5f4144445200000000000000000000000000000000000000000000000000006064820152608401610492565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061063a57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190611e4e565b6106a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b670de0b6b3a7640000811115610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f576f6f4665654d616e616765723a207661756c74526577617264526174655f4960448201527f4e56414c494400000000000000000000000000000000000000000000000000006064820152608401610492565b600355565b61074561168c565b60005473ffffffffffffffffffffffffffffffffffffffff163314806107fa57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af11580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190611e4e565b610860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b81518151146108cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f576f6f4665654d616e616765723a20216c656e677468000000000000000000006044820152606401610492565b6000805b83518110156109d757600554845173ffffffffffffffffffffffffffffffffffffffff9091169063231bbff69086908490811061090e5761090e611e70565b602002602001015185848151811061092857610928611e70565b60200260200101516040518363ffffffff1660e01b815260040161096e92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600060405180830381600087803b15801561098857600080fd5b505af115801561099c573d6000803e3d6000fd5b505050508281815181106109b2576109b2611e70565b6020026020010151826109c59190611ece565b91506109d081611ee6565b90506108cf565b50806004546109e69190611ece565b600455506109f360018055565b5050565b6109ff6116ff565b610a096000611780565b565b610a1361168c565b610a3f7f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388943330856117f5565b6005546040517f77ea464d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009216906377ea464d90602401602060405180830381865afa158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad49190611f1e565b90508015610b9c576000670de0b6b3a7640000610af18386611f37565b610afb9190611f74565b6005546040517f231bbff600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820184905292935091169063231bbff690604401600060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b5050505080600454610b979190611ece565b600455505b506109f360018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331480610c5b57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611e4e565b610cc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b662386f26fc10000811115610d32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f576f6f4665654d616e616765723a204645455f524154453e31250000000000006044820152606401610492565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602052604090819020839055517f98259702e6263eb2c9423b892e36fcaaaac8885fbeab7826218791df24d8498790610d8c9084815260200190565b60405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480610e4d57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190611e4e565b610eb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b73ffffffffffffffffffffffffffffffffffffffff8116610f56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f576f6f4665654d616e616765723a206e65775661756c744d616e616765725f5a60448201527f45524f5f414444520000000000000000000000000000000000000000000000006064820152608401610492565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610fa561168c565b60005473ffffffffffffffffffffffffffffffffffffffff1633148061105a57506007546040517fd624776500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063d6247765906024016020604051808303816000875af1158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a9190611e4e565b6110c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f576f6f4665654d616e616765723a202161646d696e00000000000000000000006044820152606401610492565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889473ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561114d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111719190611f1e565b9050600081116111dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f576f6f4665654d616e616765723a2062616c616e63655f5a45524f00000000006044820152606401610492565b6000670de0b6b3a7640000600354836111f69190611f37565b6112009190611f74565b9050801561125a5760065461124d907f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388949073ffffffffffffffffffffffffffffffffffffffff168361196e565b6112578183611faf565b91505b600454156112c1576005546004546112ac917f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388949173ffffffffffffffffffffffffffffffffffffffff9091169061196e565b6004546112b99083611faf565b600060045591505b600854611306907f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388949073ffffffffffffffffffffffffffffffffffffffff168461196e565b5050610a0960018055565b6113196116ff565b73ffffffffffffffffffffffffffffffffffffffff81166113bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f576f6f4665654d616e616765723a206e65774163636573734d616e616765725f60448201527f5a45524f5f4144445200000000000000000000000000000000000000000000006064820152608401610492565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61140b6116ff565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee03611449576114463347611ade565b50565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156114b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114da9190611f1e565b90506109f382338361196e565b6114ef6116ff565b73ffffffffffffffffffffffffffffffffffffffff8116611591576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f576f6f4665654d616e616765723a206e657754726561737572795f5a45524f5f60448201527f41444452000000000000000000000000000000000000000000000000000000006064820152608401610492565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6115e06116ff565b73ffffffffffffffffffffffffffffffffffffffff8116611683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610492565b61144681611780565b6002600154036116f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610492565b6002600155565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610492565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916118949190611fc6565b6000604051808303816000865af19150503d80600081146118d1576040519150601f19603f3d011682016040523d82523d6000602084013e6118d6565b606091505b50915091508180156119005750805115806119005750808060200190518101906119009190611e4e565b611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544600000000000000000000000000000000000000000000000000000000006044820152606401610492565b505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691611a059190611fc6565b6000604051808303816000865af19150503d8060008114611a42576040519150601f19603f3d011682016040523d82523d6000602084013e611a47565b606091505b5091509150818015611a71575080511580611a71575080806020019051810190611a719190611e4e565b611ad7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f53540000000000000000000000000000000000000000000000000000000000006044820152606401610492565b5050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051611b159190611fc6565b60006040518083038185875af1925050503d8060008114611b52576040519150601f19603f3d011682016040523d82523d6000602084013e611b57565b606091505b5050905080611bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544500000000000000000000000000000000000000000000000000000000006044820152606401610492565b505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611beb57600080fd5b919050565b600060208284031215611c0257600080fd5b611c0b82611bc7565b9392505050565b600060208284031215611c2457600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611ca157611ca1611c2b565b604052919050565b600067ffffffffffffffff821115611cc357611cc3611c2b565b5060051b60200190565b600082601f830112611cde57600080fd5b81356020611cf3611cee83611ca9565b611c5a565b82815260059290921b84018101918181019086841115611d1257600080fd5b8286015b84811015611d2d5780358352918301918301611d16565b509695505050505050565b60008060408385031215611d4b57600080fd5b823567ffffffffffffffff80821115611d6357600080fd5b818501915085601f830112611d7757600080fd5b81356020611d87611cee83611ca9565b82815260059290921b84018101918181019089841115611da657600080fd5b948201945b83861015611dcb57611dbc86611bc7565b82529482019490820190611dab565b96505086013592505080821115611de157600080fd5b50611dee85828601611ccd565b9150509250929050565b60008060408385031215611e0b57600080fd5b82359150611e1b60208401611bc7565b90509250929050565b60008060408385031215611e3757600080fd5b611e4083611bc7565b946020939093013593505050565b600060208284031215611e6057600080fd5b81518015158114611c0b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611ee157611ee1611e9f565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f1757611f17611e9f565b5060010190565b600060208284031215611f3057600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611f6f57611f6f611e9f565b500290565b600082611faa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600082821015611fc157611fc1611e9f565b500390565b6000825160005b81811015611fe75760208186018101518583015201611fcd565b81811115611ff6576000828501525b50919091019291505056fea26469706673582212209e670add065b31720f3656f4c6320b60e93ee13f7a4ed639b466b0ac7d37d0b464736f6c634300080e0033

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

00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388940000000000000000000000007616614084e040028d6a61c0f3a9699c121a650000000000000000000000000032a1d9b2a85f2ef0516daabaa9c34325bc774cac000000000000000000000000af558f888e138ca9416111ec7ae8e28354cd92390000000000000000000000003d2f54bac9eb3bdb360bc3bab6e77243377a3586

-----Decoded View---------------
Arg [0] : _quoteToken (address): 0x29219dd400f2Bf60E5a23d13Be72B486D4038894
Arg [1] : _rebateManager (address): 0x7616614084e040028D6a61c0f3A9699c121A6500
Arg [2] : _vaultManager (address): 0x32a1d9B2a85F2eF0516dAAbAa9C34325BC774CAc
Arg [3] : _accessManager (address): 0xAf558f888e138CA9416111Ec7aE8e28354Cd9239
Arg [4] : _treasury (address): 0x3D2F54BaC9EB3BdB360BC3bab6E77243377A3586

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894
Arg [1] : 0000000000000000000000007616614084e040028d6a61c0f3a9699c121a6500
Arg [2] : 00000000000000000000000032a1d9b2a85f2ef0516daabaa9c34325bc774cac
Arg [3] : 000000000000000000000000af558f888e138ca9416111ec7ae8e28354cd9239
Arg [4] : 0000000000000000000000003d2f54bac9eb3bdb360bc3bab6e77243377a3586


Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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