ETH Price: $3,394.64 (+1.72%)
Gas: 6 Gwei

Contract

0x8a65c07f438A631D4209CFBFC680a596BB0c1513
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Enable Vault201811342024-06-27 6:08:2319 days ago1719468503IN
0x8a65c07f...6BB0c1513
0 ETH0.000703935.41409767
Set Mint Vault M...201808282024-06-27 5:06:5919 days ago1719464819IN
0x8a65c07f...6BB0c1513
0 ETH0.000294966.15498242
Enable Vault199751372024-05-29 11:10:4747 days ago1716981047IN
0x8a65c07f...6BB0c1513
0 ETH0.001645499.27854383
Enable Vault199751372024-05-29 11:10:4747 days ago1716981047IN
0x8a65c07f...6BB0c1513
0 ETH0.001707799.27854383
Set Mint Vault M...199750162024-05-29 10:46:3547 days ago1716979595IN
0x8a65c07f...6BB0c1513
0 ETH0.0005525111.52923752
Set Zk Oracle199750152024-05-29 10:46:2347 days ago1716979583IN
0x8a65c07f...6BB0c1513
0 ETH0.0005719211.81248785
Set Mint Vault M...199750092024-05-29 10:45:1147 days ago1716979511IN
0x8a65c07f...6BB0c1513
0 ETH0.0005729611.95593613
Set Zk Oracle199750082024-05-29 10:44:5947 days ago1716979499IN
0x8a65c07f...6BB0c1513
0 ETH0.0005956512.29956679
Setn USD199750042024-05-29 10:44:1147 days ago1716979451IN
0x8a65c07f...6BB0c1513
0 ETH0.0005333811.24445447
0x61010060199750012024-05-29 10:43:3547 days ago1716979415IN
 Create: UnstableConfigurator
0 ETH0.0325118410.17589419

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UnstableConfigurator

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 9999 runs

Other Settings:
paris EvmVersion
File 1 of 10 : UnstableConfigurator.sol
// SPDX-License-Identifier: MIT

/**
 * @title Unstable Protocol V2 Configurator Contract
 * @dev The Configurator contract is used to set various control functionalities of the Unstable Protocol.
 * There are two types of governance roles:
 * * OWNER: Higher level privilege, multisig + timelock.
 * * ADMIN: Lower level privilege for emergency pauses and low level configs (e.g. incentives).
 * All setting functions have two levels of calling permissions:
 * * onlyOwner: Only callable by owner.
 * * onlyOwnerOrAdmin: Callable by owner and admin.
 * All ratios, fees and similar decimal parameters should be configured as bps (basis points), i.e. 4 decimals of precision.
 */

pragma solidity 0.8.19;

