Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,164 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Psm Swap DUSX Fo... | 11374392 | 2 mins ago | IN | 0 S | 0.02259163 | ||||
Lender Borrow Va... | 11374321 | 2 mins ago | IN | 0 S | 0.02567554 | ||||
Lender Borrow Va... | 11373893 | 5 mins ago | IN | 0 S | 0.03517506 | ||||
Lender Borrow Va... | 11372880 | 12 mins ago | IN | 0 S | 0.02488904 | ||||
Psm Swap DUSX Fo... | 11369353 | 35 mins ago | IN | 0 S | 0.02614722 | ||||
Lender Borrow Va... | 11369242 | 35 mins ago | IN | 0 S | 0.02921852 | ||||
Psm Swap DUSX Fo... | 11368556 | 40 mins ago | IN | 0 S | 0.02377133 | ||||
Lender Borrow Va... | 11368453 | 41 mins ago | IN | 0 S | 0.02706758 | ||||
Psm Swap DUSX Fo... | 11368034 | 44 mins ago | IN | 0 S | 0.0247955 | ||||
Lender Borrow Va... | 11367671 | 46 mins ago | IN | 0 S | 0.0285355 | ||||
Psm Swap DUSX Fo... | 11365613 | 1 hr ago | IN | 0 S | 0.02353213 | ||||
Deposit Staked D... | 11365466 | 1 hr ago | IN | 0 S | 0.02782125 | ||||
Psm Swap Stable ... | 11365433 | 1 hr ago | IN | 0 S | 0.02789332 | ||||
Deposit Staked D... | 11365326 | 1 hr ago | IN | 0 S | 0.0322515 | ||||
Lender Borrow Va... | 11365292 | 1 hr ago | IN | 0 S | 0.02473504 | ||||
Psm Swap DUSX Fo... | 11365075 | 1 hr ago | IN | 0 S | 0.02259163 | ||||
Lender Borrow Va... | 11364949 | 1 hr ago | IN | 0 S | 0.02473504 | ||||
Psm Swap DUSX Fo... | 11364851 | 1 hr ago | IN | 0 S | 0.02376839 | ||||
Refund Floor | 11364816 | 1 hr ago | IN | 0 S | 0.03015653 | ||||
Psm Swap DUSX Fo... | 11364527 | 1 hr ago | IN | 0 S | 0.02259163 | ||||
Lender Borrow Va... | 11364413 | 1 hr ago | IN | 0 S | 0.02582954 | ||||
Psm Swap DUSX Fo... | 11363477 | 1 hr ago | IN | 0 S | 0.02376701 | ||||
Withdraw Staked ... | 11363451 | 1 hr ago | IN | 0 S | 0.03067583 | ||||
Lender Borrow Va... | 11362408 | 1 hr ago | IN | 0 S | 0.02722439 | ||||
Psm Swap DUSX Fo... | 11362210 | 1 hr ago | IN | 0 S | 0.02259097 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
MiscHelper
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {Ownable} from "../abstract/Ownable.sol"; import {ReentrancyGuard} from "../abstract/ReentrancyGuard.sol"; import {Rebase, AuxRebase} from "../library/AuxRebase.sol"; import {IBaseContracts} from "../interface/IBaseContracts.sol"; import {IDynamicInterestRate} from "../interface/IDynamicInterestRate.sol"; import {IERC20Custom} from "../interface/IERC20Custom.sol"; import {IFloor} from "../interface/IFloor.sol"; import {IFeesDistributor} from "../interface/IFees.sol"; import {IFeesWithdrawer} from "../interface/IFees.sol"; import {ILender} from "../interface/ILender.sol"; import {ILenderOwner} from "../interface/ILenderOwner.sol"; import {ILiquidationHelper} from "../interface/ILiquidationHelper.sol"; import {IMarketLens} from "../interface/IMarketLens.sol"; import {IPSM} from "../interface/IPSM.sol"; import {IRepayHelper} from "../interface/IRepayHelper.sol"; import {IStakedDUSX} from "../interface/IStakedDUSX.sol"; import {ISupplyHangingCalculator} from "../interface/ISupplyHangingCalculator.sol"; import {IVault} from "../interface/IVault.sol"; /** * @title MiscHelper * @dev Central coordinator for protocol operations and interactions * @notice Provides: * · Core protocol operation coordination * · Cross-contract interaction management * · System-wide parameter updates */ contract MiscHelper is Ownable, ReentrancyGuard { using AuxRebase for Rebase; /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /// @notice Precision constants uint256 public constant TENK_PRECISION = 10_000; /// @notice Repayment helper contract IRepayHelper public repayHelper; /// @notice Liquidation helper contract ILiquidationHelper public liquidationHelper; /// @notice Dynamic interest rate model IDynamicInterestRate public dynamicInterestRate; /// @notice Floor price contract IFloor public immutable floor; /// @notice Fees distribution contract IFeesDistributor public feesDistributor; /// @notice Fees withdrawal contract IFeesWithdrawer public feesWithdrawer; /// @notice Lender ownership management contract ILenderOwner public lenderOwner; /// @notice Market analytics contract IMarketLens public marketLens; /// @notice Array of peg stability module contracts IPSM[] public pegStabilityModules; /// @notice Staked DUSX token contract IStakedDUSX public immutable stDUSX; /// @notice Supply hanging calculator contract ISupplyHangingCalculator public supplyHangingCalculator; /// @notice Base contracts registry IBaseContracts public immutable baseContracts; /// @notice Vault contract reference IVault public immutable vault; /// @notice Flag to track if parameters have been initialized bool public parametersSet; /*////////////////////////////////////////////////////////////// CUSTOM ERRORS //////////////////////////////////////////////////////////////*/ /// @notice Thrown when a zero address is provided error ZeroAddress(); /// @notice Thrown when parameters are already set error AlreadyInitialized(); /*////////////////////////////////////////////////////////////// MODIFIERS //////////////////////////////////////////////////////////////*/ /** * @notice Restricts function access to repay helper * @dev Reverts if caller is not the repay helper contract */ modifier onlyRepayHelper() { if (address(repayHelper) != _msgSender()) { revert UnauthorizedAccount(_msgSender()); } _; } /** * @notice Restricts function access to liquidation helper * @dev Reverts if caller is not the liquidation helper contract */ modifier onlyLiquidationHelper() { if (address(liquidationHelper) != _msgSender()) { revert UnauthorizedAccount(_msgSender()); } _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Initializes the MiscHelper contract * @param baseContracts_ Base contracts registry address */ constructor(IBaseContracts baseContracts_) { _ensureNonzeroAddress(address(baseContracts_)); baseContracts = baseContracts_; vault = baseContracts.vault(); floor = baseContracts.floor(); stDUSX = baseContracts.stDUSX(); supplyHangingCalculator = baseContracts.supplyCalculator(); _ensureNonzeroAddress(address(vault)); _ensureNonzeroAddress(address(floor)); _ensureNonzeroAddress(address(stDUSX)); _ensureNonzeroAddress(address(supplyHangingCalculator)); // Initialize PSMs IPSM[] memory psms_ = new IPSM[](2); psms_[0] = baseContracts.psmCircle(); psms_[1] = baseContracts.psmTether(); if (address(psms_[0]) == address(0) || address(psms_[1]) == address(0)) revert ZeroAddress(); pegStabilityModules = psms_; } /*////////////////////////////////////////////////////////////// CONFIGURATION FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Updates core protocol parameters by fetching from BaseContracts */ function setParameters() external onlyOwner { if (parametersSet) { revert AlreadyInitialized(); } // Get helper contracts repayHelper = baseContracts.repayHelper(); liquidationHelper = baseContracts.liquidationHelper(); marketLens = baseContracts.marketLens(); // Get other contracts dynamicInterestRate = baseContracts.dynamicInterestRate(); feesDistributor = baseContracts.feesDistributor(); feesWithdrawer = baseContracts.feesWithdrawer(); lenderOwner = baseContracts.lenderOwner(); // Validate all addresses _ensureNonzeroAddress(address(repayHelper)); _ensureNonzeroAddress(address(liquidationHelper)); _ensureNonzeroAddress(address(marketLens)); _ensureNonzeroAddress(address(dynamicInterestRate)); _ensureNonzeroAddress(address(feesDistributor)); _ensureNonzeroAddress(address(feesWithdrawer)); _ensureNonzeroAddress(address(lenderOwner)); parametersSet = true; } /*////////////////////////////////////////////////////////////// FLOOR OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Deposits into the floor * @param amount Deposit amount * @dev Includes reentrancy protection * * Requirements: * · Valid deposit amount * * Effects: * · Deposits into floor * · Updates interest rates */ function depositFloor(uint256 amount) external { floor.deposit(_msgSender(), amount); _updateInterestRateAndBorrowLimit(); } /** * @notice Refunds from the floor * @param amount Refund amount * @dev Includes reentrancy protection * * Requirements: * · Valid refund amount * * Effects: * · Refunds from floor * · Updates interest rates */ function refundFloor(uint256 amount) external nonReentrant { _distributeFees(); floor.refund(_msgSender(), amount); _updateInterestRateAndBorrowLimit(); } /*////////////////////////////////////////////////////////////// STAKED DUSX OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Deposits into staked DUSX * @param amount Deposit amount * @dev Includes reentrancy protection * * Requirements: * · Valid deposit amount * * Effects: * · Deposits into staked DUSX * · Updates interest rates */ function depositStakedDUSX(uint256 amount) external nonReentrant { _distributeFees(); stDUSX.deposit(_msgSender(), _msgSender(), amount); _updateInterestRateAndBorrowLimit(); } /** * @notice Withdraws from staked DUSX * @dev Includes reentrancy protection * * Requirements: * · Valid withdrawal amount * * Effects: * · Withdraws from staked DUSX * · Updates interest rates */ function withdrawStakedDUSX() external nonReentrant { _distributeFees(); stDUSX.withdraw(_msgSender()); _updateInterestRateAndBorrowLimit(); } /*////////////////////////////////////////////////////////////// PSM OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Swaps DUSX for stable using PSM * @param psm PSM contract * @param receiver Receiver address * @param amountDUSX DUSX amount * @dev Includes reentrancy protection * * Requirements: * · Valid PSM contract * · Valid receiver address * · Valid DUSX amount * * Effects: * · Swaps DUSX for stable * · Updates interest rates */ function psmSwapDUSXForStable( IPSM psm, address receiver, uint256 amountDUSX ) external nonReentrant { psm.swapDUSXForStable(_msgSender(), receiver, amountDUSX); _updateInterestRateAndBorrowLimit(); } /** * @notice Swaps stable for DUSX using PSM * @param psm PSM contract * @param receiver Receiver address * @param amountStable Stable amount * @dev Includes reentrancy protection * * Requirements: * · Valid PSM contract * · Valid receiver address * · Valid stable amount * * Effects: * · Swaps stable for DUSX * · Updates interest rates */ function psmSwapStableForDUSX( IPSM psm, address receiver, uint256 amountStable ) external nonReentrant { psm.swapStableForDUSX(_msgSender(), receiver, amountStable); _updateInterestRateAndBorrowLimit(); } /*////////////////////////////////////////////////////////////// LENDER OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Withdraws from lender vault * @param lender Lender contract * @param amount Withdrawal amount * @dev Includes reentrancy protection * * Requirements: * · Valid lender contract * · Valid withdrawal amount * * Effects: * · Withdraws from lender vault * · Updates interest rates */ function lenderBorrowVaultWithdraw( ILender lender, uint256 amount ) external nonReentrant { lender.borrowVaultWithdraw(_msgSender(), amount); _updateInterestRateAndBorrowLimit(); } /** * @notice Borrows from lender * @param lender Lender contract * @param amount Borrow amount * @dev Includes reentrancy protection * * Requirements: * · Valid lender contract * · Valid borrow amount * * Effects: * · Borrows from lender * · Updates interest rates */ function lenderBorrow( ILender lender, uint256 amount ) external nonReentrant { lender.borrow(_msgSender(), amount); _updateInterestRateAndBorrowLimit(); } /** * @notice Repays lender * @param lender Lender contract * @param payer Payer address * @param to Repayment recipient address * @param skim Skimming flag * @param part Repayment part * @dev Only callable by repay helper * * Requirements: * · Valid lender contract * · Valid payer address * · Valid repayment recipient address * · Valid repayment part * * Effects: * · Repays lender * · Updates interest rates */ function lenderRepay( ILender lender, address payer, address to, bool skim, uint256 part ) external nonReentrant onlyRepayHelper { lender.repay(payer, to, skim, part); _updateInterestRateAndBorrowLimit(); } /** * @notice Liquidates lender * @param lender Lender contract * @param liquidator Liquidator address * @param users User addresses * @param maxBorrowParts Maximum borrow parts * @param to Liquidation recipient address * @dev Only callable by liquidation helper * * Requirements: * · Valid lender contract * · Valid liquidator address * · Valid user addresses * · Valid maximum borrow parts * · Valid liquidation recipient address * * Effects: * · Liquidates lender * · Updates interest rates */ function lenderLiquidate( ILender lender, address liquidator, address[] memory users, uint256[] memory maxBorrowParts, address to ) external nonReentrant onlyLiquidationHelper { lender.liquidate(liquidator, users, maxBorrowParts, to); _updateInterestRateAndBorrowLimit(); } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Calculates APR for staked DUSX * @return APR value * @dev Includes reentrancy protection * * Requirements: * · Valid staked DUSX balance * * Effects: * · Calculates APR */ function aprStakedDUSX() external view returns (uint256) { uint256 totalBorrowed = 0; address[] memory lenders = vault.getControllers(); uint256 length = lenders.length; for (uint256 i; i < length; i++) { totalBorrowed += marketLens.getTotalBorrowed(ILender(lenders[i])); } if (IERC20Custom(address(stDUSX)).totalSupply() == 0) { return 0; } else { return ((totalBorrowed * dynamicInterestRate.getInterestRate() * (TENK_PRECISION - feesDistributor.floorAllocation())) / TENK_PRECISION) / IERC20Custom(address(stDUSX)).totalSupply(); } } /*////////////////////////////////////////////////////////////// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @dev Distributes fees * @notice Called before lending operations * * Effects: * · Distributes fees * · Updates fee state */ function _distributeFees() private { feesWithdrawer.withdraw(); feesDistributor.distribute(); } /** * @dev Updates interest rates and borrow limits * @notice Called after lending operations * * Effects: * · Updates dynamic interest rates * · Adjusts borrow limits * · Maintains system stability */ function _updateInterestRateAndBorrowLimit() private { uint256 supplyHanging = supplyHangingCalculator.getSupplyHanging(); uint256 psmTotalCapital = 0; uint256 pegStabilityModulesLength = pegStabilityModules.length; for (uint256 i; i < pegStabilityModulesLength; i++) { psmTotalCapital += pegStabilityModules[i].dusxMinted(); } uint256 newBorrowLimit = 0; if (supplyHanging < psmTotalCapital) { newBorrowLimit = psmTotalCapital - supplyHanging; } address[] memory lenders = vault.getControllers(); uint256 lendersLength = lenders.length; for (uint256 i; i < lendersLength; i++) { uint256 totalBorrowed = marketLens.getTotalBorrowed( ILender(lenders[i]) ); uint256 adjustedBorrowLimit = totalBorrowed + newBorrowLimit; lenderOwner.changeInterestRate( ILender(lenders[i]), dynamicInterestRate.getInterestPerSecond() ); if ( !lenderOwner.deprecated(address(lenders[i])) && !lenderOwner.manual(address(lenders[i])) ) { lenderOwner.changeBorrowLimit( ILender(lenders[i]), adjustedBorrowLimit, adjustedBorrowLimit ); } } } // Validates that an address is not zero function _ensureNonzeroAddress(address addr) private pure { if (addr == address(0)) { revert ZeroAddress(); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title Context * @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, as 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). * @notice This contract is used through inheritance. It will make available the * modifier `_msgSender()`, which can be used to reference the account that * called a function within an implementing contract. */ abstract contract Context { /*////////////////////////////////////////////////////////////// INTERNAL FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Gets the sender of the current call * @dev Provides a way to retrieve the message sender that supports meta-transactions * @return Sender address (msg.sender in the base implementation) */ function _msgSender() internal view virtual returns (address) { return msg.sender; } /** * @notice Gets the complete calldata of the current call * @dev Provides a way to retrieve the message data that supports meta-transactions * @return Complete calldata bytes */ function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @notice Gets the length of any context-specific suffix in the message data * @dev Used in meta-transaction implementations to account for additional data * @return Length of the context suffix (0 in the base implementation) */ function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {Context} from "./Context.sol"; /** * @title Ownable * @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. * @notice By default, the owner account will be the one that deploys the contract. * This can later be changed with {transferOwnership} and {renounceOwnership}. */ abstract contract Ownable is Context { /*////////////////////////////////////////////////////////////// STATE VARIABLES //////////////////////////////////////////////////////////////*/ /// @notice Address of the current owner address private _owner; /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /// @notice Emitted when ownership is transferred event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /*////////////////////////////////////////////////////////////// CUSTOM ERRORS //////////////////////////////////////////////////////////////*/ /// @notice Thrown when non-owner tries to call owner-only function error UnauthorizedAccount(address account); /// @notice Thrown when trying to transfer ownership to invalid address error InvalidOwner(address owner); /*////////////////////////////////////////////////////////////// MODIFIERS //////////////////////////////////////////////////////////////*/ /** * @dev Throws if called by any account other than the owner */ modifier onlyOwner() { _checkOwner(); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @dev Initializes the contract setting the deployer as the initial owner */ constructor() { _transferOwnership(_msgSender()); } /*////////////////////////////////////////////////////////////// PUBLIC FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Leaves the contract without owner * @dev Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @notice Transfers ownership of the contract to a new account * @dev The new owner cannot be the zero address * @param newOwner The address that will become the new owner */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert InvalidOwner(address(0)); } _transferOwnership(newOwner); } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Returns the address of the current owner * @return Current owner address */ function owner() public view virtual returns (address) { return _owner; } /*////////////////////////////////////////////////////////////// INTERNAL FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @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); } /** * @dev Throws if the sender is not the owner */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert UnauthorizedAccount(_msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title ReentrancyGuard * @dev Contract module that helps prevent reentrant calls to a function * @notice This module is used through inheritance. It will make available the modifier * `nonReentrant`, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. */ abstract contract ReentrancyGuard { /*////////////////////////////////////////////////////////////// STATE VARIABLES //////////////////////////////////////////////////////////////*/ /// @notice Guard state constants uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; /// @notice Current state of the guard uint256 private _status; /*////////////////////////////////////////////////////////////// CUSTOM ERRORS //////////////////////////////////////////////////////////////*/ error ReentrantCall(); /*////////////////////////////////////////////////////////////// MODIFIERS //////////////////////////////////////////////////////////////*/ /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Initializes the contract by setting the initial reentrancy guard state */ constructor() { _status = NOT_ENTERED; } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Checks if a protected function is currently executing * @return True if the contract is in the entered state */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } /*////////////////////////////////////////////////////////////// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @dev Sets guard state before protected function execution * @notice Reverts if a reentrant call is detected */ function _nonReentrantBefore() private { if (_status == ENTERED) { revert ReentrantCall(); } _status = ENTERED; } /** * @dev Resets guard state after protected function execution */ function _nonReentrantAfter() private { _status = NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IDUSXProvider} from "./IDUSXProvider.sol"; import {IERC20Token} from "./IERC20Token.sol"; import {IERC20TokenRebase} from "./IERC20TokenRebase.sol"; import {IFeesDistributor} from "./IFees.sol"; import {IFeesWithdrawer} from "./IFees.sol"; import {IFloor} from "./IFloor.sol"; import {ILenderOwner} from "./ILenderOwner.sol"; import {ILiquidationHelper} from "./ILiquidationHelper.sol"; import {IMarketLens} from "./IMarketLens.sol"; import {IMiscHelper} from "./IMiscHelper.sol"; import {IOracle} from "./IOracle.sol"; import {IPSM} from "./IPSM.sol"; import {IRepayHelper} from "./IRepayHelper.sol"; import {IStableOwner} from "./IStableOwner.sol"; import {IStakedDUSX} from "./IStakedDUSX.sol"; import {ISupplyHangingCalculator} from "./ISupplyHangingCalculator.sol"; import {IVault} from "./IVault.sol"; import {IVoteEscrowedSTTX} from "./IVoteEscrowedSTTX.sol"; import {IDynamicInterestRate} from "./IDynamicInterestRate.sol"; import {IMinter} from "./IMinter.sol"; interface IBaseContracts { struct CoreTokens { IERC20Token dusx; IERC20TokenRebase sttx; IStakedDUSX stDUSX; IVoteEscrowedSTTX veSTTX; } struct PSMContracts { IPSM psmCircle; IPSM psmTether; IStableOwner stableOwner; } struct OracleContracts { IOracle oracleChainlink; IOracle oracleFloorPrice; } struct HelperContracts { IMiscHelper helper; ILiquidationHelper liquidationHelper; IRepayHelper repayHelper; IMarketLens marketLens; } error ZeroAddress(); error ContractAlreadySet(); // Struct getters function coreTokens() external view returns (CoreTokens memory); function psmContracts() external view returns (PSMContracts memory); function oracleContracts() external view returns (OracleContracts memory); function helperContracts() external view returns (HelperContracts memory); // Individual contract getters function dusxProvider() external view returns (IDUSXProvider); function feesDistributor() external view returns (IFeesDistributor); function feesWithdrawer() external view returns (IFeesWithdrawer); function floor() external view returns (IFloor); function lenderOwner() external view returns (ILenderOwner); function minter() external view returns (IMinter); function supplyCalculator() external view returns (ISupplyHangingCalculator); function vault() external view returns (IVault); function dynamicInterestRate() external view returns (IDynamicInterestRate); // Convenience getters for struct members function dusx() external view returns (IERC20Token); function sttx() external view returns (IERC20TokenRebase); function stDUSX() external view returns (IStakedDUSX); function veSTTX() external view returns (IVoteEscrowedSTTX); function psmCircle() external view returns (IPSM); function psmTether() external view returns (IPSM); function stableOwner() external view returns (IStableOwner); function oracleChainlink() external view returns (IOracle); function oracleFloorPrice() external view returns (IOracle); function helper() external view returns (IMiscHelper); function liquidationHelper() external view returns (ILiquidationHelper); function repayHelper() external view returns (IRepayHelper); function marketLens() external view returns (IMarketLens); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IDUSXProvider * @dev Interface for DUSX token provision and distribution operations * @notice Defines functionality for: * 1. Token provision management * 2. Supply control * 3. Distribution tracking */ interface IDUSXProvider { /*////////////////////////////////////////////////////////////// PROVISION OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Provides DUSX tokens to the requesting address * @param amount The quantity of DUSX tokens to provide in base units * @dev Handles: * · Token minting/transfer * · Supply tracking * · State updates * * Requirements: * · Caller is authorized * · Amount > 0 * · Within supply limits * * Effects: * · Increases recipient balance * · Updates total supply * · Emits provision event */ function provide(uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IDynamicInterestRate * @dev Interface for dynamic interest rate calculations in the lending protocol * @notice Defines methods for retrieving time-based interest rates that: * 1. Adjust based on market conditions * 2. Support per-second and base rate calculations * 3. Maintain precision through proper scaling * * This interface is crucial for: * · Accurate interest accrual * · Dynamic market response * · Protocol yield calculations */ interface IDynamicInterestRate { /*////////////////////////////////////////////////////////////// INTEREST RATE QUERIES //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves the current interest rate per second * @return uint256 Interest rate per second, scaled by 1e18 * @dev Used for precise interest calculations over time periods */ function getInterestPerSecond() external view returns (uint256); /** * @notice Retrieves the current base interest rate * @return uint256 Base interest rate, scaled by 1e18 * @dev Represents the foundational rate before adjustments */ function getInterestRate() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IERC20Custom * @dev Interface for the ERC20 fungible token standard (EIP-20) * @notice Defines functionality for: * 1. Token transfers * 2. Allowance management * 3. Balance tracking * 4. Token metadata */ interface IERC20Custom { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /** * @dev Emitted on token transfer between addresses * @param from Source address (0x0 for mints) * @param to Destination address (0x0 for burns) * @param value Amount of tokens transferred * @notice Tracks: * · Regular transfers * · Minting operations * · Burning operations */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when spending allowance is granted * @param owner Address granting permission * @param spender Address receiving permission * @param value Amount of tokens approved * @notice Records: * · New approvals * · Updated allowances * · Revoked permissions */ event Approval( address indexed owner, address indexed spender, uint256 value ); /*////////////////////////////////////////////////////////////// TRANSFER OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Transfers tokens to specified recipient * @param to Recipient address * @param value Amount to transfer in base units * @return bool True if transfer succeeds * @dev Requirements: * · Caller has sufficient balance * · Recipient is valid * · Amount > 0 * * Effects: * · Decreases caller balance * · Increases recipient balance * · Emits Transfer event */ function transfer(address to, uint256 value) external returns (bool); /** * @notice Executes transfer on behalf of token owner * @param from Source address * @param to Destination address * @param value Amount to transfer in base units * @return bool True if transfer succeeds * @dev Requirements: * · Caller has sufficient allowance * · Source has sufficient balance * · Valid addresses * * Effects: * · Decreases allowance * · Updates balances * · Emits Transfer event */ function transferFrom( address from, address to, uint256 value ) external returns (bool); /*////////////////////////////////////////////////////////////// APPROVAL OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Authorizes address to spend tokens * @param spender Address to authorize * @param value Amount to authorize in base units * @return bool True if approval succeeds * @dev Controls: * · Spending permissions * · Delegation limits * · Authorization levels * * Security: * · Overwrites previous allowance * · Requires explicit value * · Emits Approval event */ function approve(address spender, uint256 value) external returns (bool); /*////////////////////////////////////////////////////////////// TOKEN METADATA //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves human-readable token name * @return string Full token name */ function name() external view returns (string memory); /** * @notice Retrieves token trading symbol * @return string Short token identifier */ function symbol() external view returns (string memory); /** * @notice Retrieves token decimal precision * @return uint8 Number of decimal places * @dev Standard: * · 18 for most tokens * · Used for display formatting */ function decimals() external view returns (uint8); /*////////////////////////////////////////////////////////////// BALANCE QUERIES //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves total token supply * @return uint256 Current total supply * @dev Reflects: * · All minted tokens * · Minus burned tokens * · In base units */ function totalSupply() external view returns (uint256); /** * @notice Retrieves account token balance * @param account Address to query * @return uint256 Current balance in base units * @dev Returns: * · Available balance * · Includes pending rewards * · Excludes locked tokens */ function balanceOf(address account) external view returns (uint256); /** * @notice Retrieves remaining spending allowance * @param owner Token owner address * @param spender Authorized spender address * @return uint256 Current allowance in base units * @dev Shows: * · Approved amount * · Remaining limit * · Delegation status */ function allowance( address owner, address spender ) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; /** * @title IERC20Token * @dev Extended interface for ERC20 tokens with supply control capabilities * @notice Defines functionality for: * 1. Token minting * 2. Token burning * 3. Supply management */ interface IERC20Token is IERC20Custom { /*////////////////////////////////////////////////////////////// SUPPLY MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Mints new tokens to specified account * @param account Address to receive minted tokens * @param amount Quantity of tokens to mint in base units * @dev Controls: * · Supply expansion * · Balance updates * · Event emission * * Requirements: * · Caller is authorized * · Within maxSupply * · Valid recipient */ function mint(address account, uint256 amount) external; /** * @notice Burns tokens from specified account * @param account Address to burn tokens from * @param amount Quantity of tokens to burn in base units * @dev Manages: * · Supply reduction * · Balance updates * · Event emission * * Requirements: * · Caller is authorized * · Sufficient balance * · Amount > 0 */ function burn(address account, uint256 amount) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves maximum token supply limit * @return uint256 Maximum supply cap in base units * @dev Enforces: * · Supply ceiling * · Mint restrictions * · Protocol limits * * Note: This is an immutable value that * cannot be exceeded by minting operations */ function maxSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; /** * @title IERC20TokenRebase * @dev Extended interface for ERC20 tokens with elastic supply and safe management * @notice Defines functionality for: * 1. Supply elasticity (rebasing) * 2. Safe-based token management * 3. Supply control mechanisms * 4. Configuration management */ interface IERC20TokenRebase is IERC20Custom { /*////////////////////////////////////////////////////////////// SUPPLY MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Mints new tokens to specified account * @param account Address to receive minted tokens * @param amount Quantity of tokens to mint in base units * @dev Requires: * · Caller is authorized minter * · Within maxSupply limits * · Valid recipient */ function mint(address account, uint256 amount) external; /** * @notice Burns tokens from specified account * @param account Address to burn tokens from * @param amount Quantity of tokens to burn in base units * @dev Requires: * · Caller is authorized * · Account has sufficient balance * · Amount > 0 */ function burn(address account, uint256 amount) external; /*////////////////////////////////////////////////////////////// REBASE OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Executes supply rebase based on current parameters * @dev Triggers: * · Supply adjustment * · Balance recalculation * · Event emission * * Considers: * · Rebase interval * · Basis points * · Supply limits */ function rebase() external; /** * @notice Configures rebase parameters * @param rebaseInterval Time period between rebases (in seconds) * @param rebaseBasisPoints Scale factor for rebase (in basis points) * @dev Controls: * · Rebase frequency * · Rebase magnitude * · Supply elasticity */ function setRebaseConfig( uint256 rebaseInterval, uint256 rebaseBasisPoints ) external; /*////////////////////////////////////////////////////////////// SAFE MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Initializes new token management safe * @param safe Address of safe to create * @dev Establishes: * · Safe permissions * · Access controls * · Management capabilities */ function createSafe(address safe) external; /** * @notice Removes existing token management safe * @param safe Address of safe to remove * @dev Handles: * · Permission revocation * · State cleanup * · Access termination */ function destroySafe(address safe) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves floor contract address * @return address Active floor contract * @dev Used for: * · Price stability * · Supply control */ function floor() external view returns (address); /** * @notice Retrieves authorized minter address * @return address Active minter contract * @dev Controls: * · Mint permissions * · Supply expansion */ function minter() external view returns (address); /** * @notice Returns absolute maximum token supply * @return uint256 Maximum supply cap in base units * @dev Enforces: * · Hard supply limit * · Mint restrictions */ function maxSupply() external view returns (uint256); /** * @notice Calculates maximum supply after rebase * @return uint256 Post-rebase maximum supply in base units * @dev Considers: * · Current max supply * · Rebase parameters * · Supply caps */ function maxSupplyRebased() external view returns (uint256); /** * @notice Calculates total supply after rebase * @return uint256 Post-rebase total supply in base units * @dev Reflects: * · Current supply * · Rebase effects * · Supply limits */ function totalSupplyRebased() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IFeesWithdrawer * @dev Interface for protocol fee withdrawal operations * @notice Defines functionality for: * 1. Secure fee withdrawal * 2. Access control for withdrawals * 3. Protocol revenue management * * This interface ensures: * · Controlled access to protocol fees * · Safe transfer of accumulated revenue * · Proper accounting of withdrawn amounts */ interface IFeesWithdrawer { /*////////////////////////////////////////////////////////////// WITHDRAWAL OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Withdraws accumulated protocol fees to designated recipients * @dev Only callable by authorized withdrawers * Handles: * · Fee accounting updates * · Transfer of tokens * · Event emission for tracking */ function withdraw() external; } /** * @title IFeesDistributor * @dev Interface for protocol fee distribution and allocation * @notice Defines functionality for: * 1. Fee distribution across protocol components * 2. Dynamic allocation management * 3. Floor token revenue sharing * * This interface manages: * · Revenue distribution logic * · Allocation percentages * · Protocol incentive mechanisms */ interface IFeesDistributor { /*////////////////////////////////////////////////////////////// DISTRIBUTION OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Distributes accumulated protocol fees according to set allocations * @dev Handles the distribution of fees to: * · Floor token stakers * · Protocol treasury * · Other designated recipients */ function distribute() external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Returns current percentage allocated to Floor token stakers * @return uint256 Floor allocation percentage, scaled by 1e18 */ function floorAllocation() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IFloor * @dev Interface for protocol floor price management and capital operations * @notice Defines functionality for: * 1. Token deposit management * 2. Refund processing * 3. Capital tracking */ interface IFloor { /*////////////////////////////////////////////////////////////// DEPOSIT OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes token deposits into the floor contract * @param msgSender Address initiating the deposit * @param amount Quantity of tokens to deposit * @dev Handles: * · Token transfer validation * · Capital tracking updates * · Event emission */ function deposit(address msgSender, uint256 amount) external; /*////////////////////////////////////////////////////////////// REFUND OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes token refunds from the floor contract * @param msgSender Address receiving the refund * @param amount Quantity of tokens to refund * @dev Ensures: * · Sufficient contract balance * · Authorized withdrawal * · Capital accounting */ function refund(address msgSender, uint256 amount) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Returns current total capital held in the floor contract * @return uint256 Current capital amount in base units * @dev Used for: * · Floor price calculations * · Protocol health metrics * · Capital adequacy checks */ function capital() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {Rebase} from "../library/AuxRebase.sol"; import {IERC20Custom} from "./IERC20Custom.sol"; import {IOracle} from "./IOracle.sol"; import {IVault} from "./IVault.sol"; /** * @title ILender * @dev Interface for lending operations and management * @notice Defines the core lending protocol functionality including: * 1. Collateral management and borrowing operations * 2. Interest rate and fee management * 3. Liquidation handling * 4. Vault integration * * The interface is designed to support: * · Over-collateralized lending * · Dynamic interest rates * · Liquidation mechanisms * · Fee collection and distribution */ interface ILender { /*////////////////////////////////////////////////////////////// ADMIN CONFIGURATION //////////////////////////////////////////////////////////////*/ /** * @notice Updates the interest rate for borrowing * @param newInterestRate New interest rate (scaled by 1e18) */ function changeInterestRate(uint256 newInterestRate) external; /** * @notice Sets global and per-address borrowing limits * @param newBorrowLimit Total borrowing limit for the protocol * @param perAddressPart Maximum borrow amount per address */ function changeBorrowLimit( uint256 newBorrowLimit, uint256 perAddressPart ) external; /*////////////////////////////////////////////////////////////// CORE LENDING OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Updates protocol state with accrued interest */ function accrue() external; /** * @notice Updates the exchange rate from the oracle */ function updateExchangeRate() external; /** * @notice Withdraws accumulated protocol fees * @param amountToProvide Amount of fees to withdraw */ function withdrawFees(uint256 amountToProvide) external; /*////////////////////////////////////////////////////////////// LIQUIDATION HANDLING //////////////////////////////////////////////////////////////*/ /** * @notice Liquidates undercollateralized positions * @param liquidator Address performing the liquidation * @param users Array of user addresses to liquidate * @param maxBorrowParts Maximum borrow parts to liquidate per user * @param to Address to receive liquidated collateral */ function liquidate( address liquidator, address[] memory users, uint256[] memory maxBorrowParts, address to ) external; /*////////////////////////////////////////////////////////////// VAULT OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Deposits collateral into the vault * @param amount Amount of collateral to deposit */ function vaultDepositAddCollateral(uint256 amount) external; /** * @notice Withdraws borrowed assets from the vault * @param msgSender Address initiating the withdrawal * @param amount Amount to withdraw * @return part Borrow part assigned * @return share Share of the vault */ function borrowVaultWithdraw( address msgSender, uint256 amount ) external returns (uint256 part, uint256 share); /*////////////////////////////////////////////////////////////// COLLATERAL MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Adds collateral to a lending position * @param to Address to credit the collateral * @param skim True to skim tokens from the contract * @param share Amount of shares to add as collateral */ function addCollateral(address to, bool skim, uint256 share) external; /** * @notice Removes collateral from a lending position * @param to Address to receive the removed collateral * @param share Amount of shares to remove */ function removeCollateral(address to, uint256 share) external; /*////////////////////////////////////////////////////////////// BORROWING OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Borrows assets against deposited collateral * @param msgSender Address initiating the borrow * @param amount Amount to borrow * @return part Borrow part assigned * @return share Share of the borrowed amount */ function borrow( address msgSender, uint256 amount ) external returns (uint256 part, uint256 share); /** * @notice Repays borrowed assets * @param payer Address paying the debt * @param to Address whose debt to repay * @param skim True to skim tokens from the contract * @param part Amount of borrow part to repay * @return amount Actual amount repaid */ function repay( address payer, address to, bool skim, uint256 part ) external returns (uint256 amount); /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Gets the oracle contract address * @return IOracle Oracle interface */ function oracle() external view returns (IOracle); /** * @notice Gets interest accrual information * @return Last accrual timestamp, accumulated interest, interest per second */ function accrueInfo() external view returns (uint256, uint256, uint256); /** * @notice Gets the required collateral ratio * @return uint256 Collateral ratio (scaled by 1e5) */ function collateralRatio() external view returns (uint256); /** * @notice Gets the liquidation bonus multiplier * @return uint256 Liquidation multiplier (scaled by 1e5) */ function liquidationMultiplier() external view returns (uint256); /** * @notice Gets total collateral shares in the protocol * @return uint256 Total collateral share amount */ function totalCollateralShare() external view returns (uint256); /** * @notice Gets the vault contract address * @return IVault Vault interface */ function vault() external view returns (IVault); /** * @notice Gets the fee recipient address * @return address Fee recipient */ function feeTo() external view returns (address); /** * @notice Gets the collateral token address * @return IERC20Custom Collateral token interface */ function collateral() external view returns (IERC20Custom); /** * @notice Gets total borrow state * @return Rebase Total borrow information */ function totalBorrow() external view returns (Rebase memory); /** * @notice Gets user's borrow part * @param account User address * @return uint256 User's borrow part */ function userBorrowPart(address account) external view returns (uint256); /** * @notice Gets user's collateral share * @param account User address * @return uint256 User's collateral share */ function userCollateralShare( address account ) external view returns (uint256); /** * @notice Gets protocol borrowing limits * @return total Total protocol borrow limit * @return borrowPartPerAddress Per-address borrow limit */ function borrowLimit() external view returns (uint256 total, uint256 borrowPartPerAddress); /** * @notice Gets the DUSX token address * @return IERC20Custom DUSX token interface */ function dusx() external view returns (IERC20Custom); /** * @notice Gets all accounts with active positions * @return address[] Array of account addresses */ function accounts() external view returns (address[] memory); /** * @notice Gets the collateral precision factor * @return uint256 Collateral precision */ function collateralPrecision() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {ILender} from "./ILender.sol"; /** * @title ILenderOwner * @dev Interface for protocol-level lender management and configuration * @notice Defines functionality for: * 1. Interest rate management * 2. Borrow limit control * 3. Risk parameter adjustment */ interface ILenderOwner { /*////////////////////////////////////////////////////////////// INTEREST MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Updates lender's interest rate configuration * @param lender The lender contract to modify * @param newInterestRate New interest rate value in basis points * @dev Controls: * · Interest accrual * · Yield generation * · Protocol revenue * * Requirements: * · Caller is authorized * · Rate within bounds * · Valid lender contract */ function changeInterestRate( ILender lender, uint256 newInterestRate ) external; /*////////////////////////////////////////////////////////////// LIMIT MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Updates lender's borrowing constraints * @param lender The lender contract to modify * @param newBorrowLimit New total protocol borrow limit * @param perAddressPart Maximum borrow limit per address * @dev Manages: * · Protocol exposure * · Individual limits * · Risk thresholds * * Requirements: * · Caller is authorized * · Valid limits * · perAddressPart <= newBorrowLimit * * Security: * · Prevents overleveraging * · Controls risk exposure * · Ensures protocol stability */ function changeBorrowLimit( ILender lender, uint256 newBorrowLimit, uint256 perAddressPart ) external; /*////////////////////////////////////////////////////////////// DEPRECATION MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Checks if a lender contract is deprecated * @param lender The lender address to check * @return bool True if the lender is deprecated, false otherwise * @dev Used to: * · Prevent operations on deprecated markets * · Control market lifecycle * · Manage protocol upgrades * * Security: * · Read-only function * · No state modifications * · Access control not required */ function deprecated(address lender) external view returns (bool); /** * @notice Checks if a lender contract is in manual mode * @param lender The lender address to check * @return bool True if the lender is in manual mode, false otherwise * @dev Used to: * · Determine if borrow limits are managed manually * · Control automatic interest rate adjustments * * Security: * · Read-only function * · No state modifications * · Access control not required */ function manual(address lender) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; import {ILender} from "../interface/ILender.sol"; import {IMiscHelper} from "../interface/IMiscHelper.sol"; /** * @title ILiquidationHelper * @dev Interface for liquidation assistance operations * @notice Defines comprehensive liquidation functionality including: * 1. Direct liquidation execution * 2. Liquidation amount calculations * 3. Position health checks * 4. Preview and simulation functions * * The helper provides: * · Maximum and partial liquidation support * · Customizable recipient addresses * · Pre-execution liquidation simulations * · Automated DUSX amount calculations */ interface ILiquidationHelper { /*////////////////////////////////////////////////////////////// CONFIGURATION //////////////////////////////////////////////////////////////*/ /*////////////////////////////////////////////////////////////// LIQUIDATION EXECUTION //////////////////////////////////////////////////////////////*/ /** * @notice Liquidates maximum possible amount for an account * @param lender Address of the lending contract * @param account Address to be liquidated * @return collateralAmount Amount of collateral received * @return adjustedBorrowPart Adjusted borrow amount after liquidation * @return requiredDUSXAmount DUSX tokens needed to execute liquidation * @dev Automatically calculates maximum liquidatable amount */ function liquidateMax( ILender lender, address account ) external returns ( uint256 collateralAmount, uint256 adjustedBorrowPart, uint256 requiredDUSXAmount ); /** * @notice Liquidates specific amount for an account * @param lender Address of the lending contract * @param account Address to be liquidated * @param borrowPart Amount of borrow position to liquidate * @return collateralAmount Amount of collateral received * @return adjustedBorrowPart Adjusted borrow amount after liquidation * @return requiredDUSXAmount DUSX tokens needed to execute liquidation * @dev Validates borrowPart against maximum liquidatable amount */ function liquidate( ILender lender, address account, uint256 borrowPart ) external returns ( uint256 collateralAmount, uint256 adjustedBorrowPart, uint256 requiredDUSXAmount ); /*////////////////////////////////////////////////////////////// LIQUIDATION WITH CUSTOM RECIPIENT //////////////////////////////////////////////////////////////*/ /** * @notice Liquidates maximum amount and sends to specified recipient * @param lender Address of the lending contract * @param account Address to be liquidated * @param recipient Address to receive liquidated assets * @dev Combines max liquidation with custom recipient */ function liquidateMaxTo( ILender lender, address account, address recipient ) external; /** * @notice Liquidates specific amount and sends to specified recipient * @param lender Address of the lending contract * @param account Address to be liquidated * @param recipient Address to receive liquidated assets * @param borrowPart Amount of borrow position to liquidate * @dev Combines partial liquidation with custom recipient */ function liquidateTo( ILender lender, address account, address recipient, uint256 borrowPart ) external; /*////////////////////////////////////////////////////////////// LIQUIDATION PREVIEWS //////////////////////////////////////////////////////////////*/ /** * @notice Previews maximum possible liquidation amounts * @param lender Address of the lending contract * @param account Address to check * @return liquidatable Whether the account can be liquidated * @return requiredDUSXAmount DUSX tokens needed for liquidation * @return adjustedBorrowPart Final borrow amount after liquidation * @return returnedCollateralAmount Collateral amount to be received * @dev Simulates liquidation without executing */ function previewMaxLiquidation( ILender lender, address account ) external view returns ( bool liquidatable, uint256 requiredDUSXAmount, uint256 adjustedBorrowPart, uint256 returnedCollateralAmount ); /** * @notice Previews specific liquidation amounts * @param lender Address of the lending contract * @param account Address to check * @param borrowPart Amount of borrow position to liquidate * @return liquidatable Whether the account can be liquidated * @return requiredDUSXAmount DUSX tokens needed for liquidation * @return adjustedBorrowPart Final borrow amount after liquidation * @return returnedCollateralAmount Collateral amount to be received * @dev Simulates partial liquidation without executing */ function previewLiquidation( ILender lender, address account, uint256 borrowPart ) external view returns ( bool liquidatable, uint256 requiredDUSXAmount, uint256 adjustedBorrowPart, uint256 returnedCollateralAmount ); /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Checks if an account is eligible for liquidation * @param lender Address of the lending contract * @param account Address to check * @return bool True if account can be liquidated * @dev Considers collateral ratio and position health */ function isLiquidatable( ILender lender, address account ) external view returns (bool); /** * @notice Returns the DUSX token contract used for liquidations * @return IERC20Custom DUSX token interface * @dev DUSX is required to execute liquidations */ function dusx() external view returns (IERC20Custom); /** * @notice Returns the helper utility contract * @return IMiscHelper Helper interface for additional functions * @dev Helper provides supporting calculations and checks */ function helper() external view returns (IMiscHelper); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {ILender} from "./ILender.sol"; /** * @title IMarketLens * @dev Interface for viewing and analyzing lending market data * @notice Provides functionality for: * 1. Market size analysis * 2. Borrowing metrics * 3. Risk assessment data */ interface IMarketLens { /*////////////////////////////////////////////////////////////// MARKET METRICS //////////////////////////////////////////////////////////////*/ /** * @notice Calculates total borrowed amount from a specific lending market * @param lender Address of the lending market to analyze * @return uint256 Total borrowed amount in base units * @dev Aggregates: * · Active loan positions * · Accrued interest * · Pending liquidations * * Used for: * · Market size analysis * · Risk assessment * · Protocol health monitoring */ function getTotalBorrowed(ILender lender) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; /** * @title IMinter * @dev Interface for the Minter contract */ interface IMinter { /** * @notice Enables whitelist minting phase */ function enableWhitelistMint() external; /** * @notice Enables public minting phase */ function enablePublicMint() external; /** * @notice Adds a wallet to the whitelist * @param wallet Wallet address to whitelist */ function addToWhitelist(address wallet) external; /** * @notice Mints tokens during whitelist phase * @param stablecoin Stablecoin used for minting * @param stableAmount Amount of stablecoin to mint against */ function whitelistMint( IERC20Custom stablecoin, uint256 stableAmount ) external; /** * @notice Mints tokens during public phase * @param stablecoin Stablecoin used for minting * @param stableAmount Amount of stablecoin to mint against */ function publicMint(IERC20Custom stablecoin, uint256 stableAmount) external; /** * @notice Mints remaining token supply * @param stablecoin Stablecoin used for minting */ function mintRemainingSupply(IERC20Custom stablecoin) external; /** * @notice Sends accumulated DUSX to floor contract */ function sendToFloorDUSX() external; /** * @notice Verifies if a wallet is whitelisted * @param wallet Address to verify * @return bool Whitelist status */ function verifyWallet(address wallet) external view returns (bool); /** * @notice Calculates mint amount for given stablecoin input * @param stablecoin Stablecoin used for calculation * @param stableAmount Amount of stablecoin * @return uint256 Calculated mint amount */ function calcMintAmount( IERC20Custom stablecoin, uint256 stableAmount ) external view returns (uint256); /** * @notice Gets the current token reserve * @return uint256 Current token reserve */ function tokenReserve() external view returns (uint256); /** * @notice Gets the current mint ratio * @return uint256 Current mint ratio */ function getCurrentRatio() external view returns (uint256); /** * @notice Gets the current mint rate * @return uint256 Current mint rate */ function getCurrentRate() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IDynamicInterestRate} from "./IDynamicInterestRate.sol"; import {IFeesDistributor} from "./IFees.sol"; import {IFeesWithdrawer} from "./IFees.sol"; import {IFloor} from "./IFloor.sol"; import {ILender} from "./ILender.sol"; import {ILenderOwner} from "./ILenderOwner.sol"; import {ILiquidationHelper} from "./ILiquidationHelper.sol"; import {IMarketLens} from "./IMarketLens.sol"; import {IPSM} from "./IPSM.sol"; import {IRepayHelper} from "./IRepayHelper.sol"; import {IStakedDUSX} from "./IStakedDUSX.sol"; import {ISupplyHangingCalculator} from "./ISupplyHangingCalculator.sol"; /** * @title IMiscHelper * @dev Interface for miscellaneous helper functions across the protocol * @notice Provides comprehensive helper methods for: * 1. Protocol configuration and parameter management * 2. Floor token operations * 3. Staked DUSX token management * 4. PSM (Peg Stability Module) operations * 5. Lending operations including borrowing and repayment * 6. System-wide view functions * * This interface acts as a central utility hub for coordinating * various protocol components and simplifying complex operations */ interface IMiscHelper { /*////////////////////////////////////////////////////////////// CONFIGURATION FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Sets the supply hanging calculator contract * @param supplyHangingCalculator_ New calculator contract address * @dev Used for calculating supply adjustments */ function setSupplyHangingCalculator( ISupplyHangingCalculator supplyHangingCalculator_ ) external; /** * @notice Sets core protocol parameters and contract addresses * @param repayHelper_ Repayment helper contract * @param liquidationHelper_ Liquidation helper contract * @param dynamicInterestRate_ Interest rate calculator * @param feesDistributor_ Fee distribution contract * @param feesWithdrawer_ Fee withdrawal contract * @param lenderOwner_ Lender owner contract * @param marketLens_ Market data viewer contract * @dev Updates all main protocol component addresses */ function setParameters( IRepayHelper repayHelper_, ILiquidationHelper liquidationHelper_, IDynamicInterestRate dynamicInterestRate_, IFeesDistributor feesDistributor_, IFeesWithdrawer feesWithdrawer_, ILenderOwner lenderOwner_, IMarketLens marketLens_ ) external; /** * @notice Sets the list of active lender contracts * @param lenders_ Array of lender addresses * @dev Updates the protocol's lending markets */ function setLenders(ILender[] memory lenders_) external; /** * @notice Sets the list of PSM contracts * @param pegStabilityModules_ Array of PSM addresses * @dev Updates available stablecoin PSM modules */ function setPegStabilityModules( IPSM[] memory pegStabilityModules_ ) external; /*////////////////////////////////////////////////////////////// FLOOR TOKEN OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Deposits Floor tokens into the protocol * @param amount Amount of Floor tokens to deposit */ function depositFloor(uint256 amount) external; /** * @notice Refunds Floor tokens from the protocol * @param amount Amount of Floor tokens to refund */ function refundFloor(uint256 amount) external; /*////////////////////////////////////////////////////////////// STAKED DUSX OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Deposits DUSX tokens for staking * @param amount Amount of DUSX to stake */ function depositStakedDUSX(uint256 amount) external; /** * @notice Withdraws staked DUSX tokens * @param amount Amount of staked DUSX to withdraw */ function withdrawStakedDUSX(uint256 amount) external; /*////////////////////////////////////////////////////////////// PSM OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Swaps DUSX for stablecoin through PSM * @param psm PSM contract to use for swap * @param receiver Address to receive stablecoins * @param amountDUSX Amount of DUSX to swap */ function psmSwapDUSXForStable( IPSM psm, address receiver, uint256 amountDUSX ) external; /** * @notice Swaps stablecoin for DUSX through PSM * @param psm PSM contract to use for swap * @param receiver Address to receive DUSX * @param amountStable Amount of stablecoin to swap */ function psmSwapStableForDUSX( IPSM psm, address receiver, uint256 amountStable ) external; /*////////////////////////////////////////////////////////////// LENDING OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Withdraws borrowed tokens from vault * @param lender Lender contract to withdraw from * @param amount Amount to withdraw */ function lenderBorrowVaultWithdraw(ILender lender, uint256 amount) external; /** * @notice Executes a borrow operation * @param lender Lender contract to borrow from * @param amount Amount to borrow */ function lenderBorrow(ILender lender, uint256 amount) external; /** * @notice Repays borrowed tokens * @param lender Lender contract to repay to * @param payer Address paying the debt * @param to Address receiving any excess * @param skim Whether to skim tokens from contract * @param part Amount of borrow part to repay */ function lenderRepay( ILender lender, address payer, address to, bool skim, uint256 part ) external; /** * @notice Executes liquidation for multiple users * @param lender Lender contract to liquidate from * @param liquidator Address performing liquidation * @param users Array of addresses to liquidate * @param maxBorrowParts Maximum borrow parts to liquidate per user * @param to Address to receive liquidated assets */ function lenderLiquidate( ILender lender, address liquidator, address[] memory users, uint256[] memory maxBorrowParts, address to ) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Returns current APR for staked DUSX * @return uint256 Annual percentage rate */ function aprStakedDUSX() external view returns (uint256); /** * @notice Returns repayment helper contract */ function repayHelper() external view returns (IRepayHelper); /** * @notice Returns liquidation helper contract */ function liquidationHelper() external view returns (ILiquidationHelper); /** * @notice Returns dynamic interest rate calculator */ function dynamicInterestRate() external view returns (IDynamicInterestRate); /** * @notice Returns floor token contract */ function floor() external view returns (IFloor); /** * @notice Returns fees distributor contract */ function feesDistributor() external view returns (IFeesDistributor); /** * @notice Returns fees withdrawer contract */ function feesWithdrawer() external view returns (IFeesWithdrawer); /** * @notice Returns lender contract at specified index * @param index Position in lenders array */ function lenders(uint256 index) external view returns (ILender); /** * @notice Returns total number of lender contracts */ function lendersLength() external view returns (uint256); /** * @notice Returns lender owner contract */ function lenderOwner() external view returns (ILenderOwner); /** * @notice Returns market lens contract */ function marketLens() external view returns (IMarketLens); /** * @notice Returns PSM contract at specified index * @param index Position in PSM array */ function pegStabilityModules(uint256 index) external view returns (IPSM); /** * @notice Returns total number of PSM contracts */ function pegStabilityModulesLength() external view returns (uint256); /** * @notice Returns staked DUSX token contract */ function stDUSX() external view returns (IStakedDUSX); /** * @notice Returns supply hanging calculator contract */ function supplyHangingCalculator() external view returns (ISupplyHangingCalculator); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IOracle * @dev Interface for basic price feed operations * @notice Defines functionality for: * 1. Asset price retrieval * 2. Price precision handling */ interface IOracle { /*////////////////////////////////////////////////////////////// PRICE QUERIES //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves current asset price * @param asset Address of the asset to price * @return uint256 Current price in base units with precision * @dev Provides: * · Latest price data * · Standardized precision * · Asset valuation * * Note: Check implementation for specific precision details */ function getPrice(address asset) external view returns (uint256); } /** * @title ITwapOracle * @dev Interface for time-weighted average price calculations * @notice Defines functionality for: * 1. TWAP updates * 2. Time-weighted calculations * 3. Price smoothing */ interface ITwapOracle { /*////////////////////////////////////////////////////////////// TWAP OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Updates time-weighted average price * @param asset Address of the asset to update * @return uint256 New TWAP value in base units * @dev Calculates: * · Time-weighted price * · Cumulative values * · Price averages * * Features: * · Manipulation resistance * · Smoothing effect * · Historical tracking */ function updateTwap(address asset) external returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; /** * @title IPSM * @dev Interface for Peg Stability Module (PSM) operations * @notice Defines functionality for: * 1. Stablecoin/DUSX swaps * 2. Peg maintenance * 3. Supply tracking */ interface IPSM { /*////////////////////////////////////////////////////////////// SWAP OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Executes stablecoin to DUSX swap * @param msgSender Address initiating the swap * @param receiver Address receiving the DUSX * @param stableTokenAmount Amount of stablecoins to swap * @dev Handles: * · Stablecoin deposit * · DUSX minting * · Supply tracking */ function swapStableForDUSX( address msgSender, address receiver, uint256 stableTokenAmount ) external; /** * @notice Executes DUSX to stablecoin swap * @param msgSender Address initiating the swap * @param receiver Address receiving the stablecoins * @param stableTokenAmount Amount of stablecoins to receive * @dev Handles: * · DUSX burning * · Stablecoin release * · Supply adjustment */ function swapDUSXForStable( address msgSender, address receiver, uint256 stableTokenAmount ) external; /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves the stablecoin token contract * @return IERC20Custom Stablecoin token interface * @dev Used for: * · Token transfers * · Balance checks * · Allowance verification */ function stableToken() external view returns (IERC20Custom); /** * @notice Returns total DUSX tokens minted through PSM * @return uint256 Total minted amount in base units * @dev Tracks: * · Total supply impact * · PSM utilization * · Protocol growth metrics */ function dusxMinted() external view returns (uint256); /** * @notice Returns the maximum amount of DUSX that can be minted through PSM * @return uint256 Maximum mintable amount in base units * @dev Used for: * · Supply control * · Risk management * · Protocol safety */ function dusxMintCap() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Custom} from "./IERC20Custom.sol"; import {ILender} from "./ILender.sol"; import {IMiscHelper} from "./IMiscHelper.sol"; /** * @title IRepayHelper * @dev Interface for streamlined loan repayment operations and management * @notice Defines functionality for: * 1. Loan repayment processing * 2. Multi-loan management * 3. Helper contract integration * 4. Token interactions */ interface IRepayHelper { /*////////////////////////////////////////////////////////////// CONFIGURATION //////////////////////////////////////////////////////////////*/ /*////////////////////////////////////////////////////////////// REPAYMENT OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes partial loan repayment * @param lender Address of the lending contract * @param to Address whose loan is being repaid * @param amount Amount to repay in base units * @return part Share of the loan repaid * @dev Handles: * · Token transfers * · Loan accounting * · Share calculations * * Requirements: * · Amount > 0 * · Sufficient balance * · Valid addresses */ function repayAmount( ILender lender, address to, uint256 amount ) external returns (uint256 part); /** * @notice Processes complete loan repayment * @param lender Address of the lending contract * @param to Address whose loan is being repaid * @return amount Total amount repaid in base units * @dev Manages: * · Full debt calculation * · Complete repayment * · Account settlement * * Effects: * · Clears entire debt * · Updates balances * · Emits events */ function repayTotal( ILender lender, address to ) external returns (uint256 amount); /** * @notice Processes multiple complete loan repayments * @param lender Address of the lending contract * @param tos Array of addresses whose loans are being repaid * @return amount Total amount repaid across all loans * @dev Executes: * · Batch processing * · Multiple settlements * · Aggregate accounting * * Optimizations: * · Gas efficient * · Bulk processing * · Single transaction */ function repayTotalMultiple( ILender lender, address[] calldata tos ) external returns (uint256 amount); /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves DUSX token contract * @return IERC20Custom Interface of the DUSX token * @dev Used for: * · Token operations * · Balance checks * · Allowance verification */ function dusx() external view returns (IERC20Custom); /** * @notice Retrieves helper contract * @return IMiscHelper Interface of the helper contract * @dev Provides: * · Helper functionality * · Integration access * · Utility methods */ function helper() external view returns (IMiscHelper); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {IERC20Token} from "./IERC20Token.sol"; /** * @title IStableOwner Interface * @dev Interface for StableOwner contract that manages stable token supply * @notice Defines the external interface for stable token supply management */ interface IStableOwner { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /// @notice Emitted when stable token contract is updated /// @param stable New stable token contract address event StableSet(IERC20Token indexed stable); /// @notice Emitted when new tokens are minted /// @param account Recipient of minted tokens /// @param amount Amount of tokens minted event TokensMinted(address indexed account, uint256 amount); /// @notice Emitted when tokens are burned /// @param account Account tokens were burned from /// @param amount Amount of tokens burned event TokensBurned(address indexed account, uint256 amount); /*////////////////////////////////////////////////////////////// FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Updates the stable token contract address /// @param stable_ New stable token contract address function setStable(IERC20Token stable_) external; /// @notice Creates new stable tokens /// @param account Address to receive minted tokens /// @param amount Number of tokens to mint function mint(address account, uint256 amount) external; /// @notice Destroys existing stable tokens /// @param account Address to burn tokens from /// @param amount Number of tokens to burn function burn(address account, uint256 amount) external; /// @notice The managed stable token contract /// @return The IERC20Token interface of the stable token function stable() external view returns (IERC20Token); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IStakedDUSX * @dev Interface for staked DUSX token operations and reward distribution * @notice Defines functionality for: * 1. DUSX token staking * 2. Reward distribution * 3. Position management */ interface IStakedDUSX { /*////////////////////////////////////////////////////////////// REWARD DISTRIBUTION //////////////////////////////////////////////////////////////*/ /** * @notice Distributes protocol fees as staking rewards * @param amount Amount of fees to distribute in base units * @dev Handles: * · Pro-rata distribution * · Reward accounting * · Distribution events * * Rewards are: * · Automatically calculated * · Immediately available * · Proportional to stake */ function distributeFees(uint256 amount) external; /** * @notice Claims pending fee rewards for the caller * @return claimedAmount Amount of fees claimed * @dev Allows users to manually claim their accumulated fees */ function claimFees() external returns (uint256 claimedAmount); /*////////////////////////////////////////////////////////////// STAKING OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes DUSX token deposits for staking * @param from Address providing the tokens * @param to Address receiving the staked position * @param amount Quantity of tokens to stake in base units * @dev Manages: * · Token transfers * · Position creation * · Reward calculations * * Supports: * · Direct deposits * · Delegated deposits * · Position tracking */ function deposit(address from, address to, uint256 amount) external; /** * @notice Initiates a withdrawal from staked DUSX * @param amount Amount of tokens to withdraw */ function beginWithdrawal(uint256 amount) external; /** * @notice Processes withdrawal of staked DUSX tokens * @param account Address withdrawing tokens * @dev Handles: * · Position updates * · Reward claims * · Token transfers * * Ensures: * · Sufficient balance * · Reward distribution * · Clean exit */ function withdraw(address account) external; /** * @notice Views pending unclaimed fees for an account * @param account Address to check for pending fees * @return pendingAmount Amount of pending fees available to claim * @dev Calculates based on the fee accumulator and account's last claimed value */ function pendingFees( address account ) external view returns (uint256 pendingAmount); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title ISupplyHangingCalculator * @dev Interface for calculating and managing token supply adjustments * @notice Defines functionality for: * 1. Supply hanging calculations * 2. Safety margin management * 3. Risk-adjusted metrics */ interface ISupplyHangingCalculator { /*////////////////////////////////////////////////////////////// SAFETY PARAMETERS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves current safety margin for supply calculations * @return uint256 Safety margin percentage scaled by 1e18 * @dev Used for: * · Risk adjustment * · Supply buffer * · Protocol protection */ function safetyMargin() external view returns (uint256); /*////////////////////////////////////////////////////////////// SUPPLY HANGING CALCULATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Calculates current supply hanging with safety margins * @return uint256 Risk-adjusted supply hanging in base units * @dev Includes: * · Safety margin application * · Risk adjustments * · Protocol constraints * * Used for: * · Safe supply management * · Conservative adjustments * · Risk-aware operations */ function getSupplyHanging() external view returns (uint256); /** * @notice Calculates raw supply hanging without safety margins * @return uint256 Unadjusted supply hanging in base units * @dev Provides: * · Raw calculations * · No safety buffers * · Maximum theoretical values * * Used for: * · Analysis purposes * · Maximum bounds * · Stress testing */ function getSupplyHangingUnsafe() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; import {Rebase} from "../library/AuxRebase.sol"; import {IERC20Custom} from "./IERC20Custom.sol"; /** * @title IVault * @dev Interface for advanced vault operations with elastic share system * @notice Defines functionality for: * 1. Token custody and management * 2. Share-based accounting * 3. Elastic supply mechanics * 4. Amount/share conversions */ interface IVault { /*////////////////////////////////////////////////////////////// DEPOSIT OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes token deposits into vault * @param token Token contract to deposit * @param from Source of tokens * @param to Recipient of shares * @param amount Token amount (in base units, 0 for share-based) * @param share Share amount (0 for amount-based) * @return amountIn Actual tokens deposited * @return shareIn Actual shares minted * @dev Handles: * · Token transfers * · Share minting * · Balance updates * * Requirements: * · Valid token contract * · Authorized caller * · Sufficient balance * · Either amount or share > 0 * * Note: Only one of amount/share should be non-zero */ function deposit( IERC20Custom token, address from, address to, uint256 amount, uint256 share ) external returns (uint256 amountIn, uint256 shareIn); /*////////////////////////////////////////////////////////////// WITHDRAWAL OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes token withdrawals from vault * @param token Token contract to withdraw * @param from Source of shares * @param to Recipient of tokens * @param amount Token amount (in base units, 0 for share-based) * @param share Share amount (0 for amount-based) * @return amountOut Actual tokens withdrawn * @return shareOut Actual shares burned * @dev Manages: * · Share burning * · Token transfers * · Balance updates * * Requirements: * · Valid token contract * · Sufficient shares * · Either amount or share > 0 * · Authorized withdrawal * * Security: * · Validates balances * · Checks permissions * · Updates state atomically */ function withdraw( IERC20Custom token, address from, address to, uint256 amount, uint256 share ) external returns (uint256 amountOut, uint256 shareOut); /*////////////////////////////////////////////////////////////// SHARE TRANSFERS //////////////////////////////////////////////////////////////*/ /** * @notice Transfers vault shares between accounts * @param token Associated token contract * @param from Source of shares * @param to Recipient of shares * @param share Amount of shares to transfer * @dev Executes: * · Direct share movement * · Balance updates * · Event emission * * Requirements: * · Sufficient share balance * · Valid addresses * · Share amount > 0 * * Note: Bypasses amount calculations for efficiency */ function transfer( IERC20Custom token, address from, address to, uint256 share ) external; /*////////////////////////////////////////////////////////////// BALANCE QUERIES //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves account's vault share balance * @param token Token contract to query * @param account Address to check * @return uint256 Share balance * @dev Provides: * · Raw share balance * · Without conversion * · Current state * * Use toAmount() to convert to token amount */ function balanceOf( IERC20Custom token, address account ) external view returns (uint256); /*////////////////////////////////////////////////////////////// CONVERSION OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Converts token amount to vault shares * @param token Token contract for conversion * @param amount Amount of tokens to convert * @param roundUp Whether to round up result * @return share Equivalent share amount * @dev Calculates: * · Share equivalent * · Based on totals * · Handles precision * * Rounding: * true = ceiling (≥) * false = floor (≤) */ function toShare( IERC20Custom token, uint256 amount, bool roundUp ) external view returns (uint256 share); /** * @notice Converts vault shares to token amount * @param token Token contract for conversion * @param share Amount of shares to convert * @param roundUp Whether to round up result * @return amount Equivalent token amount * @dev Calculates: * · Token equivalent * · Based on totals * · Handles precision * * Rounding: * true = ceiling (≥) * false = floor (≤) */ function toAmount( IERC20Custom token, uint256 share, bool roundUp ) external view returns (uint256 amount); /** * @notice Gets the list of active controllers * @return Array of controller addresses */ function getControllers() external view returns (address[] memory); /*////////////////////////////////////////////////////////////// VAULT TOTALS //////////////////////////////////////////////////////////////*/ /** * @notice Retrieves vault's total supply tracking * @param token Token contract to query * @return vaultTotals Rebase struct containing: * · elastic: Total token amount * · base: Total shares * @dev Provides: * · Current vault state * · Supply tracking * · Conversion basis * * Used for: * · Share calculations * · Amount conversions * · State validation */ function totals( IERC20Custom token ) external view returns (Rebase memory vaultTotals); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title IVoteEscrowedSTTX * @dev Interface for vote-escrowed STTX (veSTTX) token operations * @notice Defines functionality for: * 1. Token withdrawal management * 2. Escrow position handling * 3. Voting power release */ interface IVoteEscrowedSTTX { /*////////////////////////////////////////////////////////////// WITHDRAWAL OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Processes withdrawal of escrowed STTX tokens * @dev Handles: * · Lock period verification * · Position liquidation * · Token transfers * * Requirements: * · Lock period expired * · Active position exists * · Caller is position owner * * Effects: * · Releases locked tokens * · Removes voting power * · Clears escrow position */ function withdraw() external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.24 <0.9.0; /** * @title Rebase Library * @dev Library for handling elastic supply token calculations and adjustments * @notice This library provides mathematical operations for elastic/base token conversions * and supply adjustments. It handles two key concepts: * * 1. Elastic Supply: The actual total supply that can expand or contract * 2. Base Supply: The underlying base amount that remains constant */ /*////////////////////////////////////////////////////////////// TYPES //////////////////////////////////////////////////////////////*/ /** * @dev Core data structure for elastic supply tracking * @param elastic Current elastic (rebased) supply * @param base Current base (non-rebased) supply */ struct Rebase { uint256 elastic; uint256 base; } /** * @title AuxRebase * @dev Auxiliary functions for elastic supply calculations * @notice Provides safe mathematical operations for elastic/base conversions * with optional rounding control */ library AuxRebase { /*////////////////////////////////////////////////////////////// ELASTIC SUPPLY OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Increases the elastic supply * @param total Current total supply state * @param elastic Amount to add to elastic supply * @return newElastic Updated elastic supply after addition */ function addElastic( Rebase storage total, uint256 elastic ) internal returns (uint256 newElastic) { newElastic = total.elastic += elastic; } /** * @notice Decreases the elastic supply * @param total Current total supply state * @param elastic Amount to subtract from elastic supply * @return newElastic Updated elastic supply after subtraction */ function subElastic( Rebase storage total, uint256 elastic ) internal returns (uint256 newElastic) { newElastic = total.elastic -= elastic; } /*////////////////////////////////////////////////////////////// CONVERSION OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Converts an elastic amount to its base amount * @param total Current total supply state * @param elastic Amount of elastic tokens to convert * @param roundUp If true, rounds up the result * @return base Equivalent amount in base units * @dev * · If elastic supply is 0, returns elastic amount as base * · Handles potential precision loss during conversion * · Rounding can cause slight variations in converted amounts * · Recommended for scenarios requiring precise supply tracking * * Rounding Behavior: * · roundUp = false: Always rounds down (truncates) * · roundUp = true: Rounds up if there's a fractional remainder * * Edge Cases: * · total.elastic == 0: Returns input elastic as base * · Potential for minimal precision differences */ function toBase( Rebase memory total, uint256 elastic, bool roundUp ) internal pure returns (uint256 base) { if (total.elastic == 0) { base = elastic; } else { base = (elastic * total.base) / total.elastic; if (roundUp && (base * total.elastic) / total.base < elastic) { base++; } } } /** * @notice Converts a base amount to its elastic amount * @param total Current total supply state * @param base Amount of base tokens to convert * @param roundUp If true, rounds up the result * @return elastic Equivalent amount in elastic units * @dev * · If base supply is 0, returns base amount as elastic * · Handles potential precision loss during conversion * · Rounding can cause slight variations in converted amounts * · Recommended for scenarios requiring precise supply tracking * * Rounding Behavior: * · roundUp = false: Always rounds down (truncates) * · roundUp = true: Rounds up if there's a fractional remainder * * Edge Cases: * · total.base == 0: Returns input base as elastic * · Potential for minimal precision differences */ function toElastic( Rebase memory total, uint256 base, bool roundUp ) internal pure returns (uint256 elastic) { if (total.base == 0) { elastic = base; } else { elastic = (base * total.elastic) / total.base; if (roundUp && (elastic * total.base) / total.elastic < base) { elastic++; } } } /*////////////////////////////////////////////////////////////// COMBINED OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Adds elastic tokens and calculates corresponding base amount * @param total Current total supply state * @param elastic Amount of elastic tokens to add * @param roundUp If true, rounds up base conversion * @return (Rebase, uint256) Updated total supply and calculated base amount */ function add( Rebase memory total, uint256 elastic, bool roundUp ) internal pure returns (Rebase memory, uint256 base) { base = toBase(total, elastic, roundUp); total.elastic += elastic; total.base += base; return (total, base); } /** * @notice Subtracts base tokens and calculates corresponding elastic amount * @param total Current total supply state * @param base Amount of base tokens to subtract * @param roundUp If true, rounds up elastic conversion * @return (Rebase, uint256) Updated total supply and calculated elastic amount */ function sub( Rebase memory total, uint256 base, bool roundUp ) internal pure returns (Rebase memory, uint256 elastic) { elastic = toElastic(total, base, roundUp); total.elastic -= elastic; total.base -= base; return (total, elastic); } /** * @notice Adds specific amounts to both elastic and base supplies * @param total Current total supply state * @param elastic Amount of elastic tokens to add * @param base Amount of base tokens to add * @return Rebase Updated total supply after addition */ function add( Rebase memory total, uint256 elastic, uint256 base ) internal pure returns (Rebase memory) { total.elastic += elastic; total.base += base; return total; } /** * @notice Subtracts specific amounts from both elastic and base supplies * @param total Current total supply state * @param elastic Amount of elastic tokens to subtract * @param base Amount of base tokens to subtract * @return Rebase Updated total supply after subtraction */ function sub( Rebase memory total, uint256 elastic, uint256 base ) internal pure returns (Rebase memory) { total.elastic -= elastic; total.base -= base; return total; } }
{ "viaIR": true, "evmVersion": "paris", "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IBaseContracts","name":"baseContracts_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"InvalidOwner","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"UnauthorizedAccount","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"TENK_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aprStakedDUSX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseContracts","outputs":[{"internalType":"contract IBaseContracts","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositFloor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositStakedDUSX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dynamicInterestRate","outputs":[{"internalType":"contract IDynamicInterestRate","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesDistributor","outputs":[{"internalType":"contract IFeesDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesWithdrawer","outputs":[{"internalType":"contract IFeesWithdrawer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"floor","outputs":[{"internalType":"contract IFloor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ILender","name":"lender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lenderBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILender","name":"lender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lenderBorrowVaultWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILender","name":"lender","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"maxBorrowParts","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"name":"lenderLiquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lenderOwner","outputs":[{"internalType":"contract ILenderOwner","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ILender","name":"lender","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"skim","type":"bool"},{"internalType":"uint256","name":"part","type":"uint256"}],"name":"lenderRepay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidationHelper","outputs":[{"internalType":"contract ILiquidationHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketLens","outputs":[{"internalType":"contract IMarketLens","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"parametersSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pegStabilityModules","outputs":[{"internalType":"contract IPSM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPSM","name":"psm","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amountDUSX","type":"uint256"}],"name":"psmSwapDUSXForStable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPSM","name":"psm","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amountStable","type":"uint256"}],"name":"psmSwapStableForDUSX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"refundFloor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"repayHelper","outputs":[{"internalType":"contract IRepayHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stDUSX","outputs":[{"internalType":"contract IStakedDUSX","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supplyHangingCalculator","outputs":[{"internalType":"contract ISupplyHangingCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawStakedDUSX","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61010060405234620000c5576200001f62000019620001b2565b62000870565b62000029620000cb565b613bdd62000fb882396080518181816104b801528181612b490152612f1d015260a051818181610ac50152818161179c0152818161191501528181611aba0152612645015260c05181818161031c01528181612081015281816120f301528181612165015281816121d701528181612249015281816122bb015261232d015260e0518181816112890152818161164001526135810152613bdd90f35b620000d1565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906200010290620000d6565b810190811060018060401b038211176200011b57604052565b620000e0565b906200013862000130620000cb565b9283620000f6565b565b600080fd5b60018060a01b031690565b62000155906200013f565b90565b62000163906200014a565b90565b620001718162000158565b036200017957565b600080fd5b905051906200018d8262000166565b565b90602082820312620001ac57620001a9916000016200017e565b90565b6200013a565b620001d562004b9580380380620001c98162000121565b9283398101906200018f565b90565b90565b620001f4620001ee620001fa926200013f565b620001d8565b6200013f565b90565b6200020890620001db565b90565b6200021690620001fd565b90565b62000225905162000158565b90565b60e01b90565b62000239906200014a565b90565b62000247816200022e565b036200024f57565b600080fd5b9050519062000263826200023c565b565b9060208282031262000282576200027f9160000162000254565b90565b6200013a565b60000190565b62000298620000cb565b3d6000823e3d90fd5b620002ac906200014a565b90565b620002ba81620002a1565b03620002c257565b600080fd5b90505190620002d682620002af565b565b90602082820312620002f557620002f291600001620002c7565b90565b6200013a565b62000306906200014a565b90565b6200031481620002fb565b036200031c57565b600080fd5b90505190620003308262000309565b565b906020828203126200034f576200034c9160000162000321565b90565b6200013a565b62000360906200014a565b90565b6200036e8162000355565b036200037657565b600080fd5b905051906200038a8262000363565b565b90602082820312620003a957620003a6916000016200037b565b90565b6200013a565b60001b90565b90620003c860018060a01b0391620003af565b9181191691161790565b620003dd90620001db565b90565b620003eb90620003d2565b90565b90565b906200040b620004056200041392620003e0565b620003ee565b8254620003b5565b9055565b6200042390516200022e565b90565b6200043190620001fd565b90565b620004409051620002a1565b90565b6200044e90620001fd565b90565b6200045d9051620002fb565b90565b6200046b90620001fd565b90565b60001c90565b60018060a01b031690565b6200048e62000494916200046e565b62000474565b90565b620004a390546200047f565b90565b620004b190620001fd565b90565b90565b90565b620004d3620004cd620004d992620004b4565b620001d8565b620004b7565b90565b60018060401b038111620004f35760208091020190565b620000e0565b906200050f6200050983620004dc565b62000121565b918252565b369037565b90620005446200052983620004f9565b92602080620005398693620004dc565b920191039062000514565b565b62000551906200014a565b90565b6200055f8162000546565b036200056757565b600080fd5b905051906200057b8262000554565b565b906020828203126200059a5762000597916000016200056c565b90565b6200013a565b634e487b7160e01b600052603260045260246000fd5b5190565b90620005c682620005b6565b811015620005d8576020809102010190565b620005a0565b90565b620005fa620005f46200060092620005de565b620001d8565b620004b7565b90565b906200060f9062000546565b9052565b90565b6200062f62000629620006359262000613565b620001d8565b620004b7565b90565b62000644905162000546565b90565b6200065290620001fd565b90565b6200066e620006686200067492620005de565b620001d8565b6200013f565b90565b620006829062000655565b90565b5490565b600190818003010490565b600052602060002090565b1b90565b91906008620006c3910291620006bc600019846200069f565b926200069f565b9181191691161790565b620006e6620006e0620006ec92620004b7565b620001d8565b620004b7565b90565b90565b91906200070d620007076200071693620006cd565b620006ef565b908354620006a3565b9055565b600090565b62000735916200072e6200071a565b91620006f2565b565b5b81811062000744575050565b806200075460006001936200071f565b0162000738565b90918281106200076b575b505050565b6200079062000789620007826200079c9562000689565b9262000689565b9262000694565b91820191019062000737565b38808062000766565b90680100000000000000008111620007d35781620007c7620007d19362000685565b908281556200075b565b565b620000e0565b60200190565b90565b620007ed82620005b6565b9160018060401b0383116200085c576200082062000819600192620008138686620007a5565b620007d9565b9262000694565b92049160005b838110620008345750505050565b60019060206200084e620008488662000638565b620007df565b940193818401550162000826565b620000e0565b906200086e91620007e2565b565b6200087a62000e45565b6200088f62000889826200020b565b62000e7d565b60c052620008c76020620008ae620008a860c062000219565b6200020b565b63fbfa77cf90620008be620000cb565b93849262000228565b82528180620008d96004820162000288565b03915afa90811562000df15760009162000dbc575b5060e0526200092760206200090e6200090860c062000219565b6200020b565b6340695363906200091e620000cb565b93849262000228565b82528180620009396004820162000288565b03915afa90811562000db65760009162000d81575b506080526200098760206200096e6200096860c062000219565b6200020b565b6374453d1b906200097e620000cb565b93849262000228565b82528180620009996004820162000288565b03915afa90811562000d7b5760009162000d46575b5060a052620009e76020620009ce620009c860c062000219565b6200020b565b63d358b3a290620009de620000cb565b93849262000228565b82528180620009f96004820162000288565b03915afa801562000d405762000a1b9160009162000d0b575b50600a620003f1565b62000a3b62000a3562000a2f60e062000417565b62000426565b62000e7d565b62000a5b62000a5562000a4f608062000434565b62000443565b62000e7d565b62000a7b62000a7562000a6f60a062000451565b62000460565b62000e7d565b62000a9b62000a9562000a8f600a62000497565b620004a6565b62000e7d565b62000ab162000aab6002620004ba565b62000519565b62000ae6602062000acd62000ac760c062000219565b6200020b565b63b5cab3629062000add620000cb565b93849262000228565b8252818062000af86004820162000288565b03915afa801562000d055762000b309160009162000cd0575b5062000b2a8362000b236000620005e1565b90620005ba565b62000603565b62000b65602062000b4c62000b4660c062000219565b6200020b565b63d4aaf8b99062000b5c620000cb565b93849262000228565b8252818062000b776004820162000288565b03915afa801562000cca5762000baf9160009162000c95575b5062000ba98362000ba2600162000616565b90620005ba565b62000603565b62000bdb62000bd562000bcf8362000bc86000620005e1565b90620005ba565b62000638565b62000647565b62000bfc62000bf562000bef600062000677565b6200014a565b916200014a565b14801562000c40575b62000c195762000c1790600962000862565b565b62000c23620000cb565b63d92e233d60e01b81528062000c3c6004820162000288565b0390fd5b5062000c6d62000c6762000c618362000c5a600162000616565b90620005ba565b62000638565b62000647565b62000c8e62000c8762000c81600062000677565b6200014a565b916200014a565b1462000c05565b62000cbb915060203d811162000cc2575b62000cb28183620000f6565b8101906200057d565b3862000b90565b503d62000ca6565b6200028e565b62000cf6915060203d811162000cfd575b62000ced8183620000f6565b8101906200057d565b3862000b11565b503d62000ce1565b6200028e565b62000d31915060203d811162000d38575b62000d288183620000f6565b8101906200038c565b3862000a12565b503d62000d1c565b6200028e565b62000d6c915060203d811162000d73575b62000d638183620000f6565b81019062000332565b38620009ae565b503d62000d57565b6200028e565b62000da7915060203d811162000dae575b62000d9e8183620000f6565b810190620002d8565b386200094e565b503d62000d92565b6200028e565b62000de2915060203d811162000de9575b62000dd98183620000f6565b81019062000265565b38620008ee565b503d62000dcd565b6200028e565b62000e03600162000616565b90565b9062000e1560001991620003af565b9181191691161790565b9062000e3962000e3362000e4192620006cd565b620006ef565b825462000e06565b9055565b62000e4f62000e67565b62000e6562000e5d62000df7565b600162000e1f565b565b62000e7b62000e7562000ed2565b62000f4a565b565b62000e9e62000e9762000e91600062000677565b6200014a565b916200014a565b1462000ea657565b62000eb0620000cb565b63d92e233d60e01b81528062000ec96004820162000288565b0390fd5b600090565b62000edc62000ecd565b503390565b60018060a01b031690565b62000efb62000f01916200046e565b62000ee1565b90565b62000f10905462000eec565b90565b62000f1e90620001fd565b90565b90565b9062000f3e62000f3862000f469262000f13565b62000f21565b8254620003b5565b9055565b62000f56600062000f04565b62000f6382600062000f24565b9062000f9b62000f947f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09362000f13565b9162000f13565b9162000fa6620000cb565b8062000fb28162000288565b0390a356fe60806040526004361015610013575b61130f565b61001e6000356101fc565b8062b26712146101f75780631d88c3ac146101f257806325d3d7cf146101ed57806330452695146101e85780633a642f7e146101e357806340695363146101de5780634f01f6f1146101d957806351bc3b70146101d4578063579c54c0146101cf57806360f7237b146101ca57806361f04d75146101c5578063624a8cb3146101c0578063715018a6146101bb57806374453d1b146101b65780638da5cb5b146101b15780638e0bae7f146101ac5780638eda7e69146101a7578063945e3b11146101a25780639788fe1c1461019d5780639860a44e14610198578063a8fdfb1114610193578063b0d95da11461018e578063c43f975514610189578063cbfd73d514610184578063cc5005961461017f578063dc7d73231461017a578063ed987a0814610175578063ee796c9614610170578063f2fde38b1461016b5763fbfa77cf0361000e576112da565b611254565b611201565b6111cc565b6110be565b611089565b610fe4565b610f3d565b610e8e565b610e2b565b610d86565b610d1a565b610ce7565b610cb3565b610c13565b610b6e565b610b16565b610a90565b610a59565b6107a6565b610701565b61065c565b6105b9565b61053e565b610509565b610481565b6103de565b6103a3565b6102e5565b61028a565b60e01c90565b60405190565b600080fd5b600080fd5b600091031261021d57565b61020d565b1c90565b60ff1690565b61023c9060086102419302610222565b610226565b90565b9061024f915461022c565b90565b61025f600a601490610244565b90565b151590565b61027090610262565b9052565b919061028890600060208501940190610267565b565b346102ba5761029a366004610212565b6102b66102a5610252565b6102ad610202565b91829182610274565b0390f35b610208565b90565b6102cb906102bf565b9052565b91906102e3906000602085019401906102c2565b565b34610315576102f5366004610212565b610311610300611622565b610308610202565b918291826102cf565b0390f35b610208565b7f000000000000000000000000000000000000000000000000000000000000000090565b60018060a01b031690565b90565b61036061035b6103659261033e565b610349565b61033e565b90565b6103719061034c565b90565b61037d90610368565b90565b61038990610374565b9052565b91906103a190600060208501940190610380565b565b346103d3576103b3366004610212565b6103cf6103be61031a565b6103c6610202565b9182918261038d565b0390f35b610208565b60000190565b3461040c576103ee366004610212565b6103f6611b6d565b6103fe610202565b80610408816103d8565b0390f35b610208565b60018060a01b031690565b61042c9060086104319302610222565b610411565b90565b9061043f915461041c565b90565b61044f6002600090610434565b90565b61045b90610368565b90565b61046790610452565b9052565b919061047f9060006020850194019061045e565b565b346104b157610491366004610212565b6104ad61049c610442565b6104a4610202565b9182918261046b565b0390f35b610208565b7f000000000000000000000000000000000000000000000000000000000000000090565b6104e390610368565b90565b6104ef906104da565b9052565b9190610507906000602085019401906104e6565b565b3461053957610519366004610212565b6105356105246104b6565b61052c610202565b918291826104f3565b0390f35b610208565b3461056c5761054e366004610212565b6105566125e0565b61055e610202565b80610568816103d8565b0390f35b610208565b600080fd5b61057f816102bf565b0361058657565b600080fd5b9050359061059882610576565b565b906020828203126105b4576105b19160000161058b565b90565b61020d565b346105e7576105d16105cc36600461059a565b612704565b6105d9610202565b806105e3816103d8565b0390f35b610208565b60018060a01b031690565b61060790600861060c9302610222565b6105ec565b90565b9061061a91546105f7565b90565b61062a600360009061060f565b90565b61063690610368565b90565b6106429061062d565b9052565b919061065a90600060208501940190610639565b565b3461068c5761066c366004610212565b61068861067761061d565b61067f610202565b91829182610646565b0390f35b610208565b60018060a01b031690565b6106ac9060086106b19302610222565b610691565b90565b906106bf915461069c565b90565b6106cf600a6000906106b4565b90565b6106db90610368565b90565b6106e7906106d2565b9052565b91906106ff906000602085019401906106de565b565b3461073157610711366004610212565b61072d61071c6106c2565b610724610202565b918291826106eb565b0390f35b610208565b60018060a01b031690565b6107519060086107569302610222565b610736565b90565b906107649154610741565b90565b6107746008600090610759565b90565b61078090610368565b90565b61078c90610777565b9052565b91906107a490600060208501940190610783565b565b346107d6576107b6366004610212565b6107d26107c1610767565b6107c9610202565b91829182610790565b0390f35b610208565b6107e49061033e565b90565b6107f0906107db565b90565b6107fc816107e7565b0361080357565b600080fd5b90503590610815826107f3565b565b610820816107db565b0361082757565b600080fd5b9050359061083982610817565b565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061086a90610840565b810190811067ffffffffffffffff82111761088457604052565b61084a565b9061089c610895610202565b9283610860565b565b67ffffffffffffffff81116108b65760208091020190565b61084a565b600080fd5b909291926108d56108d08261089e565b610889565b938185526020808601920283019281841161091257915b8383106108f95750505050565b60208091610907848661082c565b8152019201916108ec565b6108bb565b9080601f8301121561093557816020610932933591016108c0565b90565b61083b565b67ffffffffffffffff81116109525760208091020190565b61084a565b9092919261096c6109678261093a565b610889565b93818552602080860192028301928184116109a957915b8383106109905750505050565b6020809161099e848661058b565b815201920191610983565b6108bb565b9080601f830112156109cc578160206109c993359101610957565b90565b61083b565b919060a083820312610a54576109ea8160008501610808565b926109f8826020830161082c565b92604082013567ffffffffffffffff8111610a4f5783610a19918401610917565b9260608301359067ffffffffffffffff8211610a4a57610a3e81610a479386016109ae565b9360800161082c565b90565b610571565b610571565b61020d565b34610a8b57610a75610a6c3660046109d1565b93929092612988565b610a7d610202565b80610a87816103d8565b0390f35b610208565b34610abe57610aa0366004610212565b610aa86129e5565b610ab0610202565b80610aba816103d8565b0390f35b610208565b7f000000000000000000000000000000000000000000000000000000000000000090565b610af090610368565b90565b610afc90610ae7565b9052565b9190610b1490600060208501940190610af3565b565b34610b4657610b26366004610212565b610b42610b31610ac3565b610b39610202565b91829182610b00565b0390f35b610208565b610b54906107db565b9052565b9190610b6c90600060208501940190610b4b565b565b34610b9e57610b7e366004610212565b610b9a610b89612a20565b610b91610202565b91829182610b58565b0390f35b610208565b60018060a01b031690565b610bbe906008610bc39302610222565b610ba3565b90565b90610bd19154610bae565b90565b610be16005600090610bc6565b90565b610bed90610368565b90565b610bf990610be4565b9052565b9190610c1190600060208501940190610bf0565b565b34610c4357610c23366004610212565b610c3f610c2e610bd4565b610c36610202565b91829182610bfd565b0390f35b610208565b610c51906107db565b90565b610c5d81610c48565b03610c6457565b600080fd5b90503590610c7682610c54565b565b9091606082840312610cae57610cab610c948460008501610c69565b93610ca2816020860161082c565b9360400161058b565b90565b61020d565b34610ce257610ccc610cc6366004610c78565b91612af0565b610cd4610202565b80610cde816103d8565b0390f35b610208565b34610d1557610cff610cfa36600461059a565b612bff565b610d07610202565b80610d11816103d8565b0390f35b610208565b34610d4957610d33610d2d366004610c78565b91612cc4565b610d3b610202565b80610d45816103d8565b0390f35b610208565b90565b610d65610d60610d6a92610d4e565b610349565b6102bf565b90565b610d78612710610d51565b90565b610d83610d6d565b90565b34610db657610d96366004610212565b610db2610da1610d7b565b610da9610202565b918291826102cf565b0390f35b610208565b60018060a01b031690565b610dd6906008610ddb9302610222565b610dbb565b90565b90610de99154610dc6565b90565b610df96004600090610dde565b90565b610e0590610368565b90565b610e1190610dfc565b9052565b9190610e2990600060208501940190610e08565b565b34610e5b57610e3b366004610212565b610e57610e46610dec565b610e4e610202565b91829182610e15565b0390f35b610208565b9190604083820312610e895780610e7d610e869260008601610808565b9360200161058b565b90565b61020d565b34610ebd57610ea7610ea1366004610e60565b90612daa565b610eaf610202565b80610eb9816103d8565b0390f35b610208565b610ecb81610262565b03610ed257565b600080fd5b90503590610ee482610ec2565b565b919060a083820312610f3857610eff8160008501610808565b92610f0d826020830161082c565b92610f35610f1e846040850161082c565b93610f2c8160608601610ed7565b9360800161058b565b90565b61020d565b34610f6f57610f59610f50366004610ee6565b93929092612f09565b610f61610202565b80610f6b816103d8565b0390f35b610208565b60018060a01b031690565b610f8f906008610f949302610222565b610f74565b90565b90610fa29154610f7f565b90565b610fb26006600090610f97565b90565b610fbe90610368565b90565b610fca90610fb5565b9052565b9190610fe290600060208501940190610fc1565b565b3461101457610ff4366004610212565b611010610fff610fa5565b611007610202565b91829182610fce565b0390f35b610208565b60018060a01b031690565b6110349060086110399302610222565b611019565b90565b906110479154611024565b90565b611057600760009061103c565b90565b61106390610368565b90565b61106f9061105a565b9052565b919061108790600060208501940190611066565b565b346110b957611099366004610212565b6110b56110a461104a565b6110ac610202565b91829182611073565b0390f35b610208565b346110ec576110d66110d136600461059a565b612f18565b6110de610202565b806110e8816103d8565b0390f35b610208565b634e487b7160e01b600052603260045260246000fd5b5490565b600052602060002090565b61111f81611107565b82101561113a5761113160019161110b565b91020190600090565b6110f1565b60018060a01b031690565b61115a90600861115f9302610222565b61113f565b90565b9061116d915461114a565b90565b600961117b81611107565b821015611198576111959161118f91611116565b90611162565b90565b600080fd5b6111a690610368565b90565b6111b29061119d565b9052565b91906111ca906000602085019401906111a9565b565b346111fc576111f86111e76111e236600461059a565b611170565b6111ef610202565b918291826111b6565b0390f35b610208565b346112305761121a611214366004610e60565b9061307e565b611222610202565b8061122c816103d8565b0390f35b610208565b9060208282031261124f5761124c9160000161082c565b90565b61020d565b346112825761126c611267366004611235565b6130f8565b611274610202565b8061127e816103d8565b0390f35b610208565b7f000000000000000000000000000000000000000000000000000000000000000090565b6112b490610368565b90565b6112c0906112ab565b9052565b91906112d8906000602085019401906112b7565b565b3461130a576112ea366004610212565b6113066112f5611287565b6112fd610202565b918291826112c4565b0390f35b610208565b600080fd5b600090565b90565b61133061132b61133592611319565b610349565b6102bf565b90565b600080fd5b60e01b90565b9050519061135082610817565b565b909291926113676113628261089e565b610889565b93818552602080860192028301928184116113a457915b83831061138b5750505050565b602080916113998486611343565b81520192019161137e565b6108bb565b9080601f830112156113c7578160206113c493519101611352565b90565b61083b565b906020828203126113fd57600082015167ffffffffffffffff81116113f8576113f592016113a9565b90565b610571565b61020d565b61140a610202565b3d6000823e3d90fd5b5190565b600161142391016102bf565b90565b60001c90565b61143861143d91611426565b610736565b90565b61144a905461142c565b90565b9061145782611413565b811015611468576020809102010190565b6110f1565b61147790516107db565b90565b6114839061034c565b90565b61148f9061147a565b90565b9050519061149f82610576565b565b906020828203126114bb576114b891600001611492565b90565b61020d565b6114c990610368565b90565b6114d5906114c0565b9052565b91906114ed906000602085019401906114cc565b565b634e487b7160e01b600052601160045260246000fd5b61151461151a919392936102bf565b926102bf565b820180921161152557565b6114ef565b6115339061034c565b90565b61153f9061152a565b90565b61154b90610368565b90565b61155a61155f91611426565b610dbb565b90565b61156c905461154e565b90565b61157e611584919392936102bf565b926102bf565b916115908382026102bf565b92818404149015171561159f57565b6114ef565b6115b06115b591611426565b610ba3565b90565b6115c290546115a4565b90565b6115d46115da919392936102bf565b926102bf565b82039182116115e557565b6114ef565b634e487b7160e01b600052601260045260246000fd5b61160c611612916102bf565b916102bf565b90811561161d570490565b6115ea565b61162a611314565b50611635600061131c565b9061167a60006116647f00000000000000000000000000000000000000000000000000000000000000006112ab565b63b4e8a6c490611672610202565b93849261133d565b8252818061168a600482016103d8565b03915afa908115611a7e57600091611a5b575b506116a781611413565b916116b0611314565b935b846116c56116bf866102bf565b916102bf565b10156117875761172660206116e26116dd6008611440565b610777565b63842126359061171b6117066117016116fc8a8d9061144d565b61146d565b611486565b9261170f610202565b9586948593849361133d565b8352600483016114d9565b03915afa80156117825761174c9261174692600092611752575b50611505565b94611417565b936116b2565b61177491925060203d811161177b575b61176c8183610860565b8101906114a1565b9038611740565b503d611762565b611402565b92509250506117e060206117ca6117c56117c07f0000000000000000000000000000000000000000000000000000000000000000610ae7565b611536565b611542565b6318160ddd906117d8610202565b93849261133d565b825281806117f0600482016103d8565b03915afa908115611a5657600091611a28575b50611817611811600061131c565b916102bf565b1460001461182d575061182a600061131c565b90565b61185a602061184461183f6004611562565b610dfc565b635257b56690611852610202565b93849261133d565b8252818061186a600482016103d8565b03915afa8015611a23576118bc9261188a926000926119f3575b5061156f565b611892610d6d565b60206118a66118a160056115b8565b610be4565b63a330f5da906118b4610202565b95869261133d565b825281806118cc600482016103d8565b03915afa9182156119ee576118f4611908936118fa93611959966000926119be575b506115c5565b9061156f565b611902610d6d565b90611600565b602061194361193e6119397f0000000000000000000000000000000000000000000000000000000000000000610ae7565b611536565b611542565b6318160ddd90611951610202565b94859261133d565b82528180611969600482016103d8565b03915afa9081156119b95761198692600092611989575b50611600565b90565b6119ab91925060203d81116119b2575b6119a38183610860565b8101906114a1565b9038611980565b503d611999565b611402565b6119e091925060203d81116119e7575b6119d88183610860565b8101906114a1565b90386118ee565b503d6119ce565b611402565b611a1591925060203d8111611a1c575b611a0d8183610860565b8101906114a1565b9038611884565b503d611a03565b611402565b611a49915060203d8111611a4f575b611a418183610860565b8101906114a1565b38611803565b503d611a37565b611402565b611a7891503d806000833e611a708183610860565b8101906113cc565b3861169d565b611402565b611a8b6131a9565b611a93611aad565b611a9b613234565b565b6000910312611aa857565b61020d565b611ab5613248565b611ade7f0000000000000000000000000000000000000000000000000000000000000000610ae7565b6351cff8d9611aeb613366565b823b15611b6857611b1c92611b1160008094611b05610202565b9687958694859361133d565b835260048301610b58565b03925af18015611b6357611b36575b50611b34613419565b565b611b569060003d8111611b5c575b611b4e8183610860565b810190611a9d565b38611b2b565b503d611b44565b611402565b611338565b611b75611a83565b565b611b7f613a7d565b611b87612069565b565b60a01c90565b611b9b611ba091611b89565b610226565b90565b611bad9054611b8f565b90565b611bb9906107db565b90565b611bc581611bb0565b03611bcc57565b600080fd5b90505190611bde82611bbc565b565b90602082820312611bfa57611bf791600001611bd1565b90565b61020d565b60001b90565b90611c1660018060a01b0391611bff565b9181191691161790565b611c299061034c565b90565b611c3590611c20565b90565b90565b90611c50611c4b611c5792611c2c565b611c38565b8254611c05565b9055565b611c64906107db565b90565b611c7081611c5b565b03611c7757565b600080fd5b90505190611c8982611c67565b565b90602082820312611ca557611ca291600001611c7c565b90565b61020d565b611cb39061034c565b90565b611cbf90611caa565b90565b90565b90611cda611cd5611ce192611cb6565b611cc2565b8254611c05565b9055565b611cee906107db565b90565b611cfa81611ce5565b03611d0157565b600080fd5b90505190611d1382611cf1565b565b90602082820312611d2f57611d2c91600001611d06565b90565b61020d565b611d3d9061034c565b90565b611d4990611d34565b90565b90565b90611d64611d5f611d6b92611d40565b611d4c565b8254611c05565b9055565b611d78906107db565b90565b611d8481611d6f565b03611d8b57565b600080fd5b90505190611d9d82611d7b565b565b90602082820312611db957611db691600001611d90565b90565b61020d565b611dc79061034c565b90565b611dd390611dbe565b90565b90565b90611dee611de9611df592611dca565b611dd6565b8254611c05565b9055565b611e02906107db565b90565b611e0e81611df9565b03611e1557565b600080fd5b90505190611e2782611e05565b565b90602082820312611e4357611e4091600001611e1a565b90565b61020d565b611e519061034c565b90565b611e5d90611e48565b90565b90565b90611e78611e73611e7f92611e54565b611e60565b8254611c05565b9055565b611e8c906107db565b90565b611e9881611e83565b03611e9f57565b600080fd5b90505190611eb182611e8f565b565b90602082820312611ecd57611eca91600001611ea4565b90565b61020d565b611edb9061034c565b90565b611ee790611ed2565b90565b90565b90611f02611efd611f0992611ede565b611eea565b8254611c05565b9055565b611f16906107db565b90565b611f2281611f0d565b03611f2957565b600080fd5b90505190611f3b82611f19565b565b90602082820312611f5757611f5491600001611f2e565b90565b61020d565b611f659061034c565b90565b611f7190611f5c565b90565b90565b90611f8c611f87611f9392611f68565b611f74565b8254611c05565b9055565b611fa3611fa891611426565b610411565b90565b611fb59054611f97565b90565b611fc4611fc991611426565b6105ec565b90565b611fd69054611fb8565b90565b611fe5611fea91611426565b610f74565b90565b611ff79054611fd9565b90565b61200661200b91611426565b611019565b90565b6120189054611ffa565b90565b60a01b90565b9061203060ff60a01b9161201b565b9181191691161790565b61204390610262565b90565b90565b9061205e6120596120659261203a565b612046565b8254612021565b9055565b612073600a611ba3565b6125be576120bb60206120a57f0000000000000000000000000000000000000000000000000000000000000000610374565b633a642f7e906120b3610202565b93849261133d565b825281806120cb600482016103d8565b03915afa80156125b9576120e99160009161258b575b506002611c3b565b61212d60206121177f0000000000000000000000000000000000000000000000000000000000000000610374565b63579c54c090612125610202565b93849261133d565b8252818061213d600482016103d8565b03915afa80156125865761215b91600091612558575b506003611cc5565b61219f60206121897f0000000000000000000000000000000000000000000000000000000000000000610374565b6361f04d7590612197610202565b93849261133d565b825281806121af600482016103d8565b03915afa8015612553576121cd91600091612525575b506008611d4f565b61221160206121fb7f0000000000000000000000000000000000000000000000000000000000000000610374565b63a8fdfb1190612209610202565b93849261133d565b82528180612221600482016103d8565b03915afa80156125205761223f916000916124f2575b506004611dd9565b612283602061226d7f0000000000000000000000000000000000000000000000000000000000000000610374565b638e0bae7f9061227b610202565b93849261133d565b82528180612293600482016103d8565b03915afa80156124ed576122b1916000916124bf575b506005611e63565b6122f560206122df7f0000000000000000000000000000000000000000000000000000000000000000610374565b63cbfd73d5906122ed610202565b93849261133d565b82528180612305600482016103d8565b03915afa80156124ba576123239160009161248c575b506006611eed565b61236760206123517f0000000000000000000000000000000000000000000000000000000000000000610374565b63cc5005969061235f610202565b93849261133d565b82528180612377600482016103d8565b03915afa80156124875761239591600091612459575b506007611f77565b6123af6123aa6123a56002611fab565b610452565b613ad2565b6123c96123c46123bf6003611fcc565b61062d565b613ad2565b6123e36123de6123d96008611440565b610777565b613ad2565b6123fd6123f86123f36004611562565b610dfc565b613ad2565b61241761241261240d60056115b8565b610be4565b613ad2565b61243161242c6124276006611fed565b610fb5565b613ad2565b61244b612446612441600761200e565b61105a565b613ad2565b6124576001600a612049565b565b61247a915060203d8111612480575b6124728183610860565b810190611f3d565b3861238d565b503d612468565b611402565b6124ad915060203d81116124b3575b6124a58183610860565b810190611eb3565b3861231b565b503d61249b565b611402565b6124e0915060203d81116124e6575b6124d88183610860565b810190611e29565b386122a9565b503d6124ce565b611402565b612513915060203d8111612519575b61250b8183610860565b810190611d9f565b38612237565b503d612501565b611402565b612546915060203d811161254c575b61253e8183610860565b810190611d15565b386121c5565b503d612534565b611402565b612579915060203d811161257f575b6125718183610860565b810190611c8b565b38612153565b503d612567565b611402565b6125ac915060203d81116125b2575b6125a48183610860565b810190611be0565b386120e1565b503d61259a565b611402565b6125c6610202565b62dc149f60e41b8152806125dc600482016103d8565b0390fd5b6125e8611b77565b565b6125fb906125f66131a9565b612638565b612603613234565b565b60409061262f612636949695939661262560608401986000850190610b4b565b6020830190610b4b565b01906102c2565b565b612640613248565b6126697f0000000000000000000000000000000000000000000000000000000000000000610ae7565b638340f54990612677613366565b90612680613366565b9392813b156126ff5760006126a8916126b3829661269c610202565b9889978896879561133d565b855260048501612605565b03925af180156126fa576126cd575b506126cb613419565b565b6126ed9060003d81116126f3575b6126e58183610860565b810190611a9d565b386126c2565b503d6126db565b611402565b611338565b61270d906125ea565b565b906127249493929161271f6131a9565b61272e565b61272c613234565b565b9392919061274461273f6003611fcc565b61062d565b61275d612757612752613366565b6107db565b916107db565b0361276d5761276b946128ee565b565b612796612778613366565b612780610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b60209181520190565b60200190565b6127b2906107db565b9052565b906127c3816020936127a9565b0190565b60200190565b906127ea6127e46127dd84611413565b809361279a565b926127a3565b9060005b8181106127fb5750505090565b90919261281461280e60019286516127b6565b946127c7565b91019190916127ee565b5190565b60209181520190565b60200190565b61283a906102bf565b9052565b9061284b81602093612831565b0190565b60200190565b9061287261286c6128658461281e565b8093612822565b9261282b565b9060005b8181106128835750505090565b90919261289c612896600192865161283e565b9461284f565b9101919091612876565b9493916128ec936128d66060936128e4936128c960808b019260008c0190610b4b565b89820360208b01526127cd565b908782036040890152612855565b940190610b4b565b565b6128fb90949193946114c0565b90637ce6900193929490823b1561298357600094612937869261292c94612920610202565b998a988997889661133d565b8652600486016128a6565b03925af1801561297e57612951575b5061294f613419565b565b6129719060003d8111612977575b6129698183610860565b810190611a9d565b38612946565b503d61295f565b611402565b611338565b906129959493929161270f565b565b61299f613a7d565b6129a76129d1565b565b6129bd6129b86129c292611319565b610349565b61033e565b90565b6129ce906129a9565b90565b6129e36129de60006129c5565b613b46565b565b6129ed612997565b565b600090565b60018060a01b031690565b612a0b612a1091611426565b6129f4565b90565b612a1d90546129ff565b90565b612a286129ef565b50612a336000612a13565b90565b90612a499291612a446131a9565b612a53565b612a51613234565b565b612a5c9061119d565b9063da2c91dc91612a6b613366565b919392813b15612aeb576000612a9491612a9f8296612a88610202565b9889978896879561133d565b855260048501612605565b03925af18015612ae657612ab9575b50612ab7613419565b565b612ad99060003d8111612adf575b612ad18183610860565b810190611a9d565b38612aae565b503d612ac7565b611402565b611338565b90612afb9291612a36565b565b612b0e90612b096131a9565b612b3c565b612b16613234565b565b916020612b3a929493612b3360408201966000830190610b4b565b01906102c2565b565b612b44613248565b612b6d7f00000000000000000000000000000000000000000000000000000000000000006104da565b9063410085df90612b7c613366565b9092803b15612bfa57612ba360008094612bae612b97610202565b9788968795869461133d565b845260048401612b18565b03925af18015612bf557612bc8575b50612bc6613419565b565b612be89060003d8111612bee575b612be08183610860565b810190611a9d565b38612bbd565b503d612bd6565b611402565b611338565b612c0890612afd565b565b90612c1d9291612c186131a9565b612c27565b612c25613234565b565b612c309061119d565b9063f238537a91612c3f613366565b919392813b15612cbf576000612c6891612c738296612c5c610202565b9889978896879561133d565b855260048501612605565b03925af18015612cba57612c8d575b50612c8b613419565b565b612cad9060003d8111612cb3575b612ca58183610860565b810190611a9d565b38612c82565b503d612c9b565b611402565b611338565b90612ccf9291612c0a565b565b90612ce391612cde6131a9565b612d1b565b612ceb613234565b565b9190604083820312612d165780612d0a612d139260008601611492565b93602001611492565b90565b61020d565b612d266040916114c0565b91638a1bdb5492612d536000612d3a613366565b9395612d5e612d47610202565b9788968795869461133d565b845260048401612b18565b03925af18015612da557612d78575b50612d76613419565b565b612d989060403d8111612d9e575b612d908183610860565b810190612ced565b50612d6d565b503d612d86565b611402565b90612db491612cd1565b565b90612dcb94939291612dc66131a9565b612dd5565b612dd3613234565b565b93929190612deb612de66002611fab565b610452565b612e04612dfe612df9613366565b6107db565b916107db565b03612e1457612e1294612e80565b565b612e3d612e1f613366565b612e27610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b612e77612e7e94612e6d606094989795612e63608086019a6000870190610b4b565b6020850190610b4b565b6040830190610267565b01906102c2565b565b60006020949592612ebe612e96612eb3946114c0565b9463cd0211eb929698612ea7610202565b998a988997889661133d565b865260048601612e41565b03925af18015612f0457612ed8575b50612ed6613419565b565b612ef89060203d8111612efd575b612ef08183610860565b8101906114a1565b612ecd565b503d612ee6565b611402565b90612f1694939291612db6565b565b612f417f00000000000000000000000000000000000000000000000000000000000000006104da565b906347e7ef2490612f50613366565b9092803b15612fce57612f7760008094612f82612f6b610202565b9788968795869461133d565b845260048401612b18565b03925af18015612fc957612f9c575b50612f9a613419565b565b612fbc9060003d8111612fc2575b612fb48183610860565b810190611a9d565b38612f91565b503d612faa565b611402565b611338565b90612fe591612fe06131a9565b612fef565b612fed613234565b565b612ffa6040916114c0565b91634b8a352992613027600061300e613366565b939561303261301b610202565b9788968795869461133d565b845260048401612b18565b03925af180156130795761304c575b5061304a613419565b565b61306c9060403d8111613072575b6130648183610860565b810190612ced565b50613041565b503d61305a565b611402565b9061308891612fd3565b565b61309b90613096613a7d565b61309d565b565b806130b96130b36130ae60006129c5565b6107db565b916107db565b146130c9576130c790613b46565b565b6130f46130d660006129c5565b6130de610202565b91829163b20f76e360e01b835260048301610b58565b0390fd5b6131019061308a565b565b90565b61311261311791611426565b613103565b90565b6131249054613106565b90565b90565b61313e61313961314392613127565b610349565b6102bf565b90565b613150600261312a565b90565b9061316060001991611bff565b9181191691161790565b61317e613179613183926102bf565b610349565b6102bf565b90565b90565b9061319e6131996131a59261316a565b613186565b8254613153565b9055565b6131b3600161311a565b6131cc6131c66131c1613146565b6102bf565b916102bf565b146131e5576131e36131dc613146565b6001613189565b565b6131ed610202565b6306fda65d60e31b815280613204600482016103d8565b0390fd5b90565b61321f61321a61322492613208565b610349565b6102bf565b90565b613231600161320b565b90565b61324661323f613227565b6001613189565b565b61325a6132556006611fed565b610fb5565b633ccfd60b90803b156133615761327e91600091613276610202565b93849261133d565b825281838161328f600482016103d8565b03925af1801561335c5761332f575b506132b16132ac60056115b8565b610be4565b63e4fc6b6d90803b1561332a576132d5916000916132cd610202565b93849261133d565b82528183816132e6600482016103d8565b03925af18015613325576132f8575b50565b6133189060003d811161331e575b6133108183610860565b810190611a9d565b386132f5565b503d613306565b611402565b611338565b61334f9060003d8111613355575b6133478183610860565b810190611a9d565b3861329e565b503d61333d565b611402565b611338565b61336e6129ef565b503390565b61337f61338491611426565b610691565b90565b6133919054613373565b90565b9160206133b69294936133af604082019660008301906114cc565b01906102c2565b565b905051906133c582610ec2565b565b906020828203126133e1576133de916000016133b8565b90565b61020d565b6040906134106134179496959396613406606084019860008501906114cc565b60208301906102c2565b01906102c2565b565b613446602061343061342b600a613387565b6106d2565b63d5a377869061343e610202565b93849261133d565b82528180613456600482016103d8565b03915afa908115613a7857600091613a4a575b50613474600061131c565b9161347f6009611107565b91613488611314565b935b8461349d613497866102bf565b916102bf565b101561354c576134db60206134c56134c06134ba60098a90611116565b90611162565b61119d565b634a8622ea906134d3610202565b93849261133d565b825281806134eb600482016103d8565b03915afa8015613547576135119261350b92600092613517575b50611505565b94611417565b9361348a565b61353991925060203d8111613540575b6135318183610860565b8101906114a1565b9038613505565b503d613527565b611402565b935090915061355b600061131c565b928161356f613569836102bf565b916102bf565b10613a37575b50506135bb60006135a57f00000000000000000000000000000000000000000000000000000000000000006112ab565b63b4e8a6c4906135b3610202565b93849261133d565b825281806135cb600482016103d8565b03915afa908115613a3257600091613a0f575b50916135e983611413565b916135f2611314565b5b80613606613600866102bf565b916102bf565b1015613a0857613667602061362361361e6008611440565b610777565b63842126359061365c61364761364261363d8c899061144d565b61146d565b611486565b92613650610202565b9586948593849361133d565b8352600483016114d9565b03915afa8015613a0357613685916000916139d5575b508490611505565b906136e761369b613696600761200e565b61105a565b63f8392609906136bc6136b76136b28b879061144d565b61146d565b611486565b9060206136d16136cc6004611562565b610dfc565b6383cf078e906136df610202565b96879261133d565b825281806136f7600482016103d8565b03915afa9384156139d0576000946139a0575b50803b1561399b576137306000809461373b613724610202565b9788968795869461133d565b845260048401613394565b03925af1801561399657613969575b5061379e602061376261375d600761200e565b61105a565b63266f803a9061379361377e6137798c889061144d565b61146d565b92613787610202565b9586948593849361133d565b835260048301610b58565b03915afa8015613964576137bb91600091613936575b5015610262565b8061388d575b6137d5575b6137d09150611417565b6135f3565b6137e76137e2600761200e565b61105a565b636a65092e906138086138036137fe8a869061144d565b61146d565b611486565b908492813b156138885760006138319161383c8296613825610202565b998a978896879561133d565b8552600485016133e6565b03925af1918215613883576137d092613856575b506137c6565b6138769060003d811161387c575b61386e8183610860565b810190611a9d565b38613850565b503d613864565b611402565b611338565b506138e160206138a56138a0600761200e565b61105a565b630a7af47c906138d66138c16138bc8c889061144d565b61146d565b926138ca610202565b9586948593849361133d565b835260048301610b58565b03915afa8015613931576138fe91600091613903575b5015610262565b6137c1565b613924915060203d811161392a575b61391c8183610860565b8101906133c7565b386138f7565b503d613912565b611402565b613957915060203d811161395d575b61394f8183610860565b8101906133c7565b386137b4565b503d613945565b611402565b6139899060003d811161398f575b6139818183610860565b810190611a9d565b3861374a565b503d613977565b611402565b611338565b6139c291945060203d81116139c9575b6139ba8183610860565b8101906114a1565b923861370a565b503d6139b0565b611402565b6139f6915060203d81116139fc575b6139ee8183610860565b8101906114a1565b3861367d565b503d6139e4565b611402565b5092505050565b613a2c91503d806000833e613a248183610860565b8101906113cc565b386135de565b611402565b613a429293506115c5565b903880613575565b613a6b915060203d8111613a71575b613a638183610860565b8101906114a1565b38613469565b503d613a59565b611402565b613a85612a20565b613a9e613a98613a93613366565b6107db565b916107db565b03613aa557565b613ace613ab0613366565b613ab8610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b613aed613ae7613ae260006129c5565b6107db565b916107db565b14613af457565b613afc610202565b63d92e233d60e01b815280613b13600482016103d8565b0390fd5b613b2090610368565b90565b90565b90613b3b613b36613b4292613b17565b613b23565b8254611c05565b9055565b613b506000612a13565b613b5b826000613b26565b90613b8f613b897f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093613b17565b91613b17565b91613b98610202565b80613ba2816103d8565b0390a356fea264697066735822122072fd3ce566b7efed80c3d99815617b404c1f8d3b445e75a26e9c5e8fd2049e5364736f6c634300081800330000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c
Deployed Bytecode
0x60806040526004361015610013575b61130f565b61001e6000356101fc565b8062b26712146101f75780631d88c3ac146101f257806325d3d7cf146101ed57806330452695146101e85780633a642f7e146101e357806340695363146101de5780634f01f6f1146101d957806351bc3b70146101d4578063579c54c0146101cf57806360f7237b146101ca57806361f04d75146101c5578063624a8cb3146101c0578063715018a6146101bb57806374453d1b146101b65780638da5cb5b146101b15780638e0bae7f146101ac5780638eda7e69146101a7578063945e3b11146101a25780639788fe1c1461019d5780639860a44e14610198578063a8fdfb1114610193578063b0d95da11461018e578063c43f975514610189578063cbfd73d514610184578063cc5005961461017f578063dc7d73231461017a578063ed987a0814610175578063ee796c9614610170578063f2fde38b1461016b5763fbfa77cf0361000e576112da565b611254565b611201565b6111cc565b6110be565b611089565b610fe4565b610f3d565b610e8e565b610e2b565b610d86565b610d1a565b610ce7565b610cb3565b610c13565b610b6e565b610b16565b610a90565b610a59565b6107a6565b610701565b61065c565b6105b9565b61053e565b610509565b610481565b6103de565b6103a3565b6102e5565b61028a565b60e01c90565b60405190565b600080fd5b600080fd5b600091031261021d57565b61020d565b1c90565b60ff1690565b61023c9060086102419302610222565b610226565b90565b9061024f915461022c565b90565b61025f600a601490610244565b90565b151590565b61027090610262565b9052565b919061028890600060208501940190610267565b565b346102ba5761029a366004610212565b6102b66102a5610252565b6102ad610202565b91829182610274565b0390f35b610208565b90565b6102cb906102bf565b9052565b91906102e3906000602085019401906102c2565b565b34610315576102f5366004610212565b610311610300611622565b610308610202565b918291826102cf565b0390f35b610208565b7f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c90565b60018060a01b031690565b90565b61036061035b6103659261033e565b610349565b61033e565b90565b6103719061034c565b90565b61037d90610368565b90565b61038990610374565b9052565b91906103a190600060208501940190610380565b565b346103d3576103b3366004610212565b6103cf6103be61031a565b6103c6610202565b9182918261038d565b0390f35b610208565b60000190565b3461040c576103ee366004610212565b6103f6611b6d565b6103fe610202565b80610408816103d8565b0390f35b610208565b60018060a01b031690565b61042c9060086104319302610222565b610411565b90565b9061043f915461041c565b90565b61044f6002600090610434565b90565b61045b90610368565b90565b61046790610452565b9052565b919061047f9060006020850194019061045e565b565b346104b157610491366004610212565b6104ad61049c610442565b6104a4610202565b9182918261046b565b0390f35b610208565b7f000000000000000000000000b8c30cf1aa46b4e8ee8d008a0f2f763b3d5bac0e90565b6104e390610368565b90565b6104ef906104da565b9052565b9190610507906000602085019401906104e6565b565b3461053957610519366004610212565b6105356105246104b6565b61052c610202565b918291826104f3565b0390f35b610208565b3461056c5761054e366004610212565b6105566125e0565b61055e610202565b80610568816103d8565b0390f35b610208565b600080fd5b61057f816102bf565b0361058657565b600080fd5b9050359061059882610576565b565b906020828203126105b4576105b19160000161058b565b90565b61020d565b346105e7576105d16105cc36600461059a565b612704565b6105d9610202565b806105e3816103d8565b0390f35b610208565b60018060a01b031690565b61060790600861060c9302610222565b6105ec565b90565b9061061a91546105f7565b90565b61062a600360009061060f565b90565b61063690610368565b90565b6106429061062d565b9052565b919061065a90600060208501940190610639565b565b3461068c5761066c366004610212565b61068861067761061d565b61067f610202565b91829182610646565b0390f35b610208565b60018060a01b031690565b6106ac9060086106b19302610222565b610691565b90565b906106bf915461069c565b90565b6106cf600a6000906106b4565b90565b6106db90610368565b90565b6106e7906106d2565b9052565b91906106ff906000602085019401906106de565b565b3461073157610711366004610212565b61072d61071c6106c2565b610724610202565b918291826106eb565b0390f35b610208565b60018060a01b031690565b6107519060086107569302610222565b610736565b90565b906107649154610741565b90565b6107746008600090610759565b90565b61078090610368565b90565b61078c90610777565b9052565b91906107a490600060208501940190610783565b565b346107d6576107b6366004610212565b6107d26107c1610767565b6107c9610202565b91829182610790565b0390f35b610208565b6107e49061033e565b90565b6107f0906107db565b90565b6107fc816107e7565b0361080357565b600080fd5b90503590610815826107f3565b565b610820816107db565b0361082757565b600080fd5b9050359061083982610817565b565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061086a90610840565b810190811067ffffffffffffffff82111761088457604052565b61084a565b9061089c610895610202565b9283610860565b565b67ffffffffffffffff81116108b65760208091020190565b61084a565b600080fd5b909291926108d56108d08261089e565b610889565b938185526020808601920283019281841161091257915b8383106108f95750505050565b60208091610907848661082c565b8152019201916108ec565b6108bb565b9080601f8301121561093557816020610932933591016108c0565b90565b61083b565b67ffffffffffffffff81116109525760208091020190565b61084a565b9092919261096c6109678261093a565b610889565b93818552602080860192028301928184116109a957915b8383106109905750505050565b6020809161099e848661058b565b815201920191610983565b6108bb565b9080601f830112156109cc578160206109c993359101610957565b90565b61083b565b919060a083820312610a54576109ea8160008501610808565b926109f8826020830161082c565b92604082013567ffffffffffffffff8111610a4f5783610a19918401610917565b9260608301359067ffffffffffffffff8211610a4a57610a3e81610a479386016109ae565b9360800161082c565b90565b610571565b610571565b61020d565b34610a8b57610a75610a6c3660046109d1565b93929092612988565b610a7d610202565b80610a87816103d8565b0390f35b610208565b34610abe57610aa0366004610212565b610aa86129e5565b610ab0610202565b80610aba816103d8565b0390f35b610208565b7f000000000000000000000000a0b0cbffed77e57e946fb1fb875b28edd0d0cc6d90565b610af090610368565b90565b610afc90610ae7565b9052565b9190610b1490600060208501940190610af3565b565b34610b4657610b26366004610212565b610b42610b31610ac3565b610b39610202565b91829182610b00565b0390f35b610208565b610b54906107db565b9052565b9190610b6c90600060208501940190610b4b565b565b34610b9e57610b7e366004610212565b610b9a610b89612a20565b610b91610202565b91829182610b58565b0390f35b610208565b60018060a01b031690565b610bbe906008610bc39302610222565b610ba3565b90565b90610bd19154610bae565b90565b610be16005600090610bc6565b90565b610bed90610368565b90565b610bf990610be4565b9052565b9190610c1190600060208501940190610bf0565b565b34610c4357610c23366004610212565b610c3f610c2e610bd4565b610c36610202565b91829182610bfd565b0390f35b610208565b610c51906107db565b90565b610c5d81610c48565b03610c6457565b600080fd5b90503590610c7682610c54565b565b9091606082840312610cae57610cab610c948460008501610c69565b93610ca2816020860161082c565b9360400161058b565b90565b61020d565b34610ce257610ccc610cc6366004610c78565b91612af0565b610cd4610202565b80610cde816103d8565b0390f35b610208565b34610d1557610cff610cfa36600461059a565b612bff565b610d07610202565b80610d11816103d8565b0390f35b610208565b34610d4957610d33610d2d366004610c78565b91612cc4565b610d3b610202565b80610d45816103d8565b0390f35b610208565b90565b610d65610d60610d6a92610d4e565b610349565b6102bf565b90565b610d78612710610d51565b90565b610d83610d6d565b90565b34610db657610d96366004610212565b610db2610da1610d7b565b610da9610202565b918291826102cf565b0390f35b610208565b60018060a01b031690565b610dd6906008610ddb9302610222565b610dbb565b90565b90610de99154610dc6565b90565b610df96004600090610dde565b90565b610e0590610368565b90565b610e1190610dfc565b9052565b9190610e2990600060208501940190610e08565b565b34610e5b57610e3b366004610212565b610e57610e46610dec565b610e4e610202565b91829182610e15565b0390f35b610208565b9190604083820312610e895780610e7d610e869260008601610808565b9360200161058b565b90565b61020d565b34610ebd57610ea7610ea1366004610e60565b90612daa565b610eaf610202565b80610eb9816103d8565b0390f35b610208565b610ecb81610262565b03610ed257565b600080fd5b90503590610ee482610ec2565b565b919060a083820312610f3857610eff8160008501610808565b92610f0d826020830161082c565b92610f35610f1e846040850161082c565b93610f2c8160608601610ed7565b9360800161058b565b90565b61020d565b34610f6f57610f59610f50366004610ee6565b93929092612f09565b610f61610202565b80610f6b816103d8565b0390f35b610208565b60018060a01b031690565b610f8f906008610f949302610222565b610f74565b90565b90610fa29154610f7f565b90565b610fb26006600090610f97565b90565b610fbe90610368565b90565b610fca90610fb5565b9052565b9190610fe290600060208501940190610fc1565b565b3461101457610ff4366004610212565b611010610fff610fa5565b611007610202565b91829182610fce565b0390f35b610208565b60018060a01b031690565b6110349060086110399302610222565b611019565b90565b906110479154611024565b90565b611057600760009061103c565b90565b61106390610368565b90565b61106f9061105a565b9052565b919061108790600060208501940190611066565b565b346110b957611099366004610212565b6110b56110a461104a565b6110ac610202565b91829182611073565b0390f35b610208565b346110ec576110d66110d136600461059a565b612f18565b6110de610202565b806110e8816103d8565b0390f35b610208565b634e487b7160e01b600052603260045260246000fd5b5490565b600052602060002090565b61111f81611107565b82101561113a5761113160019161110b565b91020190600090565b6110f1565b60018060a01b031690565b61115a90600861115f9302610222565b61113f565b90565b9061116d915461114a565b90565b600961117b81611107565b821015611198576111959161118f91611116565b90611162565b90565b600080fd5b6111a690610368565b90565b6111b29061119d565b9052565b91906111ca906000602085019401906111a9565b565b346111fc576111f86111e76111e236600461059a565b611170565b6111ef610202565b918291826111b6565b0390f35b610208565b346112305761121a611214366004610e60565b9061307e565b611222610202565b8061122c816103d8565b0390f35b610208565b9060208282031261124f5761124c9160000161082c565b90565b61020d565b346112825761126c611267366004611235565b6130f8565b611274610202565b8061127e816103d8565b0390f35b610208565b7f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf90565b6112b490610368565b90565b6112c0906112ab565b9052565b91906112d8906000602085019401906112b7565b565b3461130a576112ea366004610212565b6113066112f5611287565b6112fd610202565b918291826112c4565b0390f35b610208565b600080fd5b600090565b90565b61133061132b61133592611319565b610349565b6102bf565b90565b600080fd5b60e01b90565b9050519061135082610817565b565b909291926113676113628261089e565b610889565b93818552602080860192028301928184116113a457915b83831061138b5750505050565b602080916113998486611343565b81520192019161137e565b6108bb565b9080601f830112156113c7578160206113c493519101611352565b90565b61083b565b906020828203126113fd57600082015167ffffffffffffffff81116113f8576113f592016113a9565b90565b610571565b61020d565b61140a610202565b3d6000823e3d90fd5b5190565b600161142391016102bf565b90565b60001c90565b61143861143d91611426565b610736565b90565b61144a905461142c565b90565b9061145782611413565b811015611468576020809102010190565b6110f1565b61147790516107db565b90565b6114839061034c565b90565b61148f9061147a565b90565b9050519061149f82610576565b565b906020828203126114bb576114b891600001611492565b90565b61020d565b6114c990610368565b90565b6114d5906114c0565b9052565b91906114ed906000602085019401906114cc565b565b634e487b7160e01b600052601160045260246000fd5b61151461151a919392936102bf565b926102bf565b820180921161152557565b6114ef565b6115339061034c565b90565b61153f9061152a565b90565b61154b90610368565b90565b61155a61155f91611426565b610dbb565b90565b61156c905461154e565b90565b61157e611584919392936102bf565b926102bf565b916115908382026102bf565b92818404149015171561159f57565b6114ef565b6115b06115b591611426565b610ba3565b90565b6115c290546115a4565b90565b6115d46115da919392936102bf565b926102bf565b82039182116115e557565b6114ef565b634e487b7160e01b600052601260045260246000fd5b61160c611612916102bf565b916102bf565b90811561161d570490565b6115ea565b61162a611314565b50611635600061131c565b9061167a60006116647f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf6112ab565b63b4e8a6c490611672610202565b93849261133d565b8252818061168a600482016103d8565b03915afa908115611a7e57600091611a5b575b506116a781611413565b916116b0611314565b935b846116c56116bf866102bf565b916102bf565b10156117875761172660206116e26116dd6008611440565b610777565b63842126359061171b6117066117016116fc8a8d9061144d565b61146d565b611486565b9261170f610202565b9586948593849361133d565b8352600483016114d9565b03915afa80156117825761174c9261174692600092611752575b50611505565b94611417565b936116b2565b61177491925060203d811161177b575b61176c8183610860565b8101906114a1565b9038611740565b503d611762565b611402565b92509250506117e060206117ca6117c56117c07f000000000000000000000000a0b0cbffed77e57e946fb1fb875b28edd0d0cc6d610ae7565b611536565b611542565b6318160ddd906117d8610202565b93849261133d565b825281806117f0600482016103d8565b03915afa908115611a5657600091611a28575b50611817611811600061131c565b916102bf565b1460001461182d575061182a600061131c565b90565b61185a602061184461183f6004611562565b610dfc565b635257b56690611852610202565b93849261133d565b8252818061186a600482016103d8565b03915afa8015611a23576118bc9261188a926000926119f3575b5061156f565b611892610d6d565b60206118a66118a160056115b8565b610be4565b63a330f5da906118b4610202565b95869261133d565b825281806118cc600482016103d8565b03915afa9182156119ee576118f4611908936118fa93611959966000926119be575b506115c5565b9061156f565b611902610d6d565b90611600565b602061194361193e6119397f000000000000000000000000a0b0cbffed77e57e946fb1fb875b28edd0d0cc6d610ae7565b611536565b611542565b6318160ddd90611951610202565b94859261133d565b82528180611969600482016103d8565b03915afa9081156119b95761198692600092611989575b50611600565b90565b6119ab91925060203d81116119b2575b6119a38183610860565b8101906114a1565b9038611980565b503d611999565b611402565b6119e091925060203d81116119e7575b6119d88183610860565b8101906114a1565b90386118ee565b503d6119ce565b611402565b611a1591925060203d8111611a1c575b611a0d8183610860565b8101906114a1565b9038611884565b503d611a03565b611402565b611a49915060203d8111611a4f575b611a418183610860565b8101906114a1565b38611803565b503d611a37565b611402565b611a7891503d806000833e611a708183610860565b8101906113cc565b3861169d565b611402565b611a8b6131a9565b611a93611aad565b611a9b613234565b565b6000910312611aa857565b61020d565b611ab5613248565b611ade7f000000000000000000000000a0b0cbffed77e57e946fb1fb875b28edd0d0cc6d610ae7565b6351cff8d9611aeb613366565b823b15611b6857611b1c92611b1160008094611b05610202565b9687958694859361133d565b835260048301610b58565b03925af18015611b6357611b36575b50611b34613419565b565b611b569060003d8111611b5c575b611b4e8183610860565b810190611a9d565b38611b2b565b503d611b44565b611402565b611338565b611b75611a83565b565b611b7f613a7d565b611b87612069565b565b60a01c90565b611b9b611ba091611b89565b610226565b90565b611bad9054611b8f565b90565b611bb9906107db565b90565b611bc581611bb0565b03611bcc57565b600080fd5b90505190611bde82611bbc565b565b90602082820312611bfa57611bf791600001611bd1565b90565b61020d565b60001b90565b90611c1660018060a01b0391611bff565b9181191691161790565b611c299061034c565b90565b611c3590611c20565b90565b90565b90611c50611c4b611c5792611c2c565b611c38565b8254611c05565b9055565b611c64906107db565b90565b611c7081611c5b565b03611c7757565b600080fd5b90505190611c8982611c67565b565b90602082820312611ca557611ca291600001611c7c565b90565b61020d565b611cb39061034c565b90565b611cbf90611caa565b90565b90565b90611cda611cd5611ce192611cb6565b611cc2565b8254611c05565b9055565b611cee906107db565b90565b611cfa81611ce5565b03611d0157565b600080fd5b90505190611d1382611cf1565b565b90602082820312611d2f57611d2c91600001611d06565b90565b61020d565b611d3d9061034c565b90565b611d4990611d34565b90565b90565b90611d64611d5f611d6b92611d40565b611d4c565b8254611c05565b9055565b611d78906107db565b90565b611d8481611d6f565b03611d8b57565b600080fd5b90505190611d9d82611d7b565b565b90602082820312611db957611db691600001611d90565b90565b61020d565b611dc79061034c565b90565b611dd390611dbe565b90565b90565b90611dee611de9611df592611dca565b611dd6565b8254611c05565b9055565b611e02906107db565b90565b611e0e81611df9565b03611e1557565b600080fd5b90505190611e2782611e05565b565b90602082820312611e4357611e4091600001611e1a565b90565b61020d565b611e519061034c565b90565b611e5d90611e48565b90565b90565b90611e78611e73611e7f92611e54565b611e60565b8254611c05565b9055565b611e8c906107db565b90565b611e9881611e83565b03611e9f57565b600080fd5b90505190611eb182611e8f565b565b90602082820312611ecd57611eca91600001611ea4565b90565b61020d565b611edb9061034c565b90565b611ee790611ed2565b90565b90565b90611f02611efd611f0992611ede565b611eea565b8254611c05565b9055565b611f16906107db565b90565b611f2281611f0d565b03611f2957565b600080fd5b90505190611f3b82611f19565b565b90602082820312611f5757611f5491600001611f2e565b90565b61020d565b611f659061034c565b90565b611f7190611f5c565b90565b90565b90611f8c611f87611f9392611f68565b611f74565b8254611c05565b9055565b611fa3611fa891611426565b610411565b90565b611fb59054611f97565b90565b611fc4611fc991611426565b6105ec565b90565b611fd69054611fb8565b90565b611fe5611fea91611426565b610f74565b90565b611ff79054611fd9565b90565b61200661200b91611426565b611019565b90565b6120189054611ffa565b90565b60a01b90565b9061203060ff60a01b9161201b565b9181191691161790565b61204390610262565b90565b90565b9061205e6120596120659261203a565b612046565b8254612021565b9055565b612073600a611ba3565b6125be576120bb60206120a57f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b633a642f7e906120b3610202565b93849261133d565b825281806120cb600482016103d8565b03915afa80156125b9576120e99160009161258b575b506002611c3b565b61212d60206121177f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b63579c54c090612125610202565b93849261133d565b8252818061213d600482016103d8565b03915afa80156125865761215b91600091612558575b506003611cc5565b61219f60206121897f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b6361f04d7590612197610202565b93849261133d565b825281806121af600482016103d8565b03915afa8015612553576121cd91600091612525575b506008611d4f565b61221160206121fb7f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b63a8fdfb1190612209610202565b93849261133d565b82528180612221600482016103d8565b03915afa80156125205761223f916000916124f2575b506004611dd9565b612283602061226d7f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b638e0bae7f9061227b610202565b93849261133d565b82528180612293600482016103d8565b03915afa80156124ed576122b1916000916124bf575b506005611e63565b6122f560206122df7f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b63cbfd73d5906122ed610202565b93849261133d565b82528180612305600482016103d8565b03915afa80156124ba576123239160009161248c575b506006611eed565b61236760206123517f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c610374565b63cc5005969061235f610202565b93849261133d565b82528180612377600482016103d8565b03915afa80156124875761239591600091612459575b506007611f77565b6123af6123aa6123a56002611fab565b610452565b613ad2565b6123c96123c46123bf6003611fcc565b61062d565b613ad2565b6123e36123de6123d96008611440565b610777565b613ad2565b6123fd6123f86123f36004611562565b610dfc565b613ad2565b61241761241261240d60056115b8565b610be4565b613ad2565b61243161242c6124276006611fed565b610fb5565b613ad2565b61244b612446612441600761200e565b61105a565b613ad2565b6124576001600a612049565b565b61247a915060203d8111612480575b6124728183610860565b810190611f3d565b3861238d565b503d612468565b611402565b6124ad915060203d81116124b3575b6124a58183610860565b810190611eb3565b3861231b565b503d61249b565b611402565b6124e0915060203d81116124e6575b6124d88183610860565b810190611e29565b386122a9565b503d6124ce565b611402565b612513915060203d8111612519575b61250b8183610860565b810190611d9f565b38612237565b503d612501565b611402565b612546915060203d811161254c575b61253e8183610860565b810190611d15565b386121c5565b503d612534565b611402565b612579915060203d811161257f575b6125718183610860565b810190611c8b565b38612153565b503d612567565b611402565b6125ac915060203d81116125b2575b6125a48183610860565b810190611be0565b386120e1565b503d61259a565b611402565b6125c6610202565b62dc149f60e41b8152806125dc600482016103d8565b0390fd5b6125e8611b77565b565b6125fb906125f66131a9565b612638565b612603613234565b565b60409061262f612636949695939661262560608401986000850190610b4b565b6020830190610b4b565b01906102c2565b565b612640613248565b6126697f000000000000000000000000a0b0cbffed77e57e946fb1fb875b28edd0d0cc6d610ae7565b638340f54990612677613366565b90612680613366565b9392813b156126ff5760006126a8916126b3829661269c610202565b9889978896879561133d565b855260048501612605565b03925af180156126fa576126cd575b506126cb613419565b565b6126ed9060003d81116126f3575b6126e58183610860565b810190611a9d565b386126c2565b503d6126db565b611402565b611338565b61270d906125ea565b565b906127249493929161271f6131a9565b61272e565b61272c613234565b565b9392919061274461273f6003611fcc565b61062d565b61275d612757612752613366565b6107db565b916107db565b0361276d5761276b946128ee565b565b612796612778613366565b612780610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b60209181520190565b60200190565b6127b2906107db565b9052565b906127c3816020936127a9565b0190565b60200190565b906127ea6127e46127dd84611413565b809361279a565b926127a3565b9060005b8181106127fb5750505090565b90919261281461280e60019286516127b6565b946127c7565b91019190916127ee565b5190565b60209181520190565b60200190565b61283a906102bf565b9052565b9061284b81602093612831565b0190565b60200190565b9061287261286c6128658461281e565b8093612822565b9261282b565b9060005b8181106128835750505090565b90919261289c612896600192865161283e565b9461284f565b9101919091612876565b9493916128ec936128d66060936128e4936128c960808b019260008c0190610b4b565b89820360208b01526127cd565b908782036040890152612855565b940190610b4b565b565b6128fb90949193946114c0565b90637ce6900193929490823b1561298357600094612937869261292c94612920610202565b998a988997889661133d565b8652600486016128a6565b03925af1801561297e57612951575b5061294f613419565b565b6129719060003d8111612977575b6129698183610860565b810190611a9d565b38612946565b503d61295f565b611402565b611338565b906129959493929161270f565b565b61299f613a7d565b6129a76129d1565b565b6129bd6129b86129c292611319565b610349565b61033e565b90565b6129ce906129a9565b90565b6129e36129de60006129c5565b613b46565b565b6129ed612997565b565b600090565b60018060a01b031690565b612a0b612a1091611426565b6129f4565b90565b612a1d90546129ff565b90565b612a286129ef565b50612a336000612a13565b90565b90612a499291612a446131a9565b612a53565b612a51613234565b565b612a5c9061119d565b9063da2c91dc91612a6b613366565b919392813b15612aeb576000612a9491612a9f8296612a88610202565b9889978896879561133d565b855260048501612605565b03925af18015612ae657612ab9575b50612ab7613419565b565b612ad99060003d8111612adf575b612ad18183610860565b810190611a9d565b38612aae565b503d612ac7565b611402565b611338565b90612afb9291612a36565b565b612b0e90612b096131a9565b612b3c565b612b16613234565b565b916020612b3a929493612b3360408201966000830190610b4b565b01906102c2565b565b612b44613248565b612b6d7f000000000000000000000000b8c30cf1aa46b4e8ee8d008a0f2f763b3d5bac0e6104da565b9063410085df90612b7c613366565b9092803b15612bfa57612ba360008094612bae612b97610202565b9788968795869461133d565b845260048401612b18565b03925af18015612bf557612bc8575b50612bc6613419565b565b612be89060003d8111612bee575b612be08183610860565b810190611a9d565b38612bbd565b503d612bd6565b611402565b611338565b612c0890612afd565b565b90612c1d9291612c186131a9565b612c27565b612c25613234565b565b612c309061119d565b9063f238537a91612c3f613366565b919392813b15612cbf576000612c6891612c738296612c5c610202565b9889978896879561133d565b855260048501612605565b03925af18015612cba57612c8d575b50612c8b613419565b565b612cad9060003d8111612cb3575b612ca58183610860565b810190611a9d565b38612c82565b503d612c9b565b611402565b611338565b90612ccf9291612c0a565b565b90612ce391612cde6131a9565b612d1b565b612ceb613234565b565b9190604083820312612d165780612d0a612d139260008601611492565b93602001611492565b90565b61020d565b612d266040916114c0565b91638a1bdb5492612d536000612d3a613366565b9395612d5e612d47610202565b9788968795869461133d565b845260048401612b18565b03925af18015612da557612d78575b50612d76613419565b565b612d989060403d8111612d9e575b612d908183610860565b810190612ced565b50612d6d565b503d612d86565b611402565b90612db491612cd1565b565b90612dcb94939291612dc66131a9565b612dd5565b612dd3613234565b565b93929190612deb612de66002611fab565b610452565b612e04612dfe612df9613366565b6107db565b916107db565b03612e1457612e1294612e80565b565b612e3d612e1f613366565b612e27610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b612e77612e7e94612e6d606094989795612e63608086019a6000870190610b4b565b6020850190610b4b565b6040830190610267565b01906102c2565b565b60006020949592612ebe612e96612eb3946114c0565b9463cd0211eb929698612ea7610202565b998a988997889661133d565b865260048601612e41565b03925af18015612f0457612ed8575b50612ed6613419565b565b612ef89060203d8111612efd575b612ef08183610860565b8101906114a1565b612ecd565b503d612ee6565b611402565b90612f1694939291612db6565b565b612f417f000000000000000000000000b8c30cf1aa46b4e8ee8d008a0f2f763b3d5bac0e6104da565b906347e7ef2490612f50613366565b9092803b15612fce57612f7760008094612f82612f6b610202565b9788968795869461133d565b845260048401612b18565b03925af18015612fc957612f9c575b50612f9a613419565b565b612fbc9060003d8111612fc2575b612fb48183610860565b810190611a9d565b38612f91565b503d612faa565b611402565b611338565b90612fe591612fe06131a9565b612fef565b612fed613234565b565b612ffa6040916114c0565b91634b8a352992613027600061300e613366565b939561303261301b610202565b9788968795869461133d565b845260048401612b18565b03925af180156130795761304c575b5061304a613419565b565b61306c9060403d8111613072575b6130648183610860565b810190612ced565b50613041565b503d61305a565b611402565b9061308891612fd3565b565b61309b90613096613a7d565b61309d565b565b806130b96130b36130ae60006129c5565b6107db565b916107db565b146130c9576130c790613b46565b565b6130f46130d660006129c5565b6130de610202565b91829163b20f76e360e01b835260048301610b58565b0390fd5b6131019061308a565b565b90565b61311261311791611426565b613103565b90565b6131249054613106565b90565b90565b61313e61313961314392613127565b610349565b6102bf565b90565b613150600261312a565b90565b9061316060001991611bff565b9181191691161790565b61317e613179613183926102bf565b610349565b6102bf565b90565b90565b9061319e6131996131a59261316a565b613186565b8254613153565b9055565b6131b3600161311a565b6131cc6131c66131c1613146565b6102bf565b916102bf565b146131e5576131e36131dc613146565b6001613189565b565b6131ed610202565b6306fda65d60e31b815280613204600482016103d8565b0390fd5b90565b61321f61321a61322492613208565b610349565b6102bf565b90565b613231600161320b565b90565b61324661323f613227565b6001613189565b565b61325a6132556006611fed565b610fb5565b633ccfd60b90803b156133615761327e91600091613276610202565b93849261133d565b825281838161328f600482016103d8565b03925af1801561335c5761332f575b506132b16132ac60056115b8565b610be4565b63e4fc6b6d90803b1561332a576132d5916000916132cd610202565b93849261133d565b82528183816132e6600482016103d8565b03925af18015613325576132f8575b50565b6133189060003d811161331e575b6133108183610860565b810190611a9d565b386132f5565b503d613306565b611402565b611338565b61334f9060003d8111613355575b6133478183610860565b810190611a9d565b3861329e565b503d61333d565b611402565b611338565b61336e6129ef565b503390565b61337f61338491611426565b610691565b90565b6133919054613373565b90565b9160206133b69294936133af604082019660008301906114cc565b01906102c2565b565b905051906133c582610ec2565b565b906020828203126133e1576133de916000016133b8565b90565b61020d565b6040906134106134179496959396613406606084019860008501906114cc565b60208301906102c2565b01906102c2565b565b613446602061343061342b600a613387565b6106d2565b63d5a377869061343e610202565b93849261133d565b82528180613456600482016103d8565b03915afa908115613a7857600091613a4a575b50613474600061131c565b9161347f6009611107565b91613488611314565b935b8461349d613497866102bf565b916102bf565b101561354c576134db60206134c56134c06134ba60098a90611116565b90611162565b61119d565b634a8622ea906134d3610202565b93849261133d565b825281806134eb600482016103d8565b03915afa8015613547576135119261350b92600092613517575b50611505565b94611417565b9361348a565b61353991925060203d8111613540575b6135318183610860565b8101906114a1565b9038613505565b503d613527565b611402565b935090915061355b600061131c565b928161356f613569836102bf565b916102bf565b10613a37575b50506135bb60006135a57f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf6112ab565b63b4e8a6c4906135b3610202565b93849261133d565b825281806135cb600482016103d8565b03915afa908115613a3257600091613a0f575b50916135e983611413565b916135f2611314565b5b80613606613600866102bf565b916102bf565b1015613a0857613667602061362361361e6008611440565b610777565b63842126359061365c61364761364261363d8c899061144d565b61146d565b611486565b92613650610202565b9586948593849361133d565b8352600483016114d9565b03915afa8015613a0357613685916000916139d5575b508490611505565b906136e761369b613696600761200e565b61105a565b63f8392609906136bc6136b76136b28b879061144d565b61146d565b611486565b9060206136d16136cc6004611562565b610dfc565b6383cf078e906136df610202565b96879261133d565b825281806136f7600482016103d8565b03915afa9384156139d0576000946139a0575b50803b1561399b576137306000809461373b613724610202565b9788968795869461133d565b845260048401613394565b03925af1801561399657613969575b5061379e602061376261375d600761200e565b61105a565b63266f803a9061379361377e6137798c889061144d565b61146d565b92613787610202565b9586948593849361133d565b835260048301610b58565b03915afa8015613964576137bb91600091613936575b5015610262565b8061388d575b6137d5575b6137d09150611417565b6135f3565b6137e76137e2600761200e565b61105a565b636a65092e906138086138036137fe8a869061144d565b61146d565b611486565b908492813b156138885760006138319161383c8296613825610202565b998a978896879561133d565b8552600485016133e6565b03925af1918215613883576137d092613856575b506137c6565b6138769060003d811161387c575b61386e8183610860565b810190611a9d565b38613850565b503d613864565b611402565b611338565b506138e160206138a56138a0600761200e565b61105a565b630a7af47c906138d66138c16138bc8c889061144d565b61146d565b926138ca610202565b9586948593849361133d565b835260048301610b58565b03915afa8015613931576138fe91600091613903575b5015610262565b6137c1565b613924915060203d811161392a575b61391c8183610860565b8101906133c7565b386138f7565b503d613912565b611402565b613957915060203d811161395d575b61394f8183610860565b8101906133c7565b386137b4565b503d613945565b611402565b6139899060003d811161398f575b6139818183610860565b810190611a9d565b3861374a565b503d613977565b611402565b611338565b6139c291945060203d81116139c9575b6139ba8183610860565b8101906114a1565b923861370a565b503d6139b0565b611402565b6139f6915060203d81116139fc575b6139ee8183610860565b8101906114a1565b3861367d565b503d6139e4565b611402565b5092505050565b613a2c91503d806000833e613a248183610860565b8101906113cc565b386135de565b611402565b613a429293506115c5565b903880613575565b613a6b915060203d8111613a71575b613a638183610860565b8101906114a1565b38613469565b503d613a59565b611402565b613a85612a20565b613a9e613a98613a93613366565b6107db565b916107db565b03613aa557565b613ace613ab0613366565b613ab8610202565b9182916332b2baa360e01b835260048301610b58565b0390fd5b613aed613ae7613ae260006129c5565b6107db565b916107db565b14613af457565b613afc610202565b63d92e233d60e01b815280613b13600482016103d8565b0390fd5b613b2090610368565b90565b90565b90613b3b613b36613b4292613b17565b613b23565b8254611c05565b9055565b613b506000612a13565b613b5b826000613b26565b90613b8f613b897f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093613b17565b91613b17565b91613b98610202565b80613ba2816103d8565b0390a356fea264697066735822122072fd3ce566b7efed80c3d99815617b404c1f8d3b445e75a26e9c5e8fd2049e5364736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c
-----Decoded View---------------
Arg [0] : baseContracts_ (address): 0x5Ce899AEd04c656776148fc3b1Adbe59e5f13D5c
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.