Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
StakingPool
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "./base/StakingRewardsPool.sol"; import "./interfaces/IStrategy.sol"; /** * @title Staking Pool * @notice Allows users to stake an asset and receive derivative tokens 1:1, then deposits staked * assets into strategy contracts */ contract StakingPool is StakingRewardsPool { using SafeERC20Upgradeable for IERC20Upgradeable; struct Fee { address receiver; uint256 basisPoints; } address[] private strategies; uint256 public totalStaked; uint256 private liquidityBuffer; // deprecated Fee[] private fees; address public priorityPool; address private delegatorPool; // deprecated uint16 private poolIndex; // deprecated event UpdateStrategyRewards(address indexed account, uint256 totalStaked, int rewardsAmount, uint256 totalFees); /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address _token, string memory _derivativeTokenName, string memory _derivativeTokenSymbol, Fee[] memory _fees ) public initializer { __StakingRewardsPool_init(_token, _derivativeTokenName, _derivativeTokenSymbol); for (uint256 i = 0; i < _fees.length; i++) { fees.push(_fees[i]); } require(_totalFeesBasisPoints() <= 5000, "Total fees must be <= 50%"); } modifier onlyPriorityPool() { require(priorityPool == msg.sender, "PriorityPool only"); _; } /** * @notice returns a list of all active strategies * @return list of strategies */ function getStrategies() external view returns (address[] memory) { return strategies; } /** * @notice returns a list of all fees * @return list of fees */ function getFees() external view returns (Fee[] memory) { return fees; } /** * @notice stakes asset tokens and mints derivative tokens * @param _account account to stake for * @param _amount amount to stake **/ function deposit(address _account, uint256 _amount) external onlyPriorityPool { require(strategies.length > 0, "Must be > 0 strategies to stake"); token.safeTransferFrom(msg.sender, address(this), _amount); depositLiquidity(); _mint(_account, _amount); totalStaked += _amount; } /** * @notice withdraws asset tokens and burns derivative tokens * @dev will withdraw from strategies if not enough liquidity * @param _account account to withdraw for * @param _receiver address to receive withdrawal * @param _amount amount to withdraw **/ function withdraw( address _account, address _receiver, uint256 _amount ) external onlyPriorityPool { uint256 toWithdraw = _amount; if (_amount == type(uint256).max) { toWithdraw = balanceOf(_account); } uint256 balance = token.balanceOf(address(this)); if (toWithdraw > balance) { _withdrawLiquidity(toWithdraw - balance); } require(token.balanceOf(address(this)) >= toWithdraw, "Not enough liquidity available to withdraw"); _burn(_account, toWithdraw); totalStaked -= toWithdraw; token.safeTransfer(_receiver, toWithdraw); } /** * @notice deposits assets into a strategy * @param _index index of strategy * @param _amount amount to deposit **/ function strategyDeposit(uint256 _index, uint256 _amount) external onlyOwner { require(_index < strategies.length, "Strategy does not exist"); IStrategy(strategies[_index]).deposit(_amount); } /** * @notice withdraws assets from a strategy * @param _index index of strategy * @param _amount amount to withdraw **/ function strategyWithdraw(uint256 _index, uint256 _amount) external onlyOwner { require(_index < strategies.length, "Strategy does not exist"); IStrategy(strategies[_index]).withdraw(_amount); } /** * @notice returns the maximum amount that can be deposited into the pool * @return maximum deposit limit **/ function getMaxDeposits() public view returns (uint256) { uint256 max; for (uint256 i = 0; i < strategies.length; i++) { uint strategyMax = IStrategy(strategies[i]).getMaxDeposits(); if (strategyMax >= type(uint256).max - max) { return type(uint256).max; } max += strategyMax; } return max; } /** * @notice returns the minimum amount that must remain the pool * @return minimum deposit limit */ function getMinDeposits() public view returns (uint256) { uint256 min; for (uint256 i = 0; i < strategies.length; i++) { IStrategy strategy = IStrategy(strategies[i]); min += strategy.getMinDeposits(); } return min; } /** * @notice returns the amont of tokens sitting in this pool outside a strategy * @dev these tokens earn no yield and will be deposited ASAP * @return amount of tokens outside a strategy */ function getUnusedDeposits() external view returns (uint256) { return token.balanceOf(address(this)); } /** * @notice returns the available deposit room for this pool's strategies * @return strategy deposit room */ function getStrategyDepositRoom() external view returns (uint256) { uint256 depositRoom; for (uint256 i = 0; i < strategies.length; ++i) { uint strategyDepositRoom = IStrategy(strategies[i]).canDeposit(); if (strategyDepositRoom >= type(uint256).max - depositRoom) { return type(uint256).max; } depositRoom += strategyDepositRoom; } return depositRoom; } /** * @notice returns the available deposit room for this pool * @return available deposit room */ function canDeposit() external view returns (uint256) { uint256 max = getMaxDeposits(); if (max <= totalStaked) { return 0; } else { return max - totalStaked; } } /** * @notice returns the available withdrawal room for this pool * @return available withdrawal room */ function canWithdraw() external view returns (uint256) { uint256 min = getMinDeposits(); if (min >= totalStaked) { return 0; } else { return totalStaked - min; } } /** * @notice adds a new strategy * @param _strategy address of strategy **/ function addStrategy(address _strategy) external onlyOwner { require(!_strategyExists(_strategy), "Strategy already exists"); token.safeApprove(_strategy, type(uint256).max); strategies.push(_strategy); } /** * @notice removes a strategy * @param _index index of strategy * @param _strategyUpdateData encoded data to be passed to strategy **/ function removeStrategy(uint256 _index, bytes memory _strategyUpdateData) external onlyOwner { require(_index < strategies.length, "Strategy does not exist"); uint256[] memory idxs = new uint256[](1); idxs[0] = _index; updateStrategyRewards(idxs, _strategyUpdateData); IStrategy strategy = IStrategy(strategies[_index]); uint256 totalStrategyDeposits = strategy.getTotalDeposits(); if (totalStrategyDeposits > 0) { strategy.withdraw(totalStrategyDeposits); } for (uint256 i = _index; i < strategies.length - 1; i++) { strategies[i] = strategies[i + 1]; } strategies.pop(); token.safeApprove(address(strategy), 0); } /** * @notice reorders strategies * @param _newOrder list containing strategy indexes in a new order **/ function reorderStrategies(uint256[] calldata _newOrder) external onlyOwner { require(_newOrder.length == strategies.length, "newOrder.length must = strategies.length"); address[] memory strategyAddresses = new address[](strategies.length); for (uint256 i = 0; i < strategies.length; i++) { strategyAddresses[i] = strategies[i]; } for (uint256 i = 0; i < strategies.length; i++) { require(strategyAddresses[_newOrder[i]] != address(0), "all indices must be valid"); strategies[i] = strategyAddresses[_newOrder[i]]; strategyAddresses[_newOrder[i]] = address(0); } } /** * @notice adds a new fee * @param _receiver receiver of fee * @param _feeBasisPoints fee in basis points **/ function addFee(address _receiver, uint256 _feeBasisPoints) external onlyOwner { fees.push(Fee(_receiver, _feeBasisPoints)); require(_totalFeesBasisPoints() <= 5000, "Total fees must be <= 50%"); } /** * @notice updates an existing fee * @param _index index of fee * @param _receiver receiver of fee * @param _feeBasisPoints fee in basis points **/ function updateFee( uint256 _index, address _receiver, uint256 _feeBasisPoints ) external onlyOwner { require(_index < fees.length, "Fee does not exist"); if (_feeBasisPoints == 0) { fees[_index] = fees[fees.length - 1]; fees.pop(); } else { fees[_index].receiver = _receiver; fees[_index].basisPoints = _feeBasisPoints; } require(_totalFeesBasisPoints() <= 5000, "Total fees must be <= 50%"); } /** * @notice returns the amount of rewards earned since the last update and the amount of fees that * will be paid on the rewards * @param _strategyIdxs indexes of strategies to sum rewards/fees for * @return total rewards * @return total fees **/ function getStrategyRewards(uint256[] calldata _strategyIdxs) external view returns (int256, uint256) { int256 totalRewards; uint256 totalFees; for (uint256 i = 0; i < _strategyIdxs.length; i++) { IStrategy strategy = IStrategy(strategies[_strategyIdxs[i]]); totalRewards += strategy.getDepositChange(); totalFees += strategy.getPendingFees(); } if (totalRewards > 0) { for (uint256 i = 0; i < fees.length; i++) { totalFees += (uint256(totalRewards) * fees[i].basisPoints) / 10000; } } if (totalFees >= totalStaked) { totalFees = 0; } return (totalRewards, totalFees); } /** * @notice updates and distributes rewards based on balance changes in strategies * @param _strategyIdxs indexes of strategies to update rewards for * @param _data encoded data to be passed to each strategy **/ function updateStrategyRewards(uint256[] memory _strategyIdxs, bytes memory _data) public { int256 totalRewards; uint256 totalFeeAmounts; uint256 totalFeeCount; address[][] memory receivers = new address[][](strategies.length + 1); uint256[][] memory feeAmounts = new uint256[][](strategies.length + 1); for (uint256 i = 0; i < _strategyIdxs.length; ++i) { IStrategy strategy = IStrategy(strategies[_strategyIdxs[i]]); (int256 depositChange, address[] memory strategyReceivers, uint256[] memory strategyFeeAmounts) = strategy .updateDeposits(_data); totalRewards += depositChange; if (strategyReceivers.length != 0) { receivers[i] = strategyReceivers; feeAmounts[i] = strategyFeeAmounts; totalFeeCount += receivers[i].length; for (uint256 j = 0; j < strategyReceivers.length; ++j) { totalFeeAmounts += strategyFeeAmounts[j]; } } } if (totalRewards != 0) { totalStaked = uint256(int256(totalStaked) + totalRewards); } if (totalRewards > 0) { receivers[receivers.length - 1] = new address[](fees.length); feeAmounts[feeAmounts.length - 1] = new uint256[](fees.length); totalFeeCount += fees.length; for (uint256 i = 0; i < fees.length; i++) { receivers[receivers.length - 1][i] = fees[i].receiver; feeAmounts[feeAmounts.length - 1][i] = (uint256(totalRewards) * fees[i].basisPoints) / 10000; totalFeeAmounts += feeAmounts[feeAmounts.length - 1][i]; } } if (totalFeeAmounts >= totalStaked) { totalFeeAmounts = 0; } if (totalFeeAmounts > 0) { uint256 sharesToMint = (totalFeeAmounts * totalShares) / (totalStaked - totalFeeAmounts); _mintShares(address(this), sharesToMint); uint256 feesPaidCount; for (uint256 i = 0; i < receivers.length; i++) { for (uint256 j = 0; j < receivers[i].length; j++) { if (feesPaidCount == totalFeeCount - 1) { transferAndCallFrom(address(this), receivers[i][j], balanceOf(address(this)), "0x"); } else { transferAndCallFrom(address(this), receivers[i][j], feeAmounts[i][j], "0x"); feesPaidCount++; } } } } emit UpdateStrategyRewards(msg.sender, totalStaked, totalRewards, totalFeeAmounts); } /** * @notice deposits available liquidity into strategies by order of priority * @dev deposits into strategies[0] until its limit is reached, then strategies[1], and so on **/ function depositLiquidity() public { uint256 toDeposit = token.balanceOf(address(this)); if (toDeposit > 0) { for (uint256 i = 0; i < strategies.length; i++) { IStrategy strategy = IStrategy(strategies[i]); uint256 strategyCanDeposit = strategy.canDeposit(); if (strategyCanDeposit >= toDeposit) { strategy.deposit(toDeposit); break; } else if (strategyCanDeposit > 0) { strategy.deposit(strategyCanDeposit); toDeposit -= strategyCanDeposit; } } } } /** * @notice Sets the priority pool * @param _priorityPool address of priority pool **/ function setPriorityPool(address _priorityPool) external onlyOwner { priorityPool = _priorityPool; } /** * @notice returns the total amount of assets staked in the pool * @return the total staked amount */ function _totalStaked() internal view override returns (uint256) { return totalStaked; } /** * @notice withdraws liquidity from strategies in opposite order of priority * @dev withdraws from strategies[strategies.length - 1], then strategies[strategies.length - 2], and so on * until withdraw amount is reached * @param _amount amount to withdraw **/ function _withdrawLiquidity(uint256 _amount) private { uint256 toWithdraw = _amount; for (uint256 i = strategies.length; i > 0; i--) { IStrategy strategy = IStrategy(strategies[i - 1]); uint256 strategyCanWithdrawdraw = strategy.canWithdraw(); if (strategyCanWithdrawdraw >= toWithdraw) { strategy.withdraw(toWithdraw); break; } else if (strategyCanWithdrawdraw > 0) { strategy.withdraw(strategyCanWithdrawdraw); toWithdraw -= strategyCanWithdrawdraw; } } } /** * @notice returns the sum of all fees * @return sum of fees in basis points **/ function _totalFeesBasisPoints() private view returns (uint256) { uint256 totalFees; for (uint i = 0; i < fees.length; i++) { totalFees += fees[i].basisPoints; } return totalFees; } /** * @notice checks whether or not a strategy exists * @param _strategy address of strategy * @return true if strategy exists, false otherwise **/ function _strategyExists(address _strategy) private view returns (bool) { for (uint256 i = 0; i < strategies.length; i++) { if (strategies[i] == _strategy) { return true; } } return false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967Upgradeable { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/IERC1967Upgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { AddressUpgradeable.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeTo(address newImplementation) public virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { 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}. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _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 default value returned by this function, unless * it's 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; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _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; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _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; // Overflow not possible: amount <= accountBalance <= totalSupply. _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 {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[45] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @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 (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @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.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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.9.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../extensions/IERC20PermitUpgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20Upgradeable 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(IERC20Upgradeable token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to * 0 before setting it to a non-zero value. */ function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20PermitUpgradeable 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(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../tokens/base/ERC677Upgradeable.sol"; /** * @title StakingRewardsPool * @notice Handles staking and reward distribution for a single asset * @dev Rewards can be positive or negative (user balances can increase and decrease) */ abstract contract StakingRewardsPool is ERC677Upgradeable, UUPSUpgradeable, OwnableUpgradeable { IERC20Upgradeable public token; mapping(address => uint256) private shares; uint256 public totalShares; function __StakingRewardsPool_init( address _token, string memory _derivativeTokenName, string memory _derivativeTokenSymbol ) public onlyInitializing { __ERC677_init(_derivativeTokenName, _derivativeTokenSymbol, 0); __UUPSUpgradeable_init(); __Ownable_init(); token = IERC20Upgradeable(_token); } /** * @notice returns the total supply of staking derivative tokens * @return total supply */ function totalSupply() public view override returns (uint256) { return _totalStaked(); } /** * @notice returns an account's stake balance * @param _account account address * @return account's stake balance */ function balanceOf(address _account) public view override returns (uint256) { uint256 balance = getStakeByShares(shares[_account]); if (balance < 100) { return 0; } else { return balance; } } /** * @notice returns an account's share balance * @param _account account address * @return account's share balance */ function sharesOf(address _account) public view returns (uint256) { return shares[_account]; } /** * @notice returns the amount of shares that corresponds to a staked amount * @param _amount staked amount * @return amount of shares */ function getSharesByStake(uint256 _amount) public view returns (uint256) { uint256 totalStaked = _totalStaked(); if (totalStaked == 0) { return _amount; } else { return (_amount * totalShares) / totalStaked; } } /** * @notice returns the amount of stake that corresponds to an amount of shares * @param _amount shares amount * @return amount of stake */ function getStakeByShares(uint256 _amount) public view returns (uint256) { if (totalShares == 0) { return _amount; } else { return (_amount * _totalStaked()) / totalShares; } } /** * @notice transfers shares from one account to another * @param _recipient account to transfer to * @param _sharesAmount amount of shares to transfer */ function transferShares(address _recipient, uint256 _sharesAmount) external returns (bool) { _transferShares(msg.sender, _recipient, _sharesAmount); return true; } /** * @notice transfers shares from one account to another * @param _sender account to transfer from * @param _recipient account to transfer to * @param _sharesAmount amount of shares to transfer */ function transferSharesFrom( address _sender, address _recipient, uint256 _sharesAmount ) external returns (bool) { uint256 tokensAmount = getStakeByShares(_sharesAmount); _spendAllowance(_sender, msg.sender, tokensAmount); _transferShares(_sender, _recipient, _sharesAmount); return true; } /** * @notice returns the total amount of assets staked in the pool * @return total staked amount */ function _totalStaked() internal view virtual returns (uint256); /** * @notice transfers a stake balance from one account to another * @param _sender account to transfer from * @param _recipient account to transfer to * @param _amount amount to transfer */ function _transfer( address _sender, address _recipient, uint256 _amount ) internal override { uint256 sharesToTransfer = getSharesByStake(_amount); require(_sender != address(0), "Transfer from the zero address"); require(_recipient != address(0), "Transfer to the zero address"); require(shares[_sender] >= sharesToTransfer, "Transfer amount exceeds balance"); shares[_sender] -= sharesToTransfer; shares[_recipient] += sharesToTransfer; emit Transfer(_sender, _recipient, _amount); } /** * @notice transfers shares from one account to another * @param _sender account to transfer from * @param _recipient account to transfer to * @param _sharesAmount amount of shares to transfer */ function _transferShares( address _sender, address _recipient, uint256 _sharesAmount ) internal { require(_sender != address(0), "Transfer from the zero address"); require(_recipient != address(0), "Transfer to the zero address"); require(shares[_sender] >= _sharesAmount, "Transfer amount exceeds balance"); shares[_sender] -= _sharesAmount; shares[_recipient] += _sharesAmount; emit Transfer(_sender, _recipient, getStakeByShares(_sharesAmount)); } /** * @notice mints new shares to an account * @dev takes a stake amount and calculates the amount of shares it corresponds to * @param _recipient account to mint shares for * @param _amount stake amount */ function _mint(address _recipient, uint256 _amount) internal override { uint256 sharesToMint = getSharesByStake(_amount); _mintShares(_recipient, sharesToMint); emit Transfer(address(0), _recipient, _amount); } /** * @notice mints new shares to an account * @param _recipient account to mint shares for * @param _amount shares amount */ function _mintShares(address _recipient, uint256 _amount) internal { require(_recipient != address(0), "Mint to the zero address"); totalShares += _amount; shares[_recipient] += _amount; } /** * @notice burns shares belonging to an account * @dev takes a stake amount and calculates the amount of shares it corresponds to * @param _account account to burn shares for * @param _amount stake amount */ function _burn(address _account, uint256 _amount) internal override { uint256 sharesToBurn = getSharesByStake(_amount); require(_account != address(0), "Burn from the zero address"); require(shares[_account] >= sharesToBurn, "Burn amount exceeds balance"); totalShares -= sharesToBurn; shares[_account] -= sharesToBurn; emit Transfer(_account, address(0), _amount); } function _authorizeUpgrade(address) internal override onlyOwner {} }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IERC677Receiver { function onTokenTransfer( address _sender, uint256 _value, bytes calldata _data ) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IStrategy { function deposit(uint256 _amount) external; function withdraw(uint256 _amount) external; function updateDeposits(bytes calldata _data) external returns ( int256 depositChange, address[] memory receivers, uint256[] memory amounts ); function getTotalDeposits() external view returns (uint256); function getMaxDeposits() external view returns (uint256); function getMinDeposits() external view returns (uint256); function canDeposit() external view returns (uint256); function canWithdraw() external view returns (uint256); function getDepositChange() external view returns (int256); function getPendingFees() external view returns (uint256); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../interfaces/IERC677Receiver.sol"; contract ERC677Upgradeable is ERC20Upgradeable { function __ERC677_init( string memory _tokenName, string memory _tokenSymbol, uint256 _totalSupply ) public onlyInitializing { __ERC20_init(_tokenName, _tokenSymbol); _mint(msg.sender, _totalSupply * (10**uint256(decimals()))); } function transferAndCall( address _to, uint256 _value, bytes memory _data ) public returns (bool) { super.transfer(_to, _value); if (isContract(_to)) { contractFallback(msg.sender, _to, _value, _data); } return true; } function transferAndCallFrom( address _sender, address _to, uint256 _value, bytes memory _data ) internal returns (bool) { _transfer(_sender, _to, _value); if (isContract(_to)) { contractFallback(_sender, _to, _value, _data); } return true; } function contractFallback( address _sender, address _to, uint256 _value, bytes memory _data ) internal { IERC677Receiver receiver = IERC677Receiver(_to); receiver.onTokenTransfer(_sender, _value, _data); } function isContract(address _addr) internal view returns (bool hasCode) { uint256 length; assembly { length := extcodesize(_addr) } return length > 0; } }
{ "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
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"},{"indexed":false,"internalType":"int256","name":"rewardsAmount","type":"int256"},{"indexed":false,"internalType":"uint256","name":"totalFees","type":"uint256"}],"name":"UpdateStrategyRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"name":"__ERC677_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"string","name":"_derivativeTokenName","type":"string"},{"internalType":"string","name":"_derivativeTokenSymbol","type":"string"}],"name":"__StakingRewardsPool_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_feeBasisPoints","type":"uint256"}],"name":"addFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"addStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFees","outputs":[{"components":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"basisPoints","type":"uint256"}],"internalType":"struct StakingPool.Fee[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getSharesByStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getStakeByShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategies","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategyDepositRoom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_strategyIdxs","type":"uint256[]"}],"name":"getStrategyRewards","outputs":[{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnusedDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"string","name":"_derivativeTokenName","type":"string"},{"internalType":"string","name":"_derivativeTokenSymbol","type":"string"},{"components":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"basisPoints","type":"uint256"}],"internalType":"struct StakingPool.Fee[]","name":"_fees","type":"tuple[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priorityPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"bytes","name":"_strategyUpdateData","type":"bytes"}],"name":"removeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_newOrder","type":"uint256[]"}],"name":"reorderStrategies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priorityPool","type":"address"}],"name":"setPriorityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"sharesOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"strategyDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"strategyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"transferAndCall","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_sharesAmount","type":"uint256"}],"name":"transferShares","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_sharesAmount","type":"uint256"}],"name":"transferSharesFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_feeBasisPoints","type":"uint256"}],"name":"updateFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_strategyIdxs","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"updateStrategyRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051614ce16200011f60003960008181610ba601528181610be601528181610e0901528181610e490152610fb00152614ce16000f3fe6080604052600436106102e45760003560e01c80638d09487f11610190578063c2c44eed116100dc578063dd62ed3e11610095578063eb47dc8f1161006f578063eb47dc8f14610889578063f2fde38b1461089e578063f5eb42dc146108be578063fc0c546a146108f457600080fd5b8063dd62ed3e14610834578063e78a587514610854578063ea3b3e2d1461086957600080fd5b8063c2c44eed1461077d578063ca593c591461079d578063d5647c33146107b2578063d7379028146107d2578063d9caed12146107f2578063db8d55f11461081257600080fd5b8063a9059cbb11610149578063b51459fe11610123578063b51459fe14610712578063b5169e5314610727578063b7b7a40814610748578063c08e22fa1461075d57600080fd5b8063a9059cbb146106b0578063b47529c5146106d0578063b49a60bb146106f057600080fd5b80638d09487f146105e95780638da5cb5b146106095780638fcb4e5b1461063b57806395d89b411461065b57806399b8964b14610670578063a457c2d71461069057600080fd5b806347e7ef241161024f5780636d780459116102085780637718238f116101e25780637718238f14610573578063790965d914610593578063817b1cd2146105b35780638ce09bb8146105c957600080fd5b80636d7804591461051e57806370a082311461053e578063715018a61461055e57600080fd5b806347e7ef241461046c5780634f1ef2861461048c57806350be85961461049f57806351367373146104b457806352d1902d146104d45780635ee11564146104e957600080fd5b8063313ce567116102a1578063313ce567146103ba5780633659cfe6146103d657806339509351146103f65780633a2e47cd146104165780633a98ef39146104365780634000aea01461044c57600080fd5b8063050b4d13146102e957806306fdde0314610311578063095ea7b31461033357806318160ddd14610363578063223e54791461037857806323b872dd1461039a575b600080fd5b3480156102f557600080fd5b506102fe610914565b6040519081526020015b60405180910390f35b34801561031d57600080fd5b506103266109ee565b6040516103089190613f15565b34801561033f57600080fd5b5061035361034e366004613f3d565b610a80565b6040519015158152602001610308565b34801561036f57600080fd5b506102fe610a9a565b34801561038457600080fd5b50610398610393366004613f69565b610aaa565b005b3480156103a657600080fd5b506103536103b5366004613f86565b610b78565b3480156103c657600080fd5b5060405160128152602001610308565b3480156103e257600080fd5b506103986103f1366004613f69565b610b9c565b34801561040257600080fd5b50610353610411366004613f3d565b610c7b565b34801561042257600080fd5b506103986104313660046140a4565b610c9d565b34801561044257600080fd5b506102fe60fd5481565b34801561045857600080fd5b50610353610467366004614110565b610cf2565b34801561047857600080fd5b50610398610487366004613f3d565b610d1c565b61039861049a366004614168565b610dff565b3480156104ab57600080fd5b506102fe610ecf565b3480156104c057600080fd5b506103986104cf3660046141b7565b610f3c565b3480156104e057600080fd5b506102fe610fa3565b3480156104f557600080fd5b50610509610504366004614222565b611056565b60408051928352602083019190915201610308565b34801561052a57600080fd5b50610353610539366004613f86565b611225565b34801561054a57600080fd5b506102fe610559366004613f69565b611249565b34801561056a57600080fd5b50610398611281565b34801561057f57600080fd5b5061039861058e366004613f3d565b611295565b34801561059f57600080fd5b506103986105ae366004614296565b61135a565b3480156105bf57600080fd5b506102fe60ff5481565b3480156105d557600080fd5b506102fe6105e43660046142b8565b611402565b3480156105f557600080fd5b50610398610604366004614222565b61143f565b34801561061557600080fd5b5060c9546001600160a01b03165b6040516001600160a01b039091168152602001610308565b34801561064757600080fd5b50610353610656366004613f3d565b6116cc565b34801561066757600080fd5b506103266116e2565b34801561067c57600080fd5b5061039861068b3660046142f4565b6116f1565b34801561069c57600080fd5b506103536106ab366004613f3d565b611dda565b3480156106bc57600080fd5b506103536106cb366004613f3d565b611e55565b3480156106dc57600080fd5b506103986106eb3660046143a7565b611e63565b3480156106fc57600080fd5b50610705612013565b60405161030891906143ce565b34801561071e57600080fd5b506102fe612074565b34801561073357600080fd5b5061010254610623906001600160a01b031681565b34801561075457600080fd5b506102fe6120a6565b34801561076957600080fd5b5061039861077836600461441b565b61217c565b34801561078957600080fd5b50610398610798366004614296565b6123d3565b3480156107a957600080fd5b50610398612449565b3480156107be57600080fd5b506103986107cd36600461444b565b612643565b3480156107de57600080fd5b506102fe6107ed3660046142b8565b612800565b3480156107fe57600080fd5b5061039861080d366004613f86565b61282a565b34801561081e57600080fd5b50610827612a1c565b6040516103089190614566565b34801561084057600080fd5b506102fe61084f3660046145be565b612a92565b34801561086057600080fd5b506102fe612abd565b34801561087557600080fd5b50610398610884366004613f69565b612ae8565b34801561089557600080fd5b506102fe612b13565b3480156108aa57600080fd5b506103986108b9366004613f69565b612bcd565b3480156108ca57600080fd5b506102fe6108d9366004613f69565b6001600160a01b0316600090815260fc602052604090205490565b34801561090057600080fd5b5060fb54610623906001600160a01b031681565b60008060005b60fe548110156109e857600060fe8281548110610939576109396145f7565b600091825260209182902001546040805163e78a587560e01b815290516001600160a01b039092169263e78a5875926004808401938290030181865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab919061460d565b90506109b98360001961463c565b81106109ca57600019935050505090565b6109d48184614653565b925050806109e19061466b565b905061091a565b50919050565b6060603680546109fd90614684565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2990614684565b8015610a765780601f10610a4b57610100808354040283529160200191610a76565b820191906000526020600020905b815481529060010190602001808311610a5957829003601f168201915b5050505050905090565b600033610a8e818585612c43565b60019150505b92915050565b6000610aa560ff5490565b905090565b610ab2612d68565b610abb81612dc2565b15610b0d5760405162461bcd60e51b815260206004820152601760248201527f537472617465677920616c72656164792065786973747300000000000000000060448201526064015b60405180910390fd5b60fb54610b26906001600160a01b031682600019612e2b565b60fe80546001810182556000919091527f54075df80ec1ae6ac9100e1fd0ebf3246c17f5c933137af392011f4c5f61513a0180546001600160a01b0319166001600160a01b0392909216919091179055565b600033610b86858285612f73565b610b91858585612fe7565b506001949350505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610be45760405162461bcd60e51b8152600401610b04906146b8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c2d600080516020614c45833981519152546001600160a01b031690565b6001600160a01b031614610c535760405162461bcd60e51b8152600401610b0490614704565b610c5c816131a5565b60408051600080825260208201909252610c78918391906131ad565b50565b600033610a8e818585610c8e8383612a92565b610c989190614653565b612c43565b600054610100900460ff16610cc45760405162461bcd60e51b8152600401610b0490614750565b610cce8383613318565b610ced33610cde6012600a61487f565b610ce8908461488b565b613349565b505050565b6000610cfe8484611e55565b50833b15610d1257610d123385858561338c565b5060019392505050565b610102546001600160a01b03163314610d6b5760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b60fe54610dba5760405162461bcd60e51b815260206004820152601f60248201527f4d757374206265203e2030207374726174656769657320746f207374616b65006044820152606401610b04565b60fb54610dd2906001600160a01b03163330846133f7565b610dda612449565b610de48282613349565b8060ff6000828254610df69190614653565b90915550505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610e475760405162461bcd60e51b8152600401610b04906146b8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e90600080516020614c45833981519152546001600160a01b031690565b6001600160a01b031614610eb65760405162461bcd60e51b8152600401610b0490614704565b610ebf826131a5565b610ecb828260016131ad565b5050565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa5919061460d565b600054610100900460ff16610f635760405162461bcd60e51b8152600401610b0490614750565b610f6f82826000610c9d565b610f7761342f565b610f7f613456565b505060fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110435760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b04565b50600080516020614c4583398151915290565b60008060008060005b8581101561119757600060fe88888481811061107d5761107d6145f7565b9050602002013581548110611094576110946145f7565b60009182526020918290200154604080516369feab4960e01b815290516001600160a01b03909216935083926369feab49926004808401938290030181865afa1580156110e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611109919061460d565b61111390856148aa565b9350806001600160a01b031663c51c2d0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611177919061460d565b6111819084614653565b925050808061118f9061466b565b91505061105f565b50600082131561120d5760005b6101015481101561120b5761271061010182815481106111c6576111c66145f7565b906000526020600020906002020160010154846111e3919061488b565b6111ed91906148eb565b6111f79083614653565b9150806112038161466b565b9150506111a4565b505b60ff54811061121a575060005b909590945092505050565b60008061123183612800565b905061123e853383612f73565b610b91858585613485565b6001600160a01b038116600090815260fc6020526040812054819061126d90612800565b90506064811015610a945750600092915050565b611289612d68565b6112936000613627565b565b61129d612d68565b604080518082019091526001600160a01b03838116825260208201838152610101805460018101825560009190915292517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca747689600290940293840180546001600160a01b0319169190931617909155517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768a9091015561138861133c613679565b1115610ecb5760405162461bcd60e51b8152600401610b049061490d565b611362612d68565b60fe5482106113835760405162461bcd60e51b8152600401610b0490614944565b60fe8281548110611396576113966145f7565b60009182526020909120015460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f25906024015b600060405180830381600087803b1580156113e657600080fd5b505af11580156113fa573d6000803e3d6000fd5b505050505050565b60008061140e60ff5490565b90508060000361141f575090919050565b8060fd548461142e919061488b565b61143891906148eb565b9392505050565b611447612d68565b60fe5481146114a95760405162461bcd60e51b815260206004820152602860248201527f6e65774f726465722e6c656e677468206d757374203d207374726174656769656044820152670e65cd8cadccee8d60c31b6064820152608401610b04565b60fe546000906001600160401b038111156114c6576114c6613fc7565b6040519080825280602002602001820160405280156114ef578160200160208202803683370190505b50905060005b60fe5481101561156c5760fe8181548110611512576115126145f7565b9060005260206000200160009054906101000a90046001600160a01b0316828281518110611542576115426145f7565b6001600160a01b0390921660209283029190910190910152806115648161466b565b9150506114f5565b5060005b60fe548110156116c65760008285858481811061158f5761158f6145f7565b90506020020135815181106115a6576115a66145f7565b60200260200101516001600160a01b0316036116045760405162461bcd60e51b815260206004820152601960248201527f616c6c20696e6469636573206d7573742062652076616c6964000000000000006044820152606401610b04565b81848483818110611617576116176145f7565b905060200201358151811061162e5761162e6145f7565b602002602001015160fe8281548110611649576116496145f7565b6000918252602082200180546001600160a01b0319166001600160a01b03939093169290921790915582858584818110611685576116856145f7565b905060200201358151811061169c5761169c6145f7565b6001600160a01b0390921660209283029190910190910152806116be8161466b565b915050611570565b50505050565b60006116d9338484613485565b50600192915050565b6060603780546109fd90614684565b60008060008060fe8054905060016117099190614653565b6001600160401b0381111561172057611720613fc7565b60405190808252806020026020018201604052801561175357816020015b606081526020019060019003908161173e5790505b5060fe54909150600090611768906001614653565b6001600160401b0381111561177f5761177f613fc7565b6040519080825280602002602001820160405280156117b257816020015b606081526020019060019003908161179d5790505b50905060005b875181101561194f57600060fe8983815181106117d7576117d76145f7565b6020026020010151815481106117ef576117ef6145f7565b600091825260208220015460405163af51e6a560e01b81526001600160a01b03909116925081908190849063af51e6a59061182e908e90600401613f15565b6000604051808303816000875af115801561184d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261187591908101906149e1565b91945092509050611886838b6148aa565b9950815160001461193a57818786815181106118a4576118a46145f7565b6020026020010181905250808686815181106118c2576118c26145f7565b60200260200101819052508685815181106118df576118df6145f7565b602002602001015151886118f39190614653565b975060005b825181101561193857818181518110611913576119136145f7565b60200260200101518a6119269190614653565b99506119318161466b565b90506118f8565b505b50505050806119489061466b565b90506117b8565b508415611968578460ff5461196491906148aa565b60ff555b6000851315611bda57610101546001600160401b0381111561198c5761198c613fc7565b6040519080825280602002602001820160405280156119b5578160200160208202803683370190505b5082600184516119c5919061463c565b815181106119d5576119d56145f7565b6020908102919091010152610101546001600160401b038111156119fb576119fb613fc7565b604051908082528060200260200182016040528015611a24578160200160208202803683370190505b508160018351611a34919061463c565b81518110611a4457611a446145f7565b602090810291909101015261010154611a5d9084614653565b925060005b61010154811015611bd8576101018181548110611a8157611a816145f7565b600091825260209091206002909102015483516001600160a01b03909116908490611aae9060019061463c565b81518110611abe57611abe6145f7565b60200260200101518281518110611ad757611ad76145f7565b60200260200101906001600160a01b031690816001600160a01b0316815250506127106101018281548110611b0e57611b0e6145f7565b90600052602060002090600202016001015487611b2b919061488b565b611b3591906148eb565b8260018451611b44919061463c565b81518110611b5457611b546145f7565b60200260200101518281518110611b6d57611b6d6145f7565b6020026020010181815250508160018351611b88919061463c565b81518110611b9857611b986145f7565b60200260200101518181518110611bb157611bb16145f7565b602002602001015185611bc49190614653565b945080611bd08161466b565b915050611a62565b505b60ff548410611be857600093505b8315611d8c5760008460ff54611bfe919061463c565b60fd54611c0b908761488b565b611c1591906148eb565b9050611c2130826136cf565b6000805b8451811015611d885760005b858281518110611c4357611c436145f7565b602002602001015151811015611d7557611c5e60018861463c565b8303611cca57611cc430878481518110611c7a57611c7a6145f7565b60200260200101518381518110611c9357611c936145f7565b6020026020010151611ca430611249565b60405180604001604052806002815260200161060f60f31b815250613764565b50611d63565b611d5430878481518110611ce057611ce06145f7565b60200260200101518381518110611cf957611cf96145f7565b6020026020010151878581518110611d1357611d136145f7565b60200260200101518481518110611d2c57611d2c6145f7565b602002602001015160405180604001604052806002815260200161060f60f31b815250613764565b5082611d5f8161466b565b9350505b80611d6d8161466b565b915050611c31565b5080611d808161466b565b915050611c25565b5050505b60ff546040805191825260208201879052810185905233907f04f794b9bb152df3a9f2aa7b424206ce2c2c26ef386bb1fea8325cdfdcd339569060600160405180910390a250505050505050565b60003381611de88286612a92565b905083811015611e485760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610b04565b610b918286868403612c43565b600033610a8e818585612fe7565b611e6b612d68565b610101548310611eb25760405162461bcd60e51b815260206004820152601260248201527111995948191bd95cc81b9bdd08195e1a5cdd60721b6044820152606401610b04565b80600003611f75576101018054611ecb9060019061463c565b81548110611edb57611edb6145f7565b90600052602060002090600202016101018481548110611efd57611efd6145f7565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b03909216919091178155600191820154910155610101805480611f4757611f47614aa4565b60008281526020812060026000199093019283020180546001600160a01b0319168155600101559055611fea565b816101018481548110611f8a57611f8a6145f7565b906000526020600020906002020160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806101018481548110611fd457611fd46145f7565b9060005260206000209060020201600101819055505b611388611ff5613679565b1115610ced5760405162461bcd60e51b8152600401610b049061490d565b606060fe805480602002602001604051908101604052809291908181526020018280548015610a7657602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161204d575050505050905090565b60008061207f612b13565b905060ff54811061209257600091505090565b8060ff546120a0919061463c565b91505090565b60008060005b60fe548110156109e857600060fe82815481106120cb576120cb6145f7565b60009182526020918290200154604080516316f6f48160e31b815290516001600160a01b039092169263b7b7a408926004808401938290030181865afa158015612119573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213d919061460d565b905061214b8360001961463c565b811061215c57600019935050505090565b6121668184614653565b92505080806121749061466b565b9150506120ac565b612184612d68565b60fe5482106121a55760405162461bcd60e51b8152600401610b0490614944565b6040805160018082528183019092526000916020808301908036833701905050905082816000815181106121db576121db6145f7565b6020026020010181815250506121f181836116f1565b600060fe8481548110612206576122066145f7565b600091825260208083209091015460408051630b45241160e11b815290516001600160a01b039092169450849263168a4822926004808401938290030181865afa158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c919061460d565b905080156122df57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156122c657600080fd5b505af11580156122da573d6000803e3d6000fd5b505050505b845b60fe546122f09060019061463c565b81101561237b5760fe612304826001614653565b81548110612314576123146145f7565b60009182526020909120015460fe80546001600160a01b039092169183908110612340576123406145f7565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806123738161466b565b9150506122e1565b5060fe80548061238d5761238d614aa4565b600082815260208120600019908301810180546001600160a01b031916905590910190915560fb546123cc916001600160a01b03909116908490612e2b565b5050505050565b6123db612d68565b60fe5482106123fc5760405162461bcd60e51b8152600401610b0490614944565b60fe828154811061240f5761240f6145f7565b600091825260209091200154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d906024016113cc565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b6919061460d565b90508015610c785760005b60fe54811015610ecb57600060fe82815481106124e0576124e06145f7565b60009182526020808320909101546040805163e78a587560e01b815290516001600160a01b039092169450849263e78a5875926004808401938290030181865afa158015612532573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612556919061460d565b90508381106125bf5760405163b6b55f2560e01b8152600481018590526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b1580156125a157600080fd5b505af11580156125b5573d6000803e3d6000fd5b5050505050505050565b801561262e5760405163b6b55f2560e01b8152600481018290526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b15801561260757600080fd5b505af115801561261b573d6000803e3d6000fd5b50505050808461262b919061463c565b93505b5050808061263b9061466b565b9150506124c1565b600054610100900460ff16158080156126635750600054600160ff909116105b8061267d5750303b15801561267d575060005460ff166001145b6126e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b04565b6000805460ff191660011790558015612703576000805461ff0019166101001790555b61270e858585610f3c565b60005b825181101561278a5761010183828151811061272f5761272f6145f7565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b03909216919091178155910151910155806127828161466b565b915050612711565b50611388612796613679565b11156127b45760405162461bcd60e51b8152600401610b049061490d565b80156123cc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600060fd54600003612810575090565b60fd5460ff54612820908461488b565b610a9491906148eb565b610102546001600160a01b031633146128795760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b806001810161288e5761288b84611249565b90505b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156128d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128fb919061460d565b90508082111561291757612917612912828461463c565b61378c565b60fb546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa15801561295f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612983919061460d565b10156129e45760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f756768206c697175696469747920617661696c61626c6520746044820152696f20776974686472617760b01b6064820152608401610b04565b6129ee85836138e7565b8160ff6000828254612a00919061463c565b909155505060fb546123cc906001600160a01b03168584613a22565b6060610101805480602002602001604051908101604052809291908181526020016000905b82821015612a89576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612a41565b50505050905090565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600080612ac86120a6565b905060ff548111612adb57600091505090565b60ff546120a0908261463c565b612af0612d68565b61010280546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b60fe548110156109e857600060fe8281548110612b3857612b386145f7565b600091825260209182902001546040805163eb47dc8f60e01b815290516001600160a01b039092169350839263eb47dc8f926004808401938290030181865afa158015612b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bad919061460d565b612bb79084614653565b9250508080612bc59061466b565b915050612b19565b612bd5612d68565b6001600160a01b038116612c3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b610c7881613627565b6001600160a01b038316612ca55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610b04565b6001600160a01b038216612d065760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610b04565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60c9546001600160a01b031633146112935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b04565b6000805b60fe54811015612e2257826001600160a01b031660fe8281548110612ded57612ded6145f7565b6000918252602090912001546001600160a01b031603612e105750600192915050565b80612e1a8161466b565b915050612dc6565b50600092915050565b801580612ea55750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea3919061460d565b155b612f105760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610b04565b6040516001600160a01b038316602482015260448101829052610ced90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613a52565b6000612f7f8484612a92565b905060001981146116c65781811015612fda5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610b04565b6116c68484848403612c43565b6000612ff282611402565b90506001600160a01b03841661304a5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0383166130a05760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038416600090815260fc60205260409020548111156131085760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038416600090815260fc60205260408120805483929061313090849061463c565b90915550506001600160a01b038316600090815260fc60205260408120805483929061315d908490614653565b92505081905550826001600160a01b0316846001600160a01b0316600080516020614c8c8339815191528460405161319791815260200190565b60405180910390a350505050565b610c78612d68565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131e057610ced83613b27565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561323a575060408051601f3d908101601f191682019092526132379181019061460d565b60015b61329d5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b04565b600080516020614c45833981519152811461330c5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b04565b50610ced838383613bc3565b600054610100900460ff1661333f5760405162461bcd60e51b8152600401610b0490614750565b610ecb8282613be8565b600061335482611402565b905061336083826136cf565b6040518281526001600160a01b03841690600090600080516020614c8c83398151915290602001612d5b565b604051635260769b60e11b815283906001600160a01b0382169063a4c0ed36906133be90889087908790600401614aba565b600060405180830381600087803b1580156133d857600080fd5b505af11580156133ec573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116c69085906323b872dd60e01b90608401612f3c565b600054610100900460ff166112935760405162461bcd60e51b8152600401610b0490614750565b600054610100900460ff1661347d5760405162461bcd60e51b8152600401610b0490614750565b611293613c28565b6001600160a01b0383166134db5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0382166135315760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156135995760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038316600090815260fc6020526040812080548392906135c190849061463c565b90915550506001600160a01b038216600090815260fc6020526040812080548392906135ee908490614653565b90915550506001600160a01b03808316908416600080516020614c8c83398151915261361984612800565b604051908152602001612d5b565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b610101548110156109e857610101818154811061369e5761369e6145f7565b906000526020600020906002020160010154826136bb9190614653565b9150806136c78161466b565b91505061367f565b6001600160a01b0382166137255760405162461bcd60e51b815260206004820152601860248201527f4d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610b04565b8060fd60008282546137379190614653565b90915550506001600160a01b038216600090815260fc602052604081208054839290610df6908490614653565b6000613771858585612fe7565b833b15610b9157610b918585858561338c565b949350505050565b60fe5481905b8015610ced57600060fe6137a760018461463c565b815481106137b7576137b76145f7565b600091825260208083209091015460408051635a8a2cff60e11b815290516001600160a01b039092169450849263b51459fe926004808401938290030181865afa158015613809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382d919061460d565b905083811061386357604051632e1a7d4d60e01b8152600481018590526001600160a01b03831690632e1a7d4d906024016133be565b80156138d257604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156138ab57600080fd5b505af11580156138bf573d6000803e3d6000fd5b5050505080846138cf919061463c565b93505b505080806138df90614aea565b915050613792565b60006138f282611402565b90506001600160a01b03831661394a5760405162461bcd60e51b815260206004820152601a60248201527f4275726e2066726f6d20746865207a65726f20616464726573730000000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156139b25760405162461bcd60e51b815260206004820152601b60248201527f4275726e20616d6f756e7420657863656564732062616c616e636500000000006044820152606401610b04565b8060fd60008282546139c4919061463c565b90915550506001600160a01b038316600090815260fc6020526040812080548392906139f190849061463c565b90915550506040518281526000906001600160a01b03851690600080516020614c8c83398151915290602001612d5b565b6040516001600160a01b038316602482015260448101829052610ced90849063a9059cbb60e01b90606401612f3c565b6000613aa7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c589092919063ffffffff16565b9050805160001480613ac8575080806020019051810190613ac89190614b01565b610ced5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b04565b6001600160a01b0381163b613b945760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b04565b600080516020614c4583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613bcc83613c67565b600082511180613bd95750805b15610ced576116c68383613ca7565b600054610100900460ff16613c0f5760405162461bcd60e51b8152600401610b0490614750565b6036613c1b8382614b69565b506037610ced8282614b69565b600054610100900460ff16613c4f5760405162461bcd60e51b8152600401610b0490614750565b61129333613627565b60606137848484600085613ccc565b613c7081613b27565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114388383604051806060016040528060278152602001614c6560279139613da7565b606082471015613d2d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b04565b600080866001600160a01b03168587604051613d499190614c28565b60006040518083038185875af1925050503d8060008114613d86576040519150601f19603f3d011682016040523d82523d6000602084013e613d8b565b606091505b5091509150613d9c87838387613e1f565b979650505050505050565b6060600080856001600160a01b031685604051613dc49190614c28565b600060405180830381855af49150503d8060008114613dff576040519150601f19603f3d011682016040523d82523d6000602084013e613e04565b606091505b5091509150613e1586838387613e1f565b9695505050505050565b60608315613e8e578251600003613e87576001600160a01b0385163b613e875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b04565b5081613784565b6137848383815115613ea35781518083602001fd5b8060405162461bcd60e51b8152600401610b049190613f15565b60005b83811015613ed8578181015183820152602001613ec0565b838111156116c65750506000910152565b60008151808452613f01816020860160208601613ebd565b601f01601f19169290920160200192915050565b6020815260006114386020830184613ee9565b6001600160a01b0381168114610c7857600080fd5b60008060408385031215613f5057600080fd5b8235613f5b81613f28565b946020939093013593505050565b600060208284031215613f7b57600080fd5b813561143881613f28565b600080600060608486031215613f9b57600080fd5b8335613fa681613f28565b92506020840135613fb681613f28565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613fff57613fff613fc7565b60405290565b604051601f8201601f191681016001600160401b038111828210171561402d5761402d613fc7565b604052919050565b600082601f83011261404657600080fd5b81356001600160401b0381111561405f5761405f613fc7565b614072601f8201601f1916602001614005565b81815284602083860101111561408757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156140b957600080fd5b83356001600160401b03808211156140d057600080fd5b6140dc87838801614035565b945060208601359150808211156140f257600080fd5b506140ff86828701614035565b925050604084013590509250925092565b60008060006060848603121561412557600080fd5b833561413081613f28565b92506020840135915060408401356001600160401b0381111561415257600080fd5b61415e86828701614035565b9150509250925092565b6000806040838503121561417b57600080fd5b823561418681613f28565b915060208301356001600160401b038111156141a157600080fd5b6141ad85828601614035565b9150509250929050565b6000806000606084860312156141cc57600080fd5b83356141d781613f28565b925060208401356001600160401b03808211156141f357600080fd5b6141ff87838801614035565b9350604086013591508082111561421557600080fd5b5061415e86828701614035565b6000806020838503121561423557600080fd5b82356001600160401b038082111561424c57600080fd5b818501915085601f83011261426057600080fd5b81358181111561426f57600080fd5b8660208260051b850101111561428457600080fd5b60209290920196919550909350505050565b600080604083850312156142a957600080fd5b50508035926020909101359150565b6000602082840312156142ca57600080fd5b5035919050565b60006001600160401b038211156142ea576142ea613fc7565b5060051b60200190565b6000806040838503121561430757600080fd5b82356001600160401b038082111561431e57600080fd5b818501915085601f83011261433257600080fd5b81356020614347614342836142d1565b614005565b82815260059290921b8401810191818101908984111561436657600080fd5b948201945b838610156143845785358252948201949082019061436b565b9650508601359250508082111561439a57600080fd5b506141ad85828601614035565b6000806000606084860312156143bc57600080fd5b833592506020840135613fb681613f28565b6020808252825182820181905260009190848201906040850190845b8181101561440f5783516001600160a01b0316835292840192918401916001016143ea565b50909695505050505050565b6000806040838503121561442e57600080fd5b8235915060208301356001600160401b038111156141a157600080fd5b6000806000806080858703121561446157600080fd5b843561446c81613f28565b93506020858101356001600160401b038082111561448957600080fd5b61449589838a01614035565b95506040915081880135818111156144ac57600080fd5b6144b88a828b01614035565b9550506060880135818111156144cd57600080fd5b88019050601f810189136144e057600080fd5b80356144ee614342826142d1565b81815260069190911b8201840190848101908b83111561450d57600080fd5b928501925b828410156145565784848d03121561452a5760008081fd5b614532613fdd565b843561453d81613f28565b8152848701358782015282529284019290850190614512565b989b979a50959850505050505050565b602080825282518282018190526000919060409081850190868401855b828110156145b157815180516001600160a01b03168552860151868501529284019290850190600101614583565b5091979650505050505050565b600080604083850312156145d157600080fd5b82356145dc81613f28565b915060208301356145ec81613f28565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561461f57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561464e5761464e614626565b500390565b6000821982111561466657614666614626565b500190565b60006001820161467d5761467d614626565b5060010190565b600181811c9082168061469857607f821691505b6020821081036109e857634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181815b808511156147d65781600019048211156147bc576147bc614626565b808516156147c957918102915b93841c93908002906147a0565b509250929050565b6000826147ed57506001610a94565b816147fa57506000610a94565b8160018114614810576002811461481a57614836565b6001915050610a94565b60ff84111561482b5761482b614626565b50506001821b610a94565b5060208310610133831016604e8410600b8410161715614859575081810a610a94565b614863838361479b565b806000190482111561487757614877614626565b029392505050565b600061143883836147de565b60008160001904831182151516156148a5576148a5614626565b500290565b600080821280156001600160ff1b03849003851316156148cc576148cc614626565b600160ff1b83900384128116156148e5576148e5614626565b50500190565b60008261490857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526019908201527f546f74616c2066656573206d757374206265203c3d2035302500000000000000604082015260600190565b60208082526017908201527f537472617465677920646f6573206e6f74206578697374000000000000000000604082015260600190565b600082601f83011261498c57600080fd5b8151602061499c614342836142d1565b82815260059290921b840181019181810190868411156149bb57600080fd5b8286015b848110156149d657805183529183019183016149bf565b509695505050505050565b6000806000606084860312156149f657600080fd5b835192506020808501516001600160401b0380821115614a1557600080fd5b818701915087601f830112614a2957600080fd5b8151614a37614342826142d1565b81815260059190911b8301840190848101908a831115614a5657600080fd5b938501935b82851015614a7d578451614a6e81613f28565b82529385019390850190614a5b565b60408a01519097509450505080831115614a9657600080fd5b505061415e8682870161497b565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0384168152826020820152606060408201526000614ae16060830184613ee9565b95945050505050565b600081614af957614af9614626565b506000190190565b600060208284031215614b1357600080fd5b8151801515811461143857600080fd5b601f821115610ced57600081815260208120601f850160051c81016020861015614b4a5750805b601f850160051c820191505b818110156113fa57828155600101614b56565b81516001600160401b03811115614b8257614b82613fc7565b614b9681614b908454614684565b84614b23565b602080601f831160018114614bcb5760008415614bb35750858301515b600019600386901b1c1916600185901b1785556113fa565b600085815260208120601f198616915b82811015614bfa57888601518255948401946001909101908401614bdb565b5085821015614c185787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251614c3a818460208701613ebd565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212205a3329dcfd1aac0098cc5b1dfd6d3b6b8d821fc00e842c06ea036bcedb9d384b64736f6c634300080f0033
Deployed Bytecode
0x6080604052600436106102e45760003560e01c80638d09487f11610190578063c2c44eed116100dc578063dd62ed3e11610095578063eb47dc8f1161006f578063eb47dc8f14610889578063f2fde38b1461089e578063f5eb42dc146108be578063fc0c546a146108f457600080fd5b8063dd62ed3e14610834578063e78a587514610854578063ea3b3e2d1461086957600080fd5b8063c2c44eed1461077d578063ca593c591461079d578063d5647c33146107b2578063d7379028146107d2578063d9caed12146107f2578063db8d55f11461081257600080fd5b8063a9059cbb11610149578063b51459fe11610123578063b51459fe14610712578063b5169e5314610727578063b7b7a40814610748578063c08e22fa1461075d57600080fd5b8063a9059cbb146106b0578063b47529c5146106d0578063b49a60bb146106f057600080fd5b80638d09487f146105e95780638da5cb5b146106095780638fcb4e5b1461063b57806395d89b411461065b57806399b8964b14610670578063a457c2d71461069057600080fd5b806347e7ef241161024f5780636d780459116102085780637718238f116101e25780637718238f14610573578063790965d914610593578063817b1cd2146105b35780638ce09bb8146105c957600080fd5b80636d7804591461051e57806370a082311461053e578063715018a61461055e57600080fd5b806347e7ef241461046c5780634f1ef2861461048c57806350be85961461049f57806351367373146104b457806352d1902d146104d45780635ee11564146104e957600080fd5b8063313ce567116102a1578063313ce567146103ba5780633659cfe6146103d657806339509351146103f65780633a2e47cd146104165780633a98ef39146104365780634000aea01461044c57600080fd5b8063050b4d13146102e957806306fdde0314610311578063095ea7b31461033357806318160ddd14610363578063223e54791461037857806323b872dd1461039a575b600080fd5b3480156102f557600080fd5b506102fe610914565b6040519081526020015b60405180910390f35b34801561031d57600080fd5b506103266109ee565b6040516103089190613f15565b34801561033f57600080fd5b5061035361034e366004613f3d565b610a80565b6040519015158152602001610308565b34801561036f57600080fd5b506102fe610a9a565b34801561038457600080fd5b50610398610393366004613f69565b610aaa565b005b3480156103a657600080fd5b506103536103b5366004613f86565b610b78565b3480156103c657600080fd5b5060405160128152602001610308565b3480156103e257600080fd5b506103986103f1366004613f69565b610b9c565b34801561040257600080fd5b50610353610411366004613f3d565b610c7b565b34801561042257600080fd5b506103986104313660046140a4565b610c9d565b34801561044257600080fd5b506102fe60fd5481565b34801561045857600080fd5b50610353610467366004614110565b610cf2565b34801561047857600080fd5b50610398610487366004613f3d565b610d1c565b61039861049a366004614168565b610dff565b3480156104ab57600080fd5b506102fe610ecf565b3480156104c057600080fd5b506103986104cf3660046141b7565b610f3c565b3480156104e057600080fd5b506102fe610fa3565b3480156104f557600080fd5b50610509610504366004614222565b611056565b60408051928352602083019190915201610308565b34801561052a57600080fd5b50610353610539366004613f86565b611225565b34801561054a57600080fd5b506102fe610559366004613f69565b611249565b34801561056a57600080fd5b50610398611281565b34801561057f57600080fd5b5061039861058e366004613f3d565b611295565b34801561059f57600080fd5b506103986105ae366004614296565b61135a565b3480156105bf57600080fd5b506102fe60ff5481565b3480156105d557600080fd5b506102fe6105e43660046142b8565b611402565b3480156105f557600080fd5b50610398610604366004614222565b61143f565b34801561061557600080fd5b5060c9546001600160a01b03165b6040516001600160a01b039091168152602001610308565b34801561064757600080fd5b50610353610656366004613f3d565b6116cc565b34801561066757600080fd5b506103266116e2565b34801561067c57600080fd5b5061039861068b3660046142f4565b6116f1565b34801561069c57600080fd5b506103536106ab366004613f3d565b611dda565b3480156106bc57600080fd5b506103536106cb366004613f3d565b611e55565b3480156106dc57600080fd5b506103986106eb3660046143a7565b611e63565b3480156106fc57600080fd5b50610705612013565b60405161030891906143ce565b34801561071e57600080fd5b506102fe612074565b34801561073357600080fd5b5061010254610623906001600160a01b031681565b34801561075457600080fd5b506102fe6120a6565b34801561076957600080fd5b5061039861077836600461441b565b61217c565b34801561078957600080fd5b50610398610798366004614296565b6123d3565b3480156107a957600080fd5b50610398612449565b3480156107be57600080fd5b506103986107cd36600461444b565b612643565b3480156107de57600080fd5b506102fe6107ed3660046142b8565b612800565b3480156107fe57600080fd5b5061039861080d366004613f86565b61282a565b34801561081e57600080fd5b50610827612a1c565b6040516103089190614566565b34801561084057600080fd5b506102fe61084f3660046145be565b612a92565b34801561086057600080fd5b506102fe612abd565b34801561087557600080fd5b50610398610884366004613f69565b612ae8565b34801561089557600080fd5b506102fe612b13565b3480156108aa57600080fd5b506103986108b9366004613f69565b612bcd565b3480156108ca57600080fd5b506102fe6108d9366004613f69565b6001600160a01b0316600090815260fc602052604090205490565b34801561090057600080fd5b5060fb54610623906001600160a01b031681565b60008060005b60fe548110156109e857600060fe8281548110610939576109396145f7565b600091825260209182902001546040805163e78a587560e01b815290516001600160a01b039092169263e78a5875926004808401938290030181865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab919061460d565b90506109b98360001961463c565b81106109ca57600019935050505090565b6109d48184614653565b925050806109e19061466b565b905061091a565b50919050565b6060603680546109fd90614684565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2990614684565b8015610a765780601f10610a4b57610100808354040283529160200191610a76565b820191906000526020600020905b815481529060010190602001808311610a5957829003601f168201915b5050505050905090565b600033610a8e818585612c43565b60019150505b92915050565b6000610aa560ff5490565b905090565b610ab2612d68565b610abb81612dc2565b15610b0d5760405162461bcd60e51b815260206004820152601760248201527f537472617465677920616c72656164792065786973747300000000000000000060448201526064015b60405180910390fd5b60fb54610b26906001600160a01b031682600019612e2b565b60fe80546001810182556000919091527f54075df80ec1ae6ac9100e1fd0ebf3246c17f5c933137af392011f4c5f61513a0180546001600160a01b0319166001600160a01b0392909216919091179055565b600033610b86858285612f73565b610b91858585612fe7565b506001949350505050565b6001600160a01b037f000000000000000000000000b074db74dc7f0f7d96c552331e59ae0a6b1ae088163003610be45760405162461bcd60e51b8152600401610b04906146b8565b7f000000000000000000000000b074db74dc7f0f7d96c552331e59ae0a6b1ae0886001600160a01b0316610c2d600080516020614c45833981519152546001600160a01b031690565b6001600160a01b031614610c535760405162461bcd60e51b8152600401610b0490614704565b610c5c816131a5565b60408051600080825260208201909252610c78918391906131ad565b50565b600033610a8e818585610c8e8383612a92565b610c989190614653565b612c43565b600054610100900460ff16610cc45760405162461bcd60e51b8152600401610b0490614750565b610cce8383613318565b610ced33610cde6012600a61487f565b610ce8908461488b565b613349565b505050565b6000610cfe8484611e55565b50833b15610d1257610d123385858561338c565b5060019392505050565b610102546001600160a01b03163314610d6b5760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b60fe54610dba5760405162461bcd60e51b815260206004820152601f60248201527f4d757374206265203e2030207374726174656769657320746f207374616b65006044820152606401610b04565b60fb54610dd2906001600160a01b03163330846133f7565b610dda612449565b610de48282613349565b8060ff6000828254610df69190614653565b90915550505050565b6001600160a01b037f000000000000000000000000b074db74dc7f0f7d96c552331e59ae0a6b1ae088163003610e475760405162461bcd60e51b8152600401610b04906146b8565b7f000000000000000000000000b074db74dc7f0f7d96c552331e59ae0a6b1ae0886001600160a01b0316610e90600080516020614c45833981519152546001600160a01b031690565b6001600160a01b031614610eb65760405162461bcd60e51b8152600401610b0490614704565b610ebf826131a5565b610ecb828260016131ad565b5050565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa5919061460d565b600054610100900460ff16610f635760405162461bcd60e51b8152600401610b0490614750565b610f6f82826000610c9d565b610f7761342f565b610f7f613456565b505060fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000b074db74dc7f0f7d96c552331e59ae0a6b1ae08816146110435760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b04565b50600080516020614c4583398151915290565b60008060008060005b8581101561119757600060fe88888481811061107d5761107d6145f7565b9050602002013581548110611094576110946145f7565b60009182526020918290200154604080516369feab4960e01b815290516001600160a01b03909216935083926369feab49926004808401938290030181865afa1580156110e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611109919061460d565b61111390856148aa565b9350806001600160a01b031663c51c2d0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611177919061460d565b6111819084614653565b925050808061118f9061466b565b91505061105f565b50600082131561120d5760005b6101015481101561120b5761271061010182815481106111c6576111c66145f7565b906000526020600020906002020160010154846111e3919061488b565b6111ed91906148eb565b6111f79083614653565b9150806112038161466b565b9150506111a4565b505b60ff54811061121a575060005b909590945092505050565b60008061123183612800565b905061123e853383612f73565b610b91858585613485565b6001600160a01b038116600090815260fc6020526040812054819061126d90612800565b90506064811015610a945750600092915050565b611289612d68565b6112936000613627565b565b61129d612d68565b604080518082019091526001600160a01b03838116825260208201838152610101805460018101825560009190915292517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca747689600290940293840180546001600160a01b0319169190931617909155517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768a9091015561138861133c613679565b1115610ecb5760405162461bcd60e51b8152600401610b049061490d565b611362612d68565b60fe5482106113835760405162461bcd60e51b8152600401610b0490614944565b60fe8281548110611396576113966145f7565b60009182526020909120015460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f25906024015b600060405180830381600087803b1580156113e657600080fd5b505af11580156113fa573d6000803e3d6000fd5b505050505050565b60008061140e60ff5490565b90508060000361141f575090919050565b8060fd548461142e919061488b565b61143891906148eb565b9392505050565b611447612d68565b60fe5481146114a95760405162461bcd60e51b815260206004820152602860248201527f6e65774f726465722e6c656e677468206d757374203d207374726174656769656044820152670e65cd8cadccee8d60c31b6064820152608401610b04565b60fe546000906001600160401b038111156114c6576114c6613fc7565b6040519080825280602002602001820160405280156114ef578160200160208202803683370190505b50905060005b60fe5481101561156c5760fe8181548110611512576115126145f7565b9060005260206000200160009054906101000a90046001600160a01b0316828281518110611542576115426145f7565b6001600160a01b0390921660209283029190910190910152806115648161466b565b9150506114f5565b5060005b60fe548110156116c65760008285858481811061158f5761158f6145f7565b90506020020135815181106115a6576115a66145f7565b60200260200101516001600160a01b0316036116045760405162461bcd60e51b815260206004820152601960248201527f616c6c20696e6469636573206d7573742062652076616c6964000000000000006044820152606401610b04565b81848483818110611617576116176145f7565b905060200201358151811061162e5761162e6145f7565b602002602001015160fe8281548110611649576116496145f7565b6000918252602082200180546001600160a01b0319166001600160a01b03939093169290921790915582858584818110611685576116856145f7565b905060200201358151811061169c5761169c6145f7565b6001600160a01b0390921660209283029190910190910152806116be8161466b565b915050611570565b50505050565b60006116d9338484613485565b50600192915050565b6060603780546109fd90614684565b60008060008060fe8054905060016117099190614653565b6001600160401b0381111561172057611720613fc7565b60405190808252806020026020018201604052801561175357816020015b606081526020019060019003908161173e5790505b5060fe54909150600090611768906001614653565b6001600160401b0381111561177f5761177f613fc7565b6040519080825280602002602001820160405280156117b257816020015b606081526020019060019003908161179d5790505b50905060005b875181101561194f57600060fe8983815181106117d7576117d76145f7565b6020026020010151815481106117ef576117ef6145f7565b600091825260208220015460405163af51e6a560e01b81526001600160a01b03909116925081908190849063af51e6a59061182e908e90600401613f15565b6000604051808303816000875af115801561184d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261187591908101906149e1565b91945092509050611886838b6148aa565b9950815160001461193a57818786815181106118a4576118a46145f7565b6020026020010181905250808686815181106118c2576118c26145f7565b60200260200101819052508685815181106118df576118df6145f7565b602002602001015151886118f39190614653565b975060005b825181101561193857818181518110611913576119136145f7565b60200260200101518a6119269190614653565b99506119318161466b565b90506118f8565b505b50505050806119489061466b565b90506117b8565b508415611968578460ff5461196491906148aa565b60ff555b6000851315611bda57610101546001600160401b0381111561198c5761198c613fc7565b6040519080825280602002602001820160405280156119b5578160200160208202803683370190505b5082600184516119c5919061463c565b815181106119d5576119d56145f7565b6020908102919091010152610101546001600160401b038111156119fb576119fb613fc7565b604051908082528060200260200182016040528015611a24578160200160208202803683370190505b508160018351611a34919061463c565b81518110611a4457611a446145f7565b602090810291909101015261010154611a5d9084614653565b925060005b61010154811015611bd8576101018181548110611a8157611a816145f7565b600091825260209091206002909102015483516001600160a01b03909116908490611aae9060019061463c565b81518110611abe57611abe6145f7565b60200260200101518281518110611ad757611ad76145f7565b60200260200101906001600160a01b031690816001600160a01b0316815250506127106101018281548110611b0e57611b0e6145f7565b90600052602060002090600202016001015487611b2b919061488b565b611b3591906148eb565b8260018451611b44919061463c565b81518110611b5457611b546145f7565b60200260200101518281518110611b6d57611b6d6145f7565b6020026020010181815250508160018351611b88919061463c565b81518110611b9857611b986145f7565b60200260200101518181518110611bb157611bb16145f7565b602002602001015185611bc49190614653565b945080611bd08161466b565b915050611a62565b505b60ff548410611be857600093505b8315611d8c5760008460ff54611bfe919061463c565b60fd54611c0b908761488b565b611c1591906148eb565b9050611c2130826136cf565b6000805b8451811015611d885760005b858281518110611c4357611c436145f7565b602002602001015151811015611d7557611c5e60018861463c565b8303611cca57611cc430878481518110611c7a57611c7a6145f7565b60200260200101518381518110611c9357611c936145f7565b6020026020010151611ca430611249565b60405180604001604052806002815260200161060f60f31b815250613764565b50611d63565b611d5430878481518110611ce057611ce06145f7565b60200260200101518381518110611cf957611cf96145f7565b6020026020010151878581518110611d1357611d136145f7565b60200260200101518481518110611d2c57611d2c6145f7565b602002602001015160405180604001604052806002815260200161060f60f31b815250613764565b5082611d5f8161466b565b9350505b80611d6d8161466b565b915050611c31565b5080611d808161466b565b915050611c25565b5050505b60ff546040805191825260208201879052810185905233907f04f794b9bb152df3a9f2aa7b424206ce2c2c26ef386bb1fea8325cdfdcd339569060600160405180910390a250505050505050565b60003381611de88286612a92565b905083811015611e485760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610b04565b610b918286868403612c43565b600033610a8e818585612fe7565b611e6b612d68565b610101548310611eb25760405162461bcd60e51b815260206004820152601260248201527111995948191bd95cc81b9bdd08195e1a5cdd60721b6044820152606401610b04565b80600003611f75576101018054611ecb9060019061463c565b81548110611edb57611edb6145f7565b90600052602060002090600202016101018481548110611efd57611efd6145f7565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b03909216919091178155600191820154910155610101805480611f4757611f47614aa4565b60008281526020812060026000199093019283020180546001600160a01b0319168155600101559055611fea565b816101018481548110611f8a57611f8a6145f7565b906000526020600020906002020160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806101018481548110611fd457611fd46145f7565b9060005260206000209060020201600101819055505b611388611ff5613679565b1115610ced5760405162461bcd60e51b8152600401610b049061490d565b606060fe805480602002602001604051908101604052809291908181526020018280548015610a7657602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161204d575050505050905090565b60008061207f612b13565b905060ff54811061209257600091505090565b8060ff546120a0919061463c565b91505090565b60008060005b60fe548110156109e857600060fe82815481106120cb576120cb6145f7565b60009182526020918290200154604080516316f6f48160e31b815290516001600160a01b039092169263b7b7a408926004808401938290030181865afa158015612119573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213d919061460d565b905061214b8360001961463c565b811061215c57600019935050505090565b6121668184614653565b92505080806121749061466b565b9150506120ac565b612184612d68565b60fe5482106121a55760405162461bcd60e51b8152600401610b0490614944565b6040805160018082528183019092526000916020808301908036833701905050905082816000815181106121db576121db6145f7565b6020026020010181815250506121f181836116f1565b600060fe8481548110612206576122066145f7565b600091825260208083209091015460408051630b45241160e11b815290516001600160a01b039092169450849263168a4822926004808401938290030181865afa158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c919061460d565b905080156122df57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156122c657600080fd5b505af11580156122da573d6000803e3d6000fd5b505050505b845b60fe546122f09060019061463c565b81101561237b5760fe612304826001614653565b81548110612314576123146145f7565b60009182526020909120015460fe80546001600160a01b039092169183908110612340576123406145f7565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806123738161466b565b9150506122e1565b5060fe80548061238d5761238d614aa4565b600082815260208120600019908301810180546001600160a01b031916905590910190915560fb546123cc916001600160a01b03909116908490612e2b565b5050505050565b6123db612d68565b60fe5482106123fc5760405162461bcd60e51b8152600401610b0490614944565b60fe828154811061240f5761240f6145f7565b600091825260209091200154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d906024016113cc565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b6919061460d565b90508015610c785760005b60fe54811015610ecb57600060fe82815481106124e0576124e06145f7565b60009182526020808320909101546040805163e78a587560e01b815290516001600160a01b039092169450849263e78a5875926004808401938290030181865afa158015612532573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612556919061460d565b90508381106125bf5760405163b6b55f2560e01b8152600481018590526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b1580156125a157600080fd5b505af11580156125b5573d6000803e3d6000fd5b5050505050505050565b801561262e5760405163b6b55f2560e01b8152600481018290526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b15801561260757600080fd5b505af115801561261b573d6000803e3d6000fd5b50505050808461262b919061463c565b93505b5050808061263b9061466b565b9150506124c1565b600054610100900460ff16158080156126635750600054600160ff909116105b8061267d5750303b15801561267d575060005460ff166001145b6126e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b04565b6000805460ff191660011790558015612703576000805461ff0019166101001790555b61270e858585610f3c565b60005b825181101561278a5761010183828151811061272f5761272f6145f7565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b03909216919091178155910151910155806127828161466b565b915050612711565b50611388612796613679565b11156127b45760405162461bcd60e51b8152600401610b049061490d565b80156123cc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600060fd54600003612810575090565b60fd5460ff54612820908461488b565b610a9491906148eb565b610102546001600160a01b031633146128795760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b806001810161288e5761288b84611249565b90505b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156128d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128fb919061460d565b90508082111561291757612917612912828461463c565b61378c565b60fb546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa15801561295f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612983919061460d565b10156129e45760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f756768206c697175696469747920617661696c61626c6520746044820152696f20776974686472617760b01b6064820152608401610b04565b6129ee85836138e7565b8160ff6000828254612a00919061463c565b909155505060fb546123cc906001600160a01b03168584613a22565b6060610101805480602002602001604051908101604052809291908181526020016000905b82821015612a89576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612a41565b50505050905090565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600080612ac86120a6565b905060ff548111612adb57600091505090565b60ff546120a0908261463c565b612af0612d68565b61010280546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b60fe548110156109e857600060fe8281548110612b3857612b386145f7565b600091825260209182902001546040805163eb47dc8f60e01b815290516001600160a01b039092169350839263eb47dc8f926004808401938290030181865afa158015612b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bad919061460d565b612bb79084614653565b9250508080612bc59061466b565b915050612b19565b612bd5612d68565b6001600160a01b038116612c3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b610c7881613627565b6001600160a01b038316612ca55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610b04565b6001600160a01b038216612d065760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610b04565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60c9546001600160a01b031633146112935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b04565b6000805b60fe54811015612e2257826001600160a01b031660fe8281548110612ded57612ded6145f7565b6000918252602090912001546001600160a01b031603612e105750600192915050565b80612e1a8161466b565b915050612dc6565b50600092915050565b801580612ea55750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea3919061460d565b155b612f105760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610b04565b6040516001600160a01b038316602482015260448101829052610ced90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613a52565b6000612f7f8484612a92565b905060001981146116c65781811015612fda5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610b04565b6116c68484848403612c43565b6000612ff282611402565b90506001600160a01b03841661304a5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0383166130a05760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038416600090815260fc60205260409020548111156131085760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038416600090815260fc60205260408120805483929061313090849061463c565b90915550506001600160a01b038316600090815260fc60205260408120805483929061315d908490614653565b92505081905550826001600160a01b0316846001600160a01b0316600080516020614c8c8339815191528460405161319791815260200190565b60405180910390a350505050565b610c78612d68565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131e057610ced83613b27565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561323a575060408051601f3d908101601f191682019092526132379181019061460d565b60015b61329d5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b04565b600080516020614c45833981519152811461330c5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b04565b50610ced838383613bc3565b600054610100900460ff1661333f5760405162461bcd60e51b8152600401610b0490614750565b610ecb8282613be8565b600061335482611402565b905061336083826136cf565b6040518281526001600160a01b03841690600090600080516020614c8c83398151915290602001612d5b565b604051635260769b60e11b815283906001600160a01b0382169063a4c0ed36906133be90889087908790600401614aba565b600060405180830381600087803b1580156133d857600080fd5b505af11580156133ec573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116c69085906323b872dd60e01b90608401612f3c565b600054610100900460ff166112935760405162461bcd60e51b8152600401610b0490614750565b600054610100900460ff1661347d5760405162461bcd60e51b8152600401610b0490614750565b611293613c28565b6001600160a01b0383166134db5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0382166135315760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156135995760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038316600090815260fc6020526040812080548392906135c190849061463c565b90915550506001600160a01b038216600090815260fc6020526040812080548392906135ee908490614653565b90915550506001600160a01b03808316908416600080516020614c8c83398151915261361984612800565b604051908152602001612d5b565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b610101548110156109e857610101818154811061369e5761369e6145f7565b906000526020600020906002020160010154826136bb9190614653565b9150806136c78161466b565b91505061367f565b6001600160a01b0382166137255760405162461bcd60e51b815260206004820152601860248201527f4d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610b04565b8060fd60008282546137379190614653565b90915550506001600160a01b038216600090815260fc602052604081208054839290610df6908490614653565b6000613771858585612fe7565b833b15610b9157610b918585858561338c565b949350505050565b60fe5481905b8015610ced57600060fe6137a760018461463c565b815481106137b7576137b76145f7565b600091825260208083209091015460408051635a8a2cff60e11b815290516001600160a01b039092169450849263b51459fe926004808401938290030181865afa158015613809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382d919061460d565b905083811061386357604051632e1a7d4d60e01b8152600481018590526001600160a01b03831690632e1a7d4d906024016133be565b80156138d257604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156138ab57600080fd5b505af11580156138bf573d6000803e3d6000fd5b5050505080846138cf919061463c565b93505b505080806138df90614aea565b915050613792565b60006138f282611402565b90506001600160a01b03831661394a5760405162461bcd60e51b815260206004820152601a60248201527f4275726e2066726f6d20746865207a65726f20616464726573730000000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156139b25760405162461bcd60e51b815260206004820152601b60248201527f4275726e20616d6f756e7420657863656564732062616c616e636500000000006044820152606401610b04565b8060fd60008282546139c4919061463c565b90915550506001600160a01b038316600090815260fc6020526040812080548392906139f190849061463c565b90915550506040518281526000906001600160a01b03851690600080516020614c8c83398151915290602001612d5b565b6040516001600160a01b038316602482015260448101829052610ced90849063a9059cbb60e01b90606401612f3c565b6000613aa7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c589092919063ffffffff16565b9050805160001480613ac8575080806020019051810190613ac89190614b01565b610ced5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b04565b6001600160a01b0381163b613b945760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b04565b600080516020614c4583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613bcc83613c67565b600082511180613bd95750805b15610ced576116c68383613ca7565b600054610100900460ff16613c0f5760405162461bcd60e51b8152600401610b0490614750565b6036613c1b8382614b69565b506037610ced8282614b69565b600054610100900460ff16613c4f5760405162461bcd60e51b8152600401610b0490614750565b61129333613627565b60606137848484600085613ccc565b613c7081613b27565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114388383604051806060016040528060278152602001614c6560279139613da7565b606082471015613d2d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b04565b600080866001600160a01b03168587604051613d499190614c28565b60006040518083038185875af1925050503d8060008114613d86576040519150601f19603f3d011682016040523d82523d6000602084013e613d8b565b606091505b5091509150613d9c87838387613e1f565b979650505050505050565b6060600080856001600160a01b031685604051613dc49190614c28565b600060405180830381855af49150503d8060008114613dff576040519150601f19603f3d011682016040523d82523d6000602084013e613e04565b606091505b5091509150613e1586838387613e1f565b9695505050505050565b60608315613e8e578251600003613e87576001600160a01b0385163b613e875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b04565b5081613784565b6137848383815115613ea35781518083602001fd5b8060405162461bcd60e51b8152600401610b049190613f15565b60005b83811015613ed8578181015183820152602001613ec0565b838111156116c65750506000910152565b60008151808452613f01816020860160208601613ebd565b601f01601f19169290920160200192915050565b6020815260006114386020830184613ee9565b6001600160a01b0381168114610c7857600080fd5b60008060408385031215613f5057600080fd5b8235613f5b81613f28565b946020939093013593505050565b600060208284031215613f7b57600080fd5b813561143881613f28565b600080600060608486031215613f9b57600080fd5b8335613fa681613f28565b92506020840135613fb681613f28565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613fff57613fff613fc7565b60405290565b604051601f8201601f191681016001600160401b038111828210171561402d5761402d613fc7565b604052919050565b600082601f83011261404657600080fd5b81356001600160401b0381111561405f5761405f613fc7565b614072601f8201601f1916602001614005565b81815284602083860101111561408757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156140b957600080fd5b83356001600160401b03808211156140d057600080fd5b6140dc87838801614035565b945060208601359150808211156140f257600080fd5b506140ff86828701614035565b925050604084013590509250925092565b60008060006060848603121561412557600080fd5b833561413081613f28565b92506020840135915060408401356001600160401b0381111561415257600080fd5b61415e86828701614035565b9150509250925092565b6000806040838503121561417b57600080fd5b823561418681613f28565b915060208301356001600160401b038111156141a157600080fd5b6141ad85828601614035565b9150509250929050565b6000806000606084860312156141cc57600080fd5b83356141d781613f28565b925060208401356001600160401b03808211156141f357600080fd5b6141ff87838801614035565b9350604086013591508082111561421557600080fd5b5061415e86828701614035565b6000806020838503121561423557600080fd5b82356001600160401b038082111561424c57600080fd5b818501915085601f83011261426057600080fd5b81358181111561426f57600080fd5b8660208260051b850101111561428457600080fd5b60209290920196919550909350505050565b600080604083850312156142a957600080fd5b50508035926020909101359150565b6000602082840312156142ca57600080fd5b5035919050565b60006001600160401b038211156142ea576142ea613fc7565b5060051b60200190565b6000806040838503121561430757600080fd5b82356001600160401b038082111561431e57600080fd5b818501915085601f83011261433257600080fd5b81356020614347614342836142d1565b614005565b82815260059290921b8401810191818101908984111561436657600080fd5b948201945b838610156143845785358252948201949082019061436b565b9650508601359250508082111561439a57600080fd5b506141ad85828601614035565b6000806000606084860312156143bc57600080fd5b833592506020840135613fb681613f28565b6020808252825182820181905260009190848201906040850190845b8181101561440f5783516001600160a01b0316835292840192918401916001016143ea565b50909695505050505050565b6000806040838503121561442e57600080fd5b8235915060208301356001600160401b038111156141a157600080fd5b6000806000806080858703121561446157600080fd5b843561446c81613f28565b93506020858101356001600160401b038082111561448957600080fd5b61449589838a01614035565b95506040915081880135818111156144ac57600080fd5b6144b88a828b01614035565b9550506060880135818111156144cd57600080fd5b88019050601f810189136144e057600080fd5b80356144ee614342826142d1565b81815260069190911b8201840190848101908b83111561450d57600080fd5b928501925b828410156145565784848d03121561452a5760008081fd5b614532613fdd565b843561453d81613f28565b8152848701358782015282529284019290850190614512565b989b979a50959850505050505050565b602080825282518282018190526000919060409081850190868401855b828110156145b157815180516001600160a01b03168552860151868501529284019290850190600101614583565b5091979650505050505050565b600080604083850312156145d157600080fd5b82356145dc81613f28565b915060208301356145ec81613f28565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561461f57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561464e5761464e614626565b500390565b6000821982111561466657614666614626565b500190565b60006001820161467d5761467d614626565b5060010190565b600181811c9082168061469857607f821691505b6020821081036109e857634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181815b808511156147d65781600019048211156147bc576147bc614626565b808516156147c957918102915b93841c93908002906147a0565b509250929050565b6000826147ed57506001610a94565b816147fa57506000610a94565b8160018114614810576002811461481a57614836565b6001915050610a94565b60ff84111561482b5761482b614626565b50506001821b610a94565b5060208310610133831016604e8410600b8410161715614859575081810a610a94565b614863838361479b565b806000190482111561487757614877614626565b029392505050565b600061143883836147de565b60008160001904831182151516156148a5576148a5614626565b500290565b600080821280156001600160ff1b03849003851316156148cc576148cc614626565b600160ff1b83900384128116156148e5576148e5614626565b50500190565b60008261490857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526019908201527f546f74616c2066656573206d757374206265203c3d2035302500000000000000604082015260600190565b60208082526017908201527f537472617465677920646f6573206e6f74206578697374000000000000000000604082015260600190565b600082601f83011261498c57600080fd5b8151602061499c614342836142d1565b82815260059290921b840181019181810190868411156149bb57600080fd5b8286015b848110156149d657805183529183019183016149bf565b509695505050505050565b6000806000606084860312156149f657600080fd5b835192506020808501516001600160401b0380821115614a1557600080fd5b818701915087601f830112614a2957600080fd5b8151614a37614342826142d1565b81815260059190911b8301840190848101908a831115614a5657600080fd5b938501935b82851015614a7d578451614a6e81613f28565b82529385019390850190614a5b565b60408a01519097509450505080831115614a9657600080fd5b505061415e8682870161497b565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0384168152826020820152606060408201526000614ae16060830184613ee9565b95945050505050565b600081614af957614af9614626565b506000190190565b600060208284031215614b1357600080fd5b8151801515811461143857600080fd5b601f821115610ced57600081815260208120601f850160051c81016020861015614b4a5750805b601f850160051c820191505b818110156113fa57828155600101614b56565b81516001600160401b03811115614b8257614b82613fc7565b614b9681614b908454614684565b84614b23565b602080601f831160018114614bcb5760008415614bb35750858301515b600019600386901b1c1916600185901b1785556113fa565b600085815260208120601f198616915b82811015614bfa57888601518255948401946001909101908401614bdb565b5085821015614c185787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251614c3a818460208701613ebd565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212205a3329dcfd1aac0098cc5b1dfd6d3b6b8d821fc00e842c06ea036bcedb9d384b64736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.