import "contracts/unstable/interfaces/IsnUSD.sol";
import "contracts/unstable/interfaces/IVault.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract UnstableConfigurator is Ownable {
    using SafeERC20 for IERC20;

    struct OriginationFeeConfig {
        uint16 minOriginationFee; // fee at 0% utilization
        uint16 maxOriginationFee; // fee at 100% utilization
    }

    struct RedemptionConfig {
        bool enabled; //whether a vault can redeem
        uint16 baseFee; // base fee for redemption
        uint16 maxMultiplier; // fee for redemption
        uint16 maxCollateralRatio; // collateral ratio for max fee multiplier
        uint16 providerShare; // share of redemption fee that goes to provider
    }

    address[] vaults; //list of all vaults

    mapping(address => bool) public collateralEnabled;        //for fast lookup
    address[] collaterals;                                    //list of all collaterals

    //lst specific config
    mapping(address => address) public zkOracleAddress;       //mapping of lst to zkOracle

    //vault configuration settings: must be set before vault is activated
    mapping(address => bool) public vaultEnabled;             //toggle minting for vault, required to be true to mint
    mapping(address => uint256) public mintVaultMaxSupply;    //max nUSD that can be minted for a vault

    //vault configuration settings: if you want to override defaults
    mapping(address => uint16) vaultBadCollateralRatio;      //minimum 1/ltv where liquidation can occur
    mapping(address => uint16) vaultSafeCollateralRatio;     //minimum 1/ltv required to open a position
    mapping(address => uint16) public borrowApr;             //borrowing APR. Default zero
    mapping(address => uint16) public vaultKeeperRatio;      //liquidation reward. Default in constructor
    mapping(address => uint16) depegThreshold;               //threshold to auto pause minting when market rate diverges
    mapping(address => bool) public useMarketRate;           //toggle using market rate (as opposed to redemption rate). Default false
    mapping(address => OriginationFeeConfig) public vaultOriginationFee; //origination fee config. Default in constructor
    mapping(address => RedemptionConfig) public vaultRedemptionConfig; //redemption config. Default in constructor

    //vault settings that can be changed after vault is activated
    mapping(address => bool) public vaultMintPaused;          //toggle minting for vault, required to be false to mint
    mapping(address => bool) public vaultBurnPaused;          //toggle burning for vault, required to be false to burn

    //multireward stuff
    mapping(address => bool) public rewardManager;          //user that can manage rewards

    //global config
    uint16 public flashloanFee;                           //fee for flashloaning nUSD

    //defaults
    uint16 public immutable defaultSafeCollateralRatio;                //default safe collateral ratio
    uint16 public immutable defaultBadCollateralRatioDistance;         //default amount bad collateral ratio is under the safe collateral ratio
    OriginationFeeConfig public defaultOriginationFee;                 //default origination fee config
    RedemptionConfig public defaultRedemptionConfig;                   //default redemption config
    uint16 public immutable defaultKeeperReward;                       //default liquidation reward
    uint16 public immutable defaultDepegThreshold;                     //default depeg threshold

    address public admin;
    address public treasury;
    IERC20 public nUSD;
    IsnUSD public snUSD; 
    address public etherOracle; //chainlink Oracle

    event AdminChanged(address newAdmin);
    event nUSDSet(address indexed nUSD);
    event snUSDSet(address indexed newAddr);
    event EtherOracleChanged(address newAddr);
    event TreasuryChanged(address newTreasury);

    event ZkOracleSet(address indexed vault, address zkOracle);
    event ZkOracleChanged(address indexed vault, address zkOracle);

    event VaultEnabled(address indexed vault);
    event VaultMintPaused(address indexed vault, bool paused);
    event VaultBurnPaused(address indexed vault, bool paused);
    event DepegThresholdUpdated(address indexed vault, uint16 threshold);
    event UseMarketRateChanged(address indexed vault, bool useMarketRate);

    event MintVaultMaxSupplyChanged(address indexed vault, uint256 maxSupply);
    event BadCollateralRatioChanged(address indexed vault, uint16 newRatio);
    event SafeCollateralRatioChanged(address indexed vault, uint16 newRatio);
    event BorrowAprChanged(address indexed vault, uint16 newApr);
    event KeeperRewardChanged(address indexed vault, uint16 newReward);
    event OriginationFeeChanged(address indexed vault, uint16 minOriginationFee, uint16 maxOriginationFee);
    event RedemptionConfigChanged(address indexed vault, bool enabled, uint16 baseFee, uint16 maxMultiplier, uint16 maxCollateralRatio, uint16 providerShare);

    event FeesDistributed(uint256 amount);
    event FlashloanFeeUpdated(uint16 fee);

    event TokensWithdrawn(address tokenAddress, address to, uint256 amount);
    event RewardManagerSet(address managerAddress);
    event RewardManagerRemoved(address managerAddress);

    constructor(address _etherOracle) {
        flashloanFee = 500; //500 bps = 5%
        defaultSafeCollateralRatio = 150_00; //15000 bps = 150%
        defaultBadCollateralRatioDistance = 15_00; //1500 bps = 15%
        defaultOriginationFee = OriginationFeeConfig(0, 1000); //0% at 0% utilization, 10% at 100% utilization
        defaultKeeperReward = 500; //500 bps = 5% reward
        defaultDepegThreshold = 300; //300 bps = 3% depeg
        defaultRedemptionConfig = RedemptionConfig(true, 100, 3, 200_00, 75_00); //100 bp fee, 3x max multiplier, 200% cr for max multiplier, 75% fee to provider
        etherOracle = _etherOracle; //chainlink oracle
    }

    modifier onlyOwnerOrAdmin {
        require(msg.sender == owner() || msg.sender == admin, "Only owner or admin can call this");
        _;
    }

    /**
     * @notice Sets the admin address. This function can only be executed by the owner.
     * @param _admin The address of the new admin.
     */
    function setAdmin(address _admin) external onlyOwner {
        admin = _admin;
        emit AdminChanged(_admin);
    }

    /**
     * @notice Sets the treasury address. This function can only be executed by the owner.
     * @param _treasury The address of the new treasury.
     */
    function setTreasury(address _treasury) external onlyOwner {
        treasury = _treasury;
        emit TreasuryChanged(_treasury);
    }

    /**
     * @notice Sets the reward manager status for a given address. This function can only be executed by the owner.
     * @param _rewardManager The address to set as a reward manager.
     * @dev The zero address cannot be set as a reward manager. If the address is already a reward manager, this function will have no effect.
     */
    function setRewardManager(address _rewardManager) external onlyOwner {
        require(_rewardManager != address(0), "Reward manager cannot be the zero address");
        if (!rewardManager[_rewardManager]) {
            rewardManager[_rewardManager] = true;
            emit RewardManagerSet(_rewardManager);
        }
    }

    /**
     * @notice Removes the reward manager status for a given address. This function can only be executed by the owner.
     * @param _rewardManager The address to remove as a reward manager.
     * @dev If the address is not currently a reward manager, this function will have no effect.
     */
    function removeRewardManager(address _rewardManager) external onlyOwner {
        if (rewardManager[_rewardManager]) {
            rewardManager[_rewardManager] = false;
            emit RewardManagerRemoved(_rewardManager);
        }
    }

    /**
     * @notice Sets the nUSD address. This function can only be executed once by the owner.
     * @param _nUSD The address of the new nUSD.
     */
    function setnUSD(address _nUSD) external onlyOwner {
        if (address(nUSD) == address(0)) nUSD = IERC20(_nUSD);
        emit nUSDSet(_nUSD);
    }

    /**
     * @notice Sets the snUSD address. This function can only be executed once by the owner.
     * @param _snUSD The address of the new nUSD.
     */
    function setsnUSD(address _snUSD) external onlyOwner {
        if (address(snUSD) == address(0)) snUSD = IsnUSD(_snUSD);
        IERC20(_snUSD).approve(address(nUSD), type(uint256).max);
        emit snUSDSet(_snUSD);
    }
    
    /**
     * @notice Sets the ether oracle address.
     * @param _etherOracle The address of the new ether oracle.
     */
    function updateEtherOracle(address _etherOracle) external onlyOwner {
        etherOracle = _etherOracle;
        emit EtherOracleChanged(_etherOracle);
    }

    /**
     * @notice Sets the zkOracle address for a specific nUSD vault.
     * @param collateral The address of the asset vault.
     * @param zkOracle The address of the zkOracle.
     * @dev This function can only be executed once per vault.
     */
    function setZkOracle(address collateral, address zkOracle) external onlyOwner {
        require(zkOracleAddress[collateral] == address(0), "ZkOracle already set");
        require(zkOracle != address(0), "ZkOracle cannot be zero address");
        zkOracleAddress[collateral] = zkOracle;
        emit ZkOracleSet(collateral, zkOracle);
    }

    /**
     * @notice Updates the zkOracle address for a specific nUSD vault.
     * @param collateral The address of the asset vault.
     * @param zkOracle The address of the zkOracle.
     */
    function updateZkOracle(address collateral, address zkOracle) external onlyOwner {
        require(zkOracle != address(0), "ZkOracle cannot be zero address");
        zkOracleAddress[collateral] = zkOracle;
        emit ZkOracleChanged(collateral, zkOracle);
    }

    /**
     * @notice Controls the activation of a specific nUSD vault.
     * @param vault The address of the asset vault.
     */
    function enableVault(address vault) external onlyOwner {
        require(!vaultEnabled[vault], "Vault already enabled");
        address collateral = IVault(vault).collateralAsset();
        require(zkOracleAddress[collateral] != address(0), "Set zkOracle before activating vault");
        require(IVault(vault).getAssetPrice() > 0, "Price oracle not working");

        vaultEnabled[vault] = true; //enable vaults
        vaults.push(); //add to vaults list

        //if collateral is unique
        if(collateralEnabled[collateral] == false) {
            collaterals.push(collateral); //add to collateral list
            collateralEnabled[collateral] = true; //add to lookup
        }
        emit VaultEnabled(vault);
    }

    /**
     * @notice Enables or disables the minting functionality for a asset vault.
     * @param vault The address of the vault.
     * @param isActive Boolean value indicating whether minting is active or paused.
     */
    function setVaultMintPaused(address vault, bool isActive) external onlyOwnerOrAdmin {
        vaultMintPaused[vault] = isActive;
        emit VaultMintPaused(vault, isActive);
    }

    /**
     * @notice Enables or disables the repayment functionality for a asset vault.
     * @param vault The address of the vault.
     * @param isActive Boolean value indicating whether repayment is active or paused.
     */
    function setVaultBurnPaused(address vault, bool isActive) external onlyOwnerOrAdmin {
        vaultBurnPaused[vault] = isActive;
        emit VaultBurnPaused(vault, isActive);
    }

    function setDepegThreshold(address vault, uint16 threshold) external onlyOwner {
        require(threshold <= 20_00, "Threshold too high");
        depegThreshold[vault] = threshold;
        emit DepegThresholdUpdated(vault, threshold);
    }

    /**
     * @notice Enables or disables the use of market rate for a asset vault.
     * @param vault The address of the vault.
     * @param _useMarketRate Boolean value indicating whether market rate is used.
     */
    function setUseMarketRate(address vault, bool _useMarketRate) external onlyOwner {
        if(_useMarketRate) {
            require(IVault(vault).getMarketRate() > 0, "Invalid market rate");
        }
        useMarketRate[vault] = _useMarketRate;
        emit UseMarketRateChanged(vault, _useMarketRate);
    }

    /**
     * @notice Controls the minting limit of nUSD for an asset vault.
     * @param vault The address of the asset vault.
     * @param maxSupply The maximum amount of nUSD that can be minted for the asset vault.
     */
    function setMintVaultMaxSupply(address vault, uint256 maxSupply) external onlyOwner {
        mintVaultMaxSupply[vault] = maxSupply;
        emit MintVaultMaxSupplyChanged(vault, maxSupply);
    }

    /**
        * @notice Sets the bad collateral ratio for a specific nUSD vault.
        * @param vault The address of the asset vault.
        * @param newRatio The new bad collateral ratio to set.
     */
    function setBadCollateralRatio(address vault, uint16 newRatio) external onlyOwner {
        // should be at least 10% lower than safe collateral ratio
        require(newRatio <= vaultSafeCollateralRatio[vault] - 10_00, "config too high");
        // bad collateral ratio should be between 105% and 200%
        require(newRatio >= 110_00 && newRatio <= 200_00, "config out of range");
        vaultBadCollateralRatio[vault] = newRatio;
        emit BadCollateralRatioChanged(vault, newRatio);
    }

    /**
     * @notice Sets the safe collateral ratio for a specific nUSD vault.
     * @param vault The address of the asset vault.
     * @param newRatio The new safe collateral ratio to set.
     */
    function setSafeCollateralRatio(address vault, uint16 newRatio) external onlyOwner {
        // should be at least 10% higher than bad collateral ratio
        require(newRatio >= vaultBadCollateralRatio[vault] + 10_00, "config too low");
        // safe collateral ratio should be at least 115% (10% higher than 105% minimum bad collateral ratio)
        require(newRatio >= 120_00, "config too low");
        vaultSafeCollateralRatio[vault] = newRatio;
        emit SafeCollateralRatioChanged(vault, newRatio);
    }

    /**
     * @notice Set the borrowing annual percentage rate (APR) for a asset vault.
     * @param vault The address of the vault to set the borrowing APR for.
     * @param newApr The new borrowing APR to set (in bps), limited to a maximum of 1000%.
     */
    function setBorrowApr(address vault, uint16 newApr) external onlyOwner {
        require(newApr <= 1000_00, "Borrow APR cannot exceed 1000%");
        borrowApr[vault] = newApr;
        emit BorrowAprChanged(vault, newApr);
    }

    /**
     * @notice Set the reward ratio for the liquidator after liquidation.
     * @param vault The address of the vault to set the reward ratio for.
     * @param newReward The new reward to set, limited to a maximum of 5% (out of maximum 10% liquidation penalty).
     */
    function setKeeperReward(address vault, uint16 newReward) external onlyOwner {
        require(newReward <= 500, "Max Keeper reward is 5%");
        vaultKeeperRatio[vault] = newReward;
        emit KeeperRewardChanged(vault, newReward);
    }

    /**
     * @notice Sets the redemption fee.
     */
    function setRedemptionFee(address vault, bool enabled, uint16 baseFee, uint16 maxMultiplier, uint16 maxCollateralRatio, uint16 providerShare) external onlyOwner {
        require(baseFee <= 10_00, "Max Redemption Fee is 10%");
        require(maxMultiplier <= 100_000, "Max multiplier is 10x");
        require(maxCollateralRatio >= 150_00 && maxCollateralRatio <= 300_00, "Cr for max multiplier must be 150%-300%");
        require(providerShare >= 50_00 && providerShare <= 100_00, "Provider share must be 50%-100%");
        vaultRedemptionConfig[vault] = RedemptionConfig(enabled, baseFee, maxMultiplier, maxCollateralRatio, providerShare);
        emit RedemptionConfigChanged(vault, enabled, baseFee, maxMultiplier, maxCollateralRatio, providerShare);
    }

    /**
     * @notice Set the origination fee for a asset vault.
     * @param vault The address of the vault to set the origination fee for.
     * @param minOriginationFee The minimum origination fee in percentage.
     * @param maxOriginationFee The maximum origination fee in percentage.
     */
    function setOriginationFee(address vault, uint16 minOriginationFee, uint16 maxOriginationFee) external onlyOwner {
        require(minOriginationFee <= maxOriginationFee, "Min fee cannot exceed max fee");
        require(maxOriginationFee <= 10_00, "Origination fee cannot exceed 10%");
        vaultOriginationFee[vault] = OriginationFeeConfig(minOriginationFee, maxOriginationFee);
        emit OriginationFeeChanged(vault, minOriginationFee, maxOriginationFee);
    }

    /**
     * @notice Update the flashloan fee percentage, only available to the manager of the contract
     * @param fee The fee for nUSD in bps
     */
    function setFlashloanFee(uint16 fee) external onlyOwner {
        require(fee <= 100_00, "Fee cannot exceed 100%");
        emit FlashloanFeeUpdated(fee);
        flashloanFee = fee;
    }

    /**
     * @notice Withdraws tokens from the contract.
     * @param tokenAddress The address of the token to withdraw.
     * @param to The address to send the tokens to.
     * @param amount The amount of tokens to withdraw.
     */
    function withdrawTokens(address tokenAddress, address to, uint256 amount) external onlyOwner {
        require(amount > IERC20(tokenAddress).balanceOf(address(this)), "Amount exceeds balance");
        IERC20(tokenAddress).safeTransfer(to, amount);
        emit TokensWithdrawn(tokenAddress, to, amount);
    }

    /**
     * @notice Transfers 50% of nUSD protocol fees to the snUSD contract, and remainder to the treasury
     */
    function distributeFees() external onlyOwnerOrAdmin {
        uint256 nusdBalance = nUSD.balanceOf(address(this));
        require(nusdBalance > 0, "No fees to distribute");
        uint256 snUsdRewards = nusdBalance / 2;
        snUSD.transferInRewards(snUsdRewards);
        nUSD.transfer(treasury, nusdBalance - snUsdRewards);
        emit FeesDistributed(nusdBalance);
    }

    /**
     * @dev Returns the list of all vaults.
     * @return The list of all vaults.
     */
    function getAllVaults() external view returns (address[] memory) {
        return vaults;
    }

    /**
     * @dev Returns the list of all collaterals.
     * @return The list of all collaterals.
     */
    function getAllCollaterals() external view returns (address[] memory) {
        return collaterals;
    }

    /**
     * @dev Returns the safe collateral ratio for a asset vault (or the default).
     * @param vault The address of the vault to check.
     * @return The safe collateral ratio for the specified vault.
     */
    function getSafeCollateralRatio(address vault) public view returns (uint16) {
        if (vaultSafeCollateralRatio[vault] == 0) return defaultSafeCollateralRatio;
        return vaultSafeCollateralRatio[vault];
    }

    /**
     * @dev Returns the bad collateral ratio for a asset vault (or the default).
     * @param vault The address of the vault to check.
     * @return The bad collateral ratio for the specified vault.
     */
    function getBadCollateralRatio(address vault) public view returns(uint16) {
        if(vaultBadCollateralRatio[vault] == 0) return getSafeCollateralRatio(vault) - defaultBadCollateralRatioDistance;
        return vaultBadCollateralRatio[vault];
    }

    /**
     * @dev Returns the origination fee for an asset vault (or the default if none is configured).
     * @param vault The address of the vault to check.
     */
    function getOriginationFee(address vault) external view returns(uint256 minOriginationFee, uint256 maxOriginationFee) {
        OriginationFeeConfig memory config = vaultOriginationFee[vault];
        if(config.minOriginationFee == 0 && config.maxOriginationFee == 0) return (defaultOriginationFee.minOriginationFee, defaultOriginationFee.maxOriginationFee);
        else return (config.minOriginationFee, config.maxOriginationFee);
    }

    /**
     * @dev Returns the redemption config for an asset vault (or the default if none is configured).
     * @param vault The address of the vault to check.
     */
    function getRedemptionConfig(address vault) public view returns(RedemptionConfig memory) {
        RedemptionConfig memory config = vaultRedemptionConfig[vault];
        if(config.enabled == false && config.providerShare == 0 && config.baseFee == 0 && config.maxCollateralRatio == 0 && config.maxMultiplier == 0) {
            return defaultRedemptionConfig;
        }
        else return config;
    }

    /**
     * @dev Returns the redemption fee for an asset vault.
     * @param vault The address of the vault to check.
     * @param collateralRatio The collateral ratio of the provider whose collateral is being redeemed.
     */
    function getRedemptionFee(address vault, uint256 collateralRatio) external view returns(uint256 providerFee, uint256 protocolFee) {
        require(vaultEnabled[vault], "Vault not enabled");
        require(collateralRatio >= 100_00, "Cannot redeem when collateral ratio is below 100%");
        RedemptionConfig memory config = getRedemptionConfig(vault);
        require(collateralRatio <= config.maxCollateralRatio, "Cannot redeem collateral ratio above max");
        uint16 badCollateralRatio = getBadCollateralRatio(vault);
        uint16 safeCollateralRatio = getSafeCollateralRatio(vault);
        uint16 providerShare = 80_00; //80% of redemption fee goes to provider

        uint256 totalFee;
        //Liquidateable positions don't get any redemption bonus, the baseFee goes to protocol
        if(collateralRatio <= badCollateralRatio) {
            totalFee = config.baseFee;
            providerFee = 0;
            protocolFee = totalFee;
        }
        //Positions between safe and bad collateral ratio get proportional baseFee based on how close to safe
        else if(collateralRatio <= safeCollateralRatio) {
            totalFee = config.baseFee;
            providerFee = totalFee * providerShare * (collateralRatio-badCollateralRatio) / (safeCollateralRatio-badCollateralRatio) / 100_00;
        }
        //Positions above collateralRatioForMaxMultiplier get baseFee * maxMultiplier
        else if(collateralRatio > config.maxCollateralRatio) {
            totalFee = config.baseFee * config.maxMultiplier / 100_00;
            providerFee = totalFee * providerShare / 100_00;
        }
        //Positions above safe collateral ratio and below collateralRatioForMaxMultiplier get linearly proportional multiplier
        else {
            totalFee = config.baseFee * (100_00 + (config.maxMultiplier-100_00) * (collateralRatio-safeCollateralRatio) / (config.maxCollateralRatio -safeCollateralRatio)) / 100_00;
            providerFee = totalFee * providerShare / 100_00;
        }
        protocolFee = totalFee - providerFee;
    }

    /**
     * @dev Returns the depeg threshold for a asset vault (or the default).
     * @param vault The address of the vault to check.
     * @return The depeg threshold for the specified vault.
     */
    function getDepegThreshold(address vault) external view returns(uint256) {
        if(depegThreshold[vault] == 0) return defaultDepegThreshold;
        return depegThreshold[vault];
    }

    /**
     * @dev Returns the keeper ratio for a asset vault (or the default).
     * @param vault The address of the vault to check.
     * @return The keeper ratio for the specified vault.
     */
    function getKeeperReward(address vault) external view returns(uint256) {
        if(vaultKeeperRatio[vault] == 0) return defaultKeeperReward;
        return vaultKeeperRatio[vault];
    }

    /**
     * @dev Returns whether a user is reward manager
     * @param user The address of the user to check.
     * @notice The owner is always a reward manager.
     * @return boolean indicating whether the user is a reward manager.
     */
    function isRewardManager(address user) external view returns(bool) {
        return rewardManager[user] || user == owner();
    }
}

