Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
FeesWithdrawer
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 {IBaseContracts} from "../interface/IBaseContracts.sol"; import {IDUSXProvider} from "../interface/IDUSXProvider.sol"; import {IERC20Token} from "../interface/IERC20Token.sol"; import {IFeesDistributor} from "../interface/IFees.sol"; import {IFeesWithdrawer} from "../interface/IFees.sol"; import {ILender} from "../interface/ILender.sol"; import {IMiscHelper} from "../interface/IMiscHelper.sol"; import {IVault} from "../interface/IVault.sol"; /** * @title FeesWithdrawer * @dev Manages centralized fee collection and distribution system * @notice Facilitates: * · Multi-lender fee collection * · Vault-based fee management * · Configurable fee distribution * · Override mechanisms */ contract FeesWithdrawer is Ownable, IFeesWithdrawer { /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /// @notice DUSX provider contract address /// @dev Immutable for gas optimization IDUSXProvider public immutable dusxProvider; /// @notice DUSX receiver contract address /// @dev Immutable for gas optimization IFeesDistributor public immutable feesDistributor; /// @notice DUSX token contract reference /// @dev Immutable for gas optimization IERC20Token public immutable dusx; /// @notice Vault contract /// @dev Immutable for gas optimization IVault public immutable vault; /// @notice Protocol helper contract /// @dev Facilitates cross-contract interactions IMiscHelper public helper; /// @notice Base contracts registry IBaseContracts public immutable baseContracts; /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /// @notice Emitted when total DUSX is withdrawn /// @param amount Total withdrawn amount event DUSXTotalWithdrawn(uint256 amount); /// @notice Emitted per-vault withdrawal /// @param vault Vault contract address /// @param amount Withdrawn amount event DUSXWithdrawn(IVault indexed vault, uint256 amount); /*////////////////////////////////////////////////////////////// CUSTOM ERRORS //////////////////////////////////////////////////////////////*/ /// @notice Invalid fee recipient configuration error InvalidFeeTo(); /// @notice Zero address provided error ZeroAddress(); /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Configures the withdrawer with base contracts registry * @param baseContracts_ Base contracts registry address */ constructor(IBaseContracts baseContracts_) { _ensureNonzeroAddress(address(baseContracts_)); baseContracts = baseContracts_; dusxProvider = baseContracts_.dusxProvider(); feesDistributor = baseContracts_.feesDistributor(); dusx = baseContracts_.dusx(); vault = baseContracts_.vault(); helper = baseContracts_.helper(); _ensureNonzeroAddress(address(dusxProvider)); _ensureNonzeroAddress(address(feesDistributor)); _ensureNonzeroAddress(address(dusx)); _ensureNonzeroAddress(address(vault)); _ensureNonzeroAddress(address(helper)); transferOwnership(address(helper)); } /*////////////////////////////////////////////////////////////// WITHDRAWAL OPERATIONS //////////////////////////////////////////////////////////////*/ /** * @notice Executes complete fee withdrawal cycle * @dev Process: * 1. Process each lender * · Validate configuration * · Accrue fees * · Calculate amounts * · Handle transfers * 2. Process vault withdrawals */ function withdraw() external onlyOwner { address[] memory lenders = vault.getControllers(); uint256 length = lenders.length; for (uint256 i; i < length; i++) { ILender lender = ILender(lenders[i]); if (lender.feeTo() != address(this)) { revert InvalidFeeTo(); } lender.accrue(); uint256 feesEarned = 0; (, feesEarned, ) = lender.accrueInfo(); uint256 lenderDUSXAmount = vault.toAmount( dusx, vault.balanceOf(dusx, address(lender)), false ); uint256 amountToProvide; if (feesEarned > lenderDUSXAmount) { amountToProvide = feesEarned - lenderDUSXAmount; } else { amountToProvide = 0; } lender.withdrawFees(amountToProvide); address vaultAddress = address(lender.vault()); uint256 vaultDUSXBalance = vault.balanceOf(dusx, vaultAddress); vault.transfer(dusx, vaultAddress, address(this), vaultDUSXBalance); } uint256 totalAmount = 0; uint256 share = vault.balanceOf(dusx, address(this)); if (share != 0) { (uint256 amount, ) = vault.withdraw( dusx, address(this), address(feesDistributor), 0, share ); totalAmount += amount; emit DUSXWithdrawn(vault, amount); } emit DUSXTotalWithdrawn(totalAmount); } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ // 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; 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":"InvalidFeeTo","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"UnauthorizedAccount","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DUSXTotalWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IVault","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DUSXWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"baseContracts","outputs":[{"internalType":"contract IBaseContracts","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dusx","outputs":[{"internalType":"contract IERC20Token","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dusxProvider","outputs":[{"internalType":"contract IDUSXProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesDistributor","outputs":[{"internalType":"contract IFeesDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"helper","outputs":[{"internalType":"contract IMiscHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61012060405234620000ce576200001f62000019620001bb565b62000525565b62000029620000d4565b6116d462000ba88239608051816101dc015260a0518181816103a40152611306015260c05181818161042c01528181610c8c01528181610cdf01528181610e8601528181610f14015281816111e301526112d4015260e05181818161052f01528181610aab01528181610c6001528181610cb001528181610e5801528181610ee7015281816111b5015281816112a3015261136f0152610100518160e501526116d490f35b620000da565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906200010b90620000df565b810190811060018060401b038211176200012457604052565b620000e9565b906200014162000139620000d4565b9283620000ff565b565b600080fd5b60018060a01b031690565b6200015e9062000148565b90565b6200016c9062000153565b90565b6200017a8162000161565b036200018257565b600080fd5b9050519062000196826200016f565b565b90602082820312620001b557620001b29160000162000187565b90565b62000143565b620001de6200227c80380380620001d2816200012a565b92833981019062000198565b90565b90565b620001fd620001f7620002039262000148565b620001e1565b62000148565b90565b6200021190620001e4565b90565b6200021f9062000206565b90565b60e01b90565b620002339062000153565b90565b620002418162000228565b036200024957565b600080fd5b905051906200025d8262000236565b565b906020828203126200027c5762000279916000016200024e565b90565b62000143565b60000190565b62000292620000d4565b3d6000823e3d90fd5b620002a69062000153565b90565b620002b4816200029b565b03620002bc57565b600080fd5b90505190620002d082620002a9565b565b90602082820312620002ef57620002ec91600001620002c1565b90565b62000143565b620003009062000153565b90565b6200030e81620002f5565b036200031657565b600080fd5b905051906200032a8262000303565b565b90602082820312620003495762000346916000016200031b565b90565b62000143565b6200035a9062000153565b90565b62000368816200034f565b036200037057565b600080fd5b9050519062000384826200035d565b565b90602082820312620003a357620003a09160000162000375565b90565b62000143565b620003b49062000153565b90565b620003c281620003a9565b03620003ca57565b600080fd5b90505190620003de82620003b7565b565b90602082820312620003fd57620003fa91600001620003cf565b90565b62000143565b60001b90565b906200041c60018060a01b039162000403565b9181191691161790565b6200043190620001e4565b90565b6200043f9062000426565b90565b90565b906200045f62000459620004679262000434565b62000442565b825462000409565b9055565b62000477905162000228565b90565b620004859062000206565b90565b6200049490516200029b565b90565b620004a29062000206565b90565b620004b19051620002f5565b90565b620004bf9062000206565b90565b620004ce90516200034f565b90565b620004dc9062000206565b90565b60001c90565b60018060a01b031690565b620004ff6200050591620004df565b620004e5565b90565b620005149054620004f0565b90565b620005229062000206565b90565b6200052f620008e5565b620005446200053e8262000214565b6200093a565b80610100526200057360206200055a8362000214565b633d506419906200056a620000d4565b93849262000222565b82528180620005856004820162000282565b03915afa908115620008df57600091620008aa575b50608052620005c86020620005af8362000214565b638e0bae7f90620005bf620000d4565b93849262000222565b82528180620005da6004820162000282565b03915afa908115620008a4576000916200086f575b5060a0526200061d6020620006048362000214565b6396df10c09062000614620000d4565b93849262000222565b825281806200062f6004820162000282565b03915afa908115620008695760009162000834575b5060c052620006726020620006598362000214565b63fbfa77cf9062000669620000d4565b93849262000222565b82528180620006846004820162000282565b03915afa9081156200082e57620006c992602092620006b092600091620007fa575b5060e05262000214565b6363b0e66a90620006c0620000d4565b93849262000222565b82528180620006db6004820162000282565b03915afa8015620007f457620006fd91600091620007bf575b50600162000445565b6200071d620007176200071160806200046b565b6200047a565b6200093a565b6200073d620007376200073160a062000488565b62000497565b6200093a565b6200075d620007576200075160c0620004a5565b620004b4565b6200093a565b6200077d620007776200077160e0620004c2565b620004d1565b6200093a565b6200079d6200079762000791600162000508565b62000517565b6200093a565b620007bd620007b7620007b1600162000508565b62000517565b62000a32565b565b620007e5915060203d8111620007ec575b620007dc8183620000ff565b810190620003e0565b38620006f4565b503d620007d0565b62000288565b6200081f9150843d811162000826575b620008168183620000ff565b81019062000386565b38620006a6565b503d6200080a565b62000288565b6200085a915060203d811162000861575b620008518183620000ff565b8101906200032c565b3862000644565b503d62000845565b62000288565b62000895915060203d81116200089c575b6200088c8183620000ff565b810190620002d2565b38620005ef565b503d62000880565b62000288565b620008d0915060203d8111620008d7575b620008c78183620000ff565b8101906200025f565b386200059a565b503d620008bb565b62000288565b620008ef620008f1565b565b62000905620008ff62000a44565b62000abc565b565b90565b620009236200091d620009299262000907565b620001e1565b62000148565b90565b62000937906200090a565b90565b6200095b620009546200094e60006200092c565b62000153565b9162000153565b146200096357565b6200096d620000d4565b63d92e233d60e01b815280620009866004820162000282565b0390fd5b6200099f906200099962000b29565b620009c8565b565b620009ac9062000153565b9052565b9190620009c690600060208501940190620009a1565b565b80620009ea620009e3620009dd60006200092c565b62000153565b9162000153565b14620009fd57620009fb9062000abc565b565b62000a2e62000a0d60006200092c565b62000a17620000d4565b91829163b20f76e360e01b835260048301620009b0565b0390fd5b62000a3d906200098a565b565b600090565b62000a4e62000a3f565b503390565b60018060a01b031690565b62000a6d62000a7391620004df565b62000a53565b90565b62000a82905462000a5e565b90565b62000a909062000206565b90565b90565b9062000ab062000aaa62000ab89262000a85565b62000a93565b825462000409565b9055565b62000ac8600062000a76565b62000ad582600062000a96565b9062000b0d62000b067f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09362000a85565b9162000a85565b9162000b18620000d4565b8062000b248162000282565b0390a3565b62000b3362000b8d565b62000b5262000b4b62000b4562000a44565b62000153565b9162000153565b0362000b5a57565b62000b8962000b6862000a44565b62000b72620000d4565b9182916332b2baa360e01b835260048301620009b0565b0390fd5b62000b9762000a3f565b5062000ba4600062000a76565b9056fe60806040526004361015610013575b6105b5565b61001e6000356100bd565b806325d3d7cf146100b85780633ccfd60b146100b35780633d506419146100ae57806363b0e66a146100a9578063715018a6146100a45780638da5cb5b1461009f5780638e0bae7f1461009a57806396df10c014610095578063f2fde38b146100905763fbfa77cf0361000e57610580565b6104fa565b61047d565b6103f5565b61036d565b61030b565b6102d6565b61022d565b6101a7565b61016c565b60e01c90565b60405190565b600080fd5b600080fd5b60009103126100de57565b6100ce565b7f000000000000000000000000000000000000000000000000000000000000000090565b60018060a01b031690565b90565b61012961012461012e92610107565b610112565b610107565b90565b61013a90610115565b90565b61014690610131565b90565b6101529061013d565b9052565b919061016a90600060208501940190610149565b565b3461019c5761017c3660046100d3565b6101986101876100e3565b61018f6100c3565b91829182610156565b0390f35b6100c9565b60000190565b346101d5576101b73660046100d3565b6101bf611463565b6101c76100c3565b806101d1816101a1565b0390f35b6100c9565b7f000000000000000000000000000000000000000000000000000000000000000090565b61020790610131565b90565b610213906101fe565b9052565b919061022b9060006020850194019061020a565b565b3461025d5761023d3660046100d3565b6102596102486101da565b6102506100c3565b91829182610217565b0390f35b6100c9565b1c90565b60018060a01b031690565b6102819060086102869302610262565b610266565b90565b906102949154610271565b90565b6102a46001600090610289565b90565b6102b090610131565b90565b6102bc906102a7565b9052565b91906102d4906000602085019401906102b3565b565b34610306576102e63660046100d3565b6103026102f1610297565b6102f96100c3565b918291826102c0565b0390f35b6100c9565b346103395761031b3660046100d3565b6103236114bb565b61032b6100c3565b80610335816101a1565b0390f35b6100c9565b61034790610107565b90565b6103539061033e565b9052565b919061036b9060006020850194019061034a565b565b3461039d5761037d3660046100d3565b6103996103886114fc565b6103906100c3565b91829182610357565b0390f35b6100c9565b7f000000000000000000000000000000000000000000000000000000000000000090565b6103cf90610131565b90565b6103db906103c6565b9052565b91906103f3906000602085019401906103d2565b565b34610425576104053660046100d3565b6104216104106103a2565b6104186100c3565b918291826103df565b0390f35b6100c9565b7f000000000000000000000000000000000000000000000000000000000000000090565b61045790610131565b90565b6104639061044e565b9052565b919061047b9060006020850194019061045a565b565b346104ad5761048d3660046100d3565b6104a961049861042a565b6104a06100c3565b91829182610467565b0390f35b6100c9565b600080fd5b6104c08161033e565b036104c757565b600080fd5b905035906104d9826104b7565b565b906020828203126104f5576104f2916000016104cc565b90565b6100ce565b346105285761051261050d3660046104db565b611580565b61051a6100c3565b80610524816101a1565b0390f35b6100c9565b7f000000000000000000000000000000000000000000000000000000000000000090565b61055a90610131565b90565b61056690610551565b9052565b919061057e9060006020850194019061055d565b565b346105b0576105903660046100d3565b6105ac61059b61052d565b6105a36100c3565b9182918261056a565b0390f35b6100c9565b600080fd5b6105c261158b565b6105ca610aa1565b565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906105fb906105d1565b810190811067ffffffffffffffff82111761061557604052565b6105db565b60e01b90565b600080fd5b906106386106316100c3565b92836105f1565b565b67ffffffffffffffff81116106525760208091020190565b6105db565b600080fd5b90505190610669826104b7565b565b9092919261068061067b8261063a565b610625565b93818552602080860192028301928184116106bd57915b8383106106a45750505050565b602080916106b2848661065c565b815201920191610697565b610657565b9080601f830112156106e0578160206106dd9351910161066b565b90565b610620565b9060208282031261071657600082015167ffffffffffffffff81116107115761070e92016106c2565b90565b6104b2565b6100ce565b6107236100c3565b3d6000823e3d90fd5b5190565b600090565b90565b60016107449101610735565b90565b634e487b7160e01b600052603260045260246000fd5b906107678261072c565b811015610778576020809102010190565b610747565b610787905161033e565b90565b61079390610115565b90565b61079f9061078a565b90565b6107ab90610131565b90565b906020828203126107c8576107c59160000161065c565b90565b6100ce565b6107d690610131565b90565b60009103126107e457565b6100ce565b90565b6108006107fb610805926107e9565b610112565b610735565b90565b61081181610735565b0361081857565b600080fd5b9050519061082a82610808565b565b90916060828403126108625761085f610848846000850161081d565b93610856816020860161081d565b9360400161081d565b90565b6100ce565b906020828203126108815761087e9160000161081d565b90565b6100ce565b9160206108a89294936108a16040820196600083019061045a565b019061034a565b565b6108b390610735565b9052565b151590565b6108c5906108b7565b9052565b6040906108f36108fa94969593966108e96060840198600085019061045a565b60208301906108aa565b01906108bc565b565b634e487b7160e01b600052601160045260246000fd5b61092161092791939293610735565b92610735565b820391821161093257565b6108fc565b919061094b906000602085019401906108aa565b565b6109569061033e565b90565b6109628161094d565b0361096957565b600080fd5b9050519061097b82610959565b565b90602082820312610997576109949160000161096e565b90565b6100ce565b6109d26109d9946109c86060949897956109be608086019a600087019061045a565b602085019061034a565b604083019061034a565b01906108aa565b565b9190604083820312610a0457806109f8610a01926000860161081d565b9360200161081d565b90565b6100ce565b610a12906107ec565b9052565b90959492610a6294610a51610a5b92610a47608096610a3d60a088019c600089019061045a565b602087019061034a565b604085019061034a565b6060830190610a09565b01906108aa565b565b610a73610a7991939293610735565b92610735565b8201809211610a8457565b6108fc565b610a9290610115565b90565b610a9e90610a89565b90565b610ae56000610acf7f0000000000000000000000000000000000000000000000000000000000000000610551565b63b4e8a6c490610add6100c3565b93849261061a565b82528180610af5600482016101a1565b03915afa90811561145e5760009161143b575b50610b128161072c565b91610b1b610730565b5b80610b2f610b2986610735565b91610735565b10156111a257610b50610b4b610b4685849061075d565b61077d565b610796565b610b746020610b5e836107a2565b63017e7e5890610b6c6100c3565b93849261061a565b82528180610b84600482016101a1565b03915afa90811561119d5760009161116f575b50610bb2610bac610ba7306107cd565b61033e565b9161033e565b0361114c57610bc0816107a2565b63f8ba4cff90803b1561114757610be491600091610bdc6100c3565b93849261061a565b8252818381610bf5600482016101a1565b03925af1801561114257611115575b50610c0f60006107ec565b50610c346060610c1e836107a2565b63b27c0e7490610c2c6100c3565b93849261061a565b82528180610c44600482016101a1565b03915afa908115611110576000809290506110e1575b50610c847f0000000000000000000000000000000000000000000000000000000000000000610551565b6356623118907f0000000000000000000000000000000000000000000000000000000000000000610cd47f0000000000000000000000000000000000000000000000000000000000000000610551565b91602063f7888aec937f000000000000000000000000000000000000000000000000000000000000000090610d23610d0b8a6107a2565b96610d2e610d176100c3565b9889958694859461061a565b845260048401610886565b03915afa9283156110dc576000936110a8575b50610d6260209394610d6d6000610d566100c3565b9788968795869561061a565b8552600485016108c9565b03915afa9081156110a357600091611075575b50610d89610730565b5081610d9d610d9783610735565b91610735565b1160001461106457610dae91610912565b5b610db8826107a2565b90635e318e0790823b1561105f57610df092610de560008094610dd96100c3565b9687958694859361061a565b835260048301610937565b03925af1801561105a57610e2692602092610e109261102d575b506107a2565b63fbfa77cf90610e1e6100c3565b93849261061a565b82528180610e36600482016101a1565b03915afa801561102857610e5291600091610ffa575b50610551565b90610e7c7f0000000000000000000000000000000000000000000000000000000000000000610551565b602063f7888aec917f000000000000000000000000000000000000000000000000000000000000000090610ec28694610ecd610eb66100c3565b9687958694859461061a565b845260048401610886565b03915afa908115610ff557600091610fc7575b5091610f0b7f0000000000000000000000000000000000000000000000000000000000000000610551565b9063f18d03cc917f00000000000000000000000000000000000000000000000000000000000000009194610f3e306107cd565b90823b15610fc257600094610f718692610f6694610f5a6100c3565b9a8b988997889661061a565b86526004860161099c565b03925af1918215610fbd57610f8b92610f90575b50610738565b610b1c565b610fb09060003d8111610fb6575b610fa881836105f1565b8101906107d9565b38610f85565b503d610f9e565b61071b565b6105cc565b610fe8915060203d8111610fee575b610fe081836105f1565b810190610867565b38610ee0565b503d610fd6565b61071b565b61101b915060203d8111611021575b61101381836105f1565b81019061097d565b38610e4c565b503d611009565b61071b565b61104d9060003d8111611053575b61104581836105f1565b8101906107d9565b38610e0a565b503d61103b565b61071b565b6105cc565b505061107060006107ec565b610daf565b611096915060203d811161109c575b61108e81836105f1565b810190610867565b38610d80565b503d611084565b61071b565b602093506110ce610d6291853d81116110d5575b6110c681836105f1565b810190610867565b9350610d41565b503d6110bc565b61071b565b611102915060603d8111611109575b6110fa81836105f1565b81019061082c565b5090610c5a565b503d6110f0565b61071b565b6111359060003d811161113b575b61112d81836105f1565b8101906107d9565b38610c04565b503d611123565b61071b565b6105cc565b6111546100c3565b636be81e9360e11b81528061116b600482016101a1565b0390fd5b611190915060203d8111611196575b61118881836105f1565b8101906107ae565b38610b97565b503d61117e565b61071b565b509150506111b060006107ec565b6111d97f0000000000000000000000000000000000000000000000000000000000000000610551565b602063f7888aec917f00000000000000000000000000000000000000000000000000000000000000009061122761120f306107cd565b9461123261121b6100c3565b9687958694859461061a565b845260048401610886565b03915afa90811561143657600091611408575b508061125a61125460006107ec565b91610735565b0361129c575b506112977ff8124d9bef4ad2c59aeaa3233dde8fae16bd233c5bfbc78d084c1c01d44dec289161128e6100c3565b91829182610937565b0390a1565b60406112c77f0000000000000000000000000000000000000000000000000000000000000000610551565b6397da6d309061134260007f00000000000000000000000000000000000000000000000000000000000000009361134d611300306107cd565b9761132a7f00000000000000000000000000000000000000000000000000000000000000006103c6565b908490916113366100c3565b9a8b998a98899761061a565b875260048701610a16565b03925af180156114035761136c916000916113d6575b50918290610a64565b907f00000000000000000000000000000000000000000000000000000000000000006113cd6113bb7f503d15173c86a3264aa7c119745fec1bb647aac5d9c2b5ed057c105bd947e93892610a95565b926113c46100c3565b91829182610937565b0390a238611260565b6113f7915060403d81116113fc575b6113ef81836105f1565b8101906109db565b611363565b503d6113e5565b61071b565b611429915060203d811161142f575b61142181836105f1565b810190610867565b38611245565b503d611417565b61071b565b61145891503d806000833e61145081836105f1565b8101906106e5565b38610b08565b61071b565b61146b6105ba565b565b61147561158b565b61147d6114a7565b565b61149361148e611498926107e9565b610112565b610107565b90565b6114a49061147f565b90565b6114b96114b4600061149b565b611630565b565b6114c361146d565b565b600090565b60001c90565b60018060a01b031690565b6114e76114ec916114ca565b6114d0565b90565b6114f990546114db565b90565b6115046114c5565b5061150f60006114ef565b90565b6115239061151e61158b565b611525565b565b8061154161153b611536600061149b565b61033e565b9161033e565b146115515761154f90611630565b565b61157c61155e600061149b565b6115666100c3565b91829163b20f76e360e01b835260048301610357565b0390fd5b61158990611512565b565b6115936114fc565b6115ac6115a66115a1611691565b61033e565b9161033e565b036115b357565b6115dc6115be611691565b6115c66100c3565b9182916332b2baa360e01b835260048301610357565b0390fd5b60001b90565b906115f760018060a01b03916115e0565b9181191691161790565b61160a90610131565b90565b90565b9061162561162061162c92611601565b61160d565b82546115e6565b9055565b61163a60006114ef565b611645826000611610565b906116796116737f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093611601565b91611601565b916116826100c3565b8061168c816101a1565b0390a3565b6116996114c5565b50339056fea26469706673582212200e8b417d2c419b9ca795a735c9fa20c96f7f4a25a461f098b99499ca4edfced464736f6c634300081800330000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c
Deployed Bytecode
0x60806040526004361015610013575b6105b5565b61001e6000356100bd565b806325d3d7cf146100b85780633ccfd60b146100b35780633d506419146100ae57806363b0e66a146100a9578063715018a6146100a45780638da5cb5b1461009f5780638e0bae7f1461009a57806396df10c014610095578063f2fde38b146100905763fbfa77cf0361000e57610580565b6104fa565b61047d565b6103f5565b61036d565b61030b565b6102d6565b61022d565b6101a7565b61016c565b60e01c90565b60405190565b600080fd5b600080fd5b60009103126100de57565b6100ce565b7f0000000000000000000000005ce899aed04c656776148fc3b1adbe59e5f13d5c90565b60018060a01b031690565b90565b61012961012461012e92610107565b610112565b610107565b90565b61013a90610115565b90565b61014690610131565b90565b6101529061013d565b9052565b919061016a90600060208501940190610149565b565b3461019c5761017c3660046100d3565b6101986101876100e3565b61018f6100c3565b91829182610156565b0390f35b6100c9565b60000190565b346101d5576101b73660046100d3565b6101bf611463565b6101c76100c3565b806101d1816101a1565b0390f35b6100c9565b7f0000000000000000000000000893131746962b4b5afb573351ba7f4094d81aad90565b61020790610131565b90565b610213906101fe565b9052565b919061022b9060006020850194019061020a565b565b3461025d5761023d3660046100d3565b6102596102486101da565b6102506100c3565b91829182610217565b0390f35b6100c9565b1c90565b60018060a01b031690565b6102819060086102869302610262565b610266565b90565b906102949154610271565b90565b6102a46001600090610289565b90565b6102b090610131565b90565b6102bc906102a7565b9052565b91906102d4906000602085019401906102b3565b565b34610306576102e63660046100d3565b6103026102f1610297565b6102f96100c3565b918291826102c0565b0390f35b6100c9565b346103395761031b3660046100d3565b6103236114bb565b61032b6100c3565b80610335816101a1565b0390f35b6100c9565b61034790610107565b90565b6103539061033e565b9052565b919061036b9060006020850194019061034a565b565b3461039d5761037d3660046100d3565b6103996103886114fc565b6103906100c3565b91829182610357565b0390f35b6100c9565b7f000000000000000000000000fa925d48cce408c38872d9e5a907e936661aaa8390565b6103cf90610131565b90565b6103db906103c6565b9052565b91906103f3906000602085019401906103d2565b565b34610425576104053660046100d3565b6104216104106103a2565b6104186100c3565b918291826103df565b0390f35b6100c9565b7f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f85490565b61045790610131565b90565b6104639061044e565b9052565b919061047b9060006020850194019061045a565b565b346104ad5761048d3660046100d3565b6104a961049861042a565b6104a06100c3565b91829182610467565b0390f35b6100c9565b600080fd5b6104c08161033e565b036104c757565b600080fd5b905035906104d9826104b7565b565b906020828203126104f5576104f2916000016104cc565b90565b6100ce565b346105285761051261050d3660046104db565b611580565b61051a6100c3565b80610524816101a1565b0390f35b6100c9565b7f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf90565b61055a90610131565b90565b61056690610551565b9052565b919061057e9060006020850194019061055d565b565b346105b0576105903660046100d3565b6105ac61059b61052d565b6105a36100c3565b9182918261056a565b0390f35b6100c9565b600080fd5b6105c261158b565b6105ca610aa1565b565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906105fb906105d1565b810190811067ffffffffffffffff82111761061557604052565b6105db565b60e01b90565b600080fd5b906106386106316100c3565b92836105f1565b565b67ffffffffffffffff81116106525760208091020190565b6105db565b600080fd5b90505190610669826104b7565b565b9092919261068061067b8261063a565b610625565b93818552602080860192028301928184116106bd57915b8383106106a45750505050565b602080916106b2848661065c565b815201920191610697565b610657565b9080601f830112156106e0578160206106dd9351910161066b565b90565b610620565b9060208282031261071657600082015167ffffffffffffffff81116107115761070e92016106c2565b90565b6104b2565b6100ce565b6107236100c3565b3d6000823e3d90fd5b5190565b600090565b90565b60016107449101610735565b90565b634e487b7160e01b600052603260045260246000fd5b906107678261072c565b811015610778576020809102010190565b610747565b610787905161033e565b90565b61079390610115565b90565b61079f9061078a565b90565b6107ab90610131565b90565b906020828203126107c8576107c59160000161065c565b90565b6100ce565b6107d690610131565b90565b60009103126107e457565b6100ce565b90565b6108006107fb610805926107e9565b610112565b610735565b90565b61081181610735565b0361081857565b600080fd5b9050519061082a82610808565b565b90916060828403126108625761085f610848846000850161081d565b93610856816020860161081d565b9360400161081d565b90565b6100ce565b906020828203126108815761087e9160000161081d565b90565b6100ce565b9160206108a89294936108a16040820196600083019061045a565b019061034a565b565b6108b390610735565b9052565b151590565b6108c5906108b7565b9052565b6040906108f36108fa94969593966108e96060840198600085019061045a565b60208301906108aa565b01906108bc565b565b634e487b7160e01b600052601160045260246000fd5b61092161092791939293610735565b92610735565b820391821161093257565b6108fc565b919061094b906000602085019401906108aa565b565b6109569061033e565b90565b6109628161094d565b0361096957565b600080fd5b9050519061097b82610959565b565b90602082820312610997576109949160000161096e565b90565b6100ce565b6109d26109d9946109c86060949897956109be608086019a600087019061045a565b602085019061034a565b604083019061034a565b01906108aa565b565b9190604083820312610a0457806109f8610a01926000860161081d565b9360200161081d565b90565b6100ce565b610a12906107ec565b9052565b90959492610a6294610a51610a5b92610a47608096610a3d60a088019c600089019061045a565b602087019061034a565b604085019061034a565b6060830190610a09565b01906108aa565b565b610a73610a7991939293610735565b92610735565b8201809211610a8457565b6108fc565b610a9290610115565b90565b610a9e90610a89565b90565b610ae56000610acf7f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b63b4e8a6c490610add6100c3565b93849261061a565b82528180610af5600482016101a1565b03915afa90811561145e5760009161143b575b50610b128161072c565b91610b1b610730565b5b80610b2f610b2986610735565b91610735565b10156111a257610b50610b4b610b4685849061075d565b61077d565b610796565b610b746020610b5e836107a2565b63017e7e5890610b6c6100c3565b93849261061a565b82528180610b84600482016101a1565b03915afa90811561119d5760009161116f575b50610bb2610bac610ba7306107cd565b61033e565b9161033e565b0361114c57610bc0816107a2565b63f8ba4cff90803b1561114757610be491600091610bdc6100c3565b93849261061a565b8252818381610bf5600482016101a1565b03925af1801561114257611115575b50610c0f60006107ec565b50610c346060610c1e836107a2565b63b27c0e7490610c2c6100c3565b93849261061a565b82528180610c44600482016101a1565b03915afa908115611110576000809290506110e1575b50610c847f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b6356623118907f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f854610cd47f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b91602063f7888aec937f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f85490610d23610d0b8a6107a2565b96610d2e610d176100c3565b9889958694859461061a565b845260048401610886565b03915afa9283156110dc576000936110a8575b50610d6260209394610d6d6000610d566100c3565b9788968795869561061a565b8552600485016108c9565b03915afa9081156110a357600091611075575b50610d89610730565b5081610d9d610d9783610735565b91610735565b1160001461106457610dae91610912565b5b610db8826107a2565b90635e318e0790823b1561105f57610df092610de560008094610dd96100c3565b9687958694859361061a565b835260048301610937565b03925af1801561105a57610e2692602092610e109261102d575b506107a2565b63fbfa77cf90610e1e6100c3565b93849261061a565b82528180610e36600482016101a1565b03915afa801561102857610e5291600091610ffa575b50610551565b90610e7c7f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b602063f7888aec917f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f85490610ec28694610ecd610eb66100c3565b9687958694859461061a565b845260048401610886565b03915afa908115610ff557600091610fc7575b5091610f0b7f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b9063f18d03cc917f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f8549194610f3e306107cd565b90823b15610fc257600094610f718692610f6694610f5a6100c3565b9a8b988997889661061a565b86526004860161099c565b03925af1918215610fbd57610f8b92610f90575b50610738565b610b1c565b610fb09060003d8111610fb6575b610fa881836105f1565b8101906107d9565b38610f85565b503d610f9e565b61071b565b6105cc565b610fe8915060203d8111610fee575b610fe081836105f1565b810190610867565b38610ee0565b503d610fd6565b61071b565b61101b915060203d8111611021575b61101381836105f1565b81019061097d565b38610e4c565b503d611009565b61071b565b61104d9060003d8111611053575b61104581836105f1565b8101906107d9565b38610e0a565b503d61103b565b61071b565b6105cc565b505061107060006107ec565b610daf565b611096915060203d811161109c575b61108e81836105f1565b810190610867565b38610d80565b503d611084565b61071b565b602093506110ce610d6291853d81116110d5575b6110c681836105f1565b810190610867565b9350610d41565b503d6110bc565b61071b565b611102915060603d8111611109575b6110fa81836105f1565b81019061082c565b5090610c5a565b503d6110f0565b61071b565b6111359060003d811161113b575b61112d81836105f1565b8101906107d9565b38610c04565b503d611123565b61071b565b6105cc565b6111546100c3565b636be81e9360e11b81528061116b600482016101a1565b0390fd5b611190915060203d8111611196575b61118881836105f1565b8101906107ae565b38610b97565b503d61117e565b61071b565b509150506111b060006107ec565b6111d97f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b602063f7888aec917f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f8549061122761120f306107cd565b9461123261121b6100c3565b9687958694859461061a565b845260048401610886565b03915afa90811561143657600091611408575b508061125a61125460006107ec565b91610735565b0361129c575b506112977ff8124d9bef4ad2c59aeaa3233dde8fae16bd233c5bfbc78d084c1c01d44dec289161128e6100c3565b91829182610937565b0390a1565b60406112c77f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf610551565b6397da6d309061134260007f000000000000000000000000e30e73cc52ef50a4e4a8b1a3dd0b002b2276f8549361134d611300306107cd565b9761132a7f000000000000000000000000fa925d48cce408c38872d9e5a907e936661aaa836103c6565b908490916113366100c3565b9a8b998a98899761061a565b875260048701610a16565b03925af180156114035761136c916000916113d6575b50918290610a64565b907f00000000000000000000000088d6d8547bcbd5366538cedccf424776f3f7cabf6113cd6113bb7f503d15173c86a3264aa7c119745fec1bb647aac5d9c2b5ed057c105bd947e93892610a95565b926113c46100c3565b91829182610937565b0390a238611260565b6113f7915060403d81116113fc575b6113ef81836105f1565b8101906109db565b611363565b503d6113e5565b61071b565b611429915060203d811161142f575b61142181836105f1565b810190610867565b38611245565b503d611417565b61071b565b61145891503d806000833e61145081836105f1565b8101906106e5565b38610b08565b61071b565b61146b6105ba565b565b61147561158b565b61147d6114a7565b565b61149361148e611498926107e9565b610112565b610107565b90565b6114a49061147f565b90565b6114b96114b4600061149b565b611630565b565b6114c361146d565b565b600090565b60001c90565b60018060a01b031690565b6114e76114ec916114ca565b6114d0565b90565b6114f990546114db565b90565b6115046114c5565b5061150f60006114ef565b90565b6115239061151e61158b565b611525565b565b8061154161153b611536600061149b565b61033e565b9161033e565b146115515761154f90611630565b565b61157c61155e600061149b565b6115666100c3565b91829163b20f76e360e01b835260048301610357565b0390fd5b61158990611512565b565b6115936114fc565b6115ac6115a66115a1611691565b61033e565b9161033e565b036115b357565b6115dc6115be611691565b6115c66100c3565b9182916332b2baa360e01b835260048301610357565b0390fd5b60001b90565b906115f760018060a01b03916115e0565b9181191691161790565b61160a90610131565b90565b90565b9061162561162061162c92611601565b61160d565b82546115e6565b9055565b61163a60006114ef565b611645826000611610565b906116796116737f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093611601565b91611601565b916116826100c3565b8061168c816101a1565b0390a3565b6116996114c5565b50339056fea26469706673582212200e8b417d2c419b9ca795a735c9fa20c96f7f4a25a461f098b99499ca4edfced464736f6c63430008180033
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 |
---|
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.