Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
16625254 | 747 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
DomeCreator
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /// Openzeppelin imports import "@openzeppelin/contracts/access/Ownable.sol"; /// Local imports import "./DomeCore.sol"; contract DomeCreator is Ownable { uint256 public systemOwnerPercentage; uint256 public domeCreationFee; mapping(address => address[]) public creatorDomes; mapping(address => address) public domeCreators; address stakingCoinAddress; address mUSDSavingsContractAddress; address mUSDTokenAddress; address mAssetSaveWrapperAddress; address mUSDSavingsVaultAddress; event domeCreated(address creator, string cid); constructor(){ stakingCoinAddress = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; mUSDSavingsContractAddress = 0x30647a72Dc82d7Fbb1123EA74716aB8A317Eac19; mUSDTokenAddress = 0xe2f2a5C287993345a840Db3B0845fbC70f5935a5; mAssetSaveWrapperAddress = 0x0CA7A25181FC991e3cC62BaC511E62973991f325; mUSDSavingsVaultAddress = 0x78BefCa7de27d07DC6e71da295Cc2946681A6c7B; systemOwnerPercentage = 10; domeCreationFee = 500000000000000000; } modifier payedEnough(){ require(msg.value >= domeCreationFee, "You must pay <domeCreationFee>"); _; } function CreateDome( string[] memory domeInfo, DomeCore.BeneficiaryInfo[] memory beneficiariesInfo ) public payable payedEnough{ DomeCore dome = new DomeCore( domeInfo, stakingCoinAddress, mUSDSavingsContractAddress, mUSDTokenAddress, mAssetSaveWrapperAddress, mUSDSavingsVaultAddress, msg.sender, owner(), systemOwnerPercentage, beneficiariesInfo ); creatorDomes[msg.sender].push(address(dome)); domeCreators[address(dome)] = msg.sender; emit domeCreated(msg.sender, domeInfo[0]); } function domesOf(address creator) public view returns (address[] memory) { return creatorDomes[creator]; } function ChangeSystemOwnerPercentage(uint256 percentage) external onlyOwner { systemOwnerPercentage = percentage; } function withdrawEth(uint256 amount) external onlyOwner { address payable to = payable(msg.sender); to.transfer(amount); } function changeDomeCreationFee(uint256 value) external onlyOwner { domeCreationFee = value; } function changeStakingCoinAddress(address _stakingCoinAddress) external onlyOwner { stakingCoinAddress = _stakingCoinAddress; } function changeMUSDSavingsContractAddress(address _mUSDSavingsContractAddress) external onlyOwner { mUSDSavingsContractAddress = _mUSDSavingsContractAddress; } function changeMUSDTokenAddress(address _mUSDTokenAddress) external onlyOwner { mUSDTokenAddress = _mUSDTokenAddress; } function changeMAssetSaveWrapperAddress(address _mAssetSaveWrapperAddress) external onlyOwner { mAssetSaveWrapperAddress = _mAssetSaveWrapperAddress; } function changemUSDSavingsVaultAddress(address _mUSDSavingsVaultAddress) external onlyOwner { mUSDSavingsVaultAddress = _mUSDSavingsVaultAddress; } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /// Openzeppelin imports import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol"; import "@openzeppelin/contracts/interfaces/IERC4626.sol"; /// Local imports import "./Interfaces/ImAssetSaveWrapper.sol"; import "./Interfaces/ImUSDToken.sol"; import "./Interfaces/ImUSDSavingsContract.sol"; contract DomeCore is ERC4626, Ownable { using SafeERC20 for IERC20; struct BeneficiaryInfo { string beneficiaryCID; address wallet; uint256 percentage; } /// contracts IERC20 public stakingCoin; ImUSDSavingsContract public mUSDSavingsContract; ImUSDToken public mUSDToken; ImAssetSaveWrapper public mAssetSaveWrapper; address public mUSDSavingsVault; string public _domeCID; address public _systemOwner; uint256 public _systemOwnerPercentage; //Amount Of Underlying assets owned by depositor, interested + principal uint256 public underlyingAssetsOwnedByDepositor; BeneficiaryInfo[] public beneficiaries; event Staked(address indexed staker, uint256 amount, uint256 timestamp); event Unstaked(address indexed unstaker, uint256 unstakedAmount, uint256 timestamp); event Claimed(address indexed claimer, uint256 amount, uint256 timestamp); //todo /// Constructor constructor( string[] memory domeInfo, address stakingCoinAddress, address mUSDSavingsContractAddress, address mUSDTokenAddress, address mAssetSaveWrapperAddress, address mUSDSavingsVaultAddress, address owner, address systemOwner, uint256 systemOwnerPercentage, BeneficiaryInfo[] memory beneficiariesInfo ) ERC20(domeInfo[1], domeInfo[2]) ERC4626(IERC20Metadata(stakingCoinAddress)) { stakingCoin = IERC20(stakingCoinAddress); mUSDSavingsContract = ImUSDSavingsContract(mUSDSavingsContractAddress); mUSDToken = ImUSDToken(mUSDTokenAddress); mAssetSaveWrapper = ImAssetSaveWrapper(mAssetSaveWrapperAddress); mUSDSavingsVault = mUSDSavingsVaultAddress; _domeCID = domeInfo[0]; for (uint256 i; i < beneficiariesInfo.length; i++) { beneficiaries.push(beneficiariesInfo[i]); } transferOwnership(owner); stakingCoin.approve(mAssetSaveWrapperAddress, 2**256 - 1); _systemOwner = systemOwner; _systemOwnerPercentage = systemOwnerPercentage; } function decimals() public pure override(ERC20, IERC20Metadata) returns (uint8) { return 6; } function getBeneficiariesInfo() public view returns (BeneficiaryInfo[] memory) { return beneficiaries; } function totalBalance() public view returns (uint256) { uint256 mUSD = mUSDSavingsContract.balanceOfUnderlying(address(this)); uint256 asset = mUSDToken.getRedeemOutput(address(stakingCoin), mUSD); return asset; } function setApproveForDome(uint256 amount) public onlyOwner { stakingCoin.approve(address(mAssetSaveWrapper), amount); } function deposit(uint256 assets, address receiver) public override returns (uint256) { uint256 shares = previewDeposit(assets); _deposit(msg.sender, receiver, assets, shares); return shares; } function mint(uint256 shares, address receiver) public virtual override returns (uint256) { uint256 assets = previewMint(shares); _deposit(msg.sender, receiver, assets, shares); return assets; } function withdraw( uint256 assets, address receiver, address owner ) public override returns (uint256) { uint256 shares = previewWithdraw(assets); _withdraw(msg.sender, receiver, owner, assets, shares); return shares; } function redeem( uint256 shares, address receiver, address owner ) public virtual override returns (uint256) { uint256 assets = previewRedeem(shares); _withdraw(msg.sender, receiver, owner, assets, shares); return assets; } function claimInterests() public { uint256 reward; uint256 balanceINmStable = totalBalance(); if (balanceINmStable >= underlyingAssetsOwnedByDepositor) { reward = balanceINmStable - underlyingAssetsOwnedByDepositor; } else { return; } uint256 systemFee = (reward * _systemOwnerPercentage) / 100; uint256 beneficiariesReward = ((reward - systemFee) * beneficiariesPercentage()) / 100; uint256 shares; uint256 mAssets; (shares, mAssets) = estimateSharesForWithdraw( beneficiariesReward + systemFee ); uint256 minAmountOut = mUSDToken.getRedeemOutput( address(stakingCoin), mAssets ); mUSDSavingsContract.redeemAndUnwrap( shares, true, minAmountOut, address(stakingCoin), address(this), address(mUSDToken), true ); stakingCoin.safeTransfer(_systemOwner, systemFee); uint256 totalTransfered = systemFee; uint256 toTransfer; for (uint256 i; i < beneficiaries.length; i++) { if (i == beneficiaries.length - 1) { toTransfer = beneficiariesReward + systemFee - totalTransfered; stakingCoin.safeTransfer(beneficiaries[i].wallet, toTransfer); totalTransfered += toTransfer; } else { toTransfer = ((reward - systemFee) * beneficiaries[i].percentage) / 100; stakingCoin.safeTransfer(beneficiaries[i].wallet, toTransfer); totalTransfered += toTransfer; } } underlyingAssetsOwnedByDepositor += (reward - totalTransfered); emit Claimed(msg.sender, totalTransfered, block.timestamp); } function beneficiariesPercentage() public view returns (uint256 totalPercentage) { for (uint256 i; i < beneficiaries.length; i++) { totalPercentage += beneficiaries[i].percentage; } } function balanceOfUnderlying(address user) public view returns (uint256) { if (balanceOf(user) == 0) { return 0; } else { return (balanceOf(user) * estimateReward()) / totalSupply(); } } function convertToAssets(uint256 shares) public view virtual override returns (uint256 assets) { if (totalSupply() == 0) { return shares; } else { return (shares * estimateReward()) / totalSupply(); } } function convertToShares(uint256 assets) public view virtual override returns (uint256 shares) { if (totalSupply() == 0) { return assets; } else { return (assets * totalSupply()) / estimateReward(); } } function maxWithdraw(address owner) public view virtual override returns (uint256) { return balanceOfUnderlying(owner); } function previewDeposit(uint256 assets) public view virtual override returns (uint256) { return convertToShares(assets); } function previewMint(uint256 shares) public view virtual override returns (uint256) { return convertToAssets(shares); } function previewWithdraw(uint256 assets) public view virtual override returns (uint256) { return convertToShares(assets); } function previewRedeem(uint256 shares) public view virtual override returns (uint256) { return convertToAssets(shares); } function estimateReward() internal view returns (uint256) { uint256 totalReward = totalBalance(); uint256 reward; if (totalReward > underlyingAssetsOwnedByDepositor) { uint256 newReward = totalReward - underlyingAssetsOwnedByDepositor; uint256 systemFee = (newReward * _systemOwnerPercentage) / 100; uint256 beneficiariesInterest = ((newReward - systemFee) * beneficiariesPercentage()) / 100; reward = totalReward - systemFee - beneficiariesInterest; } else { reward = totalReward; } return reward; } function _deposit( address caller, address receiver, uint256 assets, uint256 shares ) internal virtual override { require(assets > 0, "The assets must be greater than 0"); require( assets <= stakingCoin.allowance(caller, address(this)), "There is no as much allowance for staking coin" ); require( assets <= stakingCoin.balanceOf(caller), "There is no as much balance for staking coin" ); stakingCoin.safeTransferFrom(caller, address(this), assets); uint256 minOut = mUSDToken.getMintOutput(address(stakingCoin), assets); mAssetSaveWrapper.saveViaMint( address(mUSDToken), address(mUSDSavingsContract), mUSDSavingsVault, address(stakingCoin), assets, minOut, false ); underlyingAssetsOwnedByDepositor += assets; _mint(receiver, shares); emit Staked(receiver, assets, block.timestamp); } function _withdraw( address caller, address receiver, address owner, uint256 assets, uint256 shares ) internal virtual override { require(owner == caller, "Caller is not an owner"); require(0 < assets, "The amount must be greater than 0"); uint256 liquidityAmount = balanceOf(owner); require(shares <= liquidityAmount, "You don't have enough balance"); claimInterests(); uint256 sharesInMstable; uint256 mAssets; (sharesInMstable, mAssets) = estimateSharesForWithdraw(assets); uint256 minAmountOut = mUSDToken.getRedeemOutput( address(stakingCoin), mAssets ); mUSDSavingsContract.redeemAndUnwrap( sharesInMstable, true, minAmountOut, address(stakingCoin), receiver, address(mUSDToken), true ); underlyingAssetsOwnedByDepositor -= assets; _burn(owner, shares); emit Unstaked(owner, assets, block.timestamp); } function estimateSharesForWithdraw(uint256 asset) public view returns (uint256 shares, uint256 mAsset) { uint256 coefficient = mUSDToken.getRedeemOutput( address(stakingCoin), 10**18 ); mAsset = (asset * 10**18) / (coefficient + 1); shares = mUSDSavingsContract.convertToShares(mAsset); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface ImAssetSaveWrapper { function saveViaMint( address _mAsset, address _save, address _vault, address _bAsset, uint256 _amount, uint256 _minOut, bool _stake ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface ImUSDSavingsContract { function balanceOf(address account) external view returns (uint256); function balanceOfUnderlying(address _user) external view returns (uint256 balance); function convertToShares(uint256 assets) external view returns (uint256 shares); function convertToAssets(uint256 shares) external view returns (uint256 assets); function redeemAndUnwrap( uint256 _amount, bool _isCreditAmt, uint256 _minAmountOut, address _output, address _beneficiary, address _router, bool _isBassetOut ) external returns ( uint256 creditsBurned, uint256 massetRedeemed, uint256 outputQuantity ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface ImUSDToken { function getMintOutput(address _input, uint256 _inputQuantity) external view returns (uint256 mintOutput); function getRedeemOutput(address _output, uint256 _mAssetQuantity) external view returns (uint256 bAssetOutput); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (interfaces/IERC4626.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol"; import "../token/ERC20/extensions/IERC20Metadata.sol"; /** * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. * * _Available since v4.7._ */ interface IERC4626 is IERC20, IERC20Metadata { event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares); event Withdraw( address indexed caller, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); /** * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. * * - MUST be an ERC-20 token contract. * - MUST NOT revert. */ function asset() external view returns (address assetTokenAddress); /** * @dev Returns the total amount of the underlying asset that is “managed” by Vault. * * - SHOULD include any compounding that occurs from yield. * - MUST be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT revert. */ function totalAssets() external view returns (uint256 totalManagedAssets); /** * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToShares(uint256 assets) external view returns (uint256 shares); /** * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToAssets(uint256 shares) external view returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, * through a deposit call. * * - MUST return a limited value if receiver is subject to some deposit limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. * - MUST NOT revert. */ function maxDeposit(address receiver) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given * current on-chain conditions. * * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called * in the same transaction. * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the * deposit would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewDeposit(uint256 assets) external view returns (uint256 shares); /** * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * deposit execution, and are accounted for during deposit. * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function deposit(uint256 assets, address receiver) external returns (uint256 shares); /** * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. * - MUST return a limited value if receiver is subject to some mint limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. * - MUST NOT revert. */ function maxMint(address receiver) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given * current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the * same transaction. * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint * would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by minting. */ function previewMint(uint256 shares) external view returns (uint256 assets); /** * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint * execution, and are accounted for during mint. * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function mint(uint256 shares, address receiver) external returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the * Vault, through a withdraw call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST NOT revert. */ function maxWithdraw(address owner) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, * given current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if * called * in the same transaction. * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though * the withdrawal would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewWithdraw(uint256 assets) external view returns (uint256 shares); /** * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * withdraw execution, and are accounted for during withdraw. * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function withdraw( uint256 assets, address receiver, address owner ) external returns (uint256 shares); /** * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, * through a redeem call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. * - MUST NOT revert. */ function maxRedeem(address owner) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, * given current on-chain conditions. * * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the * same transaction. * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the * redemption would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by redeeming. */ function previewRedeem(uint256 shares) external view returns (uint256 assets); /** * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * redeem execution, and are accounted for during redeem. * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function redeem( uint256 shares, address receiver, address owner ) external returns (uint256 assets); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC4626.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../utils/SafeERC20.sol"; import "../../../interfaces/IERC4626.sol"; import "../../../utils/math/Math.sol"; /** * @dev Implementation of the ERC4626 "Tokenized Vault Standard" as defined in * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626]. * * This extension allows the minting and burning of "shares" (represented using the ERC20 inheritance) in exchange for * underlying "assets" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends * the ERC20 standard. Any additional extensions included along it would affect the "shares" token represented by this * contract and not the "assets" token which is an independent contract. * * CAUTION: Deposits and withdrawals may incur unexpected slippage. Users should verify that the amount received of * shares or assets is as expected. EOAs should operate through a wrapper that performs these checks such as * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router]. * * _Available since v4.7._ */ abstract contract ERC4626 is ERC20, IERC4626 { using Math for uint256; IERC20Metadata private immutable _asset; /** * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777). */ constructor(IERC20Metadata asset_) { _asset = asset_; } /** @dev See {IERC4262-asset}. */ function asset() public view virtual override returns (address) { return address(_asset); } /** @dev See {IERC4262-totalAssets}. */ function totalAssets() public view virtual override returns (uint256) { return _asset.balanceOf(address(this)); } /** @dev See {IERC4262-convertToShares}. */ function convertToShares(uint256 assets) public view virtual override returns (uint256 shares) { return _convertToShares(assets, Math.Rounding.Down); } /** @dev See {IERC4262-convertToAssets}. */ function convertToAssets(uint256 shares) public view virtual override returns (uint256 assets) { return _convertToAssets(shares, Math.Rounding.Down); } /** @dev See {IERC4262-maxDeposit}. */ function maxDeposit(address) public view virtual override returns (uint256) { return _isVaultCollateralized() ? type(uint256).max : 0; } /** @dev See {IERC4262-maxMint}. */ function maxMint(address) public view virtual override returns (uint256) { return type(uint256).max; } /** @dev See {IERC4262-maxWithdraw}. */ function maxWithdraw(address owner) public view virtual override returns (uint256) { return _convertToAssets(balanceOf(owner), Math.Rounding.Down); } /** @dev See {IERC4262-maxRedeem}. */ function maxRedeem(address owner) public view virtual override returns (uint256) { return balanceOf(owner); } /** @dev See {IERC4262-previewDeposit}. */ function previewDeposit(uint256 assets) public view virtual override returns (uint256) { return _convertToShares(assets, Math.Rounding.Down); } /** @dev See {IERC4262-previewMint}. */ function previewMint(uint256 shares) public view virtual override returns (uint256) { return _convertToAssets(shares, Math.Rounding.Up); } /** @dev See {IERC4262-previewWithdraw}. */ function previewWithdraw(uint256 assets) public view virtual override returns (uint256) { return _convertToShares(assets, Math.Rounding.Up); } /** @dev See {IERC4262-previewRedeem}. */ function previewRedeem(uint256 shares) public view virtual override returns (uint256) { return _convertToAssets(shares, Math.Rounding.Down); } /** @dev See {IERC4262-deposit}. */ function deposit(uint256 assets, address receiver) public virtual override returns (uint256) { require(assets <= maxDeposit(receiver), "ERC4626: deposit more than max"); uint256 shares = previewDeposit(assets); _deposit(_msgSender(), receiver, assets, shares); return shares; } /** @dev See {IERC4262-mint}. */ function mint(uint256 shares, address receiver) public virtual override returns (uint256) { require(shares <= maxMint(receiver), "ERC4626: mint more than max"); uint256 assets = previewMint(shares); _deposit(_msgSender(), receiver, assets, shares); return assets; } /** @dev See {IERC4262-withdraw}. */ function withdraw( uint256 assets, address receiver, address owner ) public virtual override returns (uint256) { require(assets <= maxWithdraw(owner), "ERC4626: withdraw more than max"); uint256 shares = previewWithdraw(assets); _withdraw(_msgSender(), receiver, owner, assets, shares); return shares; } /** @dev See {IERC4262-redeem}. */ function redeem( uint256 shares, address receiver, address owner ) public virtual override returns (uint256) { require(shares <= maxRedeem(owner), "ERC4626: redeem more than max"); uint256 assets = previewRedeem(shares); _withdraw(_msgSender(), receiver, owner, assets, shares); return assets; } /** * @dev Internal conversion function (from assets to shares) with support for rounding direction. * * Will revert if assets > 0, totalSupply > 0 and totalAssets = 0. That corresponds to a case where any asset * would represent an infinite amout of shares. */ function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256 shares) { uint256 supply = totalSupply(); return (assets == 0 || supply == 0) ? assets.mulDiv(10**decimals(), 10**_asset.decimals(), rounding) : assets.mulDiv(supply, totalAssets(), rounding); } /** * @dev Internal conversion function (from shares to assets) with support for rounding direction. */ function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256 assets) { uint256 supply = totalSupply(); return (supply == 0) ? shares.mulDiv(10**_asset.decimals(), 10**decimals(), rounding) : shares.mulDiv(totalAssets(), supply, rounding); } /** * @dev Deposit/mint common workflow. */ function _deposit( address caller, address receiver, uint256 assets, uint256 shares ) internal virtual { // If _asset is ERC777, `transferFrom` can trigger a reenterancy BEFORE the transfer happens through the // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer, // calls the vault, which is assumed not malicious. // // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the // assets are transfered and before the shares are minted, which is a valid state. // slither-disable-next-line reentrancy-no-eth SafeERC20.safeTransferFrom(_asset, caller, address(this), assets); _mint(receiver, shares); emit Deposit(caller, receiver, assets, shares); } /** * @dev Withdraw/redeem common workflow. */ function _withdraw( address caller, address receiver, address owner, uint256 assets, uint256 shares ) internal virtual { if (caller != owner) { _spendAllowance(owner, caller, shares); } // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer, // calls the vault, which is assumed not malicious. // // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the // shares are burned and after the assets are transfered, which is a valid state. _burn(owner, shares); SafeERC20.safeTransfer(_asset, receiver, assets); emit Withdraw(caller, receiver, owner, assets, shares); } function _isVaultCollateralized() private view returns (bool) { return totalAssets() > 0 || totalSupply() == 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`. // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`. // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a // good first aproximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1; uint256 x = a; if (x >> 128 > 0) { x >>= 128; result <<= 64; } if (x >> 64 > 0) { x >>= 64; result <<= 32; } if (x >> 32 > 0) { x >>= 32; result <<= 16; } if (x >> 16 > 0) { x >>= 16; result <<= 8; } if (x >> 8 > 0) { x >>= 8; result <<= 4; } if (x >> 4 > 0) { x >>= 4; result <<= 2; } if (x >> 2 > 0) { result <<= 1; } // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { uint256 result = sqrt(a); if (rounding == Rounding.Up && result * result < a) { result += 1; } return result; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"string","name":"cid","type":"string"}],"name":"domeCreated","type":"event"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"ChangeSystemOwnerPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"domeInfo","type":"string[]"},{"components":[{"internalType":"string","name":"beneficiaryCID","type":"string"},{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct DomeCore.BeneficiaryInfo[]","name":"beneficiariesInfo","type":"tuple[]"}],"name":"CreateDome","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"changeDomeCreationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mAssetSaveWrapperAddress","type":"address"}],"name":"changeMAssetSaveWrapperAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mUSDSavingsContractAddress","type":"address"}],"name":"changeMUSDSavingsContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mUSDTokenAddress","type":"address"}],"name":"changeMUSDTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingCoinAddress","type":"address"}],"name":"changeStakingCoinAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mUSDSavingsVaultAddress","type":"address"}],"name":"changemUSDSavingsVaultAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"creatorDomes","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domeCreationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"domeCreators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"}],"name":"domesOf","outputs":[{"internalType":"address[]","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":[],"name":"systemOwnerPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a336100d2565b600580546001600160a01b031990811673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48179091556006805482167330647a72dc82d7fbb1123ea74716ab8a317eac1917905560078054821673e2f2a5c287993345a840db3b0845fbc70f5935a5179055600880548216730ca7a25181fc991e3cc62bac511e62973991f325179055600980549091167378befca7de27d07dc6e71da295cc2946681a6c7b179055600a6001556706f05b59d3b20000600255610122565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b613eda806101316000396000f3fe608060405260043610620001135760003560e01c8063b319fa9b11620000a1578063f2fde38b116200006c578063f2fde38b14620002eb578063f332da391462000310578063f651c2711462000327578063fa7dc5fc146200035b578063fe31a6a9146200038057600080fd5b8063b319fa9b1462000262578063c311d0491462000287578063e2d2c8cc14620002ac578063ee5effdc14620002d357600080fd5b806377178cad11620000e257806377178cad14620001d3578063793826ee14620001f85780638da5cb5b146200021d5780639e68706b146200023d57600080fd5b80633cf8cef514620001185780636e34f4ed146200016f578063715018a6146200019657806374c974a114620001ae575b600080fd5b3480156200012557600080fd5b5062000152620001373660046200088a565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017c57600080fd5b50620001946200018e3660046200088a565b620003a5565b005b348015620001a357600080fd5b5062000194620003d1565b348015620001bb57600080fd5b5062000194620001cd3660046200088a565b620003e9565b348015620001e057600080fd5b5062000194620001f2366004620008af565b62000415565b3480156200020557600080fd5b506200015262000217366004620008c9565b62000424565b3480156200022a57600080fd5b506000546001600160a01b031662000152565b3480156200024a57600080fd5b50620001946200025c3660046200088a565b6200045d565b3480156200026f57600080fd5b506200019462000281366004620008af565b62000489565b3480156200029457600080fd5b5062000194620002a6366004620008af565b62000498565b348015620002b957600080fd5b50620002c460025481565b60405190815260200162000166565b348015620002e057600080fd5b50620002c460015481565b348015620002f857600080fd5b50620001946200030a3660046200088a565b620004d7565b620001946200032136600462000afc565b6200055a565b3480156200033457600080fd5b506200034c620003463660046200088a565b620006e3565b60405162000166919062000bdf565b3480156200036857600080fd5b50620001946200037a3660046200088a565b6200075b565b3480156200038d57600080fd5b50620001946200039f3660046200088a565b62000787565b620003af620007b3565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b620003db620007b3565b620003e760006200080f565b565b620003f3620007b3565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6200041f620007b3565b600255565b600360205281600052604060002081815481106200044157600080fd5b6000918252602090912001546001600160a01b03169150829050565b62000467620007b3565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b62000493620007b3565b600155565b620004a2620007b3565b6040513390819083156108fc029084906000818181858888f19350505050158015620004d2573d6000803e3d6000fd5b505050565b620004e1620007b3565b6001600160a01b0381166200054c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b62000557816200080f565b50565b600254341015620005ae5760405162461bcd60e51b815260206004820152601e60248201527f596f75206d75737420706179203c646f6d654372656174696f6e4665653e0000604482015260640162000543565b60055460065460075460085460095460009487946001600160a01b03918216949082169390821692908216911633620005ef6000546001600160a01b031690565b6001548a60405162000601906200085f565b620006169a9998979695949392919062000cf5565b604051809103906000f08015801562000633573d6000803e3d6000fd5b5033600081815260036020908152604080832080546001810182559084528284200180546001600160a01b0387166001600160a01b031991821681179092559084526004909252822080549091168317905585519293507f14c6d3bd5f6f838696b74e86fe3d10a963c618c2b07b5e1afbf77712aa43a90792869190620006be57620006be62000def565b6020026020010151604051620006d692919062000e05565b60405180910390a1505050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156200074f57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000730575b50505050509050919050565b62000765620007b3565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b62000791620007b3565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314620003e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000543565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6130718062000e3483390190565b80356001600160a01b03811681146200088557600080fd5b919050565b6000602082840312156200089d57600080fd5b620008a8826200086d565b9392505050565b600060208284031215620008c257600080fd5b5035919050565b60008060408385031215620008dd57600080fd5b620008e8836200086d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715620009325762000932620008f6565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715620009645762000964620008f6565b604052919050565b600067ffffffffffffffff821115620009895762000989620008f6565b5060051b60200190565b600082601f830112620009a557600080fd5b813567ffffffffffffffff811115620009c257620009c2620008f6565b620009d7601f8201601f191660200162000938565b818152846020838601011115620009ed57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011262000a1c57600080fd5b8135602062000a3562000a2f836200096c565b62000938565b82815260059290921b8401810191818101908684111562000a5557600080fd5b8286015b8481101562000af157803567ffffffffffffffff8082111562000a7c5760008081fd5b908801906060828b03601f190181131562000a975760008081fd5b62000aa16200090c565b878401358381111562000ab45760008081fd5b62000ac48d8a8388010162000993565b8252506040925062000ad88385016200086d565b8189015292013590820152835291830191830162000a59565b509695505050505050565b6000806040838503121562000b1057600080fd5b823567ffffffffffffffff8082111562000b2957600080fd5b818501915085601f83011262000b3e57600080fd5b8135602062000b5162000a2f836200096c565b82815260059290921b8401810191818101908984111562000b7157600080fd5b8286015b8481101562000bae5780358681111562000b8f5760008081fd5b62000b9f8c86838b010162000993565b84525091830191830162000b75565b509650508601359250508082111562000bc657600080fd5b5062000bd58582860162000a0a565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101562000c225783516001600160a01b03168352928401929184019160010162000bfb565b50909695505050505050565b6000815180845260005b8181101562000c565760208185018101518683018201520162000c38565b506000602082860101526020601f19601f83011685010191505092915050565b6000815180845260208085019450848260051b860182860160005b8581101562000ce857838303895281516060815181865262000cb68287018262000c2e565b838901516001600160a01b0316878a015260409384015193909601929092525050978401979084019060010162000c91565b5090979650505050505050565b6101408082528b5190820181905260009061016080840191600581901b85019091019060208f01845b8281101562000d555761015f1987850301855262000d3e84835162000c2e565b602095860195909450919091019060010162000d1e565b5050506001600160a01b038d1660208501526001600160a01b038c1660408501526001600160a01b038b1660608501526001600160a01b038a1660808501526001600160a01b03891660a08501526001600160a01b03881660c08501526001600160a01b03871660e08501528561010085015283810361012085015262000ddd818662000c76565b9e9d5050505050505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038316815260406020820181905260009062000e2b9083018462000c2e565b94935050505056fe60a06040523480156200001157600080fd5b50604051620030713803806200307183398101604081905262000034916200067c565b888a6001815181106200004b576200004b62000774565b60200260200101518b60028151811062000069576200006962000774565b6020026020010151816003908162000082919062000819565b50600462000091828262000819565b5050506001600160a01b0316608052620000ab336200028b565b600680546001600160a01b03199081166001600160a01b038c8116919091179092556007805482168b84161790556008805482168a8416179055600980548216898416179055600a805490911691871691909117905589518a9060009062000117576200011762000774565b6020026020010151600b90816200012f919062000819565b5060005b8151811015620001d057600f82828151811062000154576200015462000774565b6020908102919091018101518254600181018455600093845291909220825160039092020190819062000188908262000819565b5060208201516001820180546001600160a01b0319166001600160a01b0390921691909117905560409091015160029091015580620001c781620008e5565b91505062000133565b50620001dc84620002dd565b60065460405163095ea7b360e01b81526001600160a01b03888116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af115801562000231573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025791906200090d565b5050600c80546001600160a01b0319166001600160a01b039390931692909217909155600d55506200093895505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620002e762000360565b6001600160a01b038116620003525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200035d816200028b565b50565b6005546001600160a01b03163314620003bc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000349565b565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620003f957620003f9620003be565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200042a576200042a620003be565b604052919050565b60006001600160401b038211156200044e576200044e620003be565b5060051b60200190565b600082601f8301126200046a57600080fd5b81516001600160401b03811115620004865762000486620003be565b60206200049c601f8301601f19168201620003ff565b8281528582848701011115620004b157600080fd5b60005b83811015620004d1578581018301518282018401528201620004b4565b506000928101909101919091529392505050565b600082601f830112620004f757600080fd5b81516020620005106200050a8362000432565b620003ff565b82815260059290921b840181019181810190868411156200053057600080fd5b8286015b84811015620005745780516001600160401b03811115620005555760008081fd5b620005658986838b010162000458565b84525091830191830162000534565b509695505050505050565b80516001600160a01b03811681146200059757600080fd5b919050565b600082601f830112620005ae57600080fd5b81516020620005c16200050a8362000432565b82815260059290921b84018101918181019086841115620005e157600080fd5b8286015b84811015620005745780516001600160401b0380821115620006075760008081fd5b908801906060828b03601f1901811315620006225760008081fd5b6200062c620003d4565b87840151838111156200063f5760008081fd5b6200064f8d8a8388010162000458565b82525060409250620006638385016200057f565b81890152920151908201528352918301918301620005e5565b6000806000806000806000806000806101408b8d0312156200069d57600080fd5b8a516001600160401b0380821115620006b557600080fd5b620006c38e838f01620004e5565b9b50620006d360208e016200057f565b9a50620006e360408e016200057f565b9950620006f360608e016200057f565b98506200070360808e016200057f565b97506200071360a08e016200057f565b96506200072360c08e016200057f565b95506200073360e08e016200057f565b94506101008d015193506101208d01519150808211156200075357600080fd5b50620007628d828e016200059c565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806200079f57607f821691505b602082108103620007c057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200081457600081815260208120601f850160051c81016020861015620007ef5750805b601f850160051c820191505b818110156200081057828155600101620007fb565b5050505b505050565b81516001600160401b03811115620008355762000835620003be565b6200084d816200084684546200078a565b84620007c6565b602080601f8311600181146200088557600084156200086c5750858301515b600019600386901b1c1916600185901b17855562000810565b600085815260208120601f198616915b82811015620008b65788860151825594840194600190910190840162000895565b5085821015620008d55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016200090657634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200092057600080fd5b815180151581146200093157600080fd5b9392505050565b6080516127166200095b60003960008181610372015261062701526127166000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c806395d89b4111610167578063c3533dcf116100ce578063dd2b2f8e11610087578063dd2b2f8e146105a1578063dd62ed3e146105b4578063ef8b30f714610308578063efeb5e58146105c7578063f0cb9783146105e9578063f2fde38b146105fc57600080fd5b8063c3533dcf14610537578063c63d75b614610540578063c6e6f59214610555578063ce96cb7714610568578063d905777e1461057b578063da6b688e1461058e57600080fd5b8063b149b55011610120578063b149b550146104e3578063b3d7f6b9146103cf578063b460af94146104f6578063ba08765214610509578063bd275b1f1461051c578063bf4dc9801461052457600080fd5b806395d89b4114610490578063983bf1bd146104985780639af08330146104a0578063a457c2d7146104b5578063a9059cbb146104c8578063ad7a672f146104db57600080fd5b8063395093511161020b5780636e553f65116101c45780636e553f65146103fe57806370a0823114610411578063715018a61461043a57806386da754c146104445780638da5cb5b1461046c57806394bf804d1461047d57600080fd5b806339509351146103965780633af9e669146103a9578063402d267d146103bc5780634cdad506146103cf5780635c109ec8146103e257806364e5c695146103f557600080fd5b80630a28a4771161025d5780630a28a477146103085780630a6f60ff1461031b57806318160ddd1461034657806323b872dd1461034e578063313ce5671461036157806338d52e0f1461037057600080fd5b806301e1d1141461029a57806306fdde03146102b557806307a2d13a146102ca57806308d68258146102dd578063095ea7b3146102e5575b600080fd5b6102a261060f565b6040519081526020015b60405180910390f35b6102bd61069f565b6040516102ac9190612338565b6102a26102d836600461234b565b610731565b6102a2610771565b6102f86102f336600461237b565b6107c7565b60405190151581526020016102ac565b6102a261031636600461234b565b6107df565b60065461032e906001600160a01b031681565b6040516001600160a01b0390911681526020016102ac565b6002546102a2565b6102f861035c3660046123a5565b6107ea565b604051600681526020016102ac565b7f000000000000000000000000000000000000000000000000000000000000000061032e565b6102f86103a436600461237b565b610810565b6102a26103b73660046123e1565b610832565b6102a26103ca3660046123e1565b610888565b6102a26103dd36600461234b565b6108a6565b60075461032e906001600160a01b031681565b6102a2600e5481565b6102a261040c3660046123fc565b6108b1565b6102a261041f3660046123e1565b6001600160a01b031660009081526020819052604090205490565b6104426108cb565b005b61045761045236600461234b565b6108df565b604080519283526020830191909152016102ac565b6005546001600160a01b031661032e565b6102a261048b3660046123fc565b610a03565b6102bd610a1d565b610442610a2c565b6104a8610d50565b6040516102ac9190612428565b6102f86104c336600461237b565b610e64565b6102f86104d636600461237b565b610eef565b6102a2610efd565b60095461032e906001600160a01b031681565b6102a26105043660046124b2565b610feb565b6102a26105173660046124b2565b61100e565b6102bd611029565b61044261053236600461234b565b6110b7565b6102a2600d5481565b6102a261054e3660046123e1565b5060001990565b6102a261056336600461234b565b611138565b6102a26105763660046123e1565b61115e565b6102a26105893660046123e1565b611169565b600a5461032e906001600160a01b031681565b60085461032e906001600160a01b031681565b6102a26105c23660046124ee565b611187565b6105da6105d536600461234b565b6111b2565b6040516102ac93929190612518565b600c5461032e906001600160a01b031681565b61044261060a3660046123e1565b61127e565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190612546565b905090565b6060600380546106ae9061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546106da9061255f565b80156107275780601f106106fc57610100808354040283529160200191610727565b820191906000526020600020905b81548152906001019060200180831161070a57829003601f168201915b5050505050905090565b600061073c60025490565b600003610747575090565b6002546107526112f7565b61075c90846125a9565b61076691906125c0565b92915050565b919050565b6000805b600f548110156107c357600f8181548110610792576107926125e2565b906000526020600020906003020160020154826107af91906125f8565b9150806107bb8161260b565b915050610775565b5090565b6000336107d5818585611391565b5060019392505050565b600061076682611138565b6000336107f88582856114b5565b61080385858561152f565b60019150505b9392505050565b6000336107d58185856108238383611187565b61082d91906125f8565b611391565b6001600160a01b03811660009081526020819052604081205460000361085a57506000919050565b6002546108656112f7565b6001600160a01b03841660009081526020819052604090205461075c91906125a9565b60006108926116fd565b61089d576000610766565b60001992915050565b600061076682610731565b6000806108bd846107df565b905061080933848684611717565b6108d3611ab5565b6108dd6000611b0f565b565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152670de0b6b3a76400006024820152600092839283929116906378aa987e90604401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109649190612546565b90506109718160016125f8565b61098385670de0b6b3a76400006125a9565b61098d91906125c0565b6007546040516363737ac960e11b8152600481018390529193506001600160a01b03169063c6e6f59290602401602060405180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb9190612546565b925050915091565b600080610a0f846108a6565b905061080933848387611717565b6060600480546106ae9061255f565b600080610a37610efd565b9050600e548110610a5657600e54610a4f9082612624565b9150610a5a565b5050565b60006064600d5484610a6c91906125a9565b610a7691906125c0565b905060006064610a84610771565b610a8e8487612624565b610a9891906125a9565b610aa291906125c0565b9050600080610ab461045285856125f8565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529395509193506000929116906378aa987e90604401602060405180830381865afa158015610b10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b349190612546565b60075460065460085460405163f25816b560e01b81529394506001600160a01b039283169363f25816b593610b7c938993600193899392831692309216908590600401612637565b6060604051808303816000875af1158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf9190612674565b5050600c54600654610bdf92506001600160a01b03908116911687611b61565b846000805b600f54811015610ce957600f54610bfd90600190612624565b8103610c6b5782610c0e89896125f8565b610c189190612624565b9150610c5a600f8281548110610c3057610c306125e2565b60009182526020909120600160039092020101546006546001600160a01b03908116911684611b61565b610c6482846125f8565b9250610cd7565b6064600f8281548110610c8057610c806125e2565b906000526020600020906003020160020154898c610c9e9190612624565b610ca891906125a9565b610cb291906125c0565b9150610cca600f8281548110610c3057610c306125e2565b610cd482846125f8565b92505b80610ce18161260b565b915050610be4565b50610cf4828a612624565b600e6000828254610d0591906125f8565b90915550506040805183815242602082015233917f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a91015b60405180910390a2505050505050505050565b6060600f805480602002602001604051908101604052809291908181526020016000905b82821015610e5b5783829060005260206000209060030201604051806060016040529081600082018054610da79061255f565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd39061255f565b8015610e205780601f10610df557610100808354040283529160200191610e20565b820191906000526020600020905b815481529060010190602001808311610e0357829003601f168201915b50505091835250506001828101546001600160a01b031660208084019190915260029093015460409092019190915291835292019101610d74565b50505050905090565b60003381610e728286611187565b905083811015610ed75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610ee48286868403611391565b506001949350505050565b6000336107d581858561152f565b600754604051633af9e66960e01b815230600482015260009182916001600160a01b0390911690633af9e66990602401602060405180830381865afa158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e9190612546565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529293506000929116906378aa987e90604401602060405180830381865afa158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108099190612546565b600080610ff7856107df565b90506110063385858885611bc9565b949350505050565b60008061101a856108a6565b90506110063385858489611bc9565b600b80546110369061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546110629061255f565b80156110af5780601f10611084576101008083540402835291602001916110af565b820191906000526020600020905b81548152906001019060200180831161109257829003601f168201915b505050505081565b6110bf611ab5565b60065460095460405163095ea7b360e01b81526001600160a01b0391821660048201526024810184905291169063095ea7b3906044016020604051808303816000875af1158015611114573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5691906126a2565b600061114360025490565b60000361114e575090565b6111566112f7565b600254610752565b600061076682610832565b6001600160a01b038116600090815260208190526040812054610766565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600f81815481106111c257600080fd5b90600052602060002090600302016000915090508060000180546111e59061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546112119061255f565b801561125e5780601f106112335761010080835404028352916020019161125e565b820191906000526020600020905b81548152906001019060200180831161124157829003601f168201915b50505050600183015460029093015491926001600160a01b031691905083565b611286611ab5565b6001600160a01b0381166112eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ece565b6112f481611b0f565b50565b600080611302610efd565b90506000600e5482111561138b576000600e54836113209190612624565b905060006064600d548361133491906125a9565b61133e91906125c0565b90506000606461134c610771565b6113568486612624565b61136091906125a9565b61136a91906125c0565b9050806113778387612624565b6113819190612624565b9350505050610766565b50919050565b6001600160a01b0383166113f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610ece565b6001600160a01b0382166114545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610ece565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006114c18484611187565b90506000198114611529578181101561151c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ece565b6115298484848403611391565b50505050565b6001600160a01b0383166115935760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610ece565b6001600160a01b0382166115f55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610ece565b6001600160a01b0383166000908152602081905260409020548181101561166d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610ece565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906116a49084906125f8565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116f091815260200190565b60405180910390a3611529565b60008061170861060f565b118061069a5750506002541590565b600082116117715760405162461bcd60e51b815260206004820152602160248201527f54686520617373657473206d7573742062652067726561746572207468616e206044820152600360fc1b6064820152608401610ece565b600654604051636eb1769f60e11b81526001600160a01b0386811660048301523060248301529091169063dd62ed3e90604401602060405180830381865afa1580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e59190612546565b82111561184b5760405162461bcd60e51b815260206004820152602e60248201527f5468657265206973206e6f206173206d75636820616c6c6f77616e636520666f60448201526d391039ba30b5b4b7339031b7b4b760911b6064820152608401610ece565b6006546040516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa158015611895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b99190612546565b82111561191d5760405162461bcd60e51b815260206004820152602c60248201527f5468657265206973206e6f206173206d7563682062616c616e636520666f722060448201526b39ba30b5b4b7339031b7b4b760a11b6064820152608401610ece565b600654611935906001600160a01b0316853085611e9d565b60085460065460405163119849cf60e01b81526001600160a01b03918216600482015260248101859052600092919091169063119849cf90604401602060405180830381865afa15801561198d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b19190612546565b600954600854600754600a54600654604051631c08892160e11b81526001600160a01b03948516600482015292841660248401529083166044830152821660648201526084810187905260a48101849052600060c4820152929350169063381112429060e401600060405180830381600087803b158015611a3157600080fd5b505af1158015611a45573d6000803e3d6000fd5b5050505082600e6000828254611a5b91906125f8565b90915550611a6b90508483611ed5565b604080518481524260208201526001600160a01b038616917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a25050505050565b6005546001600160a01b031633146108dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ece565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b038316602482015260448101829052611bc490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fb4565b505050565b846001600160a01b0316836001600160a01b031614611c235760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba1030b71037bbb732b960511b6044820152606401610ece565b81600010611c7d5760405162461bcd60e51b815260206004820152602160248201527f54686520616d6f756e74206d7573742062652067726561746572207468616e206044820152600360fc1b6064820152608401610ece565b6001600160a01b03831660009081526020819052604090205480821115611ce65760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206861766520656e6f7567682062616c616e63650000006044820152606401610ece565b611cee610a2c565b600080611cfa856108df565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529395509193506000929116906378aa987e90604401602060405180830381865afa158015611d56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7a9190612546565b9050600760009054906101000a90046001600160a01b03166001600160a01b031663f25816b584600184600660009054906101000a90046001600160a01b03168d600860009054906101000a90046001600160a01b031660016040518863ffffffff1660e01b8152600401611df59796959493929190612637565b6060604051808303816000875af1158015611e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e389190612674565b50505085600e6000828254611e4d9190612624565b90915550611e5d90508786612086565b604080518781524260208201526001600160a01b038916917f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e9101610d3d565b6040516001600160a01b03808516602483015283166044820152606481018290526115299085906323b872dd60e01b90608401611b8d565b6001600160a01b038216611f2b5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ece565b8060026000828254611f3d91906125f8565b90915550506001600160a01b03821660009081526020819052604081208054839290611f6a9084906125f8565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6000612009826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121d49092919063ffffffff16565b805190915015611bc4578080602001905181019061202791906126a2565b611bc45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610ece565b6001600160a01b0382166120e65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610ece565b6001600160a01b0382166000908152602081905260409020548181101561215a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610ece565b6001600160a01b0383166000908152602081905260408120838303905560028054849290612189908490612624565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60606110068484600085856001600160a01b0385163b6122365760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ece565b600080866001600160a01b0316858760405161225291906126c4565b60006040518083038185875af1925050503d806000811461228f576040519150601f19603f3d011682016040523d82523d6000602084013e612294565b606091505b50915091506122a48282866122af565b979650505050505050565b606083156122be575081610809565b8251156122ce5782518084602001fd5b8160405162461bcd60e51b8152600401610ece9190612338565b60005b838110156123035781810151838201526020016122eb565b50506000910152565b600081518084526123248160208601602086016122e8565b601f01601f19169290920160200192915050565b602081526000610809602083018461230c565b60006020828403121561235d57600080fd5b5035919050565b80356001600160a01b038116811461076c57600080fd5b6000806040838503121561238e57600080fd5b61239783612364565b946020939093013593505050565b6000806000606084860312156123ba57600080fd5b6123c384612364565b92506123d160208501612364565b9150604084013590509250925092565b6000602082840312156123f357600080fd5b61080982612364565b6000806040838503121561240f57600080fd5b8235915061241f60208401612364565b90509250929050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156124a457603f198984030185528151606081518186526124758287018261230c565b838b01516001600160a01b0316878c01529289015195890195909552509487019492509086019060010161244f565b509098975050505050505050565b6000806000606084860312156124c757600080fd5b833592506124d760208501612364565b91506124e560408501612364565b90509250925092565b6000806040838503121561250157600080fd5b61250a83612364565b915061241f60208401612364565b60608152600061252b606083018661230c565b6001600160a01b039490941660208301525060400152919050565b60006020828403121561255857600080fd5b5051919050565b600181811c9082168061257357607f821691505b60208210810361138b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761076657610766612593565b6000826125dd57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b8082018082111561076657610766612593565b60006001820161261d5761261d612593565b5060010190565b8181038181111561076657610766612593565b968752941515602087015260408601939093526001600160a01b039182166060860152811660808501521660a0830152151560c082015260e00190565b60008060006060848603121561268957600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156126b457600080fd5b8151801515811461080957600080fd5b600082516126d68184602087016122e8565b919091019291505056fea2646970667358221220b654f5878a08f73cce0d52a6187c36794b1079404c2783396367853e4b7742cf64736f6c63430008110033a2646970667358221220eec3acafe2665b453cadf468e87e59c7c06108cd1ad2d1889d38dce4ba34384d64736f6c63430008110033
Deployed Bytecode
0x608060405260043610620001135760003560e01c8063b319fa9b11620000a1578063f2fde38b116200006c578063f2fde38b14620002eb578063f332da391462000310578063f651c2711462000327578063fa7dc5fc146200035b578063fe31a6a9146200038057600080fd5b8063b319fa9b1462000262578063c311d0491462000287578063e2d2c8cc14620002ac578063ee5effdc14620002d357600080fd5b806377178cad11620000e257806377178cad14620001d3578063793826ee14620001f85780638da5cb5b146200021d5780639e68706b146200023d57600080fd5b80633cf8cef514620001185780636e34f4ed146200016f578063715018a6146200019657806374c974a114620001ae575b600080fd5b3480156200012557600080fd5b5062000152620001373660046200088a565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017c57600080fd5b50620001946200018e3660046200088a565b620003a5565b005b348015620001a357600080fd5b5062000194620003d1565b348015620001bb57600080fd5b5062000194620001cd3660046200088a565b620003e9565b348015620001e057600080fd5b5062000194620001f2366004620008af565b62000415565b3480156200020557600080fd5b506200015262000217366004620008c9565b62000424565b3480156200022a57600080fd5b506000546001600160a01b031662000152565b3480156200024a57600080fd5b50620001946200025c3660046200088a565b6200045d565b3480156200026f57600080fd5b506200019462000281366004620008af565b62000489565b3480156200029457600080fd5b5062000194620002a6366004620008af565b62000498565b348015620002b957600080fd5b50620002c460025481565b60405190815260200162000166565b348015620002e057600080fd5b50620002c460015481565b348015620002f857600080fd5b50620001946200030a3660046200088a565b620004d7565b620001946200032136600462000afc565b6200055a565b3480156200033457600080fd5b506200034c620003463660046200088a565b620006e3565b60405162000166919062000bdf565b3480156200036857600080fd5b50620001946200037a3660046200088a565b6200075b565b3480156200038d57600080fd5b50620001946200039f3660046200088a565b62000787565b620003af620007b3565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b620003db620007b3565b620003e760006200080f565b565b620003f3620007b3565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6200041f620007b3565b600255565b600360205281600052604060002081815481106200044157600080fd5b6000918252602090912001546001600160a01b03169150829050565b62000467620007b3565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b62000493620007b3565b600155565b620004a2620007b3565b6040513390819083156108fc029084906000818181858888f19350505050158015620004d2573d6000803e3d6000fd5b505050565b620004e1620007b3565b6001600160a01b0381166200054c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b62000557816200080f565b50565b600254341015620005ae5760405162461bcd60e51b815260206004820152601e60248201527f596f75206d75737420706179203c646f6d654372656174696f6e4665653e0000604482015260640162000543565b60055460065460075460085460095460009487946001600160a01b03918216949082169390821692908216911633620005ef6000546001600160a01b031690565b6001548a60405162000601906200085f565b620006169a9998979695949392919062000cf5565b604051809103906000f08015801562000633573d6000803e3d6000fd5b5033600081815260036020908152604080832080546001810182559084528284200180546001600160a01b0387166001600160a01b031991821681179092559084526004909252822080549091168317905585519293507f14c6d3bd5f6f838696b74e86fe3d10a963c618c2b07b5e1afbf77712aa43a90792869190620006be57620006be62000def565b6020026020010151604051620006d692919062000e05565b60405180910390a1505050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156200074f57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000730575b50505050509050919050565b62000765620007b3565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b62000791620007b3565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314620003e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000543565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6130718062000e3483390190565b80356001600160a01b03811681146200088557600080fd5b919050565b6000602082840312156200089d57600080fd5b620008a8826200086d565b9392505050565b600060208284031215620008c257600080fd5b5035919050565b60008060408385031215620008dd57600080fd5b620008e8836200086d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715620009325762000932620008f6565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715620009645762000964620008f6565b604052919050565b600067ffffffffffffffff821115620009895762000989620008f6565b5060051b60200190565b600082601f830112620009a557600080fd5b813567ffffffffffffffff811115620009c257620009c2620008f6565b620009d7601f8201601f191660200162000938565b818152846020838601011115620009ed57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011262000a1c57600080fd5b8135602062000a3562000a2f836200096c565b62000938565b82815260059290921b8401810191818101908684111562000a5557600080fd5b8286015b8481101562000af157803567ffffffffffffffff8082111562000a7c5760008081fd5b908801906060828b03601f190181131562000a975760008081fd5b62000aa16200090c565b878401358381111562000ab45760008081fd5b62000ac48d8a8388010162000993565b8252506040925062000ad88385016200086d565b8189015292013590820152835291830191830162000a59565b509695505050505050565b6000806040838503121562000b1057600080fd5b823567ffffffffffffffff8082111562000b2957600080fd5b818501915085601f83011262000b3e57600080fd5b8135602062000b5162000a2f836200096c565b82815260059290921b8401810191818101908984111562000b7157600080fd5b8286015b8481101562000bae5780358681111562000b8f5760008081fd5b62000b9f8c86838b010162000993565b84525091830191830162000b75565b509650508601359250508082111562000bc657600080fd5b5062000bd58582860162000a0a565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101562000c225783516001600160a01b03168352928401929184019160010162000bfb565b50909695505050505050565b6000815180845260005b8181101562000c565760208185018101518683018201520162000c38565b506000602082860101526020601f19601f83011685010191505092915050565b6000815180845260208085019450848260051b860182860160005b8581101562000ce857838303895281516060815181865262000cb68287018262000c2e565b838901516001600160a01b0316878a015260409384015193909601929092525050978401979084019060010162000c91565b5090979650505050505050565b6101408082528b5190820181905260009061016080840191600581901b85019091019060208f01845b8281101562000d555761015f1987850301855262000d3e84835162000c2e565b602095860195909450919091019060010162000d1e565b5050506001600160a01b038d1660208501526001600160a01b038c1660408501526001600160a01b038b1660608501526001600160a01b038a1660808501526001600160a01b03891660a08501526001600160a01b03881660c08501526001600160a01b03871660e08501528561010085015283810361012085015262000ddd818662000c76565b9e9d5050505050505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038316815260406020820181905260009062000e2b9083018462000c2e565b94935050505056fe60a06040523480156200001157600080fd5b50604051620030713803806200307183398101604081905262000034916200067c565b888a6001815181106200004b576200004b62000774565b60200260200101518b60028151811062000069576200006962000774565b6020026020010151816003908162000082919062000819565b50600462000091828262000819565b5050506001600160a01b0316608052620000ab336200028b565b600680546001600160a01b03199081166001600160a01b038c8116919091179092556007805482168b84161790556008805482168a8416179055600980548216898416179055600a805490911691871691909117905589518a9060009062000117576200011762000774565b6020026020010151600b90816200012f919062000819565b5060005b8151811015620001d057600f82828151811062000154576200015462000774565b6020908102919091018101518254600181018455600093845291909220825160039092020190819062000188908262000819565b5060208201516001820180546001600160a01b0319166001600160a01b0390921691909117905560409091015160029091015580620001c781620008e5565b91505062000133565b50620001dc84620002dd565b60065460405163095ea7b360e01b81526001600160a01b03888116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af115801562000231573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025791906200090d565b5050600c80546001600160a01b0319166001600160a01b039390931692909217909155600d55506200093895505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620002e762000360565b6001600160a01b038116620003525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200035d816200028b565b50565b6005546001600160a01b03163314620003bc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000349565b565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620003f957620003f9620003be565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200042a576200042a620003be565b604052919050565b60006001600160401b038211156200044e576200044e620003be565b5060051b60200190565b600082601f8301126200046a57600080fd5b81516001600160401b03811115620004865762000486620003be565b60206200049c601f8301601f19168201620003ff565b8281528582848701011115620004b157600080fd5b60005b83811015620004d1578581018301518282018401528201620004b4565b506000928101909101919091529392505050565b600082601f830112620004f757600080fd5b81516020620005106200050a8362000432565b620003ff565b82815260059290921b840181019181810190868411156200053057600080fd5b8286015b84811015620005745780516001600160401b03811115620005555760008081fd5b620005658986838b010162000458565b84525091830191830162000534565b509695505050505050565b80516001600160a01b03811681146200059757600080fd5b919050565b600082601f830112620005ae57600080fd5b81516020620005c16200050a8362000432565b82815260059290921b84018101918181019086841115620005e157600080fd5b8286015b84811015620005745780516001600160401b0380821115620006075760008081fd5b908801906060828b03601f1901811315620006225760008081fd5b6200062c620003d4565b87840151838111156200063f5760008081fd5b6200064f8d8a8388010162000458565b82525060409250620006638385016200057f565b81890152920151908201528352918301918301620005e5565b6000806000806000806000806000806101408b8d0312156200069d57600080fd5b8a516001600160401b0380821115620006b557600080fd5b620006c38e838f01620004e5565b9b50620006d360208e016200057f565b9a50620006e360408e016200057f565b9950620006f360608e016200057f565b98506200070360808e016200057f565b97506200071360a08e016200057f565b96506200072360c08e016200057f565b95506200073360e08e016200057f565b94506101008d015193506101208d01519150808211156200075357600080fd5b50620007628d828e016200059c565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806200079f57607f821691505b602082108103620007c057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200081457600081815260208120601f850160051c81016020861015620007ef5750805b601f850160051c820191505b818110156200081057828155600101620007fb565b5050505b505050565b81516001600160401b03811115620008355762000835620003be565b6200084d816200084684546200078a565b84620007c6565b602080601f8311600181146200088557600084156200086c5750858301515b600019600386901b1c1916600185901b17855562000810565b600085815260208120601f198616915b82811015620008b65788860151825594840194600190910190840162000895565b5085821015620008d55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016200090657634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200092057600080fd5b815180151581146200093157600080fd5b9392505050565b6080516127166200095b60003960008181610372015261062701526127166000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c806395d89b4111610167578063c3533dcf116100ce578063dd2b2f8e11610087578063dd2b2f8e146105a1578063dd62ed3e146105b4578063ef8b30f714610308578063efeb5e58146105c7578063f0cb9783146105e9578063f2fde38b146105fc57600080fd5b8063c3533dcf14610537578063c63d75b614610540578063c6e6f59214610555578063ce96cb7714610568578063d905777e1461057b578063da6b688e1461058e57600080fd5b8063b149b55011610120578063b149b550146104e3578063b3d7f6b9146103cf578063b460af94146104f6578063ba08765214610509578063bd275b1f1461051c578063bf4dc9801461052457600080fd5b806395d89b4114610490578063983bf1bd146104985780639af08330146104a0578063a457c2d7146104b5578063a9059cbb146104c8578063ad7a672f146104db57600080fd5b8063395093511161020b5780636e553f65116101c45780636e553f65146103fe57806370a0823114610411578063715018a61461043a57806386da754c146104445780638da5cb5b1461046c57806394bf804d1461047d57600080fd5b806339509351146103965780633af9e669146103a9578063402d267d146103bc5780634cdad506146103cf5780635c109ec8146103e257806364e5c695146103f557600080fd5b80630a28a4771161025d5780630a28a477146103085780630a6f60ff1461031b57806318160ddd1461034657806323b872dd1461034e578063313ce5671461036157806338d52e0f1461037057600080fd5b806301e1d1141461029a57806306fdde03146102b557806307a2d13a146102ca57806308d68258146102dd578063095ea7b3146102e5575b600080fd5b6102a261060f565b6040519081526020015b60405180910390f35b6102bd61069f565b6040516102ac9190612338565b6102a26102d836600461234b565b610731565b6102a2610771565b6102f86102f336600461237b565b6107c7565b60405190151581526020016102ac565b6102a261031636600461234b565b6107df565b60065461032e906001600160a01b031681565b6040516001600160a01b0390911681526020016102ac565b6002546102a2565b6102f861035c3660046123a5565b6107ea565b604051600681526020016102ac565b7f000000000000000000000000000000000000000000000000000000000000000061032e565b6102f86103a436600461237b565b610810565b6102a26103b73660046123e1565b610832565b6102a26103ca3660046123e1565b610888565b6102a26103dd36600461234b565b6108a6565b60075461032e906001600160a01b031681565b6102a2600e5481565b6102a261040c3660046123fc565b6108b1565b6102a261041f3660046123e1565b6001600160a01b031660009081526020819052604090205490565b6104426108cb565b005b61045761045236600461234b565b6108df565b604080519283526020830191909152016102ac565b6005546001600160a01b031661032e565b6102a261048b3660046123fc565b610a03565b6102bd610a1d565b610442610a2c565b6104a8610d50565b6040516102ac9190612428565b6102f86104c336600461237b565b610e64565b6102f86104d636600461237b565b610eef565b6102a2610efd565b60095461032e906001600160a01b031681565b6102a26105043660046124b2565b610feb565b6102a26105173660046124b2565b61100e565b6102bd611029565b61044261053236600461234b565b6110b7565b6102a2600d5481565b6102a261054e3660046123e1565b5060001990565b6102a261056336600461234b565b611138565b6102a26105763660046123e1565b61115e565b6102a26105893660046123e1565b611169565b600a5461032e906001600160a01b031681565b60085461032e906001600160a01b031681565b6102a26105c23660046124ee565b611187565b6105da6105d536600461234b565b6111b2565b6040516102ac93929190612518565b600c5461032e906001600160a01b031681565b61044261060a3660046123e1565b61127e565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190612546565b905090565b6060600380546106ae9061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546106da9061255f565b80156107275780601f106106fc57610100808354040283529160200191610727565b820191906000526020600020905b81548152906001019060200180831161070a57829003601f168201915b5050505050905090565b600061073c60025490565b600003610747575090565b6002546107526112f7565b61075c90846125a9565b61076691906125c0565b92915050565b919050565b6000805b600f548110156107c357600f8181548110610792576107926125e2565b906000526020600020906003020160020154826107af91906125f8565b9150806107bb8161260b565b915050610775565b5090565b6000336107d5818585611391565b5060019392505050565b600061076682611138565b6000336107f88582856114b5565b61080385858561152f565b60019150505b9392505050565b6000336107d58185856108238383611187565b61082d91906125f8565b611391565b6001600160a01b03811660009081526020819052604081205460000361085a57506000919050565b6002546108656112f7565b6001600160a01b03841660009081526020819052604090205461075c91906125a9565b60006108926116fd565b61089d576000610766565b60001992915050565b600061076682610731565b6000806108bd846107df565b905061080933848684611717565b6108d3611ab5565b6108dd6000611b0f565b565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152670de0b6b3a76400006024820152600092839283929116906378aa987e90604401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109649190612546565b90506109718160016125f8565b61098385670de0b6b3a76400006125a9565b61098d91906125c0565b6007546040516363737ac960e11b8152600481018390529193506001600160a01b03169063c6e6f59290602401602060405180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb9190612546565b925050915091565b600080610a0f846108a6565b905061080933848387611717565b6060600480546106ae9061255f565b600080610a37610efd565b9050600e548110610a5657600e54610a4f9082612624565b9150610a5a565b5050565b60006064600d5484610a6c91906125a9565b610a7691906125c0565b905060006064610a84610771565b610a8e8487612624565b610a9891906125a9565b610aa291906125c0565b9050600080610ab461045285856125f8565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529395509193506000929116906378aa987e90604401602060405180830381865afa158015610b10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b349190612546565b60075460065460085460405163f25816b560e01b81529394506001600160a01b039283169363f25816b593610b7c938993600193899392831692309216908590600401612637565b6060604051808303816000875af1158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf9190612674565b5050600c54600654610bdf92506001600160a01b03908116911687611b61565b846000805b600f54811015610ce957600f54610bfd90600190612624565b8103610c6b5782610c0e89896125f8565b610c189190612624565b9150610c5a600f8281548110610c3057610c306125e2565b60009182526020909120600160039092020101546006546001600160a01b03908116911684611b61565b610c6482846125f8565b9250610cd7565b6064600f8281548110610c8057610c806125e2565b906000526020600020906003020160020154898c610c9e9190612624565b610ca891906125a9565b610cb291906125c0565b9150610cca600f8281548110610c3057610c306125e2565b610cd482846125f8565b92505b80610ce18161260b565b915050610be4565b50610cf4828a612624565b600e6000828254610d0591906125f8565b90915550506040805183815242602082015233917f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a91015b60405180910390a2505050505050505050565b6060600f805480602002602001604051908101604052809291908181526020016000905b82821015610e5b5783829060005260206000209060030201604051806060016040529081600082018054610da79061255f565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd39061255f565b8015610e205780601f10610df557610100808354040283529160200191610e20565b820191906000526020600020905b815481529060010190602001808311610e0357829003601f168201915b50505091835250506001828101546001600160a01b031660208084019190915260029093015460409092019190915291835292019101610d74565b50505050905090565b60003381610e728286611187565b905083811015610ed75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610ee48286868403611391565b506001949350505050565b6000336107d581858561152f565b600754604051633af9e66960e01b815230600482015260009182916001600160a01b0390911690633af9e66990602401602060405180830381865afa158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e9190612546565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529293506000929116906378aa987e90604401602060405180830381865afa158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108099190612546565b600080610ff7856107df565b90506110063385858885611bc9565b949350505050565b60008061101a856108a6565b90506110063385858489611bc9565b600b80546110369061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546110629061255f565b80156110af5780601f10611084576101008083540402835291602001916110af565b820191906000526020600020905b81548152906001019060200180831161109257829003601f168201915b505050505081565b6110bf611ab5565b60065460095460405163095ea7b360e01b81526001600160a01b0391821660048201526024810184905291169063095ea7b3906044016020604051808303816000875af1158015611114573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5691906126a2565b600061114360025490565b60000361114e575090565b6111566112f7565b600254610752565b600061076682610832565b6001600160a01b038116600090815260208190526040812054610766565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600f81815481106111c257600080fd5b90600052602060002090600302016000915090508060000180546111e59061255f565b80601f01602080910402602001604051908101604052809291908181526020018280546112119061255f565b801561125e5780601f106112335761010080835404028352916020019161125e565b820191906000526020600020905b81548152906001019060200180831161124157829003601f168201915b50505050600183015460029093015491926001600160a01b031691905083565b611286611ab5565b6001600160a01b0381166112eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ece565b6112f481611b0f565b50565b600080611302610efd565b90506000600e5482111561138b576000600e54836113209190612624565b905060006064600d548361133491906125a9565b61133e91906125c0565b90506000606461134c610771565b6113568486612624565b61136091906125a9565b61136a91906125c0565b9050806113778387612624565b6113819190612624565b9350505050610766565b50919050565b6001600160a01b0383166113f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610ece565b6001600160a01b0382166114545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610ece565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006114c18484611187565b90506000198114611529578181101561151c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ece565b6115298484848403611391565b50505050565b6001600160a01b0383166115935760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610ece565b6001600160a01b0382166115f55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610ece565b6001600160a01b0383166000908152602081905260409020548181101561166d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610ece565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906116a49084906125f8565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116f091815260200190565b60405180910390a3611529565b60008061170861060f565b118061069a5750506002541590565b600082116117715760405162461bcd60e51b815260206004820152602160248201527f54686520617373657473206d7573742062652067726561746572207468616e206044820152600360fc1b6064820152608401610ece565b600654604051636eb1769f60e11b81526001600160a01b0386811660048301523060248301529091169063dd62ed3e90604401602060405180830381865afa1580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e59190612546565b82111561184b5760405162461bcd60e51b815260206004820152602e60248201527f5468657265206973206e6f206173206d75636820616c6c6f77616e636520666f60448201526d391039ba30b5b4b7339031b7b4b760911b6064820152608401610ece565b6006546040516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa158015611895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b99190612546565b82111561191d5760405162461bcd60e51b815260206004820152602c60248201527f5468657265206973206e6f206173206d7563682062616c616e636520666f722060448201526b39ba30b5b4b7339031b7b4b760a11b6064820152608401610ece565b600654611935906001600160a01b0316853085611e9d565b60085460065460405163119849cf60e01b81526001600160a01b03918216600482015260248101859052600092919091169063119849cf90604401602060405180830381865afa15801561198d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b19190612546565b600954600854600754600a54600654604051631c08892160e11b81526001600160a01b03948516600482015292841660248401529083166044830152821660648201526084810187905260a48101849052600060c4820152929350169063381112429060e401600060405180830381600087803b158015611a3157600080fd5b505af1158015611a45573d6000803e3d6000fd5b5050505082600e6000828254611a5b91906125f8565b90915550611a6b90508483611ed5565b604080518481524260208201526001600160a01b038616917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a25050505050565b6005546001600160a01b031633146108dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ece565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b038316602482015260448101829052611bc490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fb4565b505050565b846001600160a01b0316836001600160a01b031614611c235760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba1030b71037bbb732b960511b6044820152606401610ece565b81600010611c7d5760405162461bcd60e51b815260206004820152602160248201527f54686520616d6f756e74206d7573742062652067726561746572207468616e206044820152600360fc1b6064820152608401610ece565b6001600160a01b03831660009081526020819052604090205480821115611ce65760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206861766520656e6f7567682062616c616e63650000006044820152606401610ece565b611cee610a2c565b600080611cfa856108df565b600854600654604051633c554c3f60e11b81526001600160a01b039182166004820152602481018490529395509193506000929116906378aa987e90604401602060405180830381865afa158015611d56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7a9190612546565b9050600760009054906101000a90046001600160a01b03166001600160a01b031663f25816b584600184600660009054906101000a90046001600160a01b03168d600860009054906101000a90046001600160a01b031660016040518863ffffffff1660e01b8152600401611df59796959493929190612637565b6060604051808303816000875af1158015611e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e389190612674565b50505085600e6000828254611e4d9190612624565b90915550611e5d90508786612086565b604080518781524260208201526001600160a01b038916917f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e9101610d3d565b6040516001600160a01b03808516602483015283166044820152606481018290526115299085906323b872dd60e01b90608401611b8d565b6001600160a01b038216611f2b5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ece565b8060026000828254611f3d91906125f8565b90915550506001600160a01b03821660009081526020819052604081208054839290611f6a9084906125f8565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6000612009826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121d49092919063ffffffff16565b805190915015611bc4578080602001905181019061202791906126a2565b611bc45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610ece565b6001600160a01b0382166120e65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610ece565b6001600160a01b0382166000908152602081905260409020548181101561215a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610ece565b6001600160a01b0383166000908152602081905260408120838303905560028054849290612189908490612624565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60606110068484600085856001600160a01b0385163b6122365760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ece565b600080866001600160a01b0316858760405161225291906126c4565b60006040518083038185875af1925050503d806000811461228f576040519150601f19603f3d011682016040523d82523d6000602084013e612294565b606091505b50915091506122a48282866122af565b979650505050505050565b606083156122be575081610809565b8251156122ce5782518084602001fd5b8160405162461bcd60e51b8152600401610ece9190612338565b60005b838110156123035781810151838201526020016122eb565b50506000910152565b600081518084526123248160208601602086016122e8565b601f01601f19169290920160200192915050565b602081526000610809602083018461230c565b60006020828403121561235d57600080fd5b5035919050565b80356001600160a01b038116811461076c57600080fd5b6000806040838503121561238e57600080fd5b61239783612364565b946020939093013593505050565b6000806000606084860312156123ba57600080fd5b6123c384612364565b92506123d160208501612364565b9150604084013590509250925092565b6000602082840312156123f357600080fd5b61080982612364565b6000806040838503121561240f57600080fd5b8235915061241f60208401612364565b90509250929050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156124a457603f198984030185528151606081518186526124758287018261230c565b838b01516001600160a01b0316878c01529289015195890195909552509487019492509086019060010161244f565b509098975050505050505050565b6000806000606084860312156124c757600080fd5b833592506124d760208501612364565b91506124e560408501612364565b90509250925092565b6000806040838503121561250157600080fd5b61250a83612364565b915061241f60208401612364565b60608152600061252b606083018661230c565b6001600160a01b039490941660208301525060400152919050565b60006020828403121561255857600080fd5b5051919050565b600181811c9082168061257357607f821691505b60208210810361138b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761076657610766612593565b6000826125dd57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b8082018082111561076657610766612593565b60006001820161261d5761261d612593565b5060010190565b8181038181111561076657610766612593565b968752941515602087015260408601939093526001600160a01b039182166060860152811660808501521660a0830152151560c082015260e00190565b60008060006060848603121561268957600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156126b457600080fd5b8151801515811461080957600080fd5b600082516126d68184602087016122e8565b919091019291505056fea2646970667358221220b654f5878a08f73cce0d52a6187c36794b1079404c2783396367853e4b7742cf64736f6c63430008110033a2646970667358221220eec3acafe2665b453cadf468e87e59c7c06108cd1ad2d1889d38dce4ba34384d64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.