File 2 of 10 : IsnUSD.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

interface IsnUSD {
  // Events //
  /// @notice Event emitted when the rewards are received
  event RewardsReceived(uint256 indexed amount, uint256 newVestingnUSDAmount);
  /// @notice Event emitted when the balance from an FULL_RESTRICTED_STAKER_ROLE user are redistributed
  event LockedAmountRedistributed(address indexed from, address indexed to, uint256 amount);

  // Errors //
  /// @notice Error emitted shares or assets equal zero.
  error InvalidAmount();
  /// @notice Error emitted when owner attempts to rescue USDe tokens.
  error InvalidToken();
  /// @notice Error emitted when slippage is exceeded on a deposit or withdrawal
  error SlippageExceeded();
  /// @notice Error emitted when a small non-zero share amount remains, which risks donations attack
  error MinSharesViolation();
  /// @notice Error emitted when owner is not allowed to perform an operation
  error OperationNotAllowed();
  /// @notice Error emitted when there is still unvested amount
  error StillVesting();
  /// @notice Error emitted when owner or blacklist manager attempts to blacklist owner
  //error CantBlacklistOwner();
  /// @notice Error emitted when the zero address is given
  error InvalidZeroAddress();

  function transferInRewards(uint256 amount) external;

  function rescueTokens(address token, uint256 amount, address to) external;

  function getUnvestedAmount() external view returns (uint256);
}

File 3 of 10 : IVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

interface IVault {
    function totalDepositedAsset() external view returns (uint256);
    function depositedAsset(address user) external view returns (uint256);
    function getBorrowedOf(address user) external view returns (uint256);
    function getPoolTotalCirculation() external view returns (uint256);
    function getAsset() external view returns (address);
    function burn(address onBehalfOf, uint256 amount) external;
    function collateralAsset() external view returns (address);
    function getAssetToUnderlyingRate() external view returns (uint256);
    function isDepegged() external view returns (bool);
    function getMarketRate() external view returns (uint256);
    function getAssetPrice() external view returns (uint256);
    function calculateRedemption(address provider, uint256 nusdAmount) external view returns (uint256 providerFee, uint256 protocolFee, uint256 nusdToProtocol, uint256 nusdToRepay, uint256 nusdToConvert, uint256 collateralReceived);
    function getRedeemableAmount(address provider) external view returns (uint256);
    function getCollateralRatio(address user) external view returns (uint256);
    function getOriginationFee(uint256 amount) external view returns (uint256);
}

File 4 of 10 : 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 5 of 10 : 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 6 of 10 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 7 of 10 : 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 8 of 10 : 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 9 of 10 : 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 10 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

Settings
{
  "remappings": [
    "@chainlink/=node_modules/@chainlink/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@ethereum-waffle/=node_modules/@ethereum-waffle/",
    "@layerzerolabs/=node_modules/@layerzerolabs/",
    "@openzeppelin-3/=node_modules/@openzeppelin-3/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@redstone-finance/=node_modules/@redstone-finance/",
    "@uniswap/=node_modules/@uniswap/",
    "erc721a/=node_modules/erc721a/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_etherOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"BadCollateralRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"newApr","type":"uint16"}],"name":"BorrowAprChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"threshold","type":"uint16"}],"name":"DepegThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAddr","type":"address"}],"name":"EtherOracleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"fee","type":"uint16"}],"name":"FlashloanFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"newReward","type":"uint16"}],"name":"KeeperRewardChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"MintVaultMaxSupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"minOriginationFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"maxOriginationFee","type":"uint16"}],"name":"OriginationFeeChanged","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":"vault","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"},{"indexed":false,"internalType":"uint16","name":"baseFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"maxMultiplier","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"maxCollateralRatio","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"providerShare","type":"uint16"}],"name":"RedemptionConfigChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"managerAddress","type":"address"}],"name":"RewardManagerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"managerAddress","type":"address"}],"name":"RewardManagerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"SafeCollateralRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTreasury","type":"address"}],"name":"TreasuryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"bool","name":"useMarketRate","type":"bool"}],"name":"UseMarketRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"VaultBurnPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"}],"name":"VaultEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"VaultMintPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"zkOracle","type":"address"}],"name":"ZkOracleChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"zkOracle","type":"address"}],"name":"ZkOracleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nUSD","type":"address"}],"name":"nUSDSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddr","type":"address"}],"name":"snUSDSet","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"borrowApr","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collateralEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultBadCollateralRatioDistance","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultDepegThreshold","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultKeeperReward","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultOriginationFee","outputs":[{"internalType":"uint16","name":"minOriginationFee","type":"uint16"},{"internalType":"uint16","name":"maxOriginationFee","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRedemptionConfig","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint16","name":"baseFee","type":"uint16"},{"internalType":"uint16","name":"maxMultiplier","type":"uint16"},{"internalType":"uint16","name":"maxCollateralRatio","type":"uint16"},{"internalType":"uint16","name":"providerShare","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultSafeCollateralRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"enableVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"etherOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flashloanFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllCollaterals","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllVaults","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getBadCollateralRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getDepegThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getKeeperReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getOriginationFee","outputs":[{"internalType":"uint256","name":"minOriginationFee","type":"uint256"},{"internalType":"uint256","name":"maxOriginationFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getRedemptionConfig","outputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint16","name":"baseFee","type":"uint16"},{"internalType":"uint16","name":"maxMultiplier","type":"uint16"},{"internalType":"uint16","name":"maxCollateralRatio","type":"uint16"},{"internalType":"uint16","name":"providerShare","type":"uint16"}],"internalType":"struct UnstableConfigurator.RedemptionConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"collateralRatio","type":"uint256"}],"name":"getRedemptionFee","outputs":[{"internalType":"uint256","name":"providerFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getSafeCollateralRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isRewardManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintVaultMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nUSD","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardManager","type":"address"}],"name":"removeRewardManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"setBadCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"newApr","type":"uint16"}],"name":"setBorrowApr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"threshold","type":"uint16"}],"name":"setDepegThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"fee","type":"uint16"}],"name":"setFlashloanFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"newReward","type":"uint16"}],"name":"setKeeperReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"setMintVaultMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"minOriginationFee","type":"uint16"},{"internalType":"uint16","name":"maxOriginationFee","type":"uint16"}],"name":"setOriginationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint16","name":"baseFee","type":"uint16"},{"internalType":"uint16","name":"maxMultiplier","type":"uint16"},{"internalType":"uint16","name":"maxCollateralRatio","type":"uint16"},{"internalType":"uint16","name":"providerShare","type":"uint16"}],"name":"setRedemptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardManager","type":"address"}],"name":"setRewardManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"setSafeCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"_useMarketRate","type":"bool"}],"name":"setUseMarketRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setVaultBurnPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setVaultMintPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address","name":"zkOracle","type":"address"}],"name":"setZkOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nUSD","type":"address"}],"name":"setnUSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_snUSD","type":"address"}],"name":"setsnUSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snUSD","outputs":[{"internalType":"contract IsnUSD","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"address","name":"_etherOracle","type":"address"}],"name":"updateEtherOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address","name":"zkOracle","type":"address"}],"name":"updateZkOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"useMarketRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultBurnPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultKeeperRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultMintPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultOriginationFee","outputs":[{"internalType":"uint16","name":"minOriginationFee","type":"uint16"},{"internalType":"uint16","name":"maxOriginationFee","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultRedemptionConfig","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint16","name":"baseFee","type":"uint16"},{"internalType":"uint16","name":"maxMultiplier","type":"uint16"},{"internalType":"uint16","name":"maxCollateralRatio","type":"uint16"},{"internalType":"uint16","name":"providerShare","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"zkOracleAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101006040523480156200001257600080fd5b50604051620038c0380380620038c0833981016040819052620000359162000154565b620000403362000104565b601280546101f461ffff199091168117909155613a9860809081526105dc60a0908152604080518082018252600081526103e86020918201526013805463ffffffff19166303e8000017905560c09490945261012c60e0528051918201815260018252606493820193909352600392810192909252614e206060830152611d4c910152601480546001600160481b031916681d4c4e200003006401179055601980546001600160a01b0319166001600160a01b039290921691909117905562000186565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200016757600080fd5b81516001600160a01b03811681146200017f57600080fd5b9392505050565b60805160a05160c05160e0516136e4620001dc6000396000818161054d01526125aa01526000818161040d015261201d0152600081816103b901526127450152600081816108ad0152611faf01526136e46000f3fe608060405234801561001057600080fd5b50600436106103af5760003560e01c80637aa27cf6116101f4578063bb57ad201161011a578063dffa7353116100ad578063f0f442601161007c578063f0f4426014610a30578063f170234114610a43578063f2fde38b14610a71578063f851a44014610a8457600080fd5b8063dffa7353146109e4578063e17bbe61146109f7578063eac7e21a14610a0a578063ecfdbf3214610a1d57600080fd5b8063cc143a04116100e9578063cc143a041461098b578063cea12844146109ab578063d4a7bc5e146109be578063d54d832c146109d157600080fd5b8063bb57ad201461093a578063bd9b8db014610942578063c026b83c14610955578063c9057db21461097857600080fd5b806397331bf911610192578063ae91874911610161578063ae918749146108cf578063b0900b87146108e2578063b300a55914610903578063b3495faa1461092757600080fd5b806397331bf9146108675780639fecc37d1461087c578063a41c8c0b146108a0578063a643e90e146108a857600080fd5b806381ddac33116101ce57806381ddac33146107a2578063857df254146108075780638da5cb5b14610843578063936f43301461085457600080fd5b80637aa27cf6146107695780637fe337681461077c578063807168ea1461078f57600080fd5b80633f506834116102d95780635adc5f951161027757806361d027b31161024657806361d027b3146107285780636c5da0231461073b578063704b6c021461074e578063715018a61461076157600080fd5b80635adc5f95146106e15780635ba0f6e8146106f45780635d6339a7146107025780635e35359e1461071557600080fd5b80634b3fef61116102b35780634b3fef61146106855780634e83423c146106a8578063508a098c146106bb57806352c0c258146106ce57600080fd5b80633f5068341461061657806346d61e681461063f5780634908ed6a1461066257600080fd5b80631ee9211f116103515780632f8e5638116103205780632f8e5638146105a25780632fe5dbdb146105b557806330ad9fd5146105d85780633b970e1d146105eb57600080fd5b80631ee9211f1461050d57806327480e5e146105355780632a771828146105485780632c7769b21461056f57600080fd5b80630ff1d9a81161038d5780630ff1d9a81461042f5780631110987814610442578063153ee55414610475578063165efc6a1461048857600080fd5b806304001e79146103b4578063045e3992146103f35780630a37a26c14610408575b600080fd5b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b60405161ffff90911681526020015b60405180910390f35b61040661040136600461322e565b610a97565b005b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b61040661043d36600461327e565b610b91565b6104656104503660046132a0565b60106020526000908152604090205460ff1681565b60405190151581526020016103ea565b6104066104833660046132a0565b610c3e565b6104da6104963660046132a0565b600e6020526000908152604090205460ff81169061ffff61010082048116916301000000810482169165010000000000820481169167010000000000000090041685565b60408051951515865261ffff9485166020870152928416928501929092528216606084015216608082015260a0016103ea565b61052061051b3660046132bd565b610d3e565b604080519283526020830191909152016103ea565b6105206105433660046132a0565b611050565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6013546105879061ffff808216916201000090041682565b6040805161ffff9384168152929091166020830152016103ea565b6104066105b03660046132e9565b6110d8565b6104656105c33660046132a0565b60116020526000908152604090205460ff1681565b6104066105e63660046132a0565b611271565b6017546105fe906001600160a01b031681565b6040516001600160a01b0390911681526020016103ea565b6105fe6106243660046132a0565b6004602052600090815260409020546001600160a01b031681565b61046561064d3660046132a0565b60056020526000908152604090205460ff1681565b6104656106703660046132a0565b60026020526000908152604090205460ff1681565b6104656106933660046132a0565b600c6020526000908152604090205460ff1681565b6104656106b63660046132a0565b6112f4565b6104066106c936600461332e565b61132e565b6104066106dc3660046132a0565b6113e7565b6104066106ef36600461322e565b611455565b6012546103db9061ffff1681565b6018546105fe906001600160a01b031681565b610406610723366004613363565b61156c565b6016546105fe906001600160a01b031681565b61040661074936600461332e565b6116a7565b61040661075c3660046132a0565b611761565b6104066117cf565b61040661077736600461332e565b6117e3565b61040661078a3660046133a4565b61191c565b61040661079d3660046132a0565b6119f2565b6107b56107b03660046132a0565b611a6c565b6040516103ea9190600060a082019050825115158252602083015161ffff8082166020850152806040860151166040850152806060860151166060850152806080860151166080850152505092915050565b6014546104da9060ff81169061ffff61010082048116916301000000810482169165010000000000820481169167010000000000000090041685565b6000546001600160a01b03166105fe565b6104066108623660046132a0565b611bb6565b61086f611ec7565b6040516103ea91906133d2565b6103db61088a3660046132a0565b60096020526000908152604090205461ffff1681565b61086f611f29565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6103db6108dd3660046132a0565b611f89565b6108f56108f03660046132a0565b611ff3565b6040519081526020016103ea565b6103db6109113660046132a0565b600a6020526000908152604090205461ffff1681565b6104066109353660046132bd565b612060565b6104066120b5565b61040661095036600461332e565b612389565b6104656109633660046132a0565b600f6020526000908152604090205460ff1681565b6104066109863660046133a4565b612442565b6108f56109993660046132a0565b60066020526000908152604090205481565b6108f56109b93660046132a0565b612580565b6104066109cc3660046132a0565b6125ed565b6103db6109df3660046132a0565b612720565b6104066109f236600461322e565b612797565b6019546105fe906001600160a01b031681565b610406610a1836600461341f565b612884565b610406610a2b36600461332e565b612bee565b610406610a3e3660046132a0565b612d3a565b610587610a513660046132a0565b600d6020526000908152604090205461ffff808216916201000090041682565b610406610a7f3660046132a0565b612da8565b6015546105fe906001600160a01b031681565b6000546001600160a01b0316331480610aba57506015546001600160a01b031633145b610b315760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b0382166000818152600f6020908152604091829020805460ff191685151590811790915591519182527fa40d190a02419e68e5f6dc9fe846b05cfa7b23c341e8512a0a17aaefe6b1d14491015b60405180910390a25050565b610b99612e35565b6127108161ffff161115610bef5760405162461bcd60e51b815260206004820152601660248201527f4665652063616e6e6f74206578636565642031303025000000000000000000006044820152606401610b28565b60405161ffff821681527f279588e548808d0be854db328e98d7c4938388d400495b156cf28e28a452d5b09060200160405180910390a16012805461ffff191661ffff92909216919091179055565b610c46612e35565b6001600160a01b038116610cc25760405162461bcd60e51b815260206004820152602960248201527f526577617264206d616e616765722063616e6e6f7420626520746865207a657260448201527f6f206164647265737300000000000000000000000000000000000000000000006064820152608401610b28565b6001600160a01b03811660009081526011602052604090205460ff16610d3b576001600160a01b038116600081815260116020908152604091829020805460ff1916600117905590519182527f4b722357462a92ae2776fce05f39902ac96cb04d2fe661eb688f4a72ab069cff91015b60405180910390a15b50565b6001600160a01b038216600090815260056020526040812054819060ff16610da85760405162461bcd60e51b815260206004820152601160248201527f5661756c74206e6f7420656e61626c65640000000000000000000000000000006044820152606401610b28565b612710831015610e205760405162461bcd60e51b815260206004820152603160248201527f43616e6e6f742072656465656d207768656e20636f6c6c61746572616c20726160448201527f74696f2069732062656c6f7720313030250000000000000000000000000000006064820152608401610b28565b6000610e2b85611a6c565b9050806060015161ffff16841115610eab5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f742072656465656d20636f6c6c61746572616c20726174696f206160448201527f626f7665206d61780000000000000000000000000000000000000000000000006064820152608401610b28565b6000610eb686612720565b90506000610ec387611f89565b9050611f40600061ffff84168811610eeb575060208401516000965061ffff16945084611038565b8261ffff168811610f545750602084015161ffff16612710610f0d85856134c6565b61ffff168561ffff168a610f2191906134e8565b610f2f61ffff8616856134fb565b610f3991906134fb565b610f439190613541565b610f4d9190613541565b9650611038565b846060015161ffff16881115610f9e5761271085604001518660200151610f7b9190613555565b610f85919061357b565b61ffff1690506127108261ffff1682610f4391906134fb565b612710838660600151610fb191906134c6565b61ffff168461ffff168a610fc591906134e8565b6127108860400151610fd791906134c6565b61ffff16610fe591906134fb565b610fef9190613541565b610ffb9061271061359c565b866020015161ffff1661100e91906134fb565b6110189190613541565b905061271061102b61ffff8416836134fb565b6110359190613541565b96505b61104287826134e8565b955050505050509250929050565b6001600160a01b0381166000908152600d6020908152604080832081518083019092525461ffff80821680845262010000909204169282019290925282911580156110a15750602081015161ffff16155b156110c057505060135461ffff80821694620100009092041692509050565b805160209091015161ffff9182169591169350915050565b6110e0612e35565b8061ffff168261ffff1611156111385760405162461bcd60e51b815260206004820152601d60248201527f4d696e206665652063616e6e6f7420657863656564206d6178206665650000006044820152606401610b28565b6103e88161ffff1611156111b45760405162461bcd60e51b815260206004820152602160248201527f4f726967696e6174696f6e206665652063616e6e6f742065786365656420313060448201527f25000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b60408051808201825261ffff808516825283811660208084019182526001600160a01b0388166000818152600d90925290859020935184549251841662010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009093169316929092171790915590517f2044f9a0ddce93e4b27a7528d5ddd10b6457266b637359915bca4b62413d116290611264908590859061ffff92831681529116602082015260400190565b60405180910390a2505050565b611279612e35565b6017546001600160a01b03166112bd57601780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790555b6040516001600160a01b038216907f689880f9ad4ba7ccfc7adca0540ca4ac20afea4e42445221e77a5c9ca732209790600090a250565b6001600160a01b03811660009081526011602052604081205460ff168061132857506000546001600160a01b038381169116145b92915050565b611336612e35565b6107d08161ffff16111561138c5760405162461bcd60e51b815260206004820152601260248201527f5468726573686f6c6420746f6f206869676800000000000000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600b6020908152604091829020805461ffff191661ffff861690811790915591519182527f99bdcc408a78b91c4be41509cc7aeb9acab26fb72b5ef2fe891f602399a8265b9101610b85565b6113ef612e35565b601980547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f543e10c6b084ab040bfc326b3270525b380ac580c281ea2bdbb1a07f6228e41390602001610d32565b61145d612e35565b8015611514576000826001600160a01b031663861a1cad6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c791906135af565b116115145760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206d61726b65742072617465000000000000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600c6020908152604091829020805460ff191685151590811790915591519182527f55037eaa55f89e895f244c980acd9d83f74503caa41b820db79b340bbe5850bb9101610b85565b611574612e35565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156115d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f591906135af565b81116116435760405162461bcd60e51b815260206004820152601660248201527f416d6f756e7420657863656564732062616c616e6365000000000000000000006044820152606401610b28565b6116576001600160a01b0384168383612e8f565b604080516001600160a01b038086168252841660208201529081018290527f6337ed398c0e8467698c581374fdce4db14922df487b5a39483079f5f59b60a49060600160405180910390a1505050565b6116af612e35565b620186a08161ffff1611156117065760405162461bcd60e51b815260206004820152601e60248201527f426f72726f77204150522063616e6e6f742065786365656420313030302500006044820152606401610b28565b6001600160a01b038216600081815260096020908152604091829020805461ffff191661ffff861690811790915591519182527f2ae8b81855126e149014e8649a82e57a5080b1dc91add6a8563e00e462a9ce7f9101610b85565b611769612e35565b601580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f7ce7ec0b50378fb6c0186ffb5f48325f6593fcb4ca4386f21861af3129188f5c90602001610d32565b6117d7612e35565b6117e16000612f14565b565b6117eb612e35565b6001600160a01b0382166000908152600760205260409020546118149061ffff166103e86135c8565b61ffff168161ffff16101561186b5760405162461bcd60e51b815260206004820152600e60248201527f636f6e66696720746f6f206c6f770000000000000000000000000000000000006044820152606401610b28565b612ee08161ffff1610156118c15760405162461bcd60e51b815260206004820152600e60248201527f636f6e66696720746f6f206c6f770000000000000000000000000000000000006044820152606401610b28565b6001600160a01b038216600081815260086020908152604091829020805461ffff191661ffff861690811790915591519182527f2c95eb50160fab9d8c004b77dd3a429cbeebf819e07769988877e6853f849de99101610b85565b611924612e35565b6001600160a01b03811661197a5760405162461bcd60e51b815260206004820152601f60248201527f5a6b4f7261636c652063616e6e6f74206265207a65726f2061646472657373006044820152606401610b28565b6001600160a01b0382811660008181526004602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917fd57eabf2e3258392b7325f4e1bd564121a61092e8301b509db26188c673aa6929101610b85565b6119fa612e35565b6001600160a01b03811660009081526011602052604090205460ff1615610d3b576001600160a01b038116600081815260116020908152604091829020805460ff1916905590519182527fff7814487df941cfbc8223d1be83bbfc5c32315bcc986fd5fb7a5ec9dd31bbfb9101610d32565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526001600160a01b0382166000908152600e6020908152604091829020825160a081018452905460ff811615801580845261ffff61010084048116958501959095526301000000830485169584019590955265010000000000820484166060840152670100000000000000909104909216608082015291611b1d5750608081015161ffff16155b8015611b2f5750602081015161ffff16155b8015611b415750606081015161ffff16155b8015611b535750604081015161ffff16155b156113285750506040805160a08101825260145460ff81161515825261ffff610100820481166020840152630100000082048116938301939093526501000000000081048316606083015267010000000000000090049091166080820152919050565b611bbe612e35565b6001600160a01b03811660009081526005602052604090205460ff1615611c275760405162461bcd60e51b815260206004820152601560248201527f5661756c7420616c726561647920656e61626c656400000000000000000000006044820152606401610b28565b6000816001600160a01b031663aabaecd66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8b91906135e3565b6001600160a01b0380821660009081526004602052604090205491925016611d1a5760405162461bcd60e51b8152602060048201526024808201527f536574207a6b4f7261636c65206265666f72652061637469766174696e67207660448201527f61756c74000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6000826001600160a01b031663e54f08806040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7e91906135af565b11611dcb5760405162461bcd60e51b815260206004820152601860248201527f5072696365206f7261636c65206e6f7420776f726b696e6700000000000000006044820152606401610b28565b6001600160a01b038083166000908152600560209081526040808320805460ff191660019081179091558054810190559284168252600290529081205460ff1615159003611e8f576003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091556000908152600260205260409020805460ff191690911790555b6040516001600160a01b038316907f64a1d1dff2cfb1454294032b9e26fa706d66fb6065ce3fefd7cba0a3b3cc315a90600090a25050565b60606001805480602002602001604051908101604052809291908181526020018280548015611f1f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f01575b5050505050905090565b60606003805480602002602001604051908101604052809291908181526020018280548015611f1f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611f01575050505050905090565b6001600160a01b03811660009081526008602052604081205461ffff168103611fd357507f0000000000000000000000000000000000000000000000000000000000000000919050565b506001600160a01b031660009081526008602052604090205461ffff1690565b6001600160a01b0381166000908152600a602052604081205461ffff16810361204057505061ffff7f00000000000000000000000000000000000000000000000000000000000000001690565b506001600160a01b03166000908152600a602052604090205461ffff1690565b612068612e35565b6001600160a01b03821660008181526006602052604090819020839055517f8587b5a841e687e68bd406507304ee9b8caa583fdd5a4483fda37b11d955251890610b859084815260200190565b6000546001600160a01b03163314806120d857506015546001600160a01b031633145b61214a5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6017546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156121ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d091906135af565b9050600081116122225760405162461bcd60e51b815260206004820152601560248201527f4e6f206665657320746f206469737472696275746500000000000000000000006044820152606401610b28565b600061222f600283613541565b6018546040517fc80ef110000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b03169063c80ef11090602401600060405180830381600087803b15801561228f57600080fd5b505af11580156122a3573d6000803e3d6000fd5b50506017546016546001600160a01b03918216935063a9059cbb9250166122ca84866134e8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561232d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123519190613600565b506040518281527f8959421a1320789a49eeec01a4750caf8a30733c3db14f000d84484df89300f99060200160405180910390a15050565b612391612e35565b6101f48161ffff1611156123e75760405162461bcd60e51b815260206004820152601760248201527f4d6178204b6565706572207265776172642069732035250000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600a6020908152604091829020805461ffff191661ffff861690811790915591519182527f5517d6e37f9f315e19a99c178bc9c7dd8b61927ddfc5b1a0a5631e202a97f2229101610b85565b61244a612e35565b6001600160a01b0382811660009081526004602052604090205416156124b25760405162461bcd60e51b815260206004820152601460248201527f5a6b4f7261636c6520616c7265616479207365740000000000000000000000006044820152606401610b28565b6001600160a01b0381166125085760405162461bcd60e51b815260206004820152601f60248201527f5a6b4f7261636c652063616e6e6f74206265207a65726f2061646472657373006044820152606401610b28565b6001600160a01b0382811660008181526004602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917fcd759650704baf7ad668a4fe284ad1658dc0a5973de2b2aa19f80a9078d79d3f9101610b85565b6001600160a01b0381166000908152600b602052604081205461ffff1681036125cd57505061ffff7f00000000000000000000000000000000000000000000000000000000000000001690565b506001600160a01b03166000908152600b602052604090205461ffff1690565b6125f5612e35565b6018546001600160a01b031661263957601880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790555b6017546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529082169063095ea7b3906044016020604051808303816000875af11580156126c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e89190613600565b506040516001600160a01b038216907f26372ae1d7bdfa69fe3b99728b67893ca79205ab6ea512503987fd2e1a6e75f490600090a250565b6001600160a01b03811660009081526007602052604081205461ffff168103612777577f000000000000000000000000000000000000000000000000000000000000000061276d83611f89565b61132891906134c6565b506001600160a01b031660009081526007602052604090205461ffff1690565b6000546001600160a01b03163314806127ba57506015546001600160a01b031633145b61282c5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6001600160a01b038216600081815260106020908152604091829020805460ff191685151590811790915591519182527faeebf6c3e2494fd3058443df6c50f9136935ff60a11c8fc87c3ee4880aa275e89101610b85565b61288c612e35565b6103e88461ffff1611156128e25760405162461bcd60e51b815260206004820152601960248201527f4d617820526564656d7074696f6e2046656520697320313025000000000000006044820152606401610b28565b620186a08361ffff1611156129395760405162461bcd60e51b815260206004820152601560248201527f4d6178206d756c7469706c6965722069732031307800000000000000000000006044820152606401610b28565b613a988261ffff161015801561295557506175308261ffff1611155b6129c75760405162461bcd60e51b815260206004820152602760248201527f437220666f72206d6178206d756c7469706c696572206d75737420626520313560448201527f30252d33303025000000000000000000000000000000000000000000000000006064820152608401610b28565b6113888161ffff16101580156129e357506127108161ffff1611155b612a2f5760405162461bcd60e51b815260206004820152601f60248201527f50726f7669646572207368617265206d757374206265203530252d31303025006044820152606401610b28565b6040805160a081018252861515815261ffff808716602080840191825287831684860190815287841660608601908152878516608087019081526001600160a01b038e166000818152600e909552938890209651875495519351925191518716670100000000000000027fffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffff92881665010000000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffff948916630100000002949094167fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff95909816610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000009097169690961717929092169490941793909317929092161790915590517f3fee70bb81249f53b4627b907a615f604a404e5b622f488eb33c91c9ddc97f6990612bde9088908890889088908890941515855261ffff938416602086015291831660408501528216606084015216608082015260a00190565b60405180910390a2505050505050565b612bf6612e35565b6001600160a01b038216600090815260086020526040902054612c20906103e89061ffff166134c6565b61ffff168161ffff161115612c775760405162461bcd60e51b815260206004820152600f60248201527f636f6e66696720746f6f206869676800000000000000000000000000000000006044820152606401610b28565b612af88161ffff1610158015612c935750614e208161ffff1611155b612cdf5760405162461bcd60e51b815260206004820152601360248201527f636f6e666967206f7574206f662072616e6765000000000000000000000000006044820152606401610b28565b6001600160a01b038216600081815260076020908152604091829020805461ffff191661ffff861690811790915591519182527f2e75c3e28a450ff7f2d52d97d5306769460ed1da8aa7474e0984d274a9b4105f9101610b85565b612d42612e35565b601680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890602001610d32565b612db0612e35565b6001600160a01b038116612e2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b28565b610d3b81612f14565b6000546001600160a01b031633146117e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b28565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052612f0f908490612f7c565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612fd1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166130649092919063ffffffff16565b9050805160001480612ff2575080806020019051810190612ff29190613600565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b28565b6060613073848460008561307b565b949350505050565b6060824710156130f35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b28565b600080866001600160a01b0316858760405161310f9190613641565b60006040518083038185875af1925050503d806000811461314c576040519150601f19603f3d011682016040523d82523d6000602084013e613151565b606091505b50915091506131628783838761316d565b979650505050505050565b606083156131dc5782516000036131d5576001600160a01b0385163b6131d55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b28565b5081613073565b61307383838151156131f15781518083602001fd5b8060405162461bcd60e51b8152600401610b28919061365d565b6001600160a01b0381168114610d3b57600080fd5b8015158114610d3b57600080fd5b6000806040838503121561324157600080fd5b823561324c8161320b565b9150602083013561325c81613220565b809150509250929050565b803561ffff8116811461327957600080fd5b919050565b60006020828403121561329057600080fd5b61329982613267565b9392505050565b6000602082840312156132b257600080fd5b81356132998161320b565b600080604083850312156132d057600080fd5b82356132db8161320b565b946020939093013593505050565b6000806000606084860312156132fe57600080fd5b83356133098161320b565b925061331760208501613267565b915061332560408501613267565b90509250925092565b6000806040838503121561334157600080fd5b823561334c8161320b565b915061335a60208401613267565b90509250929050565b60008060006060848603121561337857600080fd5b83356133838161320b565b925060208401356133938161320b565b929592945050506040919091013590565b600080604083850312156133b757600080fd5b82356133c28161320b565b9150602083013561325c8161320b565b6020808252825182820181905260009190848201906040850190845b818110156134135783516001600160a01b0316835292840192918401916001016133ee565b50909695505050505050565b60008060008060008060c0878903121561343857600080fd5b86356134438161320b565b9550602087013561345381613220565b945061346160408801613267565b935061346f60608801613267565b925061347d60808801613267565b915061348b60a08801613267565b90509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61ffff8281168282160390808211156134e1576134e1613497565b5092915050565b8181038181111561132857611328613497565b808202811582820484141761132857611328613497565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261355057613550613512565b500490565b61ffff81811683821602808216919082811461357357613573613497565b505092915050565b600061ffff8084168061359057613590613512565b92169190910492915050565b8082018082111561132857611328613497565b6000602082840312156135c157600080fd5b5051919050565b61ffff8181168382160190808211156134e1576134e1613497565b6000602082840312156135f557600080fd5b81516132998161320b565b60006020828403121561361257600080fd5b815161329981613220565b60005b83811015613638578181015183820152602001613620565b50506000910152565b6000825161365381846020870161361d565b9190910192915050565b602081526000825180602084015261367c81604085016020870161361d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212202335ae120fafdb1f2fe0a2902fcab51745472f9eb4e5f83aadc71a913495539d64736f6c634300081300330000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103af5760003560e01c80637aa27cf6116101f4578063bb57ad201161011a578063dffa7353116100ad578063f0f442601161007c578063f0f4426014610a30578063f170234114610a43578063f2fde38b14610a71578063f851a44014610a8457600080fd5b8063dffa7353146109e4578063e17bbe61146109f7578063eac7e21a14610a0a578063ecfdbf3214610a1d57600080fd5b8063cc143a04116100e9578063cc143a041461098b578063cea12844146109ab578063d4a7bc5e146109be578063d54d832c146109d157600080fd5b8063bb57ad201461093a578063bd9b8db014610942578063c026b83c14610955578063c9057db21461097857600080fd5b806397331bf911610192578063ae91874911610161578063ae918749146108cf578063b0900b87146108e2578063b300a55914610903578063b3495faa1461092757600080fd5b806397331bf9146108675780639fecc37d1461087c578063a41c8c0b146108a0578063a643e90e146108a857600080fd5b806381ddac33116101ce57806381ddac33146107a2578063857df254146108075780638da5cb5b14610843578063936f43301461085457600080fd5b80637aa27cf6146107695780637fe337681461077c578063807168ea1461078f57600080fd5b80633f506834116102d95780635adc5f951161027757806361d027b31161024657806361d027b3146107285780636c5da0231461073b578063704b6c021461074e578063715018a61461076157600080fd5b80635adc5f95146106e15780635ba0f6e8146106f45780635d6339a7146107025780635e35359e1461071557600080fd5b80634b3fef61116102b35780634b3fef61146106855780634e83423c146106a8578063508a098c146106bb57806352c0c258146106ce57600080fd5b80633f5068341461061657806346d61e681461063f5780634908ed6a1461066257600080fd5b80631ee9211f116103515780632f8e5638116103205780632f8e5638146105a25780632fe5dbdb146105b557806330ad9fd5146105d85780633b970e1d146105eb57600080fd5b80631ee9211f1461050d57806327480e5e146105355780632a771828146105485780632c7769b21461056f57600080fd5b80630ff1d9a81161038d5780630ff1d9a81461042f5780631110987814610442578063153ee55414610475578063165efc6a1461048857600080fd5b806304001e79146103b4578063045e3992146103f35780630a37a26c14610408575b600080fd5b6103db7f00000000000000000000000000000000000000000000000000000000000005dc81565b60405161ffff90911681526020015b60405180910390f35b61040661040136600461322e565b610a97565b005b6103db7f00000000000000000000000000000000000000000000000000000000000001f481565b61040661043d36600461327e565b610b91565b6104656104503660046132a0565b60106020526000908152604090205460ff1681565b60405190151581526020016103ea565b6104066104833660046132a0565b610c3e565b6104da6104963660046132a0565b600e6020526000908152604090205460ff81169061ffff61010082048116916301000000810482169165010000000000820481169167010000000000000090041685565b60408051951515865261ffff9485166020870152928416928501929092528216606084015216608082015260a0016103ea565b61052061051b3660046132bd565b610d3e565b604080519283526020830191909152016103ea565b6105206105433660046132a0565b611050565b6103db7f000000000000000000000000000000000000000000000000000000000000012c81565b6013546105879061ffff808216916201000090041682565b6040805161ffff9384168152929091166020830152016103ea565b6104066105b03660046132e9565b6110d8565b6104656105c33660046132a0565b60116020526000908152604090205460ff1681565b6104066105e63660046132a0565b611271565b6017546105fe906001600160a01b031681565b6040516001600160a01b0390911681526020016103ea565b6105fe6106243660046132a0565b6004602052600090815260409020546001600160a01b031681565b61046561064d3660046132a0565b60056020526000908152604090205460ff1681565b6104656106703660046132a0565b60026020526000908152604090205460ff1681565b6104656106933660046132a0565b600c6020526000908152604090205460ff1681565b6104656106b63660046132a0565b6112f4565b6104066106c936600461332e565b61132e565b6104066106dc3660046132a0565b6113e7565b6104066106ef36600461322e565b611455565b6012546103db9061ffff1681565b6018546105fe906001600160a01b031681565b610406610723366004613363565b61156c565b6016546105fe906001600160a01b031681565b61040661074936600461332e565b6116a7565b61040661075c3660046132a0565b611761565b6104066117cf565b61040661077736600461332e565b6117e3565b61040661078a3660046133a4565b61191c565b61040661079d3660046132a0565b6119f2565b6107b56107b03660046132a0565b611a6c565b6040516103ea9190600060a082019050825115158252602083015161ffff8082166020850152806040860151166040850152806060860151166060850152806080860151166080850152505092915050565b6014546104da9060ff81169061ffff61010082048116916301000000810482169165010000000000820481169167010000000000000090041685565b6000546001600160a01b03166105fe565b6104066108623660046132a0565b611bb6565b61086f611ec7565b6040516103ea91906133d2565b6103db61088a3660046132a0565b60096020526000908152604090205461ffff1681565b61086f611f29565b6103db7f0000000000000000000000000000000000000000000000000000000000003a9881565b6103db6108dd3660046132a0565b611f89565b6108f56108f03660046132a0565b611ff3565b6040519081526020016103ea565b6103db6109113660046132a0565b600a6020526000908152604090205461ffff1681565b6104066109353660046132bd565b612060565b6104066120b5565b61040661095036600461332e565b612389565b6104656109633660046132a0565b600f6020526000908152604090205460ff1681565b6104066109863660046133a4565b612442565b6108f56109993660046132a0565b60066020526000908152604090205481565b6108f56109b93660046132a0565b612580565b6104066109cc3660046132a0565b6125ed565b6103db6109df3660046132a0565b612720565b6104066109f236600461322e565b612797565b6019546105fe906001600160a01b031681565b610406610a1836600461341f565b612884565b610406610a2b36600461332e565b612bee565b610406610a3e3660046132a0565b612d3a565b610587610a513660046132a0565b600d6020526000908152604090205461ffff808216916201000090041682565b610406610a7f3660046132a0565b612da8565b6015546105fe906001600160a01b031681565b6000546001600160a01b0316331480610aba57506015546001600160a01b031633145b610b315760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b0382166000818152600f6020908152604091829020805460ff191685151590811790915591519182527fa40d190a02419e68e5f6dc9fe846b05cfa7b23c341e8512a0a17aaefe6b1d14491015b60405180910390a25050565b610b99612e35565b6127108161ffff161115610bef5760405162461bcd60e51b815260206004820152601660248201527f4665652063616e6e6f74206578636565642031303025000000000000000000006044820152606401610b28565b60405161ffff821681527f279588e548808d0be854db328e98d7c4938388d400495b156cf28e28a452d5b09060200160405180910390a16012805461ffff191661ffff92909216919091179055565b610c46612e35565b6001600160a01b038116610cc25760405162461bcd60e51b815260206004820152602960248201527f526577617264206d616e616765722063616e6e6f7420626520746865207a657260448201527f6f206164647265737300000000000000000000000000000000000000000000006064820152608401610b28565b6001600160a01b03811660009081526011602052604090205460ff16610d3b576001600160a01b038116600081815260116020908152604091829020805460ff1916600117905590519182527f4b722357462a92ae2776fce05f39902ac96cb04d2fe661eb688f4a72ab069cff91015b60405180910390a15b50565b6001600160a01b038216600090815260056020526040812054819060ff16610da85760405162461bcd60e51b815260206004820152601160248201527f5661756c74206e6f7420656e61626c65640000000000000000000000000000006044820152606401610b28565b612710831015610e205760405162461bcd60e51b815260206004820152603160248201527f43616e6e6f742072656465656d207768656e20636f6c6c61746572616c20726160448201527f74696f2069732062656c6f7720313030250000000000000000000000000000006064820152608401610b28565b6000610e2b85611a6c565b9050806060015161ffff16841115610eab5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f742072656465656d20636f6c6c61746572616c20726174696f206160448201527f626f7665206d61780000000000000000000000000000000000000000000000006064820152608401610b28565b6000610eb686612720565b90506000610ec387611f89565b9050611f40600061ffff84168811610eeb575060208401516000965061ffff16945084611038565b8261ffff168811610f545750602084015161ffff16612710610f0d85856134c6565b61ffff168561ffff168a610f2191906134e8565b610f2f61ffff8616856134fb565b610f3991906134fb565b610f439190613541565b610f4d9190613541565b9650611038565b846060015161ffff16881115610f9e5761271085604001518660200151610f7b9190613555565b610f85919061357b565b61ffff1690506127108261ffff1682610f4391906134fb565b612710838660600151610fb191906134c6565b61ffff168461ffff168a610fc591906134e8565b6127108860400151610fd791906134c6565b61ffff16610fe591906134fb565b610fef9190613541565b610ffb9061271061359c565b866020015161ffff1661100e91906134fb565b6110189190613541565b905061271061102b61ffff8416836134fb565b6110359190613541565b96505b61104287826134e8565b955050505050509250929050565b6001600160a01b0381166000908152600d6020908152604080832081518083019092525461ffff80821680845262010000909204169282019290925282911580156110a15750602081015161ffff16155b156110c057505060135461ffff80821694620100009092041692509050565b805160209091015161ffff9182169591169350915050565b6110e0612e35565b8061ffff168261ffff1611156111385760405162461bcd60e51b815260206004820152601d60248201527f4d696e206665652063616e6e6f7420657863656564206d6178206665650000006044820152606401610b28565b6103e88161ffff1611156111b45760405162461bcd60e51b815260206004820152602160248201527f4f726967696e6174696f6e206665652063616e6e6f742065786365656420313060448201527f25000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b60408051808201825261ffff808516825283811660208084019182526001600160a01b0388166000818152600d90925290859020935184549251841662010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009093169316929092171790915590517f2044f9a0ddce93e4b27a7528d5ddd10b6457266b637359915bca4b62413d116290611264908590859061ffff92831681529116602082015260400190565b60405180910390a2505050565b611279612e35565b6017546001600160a01b03166112bd57601780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790555b6040516001600160a01b038216907f689880f9ad4ba7ccfc7adca0540ca4ac20afea4e42445221e77a5c9ca732209790600090a250565b6001600160a01b03811660009081526011602052604081205460ff168061132857506000546001600160a01b038381169116145b92915050565b611336612e35565b6107d08161ffff16111561138c5760405162461bcd60e51b815260206004820152601260248201527f5468726573686f6c6420746f6f206869676800000000000000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600b6020908152604091829020805461ffff191661ffff861690811790915591519182527f99bdcc408a78b91c4be41509cc7aeb9acab26fb72b5ef2fe891f602399a8265b9101610b85565b6113ef612e35565b601980547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f543e10c6b084ab040bfc326b3270525b380ac580c281ea2bdbb1a07f6228e41390602001610d32565b61145d612e35565b8015611514576000826001600160a01b031663861a1cad6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c791906135af565b116115145760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206d61726b65742072617465000000000000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600c6020908152604091829020805460ff191685151590811790915591519182527f55037eaa55f89e895f244c980acd9d83f74503caa41b820db79b340bbe5850bb9101610b85565b611574612e35565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156115d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f591906135af565b81116116435760405162461bcd60e51b815260206004820152601660248201527f416d6f756e7420657863656564732062616c616e6365000000000000000000006044820152606401610b28565b6116576001600160a01b0384168383612e8f565b604080516001600160a01b038086168252841660208201529081018290527f6337ed398c0e8467698c581374fdce4db14922df487b5a39483079f5f59b60a49060600160405180910390a1505050565b6116af612e35565b620186a08161ffff1611156117065760405162461bcd60e51b815260206004820152601e60248201527f426f72726f77204150522063616e6e6f742065786365656420313030302500006044820152606401610b28565b6001600160a01b038216600081815260096020908152604091829020805461ffff191661ffff861690811790915591519182527f2ae8b81855126e149014e8649a82e57a5080b1dc91add6a8563e00e462a9ce7f9101610b85565b611769612e35565b601580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f7ce7ec0b50378fb6c0186ffb5f48325f6593fcb4ca4386f21861af3129188f5c90602001610d32565b6117d7612e35565b6117e16000612f14565b565b6117eb612e35565b6001600160a01b0382166000908152600760205260409020546118149061ffff166103e86135c8565b61ffff168161ffff16101561186b5760405162461bcd60e51b815260206004820152600e60248201527f636f6e66696720746f6f206c6f770000000000000000000000000000000000006044820152606401610b28565b612ee08161ffff1610156118c15760405162461bcd60e51b815260206004820152600e60248201527f636f6e66696720746f6f206c6f770000000000000000000000000000000000006044820152606401610b28565b6001600160a01b038216600081815260086020908152604091829020805461ffff191661ffff861690811790915591519182527f2c95eb50160fab9d8c004b77dd3a429cbeebf819e07769988877e6853f849de99101610b85565b611924612e35565b6001600160a01b03811661197a5760405162461bcd60e51b815260206004820152601f60248201527f5a6b4f7261636c652063616e6e6f74206265207a65726f2061646472657373006044820152606401610b28565b6001600160a01b0382811660008181526004602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917fd57eabf2e3258392b7325f4e1bd564121a61092e8301b509db26188c673aa6929101610b85565b6119fa612e35565b6001600160a01b03811660009081526011602052604090205460ff1615610d3b576001600160a01b038116600081815260116020908152604091829020805460ff1916905590519182527fff7814487df941cfbc8223d1be83bbfc5c32315bcc986fd5fb7a5ec9dd31bbfb9101610d32565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526001600160a01b0382166000908152600e6020908152604091829020825160a081018452905460ff811615801580845261ffff61010084048116958501959095526301000000830485169584019590955265010000000000820484166060840152670100000000000000909104909216608082015291611b1d5750608081015161ffff16155b8015611b2f5750602081015161ffff16155b8015611b415750606081015161ffff16155b8015611b535750604081015161ffff16155b156113285750506040805160a08101825260145460ff81161515825261ffff610100820481166020840152630100000082048116938301939093526501000000000081048316606083015267010000000000000090049091166080820152919050565b611bbe612e35565b6001600160a01b03811660009081526005602052604090205460ff1615611c275760405162461bcd60e51b815260206004820152601560248201527f5661756c7420616c726561647920656e61626c656400000000000000000000006044820152606401610b28565b6000816001600160a01b031663aabaecd66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8b91906135e3565b6001600160a01b0380821660009081526004602052604090205491925016611d1a5760405162461bcd60e51b8152602060048201526024808201527f536574207a6b4f7261636c65206265666f72652061637469766174696e67207660448201527f61756c74000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6000826001600160a01b031663e54f08806040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7e91906135af565b11611dcb5760405162461bcd60e51b815260206004820152601860248201527f5072696365206f7261636c65206e6f7420776f726b696e6700000000000000006044820152606401610b28565b6001600160a01b038083166000908152600560209081526040808320805460ff191660019081179091558054810190559284168252600290529081205460ff1615159003611e8f576003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091556000908152600260205260409020805460ff191690911790555b6040516001600160a01b038316907f64a1d1dff2cfb1454294032b9e26fa706d66fb6065ce3fefd7cba0a3b3cc315a90600090a25050565b60606001805480602002602001604051908101604052809291908181526020018280548015611f1f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f01575b5050505050905090565b60606003805480602002602001604051908101604052809291908181526020018280548015611f1f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611f01575050505050905090565b6001600160a01b03811660009081526008602052604081205461ffff168103611fd357507f0000000000000000000000000000000000000000000000000000000000003a98919050565b506001600160a01b031660009081526008602052604090205461ffff1690565b6001600160a01b0381166000908152600a602052604081205461ffff16810361204057505061ffff7f00000000000000000000000000000000000000000000000000000000000001f41690565b506001600160a01b03166000908152600a602052604090205461ffff1690565b612068612e35565b6001600160a01b03821660008181526006602052604090819020839055517f8587b5a841e687e68bd406507304ee9b8caa583fdd5a4483fda37b11d955251890610b859084815260200190565b6000546001600160a01b03163314806120d857506015546001600160a01b031633145b61214a5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6017546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156121ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d091906135af565b9050600081116122225760405162461bcd60e51b815260206004820152601560248201527f4e6f206665657320746f206469737472696275746500000000000000000000006044820152606401610b28565b600061222f600283613541565b6018546040517fc80ef110000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b03169063c80ef11090602401600060405180830381600087803b15801561228f57600080fd5b505af11580156122a3573d6000803e3d6000fd5b50506017546016546001600160a01b03918216935063a9059cbb9250166122ca84866134e8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561232d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123519190613600565b506040518281527f8959421a1320789a49eeec01a4750caf8a30733c3db14f000d84484df89300f99060200160405180910390a15050565b612391612e35565b6101f48161ffff1611156123e75760405162461bcd60e51b815260206004820152601760248201527f4d6178204b6565706572207265776172642069732035250000000000000000006044820152606401610b28565b6001600160a01b0382166000818152600a6020908152604091829020805461ffff191661ffff861690811790915591519182527f5517d6e37f9f315e19a99c178bc9c7dd8b61927ddfc5b1a0a5631e202a97f2229101610b85565b61244a612e35565b6001600160a01b0382811660009081526004602052604090205416156124b25760405162461bcd60e51b815260206004820152601460248201527f5a6b4f7261636c6520616c7265616479207365740000000000000000000000006044820152606401610b28565b6001600160a01b0381166125085760405162461bcd60e51b815260206004820152601f60248201527f5a6b4f7261636c652063616e6e6f74206265207a65726f2061646472657373006044820152606401610b28565b6001600160a01b0382811660008181526004602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917fcd759650704baf7ad668a4fe284ad1658dc0a5973de2b2aa19f80a9078d79d3f9101610b85565b6001600160a01b0381166000908152600b602052604081205461ffff1681036125cd57505061ffff7f000000000000000000000000000000000000000000000000000000000000012c1690565b506001600160a01b03166000908152600b602052604090205461ffff1690565b6125f5612e35565b6018546001600160a01b031661263957601880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790555b6017546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529082169063095ea7b3906044016020604051808303816000875af11580156126c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e89190613600565b506040516001600160a01b038216907f26372ae1d7bdfa69fe3b99728b67893ca79205ab6ea512503987fd2e1a6e75f490600090a250565b6001600160a01b03811660009081526007602052604081205461ffff168103612777577f00000000000000000000000000000000000000000000000000000000000005dc61276d83611f89565b61132891906134c6565b506001600160a01b031660009081526007602052604090205461ffff1690565b6000546001600160a01b03163314806127ba57506015546001600160a01b031633145b61282c5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c2074686960448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b28565b6001600160a01b038216600081815260106020908152604091829020805460ff191685151590811790915591519182527faeebf6c3e2494fd3058443df6c50f9136935ff60a11c8fc87c3ee4880aa275e89101610b85565b61288c612e35565b6103e88461ffff1611156128e25760405162461bcd60e51b815260206004820152601960248201527f4d617820526564656d7074696f6e2046656520697320313025000000000000006044820152606401610b28565b620186a08361ffff1611156129395760405162461bcd60e51b815260206004820152601560248201527f4d6178206d756c7469706c6965722069732031307800000000000000000000006044820152606401610b28565b613a988261ffff161015801561295557506175308261ffff1611155b6129c75760405162461bcd60e51b815260206004820152602760248201527f437220666f72206d6178206d756c7469706c696572206d75737420626520313560448201527f30252d33303025000000000000000000000000000000000000000000000000006064820152608401610b28565b6113888161ffff16101580156129e357506127108161ffff1611155b612a2f5760405162461bcd60e51b815260206004820152601f60248201527f50726f7669646572207368617265206d757374206265203530252d31303025006044820152606401610b28565b6040805160a081018252861515815261ffff808716602080840191825287831684860190815287841660608601908152878516608087019081526001600160a01b038e166000818152600e909552938890209651875495519351925191518716670100000000000000027fffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffff92881665010000000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffff948916630100000002949094167fffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffff95909816610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000009097169690961717929092169490941793909317929092161790915590517f3fee70bb81249f53b4627b907a615f604a404e5b622f488eb33c91c9ddc97f6990612bde9088908890889088908890941515855261ffff938416602086015291831660408501528216606084015216608082015260a00190565b60405180910390a2505050505050565b612bf6612e35565b6001600160a01b038216600090815260086020526040902054612c20906103e89061ffff166134c6565b61ffff168161ffff161115612c775760405162461bcd60e51b815260206004820152600f60248201527f636f6e66696720746f6f206869676800000000000000000000000000000000006044820152606401610b28565b612af88161ffff1610158015612c935750614e208161ffff1611155b612cdf5760405162461bcd60e51b815260206004820152601360248201527f636f6e666967206f7574206f662072616e6765000000000000000000000000006044820152606401610b28565b6001600160a01b038216600081815260076020908152604091829020805461ffff191661ffff861690811790915591519182527f2e75c3e28a450ff7f2d52d97d5306769460ed1da8aa7474e0984d274a9b4105f9101610b85565b612d42612e35565b601680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890602001610d32565b612db0612e35565b6001600160a01b038116612e2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b28565b610d3b81612f14565b6000546001600160a01b031633146117e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b28565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052612f0f908490612f7c565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612fd1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166130649092919063ffffffff16565b9050805160001480612ff2575080806020019051810190612ff29190613600565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b28565b6060613073848460008561307b565b949350505050565b6060824710156130f35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b28565b600080866001600160a01b0316858760405161310f9190613641565b60006040518083038185875af1925050503d806000811461314c576040519150601f19603f3d011682016040523d82523d6000602084013e613151565b606091505b50915091506131628783838761316d565b979650505050505050565b606083156131dc5782516000036131d5576001600160a01b0385163b6131d55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b28565b5081613073565b61307383838151156131f15781518083602001fd5b8060405162461bcd60e51b8152600401610b28919061365d565b6001600160a01b0381168114610d3b57600080fd5b8015158114610d3b57600080fd5b6000806040838503121561324157600080fd5b823561324c8161320b565b9150602083013561325c81613220565b809150509250929050565b803561ffff8116811461327957600080fd5b919050565b60006020828403121561329057600080fd5b61329982613267565b9392505050565b6000602082840312156132b257600080fd5b81356132998161320b565b600080604083850312156132d057600080fd5b82356132db8161320b565b946020939093013593505050565b6000806000606084860312156132fe57600080fd5b83356133098161320b565b925061331760208501613267565b915061332560408501613267565b90509250925092565b6000806040838503121561334157600080fd5b823561334c8161320b565b915061335a60208401613267565b90509250929050565b60008060006060848603121561337857600080fd5b83356133838161320b565b925060208401356133938161320b565b929592945050506040919091013590565b600080604083850312156133b757600080fd5b82356133c28161320b565b9150602083013561325c8161320b565b6020808252825182820181905260009190848201906040850190845b818110156134135783516001600160a01b0316835292840192918401916001016133ee565b50909695505050505050565b60008060008060008060c0878903121561343857600080fd5b86356134438161320b565b9550602087013561345381613220565b945061346160408801613267565b935061346f60608801613267565b925061347d60808801613267565b915061348b60a08801613267565b90509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61ffff8281168282160390808211156134e1576134e1613497565b5092915050565b8181038181111561132857611328613497565b808202811582820484141761132857611328613497565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261355057613550613512565b500490565b61ffff81811683821602808216919082811461357357613573613497565b505092915050565b600061ffff8084168061359057613590613512565b92169190910492915050565b8082018082111561132857611328613497565b6000602082840312156135c157600080fd5b5051919050565b61ffff8181168382160190808211156134e1576134e1613497565b6000602082840312156135f557600080fd5b81516132998161320b565b60006020828403121561361257600080fd5b815161329981613220565b60005b83811015613638578181015183820152602001613620565b50506000910152565b6000825161365381846020870161361d565b9190910192915050565b602081526000825180602084015261367c81604085016020870161361d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212202335ae120fafdb1f2fe0a2902fcab51745472f9eb4e5f83aadc71a913495539d64736f6c63430008130033

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

0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : _etherOracle (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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