Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 19282454 | 136 days ago | IN | Create: StakingPool | 0 ETH | 0.15059911 |
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"); if (_amount > 0) { token.safeTransferFrom(msg.sender, address(this), _amount); depositLiquidity(); _mint(_account, _amount); totalStaked += _amount; } else { depositLiquidity(); } } /** * @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: 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 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: 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: 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; } }
// 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) (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: GPL-3.0 pragma solidity 0.8.15; interface IERC677Receiver { function onTokenTransfer( address _sender, uint256 _value, bytes calldata _data ) external; }
// 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 (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) (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 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 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) (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 (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) (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 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) (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: 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 (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); }
{ "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
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051614cfa6200011f60003960008181610ba601528181610be601528181610e1d01528181610e5d0152610fc00152614cfa6000f3fe6080604052600436106102e45760003560e01c80638d09487f11610190578063c2c44eed116100dc578063dd62ed3e11610095578063eb47dc8f1161006f578063eb47dc8f14610889578063f2fde38b1461089e578063f5eb42dc146108be578063fc0c546a146108f457600080fd5b8063dd62ed3e14610834578063e78a587514610854578063ea3b3e2d1461086957600080fd5b8063c2c44eed1461077d578063ca593c591461079d578063d5647c33146107b2578063d7379028146107d2578063d9caed12146107f2578063db8d55f11461081257600080fd5b8063a9059cbb11610149578063b51459fe11610123578063b51459fe14610712578063b5169e5314610727578063b7b7a40814610748578063c08e22fa1461075d57600080fd5b8063a9059cbb146106b0578063b47529c5146106d0578063b49a60bb146106f057600080fd5b80638d09487f146105e95780638da5cb5b146106095780638fcb4e5b1461063b57806395d89b411461065b57806399b8964b14610670578063a457c2d71461069057600080fd5b806347e7ef241161024f5780636d780459116102085780637718238f116101e25780637718238f14610573578063790965d914610593578063817b1cd2146105b35780638ce09bb8146105c957600080fd5b80636d7804591461051e57806370a082311461053e578063715018a61461055e57600080fd5b806347e7ef241461046c5780634f1ef2861461048c57806350be85961461049f57806351367373146104b457806352d1902d146104d45780635ee11564146104e957600080fd5b8063313ce567116102a1578063313ce567146103ba5780633659cfe6146103d657806339509351146103f65780633a2e47cd146104165780633a98ef39146104365780634000aea01461044c57600080fd5b8063050b4d13146102e957806306fdde0314610311578063095ea7b31461033357806318160ddd14610363578063223e54791461037857806323b872dd1461039a575b600080fd5b3480156102f557600080fd5b506102fe610914565b6040519081526020015b60405180910390f35b34801561031d57600080fd5b506103266109ee565b6040516103089190613f2e565b34801561033f57600080fd5b5061035361034e366004613f56565b610a80565b6040519015158152602001610308565b34801561036f57600080fd5b506102fe610a9a565b34801561038457600080fd5b50610398610393366004613f82565b610aaa565b005b3480156103a657600080fd5b506103536103b5366004613f9f565b610b78565b3480156103c657600080fd5b5060405160128152602001610308565b3480156103e257600080fd5b506103986103f1366004613f82565b610b9c565b34801561040257600080fd5b50610353610411366004613f56565b610c7b565b34801561042257600080fd5b506103986104313660046140bd565b610c9d565b34801561044257600080fd5b506102fe60fd5481565b34801561045857600080fd5b50610353610467366004614129565b610cf2565b34801561047857600080fd5b50610398610487366004613f56565b610d1c565b61039861049a366004614181565b610e13565b3480156104ab57600080fd5b506102fe610edf565b3480156104c057600080fd5b506103986104cf3660046141d0565b610f4c565b3480156104e057600080fd5b506102fe610fb3565b3480156104f557600080fd5b5061050961050436600461423b565b611066565b60408051928352602083019190915201610308565b34801561052a57600080fd5b50610353610539366004613f9f565b611235565b34801561054a57600080fd5b506102fe610559366004613f82565b611259565b34801561056a57600080fd5b50610398611291565b34801561057f57600080fd5b5061039861058e366004613f56565b6112a5565b34801561059f57600080fd5b506103986105ae3660046142af565b61136a565b3480156105bf57600080fd5b506102fe60ff5481565b3480156105d557600080fd5b506102fe6105e43660046142d1565b611412565b3480156105f557600080fd5b5061039861060436600461423b565b61144f565b34801561061557600080fd5b5060c9546001600160a01b03165b6040516001600160a01b039091168152602001610308565b34801561064757600080fd5b50610353610656366004613f56565b6116dc565b34801561066757600080fd5b506103266116f2565b34801561067c57600080fd5b5061039861068b36600461430d565b611701565b34801561069c57600080fd5b506103536106ab366004613f56565b611dea565b3480156106bc57600080fd5b506103536106cb366004613f56565b611e65565b3480156106dc57600080fd5b506103986106eb3660046143c0565b611e73565b3480156106fc57600080fd5b50610705612023565b60405161030891906143e7565b34801561071e57600080fd5b506102fe612084565b34801561073357600080fd5b5061010254610623906001600160a01b031681565b34801561075457600080fd5b506102fe6120b6565b34801561076957600080fd5b50610398610778366004614434565b61218c565b34801561078957600080fd5b506103986107983660046142af565b6123e3565b3480156107a957600080fd5b50610398612459565b3480156107be57600080fd5b506103986107cd366004614464565b612653565b3480156107de57600080fd5b506102fe6107ed3660046142d1565b612810565b3480156107fe57600080fd5b5061039861080d366004613f9f565b61283a565b34801561081e57600080fd5b50610827612a2c565b604051610308919061457f565b34801561084057600080fd5b506102fe61084f3660046145d7565b612aa2565b34801561086057600080fd5b506102fe612acd565b34801561087557600080fd5b50610398610884366004613f82565b612af8565b34801561089557600080fd5b506102fe612b23565b3480156108aa57600080fd5b506103986108b9366004613f82565b612bdd565b3480156108ca57600080fd5b506102fe6108d9366004613f82565b6001600160a01b0316600090815260fc602052604090205490565b34801561090057600080fd5b5060fb54610623906001600160a01b031681565b60008060005b60fe548110156109e857600060fe828154811061093957610939614610565b600091825260209182902001546040805163e78a587560e01b815290516001600160a01b039092169263e78a5875926004808401938290030181865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab9190614626565b90506109b983600019614655565b81106109ca57600019935050505090565b6109d4818461466c565b925050806109e190614684565b905061091a565b50919050565b6060603680546109fd9061469d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a299061469d565b8015610a765780601f10610a4b57610100808354040283529160200191610a76565b820191906000526020600020905b815481529060010190602001808311610a5957829003601f168201915b5050505050905090565b600033610a8e818585612c53565b60019150505b92915050565b6000610aa560ff5490565b905090565b610ab2612d78565b610abb81612dd2565b15610b0d5760405162461bcd60e51b815260206004820152601760248201527f537472617465677920616c72656164792065786973747300000000000000000060448201526064015b60405180910390fd5b60fb54610b26906001600160a01b031682600019612e3b565b60fe80546001810182556000919091527f54075df80ec1ae6ac9100e1fd0ebf3246c17f5c933137af392011f4c5f61513a0180546001600160a01b0319166001600160a01b0392909216919091179055565b600033610b86858285612f83565b610b91858585612ff7565b506001949350505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610be45760405162461bcd60e51b8152600401610b04906146d1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c2d600080516020614c5e833981519152546001600160a01b031690565b6001600160a01b031614610c535760405162461bcd60e51b8152600401610b049061471d565b610c5c816131b5565b60408051600080825260208201909252610c78918391906131bd565b50565b600033610a8e818585610c8e8383612aa2565b610c98919061466c565b612c53565b600054610100900460ff16610cc45760405162461bcd60e51b8152600401610b0490614769565b610cce8383613328565b610ced33610cde6012600a614898565b610ce890846148a4565b613359565b505050565b6000610cfe8484611e65565b50833b15610d1257610d123385858561339c565b5060019392505050565b610102546001600160a01b03163314610d6b5760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b60fe54610dba5760405162461bcd60e51b815260206004820152601f60248201527f4d757374206265203e2030207374726174656769657320746f207374616b65006044820152606401610b04565b8015610e075760fb54610dd8906001600160a01b0316333084613407565b610de0612459565b610dea8282613359565b8060ff6000828254610dfc919061466c565b90915550610e0f9050565b610e0f612459565b5050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610e5b5760405162461bcd60e51b8152600401610b04906146d1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ea4600080516020614c5e833981519152546001600160a01b031690565b6001600160a01b031614610eca5760405162461bcd60e51b8152600401610b049061471d565b610ed3826131b5565b610e0f828260016131bd565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa59190614626565b600054610100900460ff16610f735760405162461bcd60e51b8152600401610b0490614769565b610f7f82826000610c9d565b610f8761343f565b610f8f613466565b505060fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110535760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b04565b50600080516020614c5e83398151915290565b60008060008060005b858110156111a757600060fe88888481811061108d5761108d614610565b90506020020135815481106110a4576110a4614610565b60009182526020918290200154604080516369feab4960e01b815290516001600160a01b03909216935083926369feab49926004808401938290030181865afa1580156110f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111199190614626565b61112390856148c3565b9350806001600160a01b031663c51c2d0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611163573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111879190614626565b611191908461466c565b925050808061119f90614684565b91505061106f565b50600082131561121d5760005b6101015481101561121b5761271061010182815481106111d6576111d6614610565b906000526020600020906002020160010154846111f391906148a4565b6111fd9190614904565b611207908361466c565b91508061121381614684565b9150506111b4565b505b60ff54811061122a575060005b909590945092505050565b60008061124183612810565b905061124e853383612f83565b610b91858585613495565b6001600160a01b038116600090815260fc6020526040812054819061127d90612810565b90506064811015610a945750600092915050565b611299612d78565b6112a36000613637565b565b6112ad612d78565b604080518082019091526001600160a01b03838116825260208201838152610101805460018101825560009190915292517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca747689600290940293840180546001600160a01b0319169190931617909155517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768a9091015561138861134c613689565b1115610e0f5760405162461bcd60e51b8152600401610b0490614926565b611372612d78565b60fe5482106113935760405162461bcd60e51b8152600401610b049061495d565b60fe82815481106113a6576113a6614610565b60009182526020909120015460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f25906024015b600060405180830381600087803b1580156113f657600080fd5b505af115801561140a573d6000803e3d6000fd5b505050505050565b60008061141e60ff5490565b90508060000361142f575090919050565b8060fd548461143e91906148a4565b6114489190614904565b9392505050565b611457612d78565b60fe5481146114b95760405162461bcd60e51b815260206004820152602860248201527f6e65774f726465722e6c656e677468206d757374203d207374726174656769656044820152670e65cd8cadccee8d60c31b6064820152608401610b04565b60fe546000906001600160401b038111156114d6576114d6613fe0565b6040519080825280602002602001820160405280156114ff578160200160208202803683370190505b50905060005b60fe5481101561157c5760fe818154811061152257611522614610565b9060005260206000200160009054906101000a90046001600160a01b031682828151811061155257611552614610565b6001600160a01b03909216602092830291909101909101528061157481614684565b915050611505565b5060005b60fe548110156116d65760008285858481811061159f5761159f614610565b90506020020135815181106115b6576115b6614610565b60200260200101516001600160a01b0316036116145760405162461bcd60e51b815260206004820152601960248201527f616c6c20696e6469636573206d7573742062652076616c6964000000000000006044820152606401610b04565b8184848381811061162757611627614610565b905060200201358151811061163e5761163e614610565b602002602001015160fe828154811061165957611659614610565b6000918252602082200180546001600160a01b0319166001600160a01b0393909316929092179091558285858481811061169557611695614610565b90506020020135815181106116ac576116ac614610565b6001600160a01b0390921660209283029190910190910152806116ce81614684565b915050611580565b50505050565b60006116e9338484613495565b50600192915050565b6060603780546109fd9061469d565b60008060008060fe805490506001611719919061466c565b6001600160401b0381111561173057611730613fe0565b60405190808252806020026020018201604052801561176357816020015b606081526020019060019003908161174e5790505b5060fe5490915060009061177890600161466c565b6001600160401b0381111561178f5761178f613fe0565b6040519080825280602002602001820160405280156117c257816020015b60608152602001906001900390816117ad5790505b50905060005b875181101561195f57600060fe8983815181106117e7576117e7614610565b6020026020010151815481106117ff576117ff614610565b600091825260208220015460405163af51e6a560e01b81526001600160a01b03909116925081908190849063af51e6a59061183e908e90600401613f2e565b6000604051808303816000875af115801561185d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261188591908101906149fa565b91945092509050611896838b6148c3565b9950815160001461194a57818786815181106118b4576118b4614610565b6020026020010181905250808686815181106118d2576118d2614610565b60200260200101819052508685815181106118ef576118ef614610565b60200260200101515188611903919061466c565b975060005b82518110156119485781818151811061192357611923614610565b60200260200101518a611936919061466c565b995061194181614684565b9050611908565b505b505050508061195890614684565b90506117c8565b508415611978578460ff5461197491906148c3565b60ff555b6000851315611bea57610101546001600160401b0381111561199c5761199c613fe0565b6040519080825280602002602001820160405280156119c5578160200160208202803683370190505b5082600184516119d59190614655565b815181106119e5576119e5614610565b6020908102919091010152610101546001600160401b03811115611a0b57611a0b613fe0565b604051908082528060200260200182016040528015611a34578160200160208202803683370190505b508160018351611a449190614655565b81518110611a5457611a54614610565b602090810291909101015261010154611a6d908461466c565b925060005b61010154811015611be8576101018181548110611a9157611a91614610565b600091825260209091206002909102015483516001600160a01b03909116908490611abe90600190614655565b81518110611ace57611ace614610565b60200260200101518281518110611ae757611ae7614610565b60200260200101906001600160a01b031690816001600160a01b0316815250506127106101018281548110611b1e57611b1e614610565b90600052602060002090600202016001015487611b3b91906148a4565b611b459190614904565b8260018451611b549190614655565b81518110611b6457611b64614610565b60200260200101518281518110611b7d57611b7d614610565b6020026020010181815250508160018351611b989190614655565b81518110611ba857611ba8614610565b60200260200101518181518110611bc157611bc1614610565b602002602001015185611bd4919061466c565b945080611be081614684565b915050611a72565b505b60ff548410611bf857600093505b8315611d9c5760008460ff54611c0e9190614655565b60fd54611c1b90876148a4565b611c259190614904565b9050611c3130826136df565b6000805b8451811015611d985760005b858281518110611c5357611c53614610565b602002602001015151811015611d8557611c6e600188614655565b8303611cda57611cd430878481518110611c8a57611c8a614610565b60200260200101518381518110611ca357611ca3614610565b6020026020010151611cb430611259565b60405180604001604052806002815260200161060f60f31b81525061377d565b50611d73565b611d6430878481518110611cf057611cf0614610565b60200260200101518381518110611d0957611d09614610565b6020026020010151878581518110611d2357611d23614610565b60200260200101518481518110611d3c57611d3c614610565b602002602001015160405180604001604052806002815260200161060f60f31b81525061377d565b5082611d6f81614684565b9350505b80611d7d81614684565b915050611c41565b5080611d9081614684565b915050611c35565b5050505b60ff546040805191825260208201879052810185905233907f04f794b9bb152df3a9f2aa7b424206ce2c2c26ef386bb1fea8325cdfdcd339569060600160405180910390a250505050505050565b60003381611df88286612aa2565b905083811015611e585760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610b04565b610b918286868403612c53565b600033610a8e818585612ff7565b611e7b612d78565b610101548310611ec25760405162461bcd60e51b815260206004820152601260248201527111995948191bd95cc81b9bdd08195e1a5cdd60721b6044820152606401610b04565b80600003611f85576101018054611edb90600190614655565b81548110611eeb57611eeb614610565b90600052602060002090600202016101018481548110611f0d57611f0d614610565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b03909216919091178155600191820154910155610101805480611f5757611f57614abd565b60008281526020812060026000199093019283020180546001600160a01b0319168155600101559055611ffa565b816101018481548110611f9a57611f9a614610565b906000526020600020906002020160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806101018481548110611fe457611fe4614610565b9060005260206000209060020201600101819055505b611388612005613689565b1115610ced5760405162461bcd60e51b8152600401610b0490614926565b606060fe805480602002602001604051908101604052809291908181526020018280548015610a7657602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161205d575050505050905090565b60008061208f612b23565b905060ff5481106120a257600091505090565b8060ff546120b09190614655565b91505090565b60008060005b60fe548110156109e857600060fe82815481106120db576120db614610565b60009182526020918290200154604080516316f6f48160e31b815290516001600160a01b039092169263b7b7a408926004808401938290030181865afa158015612129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214d9190614626565b905061215b83600019614655565b811061216c57600019935050505090565b612176818461466c565b925050808061218490614684565b9150506120bc565b612194612d78565b60fe5482106121b55760405162461bcd60e51b8152600401610b049061495d565b6040805160018082528183019092526000916020808301908036833701905050905082816000815181106121eb576121eb614610565b6020026020010181815250506122018183611701565b600060fe848154811061221657612216614610565b600091825260208083209091015460408051630b45241160e11b815290516001600160a01b039092169450849263168a4822926004808401938290030181865afa158015612268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228c9190614626565b905080156122ef57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156122d657600080fd5b505af11580156122ea573d6000803e3d6000fd5b505050505b845b60fe5461230090600190614655565b81101561238b5760fe61231482600161466c565b8154811061232457612324614610565b60009182526020909120015460fe80546001600160a01b03909216918390811061235057612350614610565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558061238381614684565b9150506122f1565b5060fe80548061239d5761239d614abd565b600082815260208120600019908301810180546001600160a01b031916905590910190915560fb546123dc916001600160a01b03909116908490612e3b565b5050505050565b6123eb612d78565b60fe54821061240c5760405162461bcd60e51b8152600401610b049061495d565b60fe828154811061241f5761241f614610565b600091825260209091200154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d906024016113dc565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156124a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c69190614626565b90508015610c785760005b60fe54811015610e0f57600060fe82815481106124f0576124f0614610565b60009182526020808320909101546040805163e78a587560e01b815290516001600160a01b039092169450849263e78a5875926004808401938290030181865afa158015612542573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125669190614626565b90508381106125cf5760405163b6b55f2560e01b8152600481018590526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b1580156125b157600080fd5b505af11580156125c5573d6000803e3d6000fd5b5050505050505050565b801561263e5760405163b6b55f2560e01b8152600481018290526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b15801561261757600080fd5b505af115801561262b573d6000803e3d6000fd5b50505050808461263b9190614655565b93505b5050808061264b90614684565b9150506124d1565b600054610100900460ff16158080156126735750600054600160ff909116105b8061268d5750303b15801561268d575060005460ff166001145b6126f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b04565b6000805460ff191660011790558015612713576000805461ff0019166101001790555b61271e858585610f4c565b60005b825181101561279a5761010183828151811061273f5761273f614610565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558061279281614684565b915050612721565b506113886127a6613689565b11156127c45760405162461bcd60e51b8152600401610b0490614926565b80156123dc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600060fd54600003612820575090565b60fd5460ff5461283090846148a4565b610a949190614904565b610102546001600160a01b031633146128895760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b806001810161289e5761289b84611259565b90505b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156128e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290b9190614626565b905080821115612927576129276129228284614655565b6137a5565b60fb546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa15801561296f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129939190614626565b10156129f45760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f756768206c697175696469747920617661696c61626c6520746044820152696f20776974686472617760b01b6064820152608401610b04565b6129fe8583613900565b8160ff6000828254612a109190614655565b909155505060fb546123dc906001600160a01b03168584613a3b565b6060610101805480602002602001604051908101604052809291908181526020016000905b82821015612a99576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612a51565b50505050905090565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600080612ad86120b6565b905060ff548111612aeb57600091505090565b60ff546120b09082614655565b612b00612d78565b61010280546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b60fe548110156109e857600060fe8281548110612b4857612b48614610565b600091825260209182902001546040805163eb47dc8f60e01b815290516001600160a01b039092169350839263eb47dc8f926004808401938290030181865afa158015612b99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbd9190614626565b612bc7908461466c565b9250508080612bd590614684565b915050612b29565b612be5612d78565b6001600160a01b038116612c4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b610c7881613637565b6001600160a01b038316612cb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610b04565b6001600160a01b038216612d165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610b04565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60c9546001600160a01b031633146112a35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b04565b6000805b60fe54811015612e3257826001600160a01b031660fe8281548110612dfd57612dfd614610565b6000918252602090912001546001600160a01b031603612e205750600192915050565b80612e2a81614684565b915050612dd6565b50600092915050565b801580612eb55750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612e8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb39190614626565b155b612f205760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610b04565b6040516001600160a01b038316602482015260448101829052610ced90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613a6b565b6000612f8f8484612aa2565b905060001981146116d65781811015612fea5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610b04565b6116d68484848403612c53565b600061300282611412565b90506001600160a01b03841661305a5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0383166130b05760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038416600090815260fc60205260409020548111156131185760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038416600090815260fc602052604081208054839290613140908490614655565b90915550506001600160a01b038316600090815260fc60205260408120805483929061316d90849061466c565b92505081905550826001600160a01b0316846001600160a01b0316600080516020614ca5833981519152846040516131a791815260200190565b60405180910390a350505050565b610c78612d78565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131f057610ced83613b40565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561324a575060408051601f3d908101601f1916820190925261324791810190614626565b60015b6132ad5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b04565b600080516020614c5e833981519152811461331c5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b04565b50610ced838383613bdc565b600054610100900460ff1661334f5760405162461bcd60e51b8152600401610b0490614769565b610e0f8282613c01565b600061336482611412565b905061337083826136df565b6040518281526001600160a01b03841690600090600080516020614ca583398151915290602001612d6b565b604051635260769b60e11b815283906001600160a01b0382169063a4c0ed36906133ce90889087908790600401614ad3565b600060405180830381600087803b1580156133e857600080fd5b505af11580156133fc573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116d69085906323b872dd60e01b90608401612f4c565b600054610100900460ff166112a35760405162461bcd60e51b8152600401610b0490614769565b600054610100900460ff1661348d5760405162461bcd60e51b8152600401610b0490614769565b6112a3613c41565b6001600160a01b0383166134eb5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0382166135415760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156135a95760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038316600090815260fc6020526040812080548392906135d1908490614655565b90915550506001600160a01b038216600090815260fc6020526040812080548392906135fe90849061466c565b90915550506001600160a01b03808316908416600080516020614ca583398151915261362984612810565b604051908152602001612d6b565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b610101548110156109e85761010181815481106136ae576136ae614610565b906000526020600020906002020160010154826136cb919061466c565b9150806136d781614684565b91505061368f565b6001600160a01b0382166137355760405162461bcd60e51b815260206004820152601860248201527f4d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610b04565b8060fd6000828254613747919061466c565b90915550506001600160a01b038216600090815260fc60205260408120805483929061377490849061466c565b90915550505050565b600061378a858585612ff7565b833b15610b9157610b918585858561339c565b949350505050565b60fe5481905b8015610ced57600060fe6137c0600184614655565b815481106137d0576137d0614610565b600091825260208083209091015460408051635a8a2cff60e11b815290516001600160a01b039092169450849263b51459fe926004808401938290030181865afa158015613822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138469190614626565b905083811061387c57604051632e1a7d4d60e01b8152600481018590526001600160a01b03831690632e1a7d4d906024016133ce565b80156138eb57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156138c457600080fd5b505af11580156138d8573d6000803e3d6000fd5b5050505080846138e89190614655565b93505b505080806138f890614b03565b9150506137ab565b600061390b82611412565b90506001600160a01b0383166139635760405162461bcd60e51b815260206004820152601a60248201527f4275726e2066726f6d20746865207a65726f20616464726573730000000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156139cb5760405162461bcd60e51b815260206004820152601b60248201527f4275726e20616d6f756e7420657863656564732062616c616e636500000000006044820152606401610b04565b8060fd60008282546139dd9190614655565b90915550506001600160a01b038316600090815260fc602052604081208054839290613a0a908490614655565b90915550506040518281526000906001600160a01b03851690600080516020614ca583398151915290602001612d6b565b6040516001600160a01b038316602482015260448101829052610ced90849063a9059cbb60e01b90606401612f4c565b6000613ac0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c719092919063ffffffff16565b9050805160001480613ae1575080806020019051810190613ae19190614b1a565b610ced5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b04565b6001600160a01b0381163b613bad5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b04565b600080516020614c5e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613be583613c80565b600082511180613bf25750805b15610ced576116d68383613cc0565b600054610100900460ff16613c285760405162461bcd60e51b8152600401610b0490614769565b6036613c348382614b82565b506037610ced8282614b82565b600054610100900460ff16613c685760405162461bcd60e51b8152600401610b0490614769565b6112a333613637565b606061379d8484600085613ce5565b613c8981613b40565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114488383604051806060016040528060278152602001614c7e60279139613dc0565b606082471015613d465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b04565b600080866001600160a01b03168587604051613d629190614c41565b60006040518083038185875af1925050503d8060008114613d9f576040519150601f19603f3d011682016040523d82523d6000602084013e613da4565b606091505b5091509150613db587838387613e38565b979650505050505050565b6060600080856001600160a01b031685604051613ddd9190614c41565b600060405180830381855af49150503d8060008114613e18576040519150601f19603f3d011682016040523d82523d6000602084013e613e1d565b606091505b5091509150613e2e86838387613e38565b9695505050505050565b60608315613ea7578251600003613ea0576001600160a01b0385163b613ea05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b04565b508161379d565b61379d8383815115613ebc5781518083602001fd5b8060405162461bcd60e51b8152600401610b049190613f2e565b60005b83811015613ef1578181015183820152602001613ed9565b838111156116d65750506000910152565b60008151808452613f1a816020860160208601613ed6565b601f01601f19169290920160200192915050565b6020815260006114486020830184613f02565b6001600160a01b0381168114610c7857600080fd5b60008060408385031215613f6957600080fd5b8235613f7481613f41565b946020939093013593505050565b600060208284031215613f9457600080fd5b813561144881613f41565b600080600060608486031215613fb457600080fd5b8335613fbf81613f41565b92506020840135613fcf81613f41565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561401857614018613fe0565b60405290565b604051601f8201601f191681016001600160401b038111828210171561404657614046613fe0565b604052919050565b600082601f83011261405f57600080fd5b81356001600160401b0381111561407857614078613fe0565b61408b601f8201601f191660200161401e565b8181528460208386010111156140a057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156140d257600080fd5b83356001600160401b03808211156140e957600080fd5b6140f58783880161404e565b9450602086013591508082111561410b57600080fd5b506141188682870161404e565b925050604084013590509250925092565b60008060006060848603121561413e57600080fd5b833561414981613f41565b92506020840135915060408401356001600160401b0381111561416b57600080fd5b6141778682870161404e565b9150509250925092565b6000806040838503121561419457600080fd5b823561419f81613f41565b915060208301356001600160401b038111156141ba57600080fd5b6141c68582860161404e565b9150509250929050565b6000806000606084860312156141e557600080fd5b83356141f081613f41565b925060208401356001600160401b038082111561420c57600080fd5b6142188783880161404e565b9350604086013591508082111561422e57600080fd5b506141778682870161404e565b6000806020838503121561424e57600080fd5b82356001600160401b038082111561426557600080fd5b818501915085601f83011261427957600080fd5b81358181111561428857600080fd5b8660208260051b850101111561429d57600080fd5b60209290920196919550909350505050565b600080604083850312156142c257600080fd5b50508035926020909101359150565b6000602082840312156142e357600080fd5b5035919050565b60006001600160401b0382111561430357614303613fe0565b5060051b60200190565b6000806040838503121561432057600080fd5b82356001600160401b038082111561433757600080fd5b818501915085601f83011261434b57600080fd5b8135602061436061435b836142ea565b61401e565b82815260059290921b8401810191818101908984111561437f57600080fd5b948201945b8386101561439d57853582529482019490820190614384565b965050860135925050808211156143b357600080fd5b506141c68582860161404e565b6000806000606084860312156143d557600080fd5b833592506020840135613fcf81613f41565b6020808252825182820181905260009190848201906040850190845b818110156144285783516001600160a01b031683529284019291840191600101614403565b50909695505050505050565b6000806040838503121561444757600080fd5b8235915060208301356001600160401b038111156141ba57600080fd5b6000806000806080858703121561447a57600080fd5b843561448581613f41565b93506020858101356001600160401b03808211156144a257600080fd5b6144ae89838a0161404e565b95506040915081880135818111156144c557600080fd5b6144d18a828b0161404e565b9550506060880135818111156144e657600080fd5b88019050601f810189136144f957600080fd5b803561450761435b826142ea565b81815260069190911b8201840190848101908b83111561452657600080fd5b928501925b8284101561456f5784848d0312156145435760008081fd5b61454b613ff6565b843561455681613f41565b815284870135878201528252928401929085019061452b565b989b979a50959850505050505050565b602080825282518282018190526000919060409081850190868401855b828110156145ca57815180516001600160a01b0316855286015186850152928401929085019060010161459c565b5091979650505050505050565b600080604083850312156145ea57600080fd5b82356145f581613f41565b9150602083013561460581613f41565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561463857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156146675761466761463f565b500390565b6000821982111561467f5761467f61463f565b500190565b6000600182016146965761469661463f565b5060010190565b600181811c908216806146b157607f821691505b6020821081036109e857634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181815b808511156147ef5781600019048211156147d5576147d561463f565b808516156147e257918102915b93841c93908002906147b9565b509250929050565b60008261480657506001610a94565b8161481357506000610a94565b816001811461482957600281146148335761484f565b6001915050610a94565b60ff8411156148445761484461463f565b50506001821b610a94565b5060208310610133831016604e8410600b8410161715614872575081810a610a94565b61487c83836147b4565b80600019048211156148905761489061463f565b029392505050565b600061144883836147f7565b60008160001904831182151516156148be576148be61463f565b500290565b600080821280156001600160ff1b03849003851316156148e5576148e561463f565b600160ff1b83900384128116156148fe576148fe61463f565b50500190565b60008261492157634e487b7160e01b600052601260045260246000fd5b500490565b60208082526019908201527f546f74616c2066656573206d757374206265203c3d2035302500000000000000604082015260600190565b60208082526017908201527f537472617465677920646f6573206e6f74206578697374000000000000000000604082015260600190565b600082601f8301126149a557600080fd5b815160206149b561435b836142ea565b82815260059290921b840181019181810190868411156149d457600080fd5b8286015b848110156149ef57805183529183019183016149d8565b509695505050505050565b600080600060608486031215614a0f57600080fd5b835192506020808501516001600160401b0380821115614a2e57600080fd5b818701915087601f830112614a4257600080fd5b8151614a5061435b826142ea565b81815260059190911b8301840190848101908a831115614a6f57600080fd5b938501935b82851015614a96578451614a8781613f41565b82529385019390850190614a74565b60408a01519097509450505080831115614aaf57600080fd5b505061417786828701614994565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0384168152826020820152606060408201526000614afa6060830184613f02565b95945050505050565b600081614b1257614b1261463f565b506000190190565b600060208284031215614b2c57600080fd5b8151801515811461144857600080fd5b601f821115610ced57600081815260208120601f850160051c81016020861015614b635750805b601f850160051c820191505b8181101561140a57828155600101614b6f565b81516001600160401b03811115614b9b57614b9b613fe0565b614baf81614ba9845461469d565b84614b3c565b602080601f831160018114614be45760008415614bcc5750858301515b600019600386901b1c1916600185901b17855561140a565b600085815260208120601f198616915b82811015614c1357888601518255948401946001909101908401614bf4565b5085821015614c315787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251614c53818460208701613ed6565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220826d69c47b3f8eed0396253aa943e255a1ca4b3df4053933eb20b09803b6a0a764736f6c634300080f0033
Deployed Bytecode
0x6080604052600436106102e45760003560e01c80638d09487f11610190578063c2c44eed116100dc578063dd62ed3e11610095578063eb47dc8f1161006f578063eb47dc8f14610889578063f2fde38b1461089e578063f5eb42dc146108be578063fc0c546a146108f457600080fd5b8063dd62ed3e14610834578063e78a587514610854578063ea3b3e2d1461086957600080fd5b8063c2c44eed1461077d578063ca593c591461079d578063d5647c33146107b2578063d7379028146107d2578063d9caed12146107f2578063db8d55f11461081257600080fd5b8063a9059cbb11610149578063b51459fe11610123578063b51459fe14610712578063b5169e5314610727578063b7b7a40814610748578063c08e22fa1461075d57600080fd5b8063a9059cbb146106b0578063b47529c5146106d0578063b49a60bb146106f057600080fd5b80638d09487f146105e95780638da5cb5b146106095780638fcb4e5b1461063b57806395d89b411461065b57806399b8964b14610670578063a457c2d71461069057600080fd5b806347e7ef241161024f5780636d780459116102085780637718238f116101e25780637718238f14610573578063790965d914610593578063817b1cd2146105b35780638ce09bb8146105c957600080fd5b80636d7804591461051e57806370a082311461053e578063715018a61461055e57600080fd5b806347e7ef241461046c5780634f1ef2861461048c57806350be85961461049f57806351367373146104b457806352d1902d146104d45780635ee11564146104e957600080fd5b8063313ce567116102a1578063313ce567146103ba5780633659cfe6146103d657806339509351146103f65780633a2e47cd146104165780633a98ef39146104365780634000aea01461044c57600080fd5b8063050b4d13146102e957806306fdde0314610311578063095ea7b31461033357806318160ddd14610363578063223e54791461037857806323b872dd1461039a575b600080fd5b3480156102f557600080fd5b506102fe610914565b6040519081526020015b60405180910390f35b34801561031d57600080fd5b506103266109ee565b6040516103089190613f2e565b34801561033f57600080fd5b5061035361034e366004613f56565b610a80565b6040519015158152602001610308565b34801561036f57600080fd5b506102fe610a9a565b34801561038457600080fd5b50610398610393366004613f82565b610aaa565b005b3480156103a657600080fd5b506103536103b5366004613f9f565b610b78565b3480156103c657600080fd5b5060405160128152602001610308565b3480156103e257600080fd5b506103986103f1366004613f82565b610b9c565b34801561040257600080fd5b50610353610411366004613f56565b610c7b565b34801561042257600080fd5b506103986104313660046140bd565b610c9d565b34801561044257600080fd5b506102fe60fd5481565b34801561045857600080fd5b50610353610467366004614129565b610cf2565b34801561047857600080fd5b50610398610487366004613f56565b610d1c565b61039861049a366004614181565b610e13565b3480156104ab57600080fd5b506102fe610edf565b3480156104c057600080fd5b506103986104cf3660046141d0565b610f4c565b3480156104e057600080fd5b506102fe610fb3565b3480156104f557600080fd5b5061050961050436600461423b565b611066565b60408051928352602083019190915201610308565b34801561052a57600080fd5b50610353610539366004613f9f565b611235565b34801561054a57600080fd5b506102fe610559366004613f82565b611259565b34801561056a57600080fd5b50610398611291565b34801561057f57600080fd5b5061039861058e366004613f56565b6112a5565b34801561059f57600080fd5b506103986105ae3660046142af565b61136a565b3480156105bf57600080fd5b506102fe60ff5481565b3480156105d557600080fd5b506102fe6105e43660046142d1565b611412565b3480156105f557600080fd5b5061039861060436600461423b565b61144f565b34801561061557600080fd5b5060c9546001600160a01b03165b6040516001600160a01b039091168152602001610308565b34801561064757600080fd5b50610353610656366004613f56565b6116dc565b34801561066757600080fd5b506103266116f2565b34801561067c57600080fd5b5061039861068b36600461430d565b611701565b34801561069c57600080fd5b506103536106ab366004613f56565b611dea565b3480156106bc57600080fd5b506103536106cb366004613f56565b611e65565b3480156106dc57600080fd5b506103986106eb3660046143c0565b611e73565b3480156106fc57600080fd5b50610705612023565b60405161030891906143e7565b34801561071e57600080fd5b506102fe612084565b34801561073357600080fd5b5061010254610623906001600160a01b031681565b34801561075457600080fd5b506102fe6120b6565b34801561076957600080fd5b50610398610778366004614434565b61218c565b34801561078957600080fd5b506103986107983660046142af565b6123e3565b3480156107a957600080fd5b50610398612459565b3480156107be57600080fd5b506103986107cd366004614464565b612653565b3480156107de57600080fd5b506102fe6107ed3660046142d1565b612810565b3480156107fe57600080fd5b5061039861080d366004613f9f565b61283a565b34801561081e57600080fd5b50610827612a2c565b604051610308919061457f565b34801561084057600080fd5b506102fe61084f3660046145d7565b612aa2565b34801561086057600080fd5b506102fe612acd565b34801561087557600080fd5b50610398610884366004613f82565b612af8565b34801561089557600080fd5b506102fe612b23565b3480156108aa57600080fd5b506103986108b9366004613f82565b612bdd565b3480156108ca57600080fd5b506102fe6108d9366004613f82565b6001600160a01b0316600090815260fc602052604090205490565b34801561090057600080fd5b5060fb54610623906001600160a01b031681565b60008060005b60fe548110156109e857600060fe828154811061093957610939614610565b600091825260209182902001546040805163e78a587560e01b815290516001600160a01b039092169263e78a5875926004808401938290030181865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab9190614626565b90506109b983600019614655565b81106109ca57600019935050505090565b6109d4818461466c565b925050806109e190614684565b905061091a565b50919050565b6060603680546109fd9061469d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a299061469d565b8015610a765780601f10610a4b57610100808354040283529160200191610a76565b820191906000526020600020905b815481529060010190602001808311610a5957829003601f168201915b5050505050905090565b600033610a8e818585612c53565b60019150505b92915050565b6000610aa560ff5490565b905090565b610ab2612d78565b610abb81612dd2565b15610b0d5760405162461bcd60e51b815260206004820152601760248201527f537472617465677920616c72656164792065786973747300000000000000000060448201526064015b60405180910390fd5b60fb54610b26906001600160a01b031682600019612e3b565b60fe80546001810182556000919091527f54075df80ec1ae6ac9100e1fd0ebf3246c17f5c933137af392011f4c5f61513a0180546001600160a01b0319166001600160a01b0392909216919091179055565b600033610b86858285612f83565b610b91858585612ff7565b506001949350505050565b6001600160a01b037f000000000000000000000000ebc52afcfc9495ec083264ed68e8e6f454e5f715163003610be45760405162461bcd60e51b8152600401610b04906146d1565b7f000000000000000000000000ebc52afcfc9495ec083264ed68e8e6f454e5f7156001600160a01b0316610c2d600080516020614c5e833981519152546001600160a01b031690565b6001600160a01b031614610c535760405162461bcd60e51b8152600401610b049061471d565b610c5c816131b5565b60408051600080825260208201909252610c78918391906131bd565b50565b600033610a8e818585610c8e8383612aa2565b610c98919061466c565b612c53565b600054610100900460ff16610cc45760405162461bcd60e51b8152600401610b0490614769565b610cce8383613328565b610ced33610cde6012600a614898565b610ce890846148a4565b613359565b505050565b6000610cfe8484611e65565b50833b15610d1257610d123385858561339c565b5060019392505050565b610102546001600160a01b03163314610d6b5760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b60fe54610dba5760405162461bcd60e51b815260206004820152601f60248201527f4d757374206265203e2030207374726174656769657320746f207374616b65006044820152606401610b04565b8015610e075760fb54610dd8906001600160a01b0316333084613407565b610de0612459565b610dea8282613359565b8060ff6000828254610dfc919061466c565b90915550610e0f9050565b610e0f612459565b5050565b6001600160a01b037f000000000000000000000000ebc52afcfc9495ec083264ed68e8e6f454e5f715163003610e5b5760405162461bcd60e51b8152600401610b04906146d1565b7f000000000000000000000000ebc52afcfc9495ec083264ed68e8e6f454e5f7156001600160a01b0316610ea4600080516020614c5e833981519152546001600160a01b031690565b6001600160a01b031614610eca5760405162461bcd60e51b8152600401610b049061471d565b610ed3826131b5565b610e0f828260016131bd565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa59190614626565b600054610100900460ff16610f735760405162461bcd60e51b8152600401610b0490614769565b610f7f82826000610c9d565b610f8761343f565b610f8f613466565b505060fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000ebc52afcfc9495ec083264ed68e8e6f454e5f71516146110535760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610b04565b50600080516020614c5e83398151915290565b60008060008060005b858110156111a757600060fe88888481811061108d5761108d614610565b90506020020135815481106110a4576110a4614610565b60009182526020918290200154604080516369feab4960e01b815290516001600160a01b03909216935083926369feab49926004808401938290030181865afa1580156110f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111199190614626565b61112390856148c3565b9350806001600160a01b031663c51c2d0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611163573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111879190614626565b611191908461466c565b925050808061119f90614684565b91505061106f565b50600082131561121d5760005b6101015481101561121b5761271061010182815481106111d6576111d6614610565b906000526020600020906002020160010154846111f391906148a4565b6111fd9190614904565b611207908361466c565b91508061121381614684565b9150506111b4565b505b60ff54811061122a575060005b909590945092505050565b60008061124183612810565b905061124e853383612f83565b610b91858585613495565b6001600160a01b038116600090815260fc6020526040812054819061127d90612810565b90506064811015610a945750600092915050565b611299612d78565b6112a36000613637565b565b6112ad612d78565b604080518082019091526001600160a01b03838116825260208201838152610101805460018101825560009190915292517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca747689600290940293840180546001600160a01b0319169190931617909155517f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768a9091015561138861134c613689565b1115610e0f5760405162461bcd60e51b8152600401610b0490614926565b611372612d78565b60fe5482106113935760405162461bcd60e51b8152600401610b049061495d565b60fe82815481106113a6576113a6614610565b60009182526020909120015460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f25906024015b600060405180830381600087803b1580156113f657600080fd5b505af115801561140a573d6000803e3d6000fd5b505050505050565b60008061141e60ff5490565b90508060000361142f575090919050565b8060fd548461143e91906148a4565b6114489190614904565b9392505050565b611457612d78565b60fe5481146114b95760405162461bcd60e51b815260206004820152602860248201527f6e65774f726465722e6c656e677468206d757374203d207374726174656769656044820152670e65cd8cadccee8d60c31b6064820152608401610b04565b60fe546000906001600160401b038111156114d6576114d6613fe0565b6040519080825280602002602001820160405280156114ff578160200160208202803683370190505b50905060005b60fe5481101561157c5760fe818154811061152257611522614610565b9060005260206000200160009054906101000a90046001600160a01b031682828151811061155257611552614610565b6001600160a01b03909216602092830291909101909101528061157481614684565b915050611505565b5060005b60fe548110156116d65760008285858481811061159f5761159f614610565b90506020020135815181106115b6576115b6614610565b60200260200101516001600160a01b0316036116145760405162461bcd60e51b815260206004820152601960248201527f616c6c20696e6469636573206d7573742062652076616c6964000000000000006044820152606401610b04565b8184848381811061162757611627614610565b905060200201358151811061163e5761163e614610565b602002602001015160fe828154811061165957611659614610565b6000918252602082200180546001600160a01b0319166001600160a01b0393909316929092179091558285858481811061169557611695614610565b90506020020135815181106116ac576116ac614610565b6001600160a01b0390921660209283029190910190910152806116ce81614684565b915050611580565b50505050565b60006116e9338484613495565b50600192915050565b6060603780546109fd9061469d565b60008060008060fe805490506001611719919061466c565b6001600160401b0381111561173057611730613fe0565b60405190808252806020026020018201604052801561176357816020015b606081526020019060019003908161174e5790505b5060fe5490915060009061177890600161466c565b6001600160401b0381111561178f5761178f613fe0565b6040519080825280602002602001820160405280156117c257816020015b60608152602001906001900390816117ad5790505b50905060005b875181101561195f57600060fe8983815181106117e7576117e7614610565b6020026020010151815481106117ff576117ff614610565b600091825260208220015460405163af51e6a560e01b81526001600160a01b03909116925081908190849063af51e6a59061183e908e90600401613f2e565b6000604051808303816000875af115801561185d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261188591908101906149fa565b91945092509050611896838b6148c3565b9950815160001461194a57818786815181106118b4576118b4614610565b6020026020010181905250808686815181106118d2576118d2614610565b60200260200101819052508685815181106118ef576118ef614610565b60200260200101515188611903919061466c565b975060005b82518110156119485781818151811061192357611923614610565b60200260200101518a611936919061466c565b995061194181614684565b9050611908565b505b505050508061195890614684565b90506117c8565b508415611978578460ff5461197491906148c3565b60ff555b6000851315611bea57610101546001600160401b0381111561199c5761199c613fe0565b6040519080825280602002602001820160405280156119c5578160200160208202803683370190505b5082600184516119d59190614655565b815181106119e5576119e5614610565b6020908102919091010152610101546001600160401b03811115611a0b57611a0b613fe0565b604051908082528060200260200182016040528015611a34578160200160208202803683370190505b508160018351611a449190614655565b81518110611a5457611a54614610565b602090810291909101015261010154611a6d908461466c565b925060005b61010154811015611be8576101018181548110611a9157611a91614610565b600091825260209091206002909102015483516001600160a01b03909116908490611abe90600190614655565b81518110611ace57611ace614610565b60200260200101518281518110611ae757611ae7614610565b60200260200101906001600160a01b031690816001600160a01b0316815250506127106101018281548110611b1e57611b1e614610565b90600052602060002090600202016001015487611b3b91906148a4565b611b459190614904565b8260018451611b549190614655565b81518110611b6457611b64614610565b60200260200101518281518110611b7d57611b7d614610565b6020026020010181815250508160018351611b989190614655565b81518110611ba857611ba8614610565b60200260200101518181518110611bc157611bc1614610565b602002602001015185611bd4919061466c565b945080611be081614684565b915050611a72565b505b60ff548410611bf857600093505b8315611d9c5760008460ff54611c0e9190614655565b60fd54611c1b90876148a4565b611c259190614904565b9050611c3130826136df565b6000805b8451811015611d985760005b858281518110611c5357611c53614610565b602002602001015151811015611d8557611c6e600188614655565b8303611cda57611cd430878481518110611c8a57611c8a614610565b60200260200101518381518110611ca357611ca3614610565b6020026020010151611cb430611259565b60405180604001604052806002815260200161060f60f31b81525061377d565b50611d73565b611d6430878481518110611cf057611cf0614610565b60200260200101518381518110611d0957611d09614610565b6020026020010151878581518110611d2357611d23614610565b60200260200101518481518110611d3c57611d3c614610565b602002602001015160405180604001604052806002815260200161060f60f31b81525061377d565b5082611d6f81614684565b9350505b80611d7d81614684565b915050611c41565b5080611d9081614684565b915050611c35565b5050505b60ff546040805191825260208201879052810185905233907f04f794b9bb152df3a9f2aa7b424206ce2c2c26ef386bb1fea8325cdfdcd339569060600160405180910390a250505050505050565b60003381611df88286612aa2565b905083811015611e585760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610b04565b610b918286868403612c53565b600033610a8e818585612ff7565b611e7b612d78565b610101548310611ec25760405162461bcd60e51b815260206004820152601260248201527111995948191bd95cc81b9bdd08195e1a5cdd60721b6044820152606401610b04565b80600003611f85576101018054611edb90600190614655565b81548110611eeb57611eeb614610565b90600052602060002090600202016101018481548110611f0d57611f0d614610565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b03909216919091178155600191820154910155610101805480611f5757611f57614abd565b60008281526020812060026000199093019283020180546001600160a01b0319168155600101559055611ffa565b816101018481548110611f9a57611f9a614610565b906000526020600020906002020160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806101018481548110611fe457611fe4614610565b9060005260206000209060020201600101819055505b611388612005613689565b1115610ced5760405162461bcd60e51b8152600401610b0490614926565b606060fe805480602002602001604051908101604052809291908181526020018280548015610a7657602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161205d575050505050905090565b60008061208f612b23565b905060ff5481106120a257600091505090565b8060ff546120b09190614655565b91505090565b60008060005b60fe548110156109e857600060fe82815481106120db576120db614610565b60009182526020918290200154604080516316f6f48160e31b815290516001600160a01b039092169263b7b7a408926004808401938290030181865afa158015612129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214d9190614626565b905061215b83600019614655565b811061216c57600019935050505090565b612176818461466c565b925050808061218490614684565b9150506120bc565b612194612d78565b60fe5482106121b55760405162461bcd60e51b8152600401610b049061495d565b6040805160018082528183019092526000916020808301908036833701905050905082816000815181106121eb576121eb614610565b6020026020010181815250506122018183611701565b600060fe848154811061221657612216614610565b600091825260208083209091015460408051630b45241160e11b815290516001600160a01b039092169450849263168a4822926004808401938290030181865afa158015612268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228c9190614626565b905080156122ef57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156122d657600080fd5b505af11580156122ea573d6000803e3d6000fd5b505050505b845b60fe5461230090600190614655565b81101561238b5760fe61231482600161466c565b8154811061232457612324614610565b60009182526020909120015460fe80546001600160a01b03909216918390811061235057612350614610565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558061238381614684565b9150506122f1565b5060fe80548061239d5761239d614abd565b600082815260208120600019908301810180546001600160a01b031916905590910190915560fb546123dc916001600160a01b03909116908490612e3b565b5050505050565b6123eb612d78565b60fe54821061240c5760405162461bcd60e51b8152600401610b049061495d565b60fe828154811061241f5761241f614610565b600091825260209091200154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d906024016113dc565b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156124a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c69190614626565b90508015610c785760005b60fe54811015610e0f57600060fe82815481106124f0576124f0614610565b60009182526020808320909101546040805163e78a587560e01b815290516001600160a01b039092169450849263e78a5875926004808401938290030181865afa158015612542573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125669190614626565b90508381106125cf5760405163b6b55f2560e01b8152600481018590526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b1580156125b157600080fd5b505af11580156125c5573d6000803e3d6000fd5b5050505050505050565b801561263e5760405163b6b55f2560e01b8152600481018290526001600160a01b0383169063b6b55f2590602401600060405180830381600087803b15801561261757600080fd5b505af115801561262b573d6000803e3d6000fd5b50505050808461263b9190614655565b93505b5050808061264b90614684565b9150506124d1565b600054610100900460ff16158080156126735750600054600160ff909116105b8061268d5750303b15801561268d575060005460ff166001145b6126f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b04565b6000805460ff191660011790558015612713576000805461ff0019166101001790555b61271e858585610f4c565b60005b825181101561279a5761010183828151811061273f5761273f614610565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b039092169190911781559101519101558061279281614684565b915050612721565b506113886127a6613689565b11156127c45760405162461bcd60e51b8152600401610b0490614926565b80156123dc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600060fd54600003612820575090565b60fd5460ff5461283090846148a4565b610a949190614904565b610102546001600160a01b031633146128895760405162461bcd60e51b81526020600482015260116024820152705072696f72697479506f6f6c206f6e6c7960781b6044820152606401610b04565b806001810161289e5761289b84611259565b90505b60fb546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156128e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290b9190614626565b905080821115612927576129276129228284614655565b6137a5565b60fb546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa15801561296f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129939190614626565b10156129f45760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f756768206c697175696469747920617661696c61626c6520746044820152696f20776974686472617760b01b6064820152608401610b04565b6129fe8583613900565b8160ff6000828254612a109190614655565b909155505060fb546123dc906001600160a01b03168584613a3b565b6060610101805480602002602001604051908101604052809291908181526020016000905b82821015612a99576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612a51565b50505050905090565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600080612ad86120b6565b905060ff548111612aeb57600091505090565b60ff546120b09082614655565b612b00612d78565b61010280546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b60fe548110156109e857600060fe8281548110612b4857612b48614610565b600091825260209182902001546040805163eb47dc8f60e01b815290516001600160a01b039092169350839263eb47dc8f926004808401938290030181865afa158015612b99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbd9190614626565b612bc7908461466c565b9250508080612bd590614684565b915050612b29565b612be5612d78565b6001600160a01b038116612c4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b610c7881613637565b6001600160a01b038316612cb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610b04565b6001600160a01b038216612d165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610b04565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60c9546001600160a01b031633146112a35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b04565b6000805b60fe54811015612e3257826001600160a01b031660fe8281548110612dfd57612dfd614610565b6000918252602090912001546001600160a01b031603612e205750600192915050565b80612e2a81614684565b915050612dd6565b50600092915050565b801580612eb55750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612e8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb39190614626565b155b612f205760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610b04565b6040516001600160a01b038316602482015260448101829052610ced90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613a6b565b6000612f8f8484612aa2565b905060001981146116d65781811015612fea5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610b04565b6116d68484848403612c53565b600061300282611412565b90506001600160a01b03841661305a5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0383166130b05760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038416600090815260fc60205260409020548111156131185760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038416600090815260fc602052604081208054839290613140908490614655565b90915550506001600160a01b038316600090815260fc60205260408120805483929061316d90849061466c565b92505081905550826001600160a01b0316846001600160a01b0316600080516020614ca5833981519152846040516131a791815260200190565b60405180910390a350505050565b610c78612d78565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156131f057610ced83613b40565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561324a575060408051601f3d908101601f1916820190925261324791810190614626565b60015b6132ad5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b04565b600080516020614c5e833981519152811461331c5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b04565b50610ced838383613bdc565b600054610100900460ff1661334f5760405162461bcd60e51b8152600401610b0490614769565b610e0f8282613c01565b600061336482611412565b905061337083826136df565b6040518281526001600160a01b03841690600090600080516020614ca583398151915290602001612d6b565b604051635260769b60e11b815283906001600160a01b0382169063a4c0ed36906133ce90889087908790600401614ad3565b600060405180830381600087803b1580156133e857600080fd5b505af11580156133fc573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116d69085906323b872dd60e01b90608401612f4c565b600054610100900460ff166112a35760405162461bcd60e51b8152600401610b0490614769565b600054610100900460ff1661348d5760405162461bcd60e51b8152600401610b0490614769565b6112a3613c41565b6001600160a01b0383166134eb5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610b04565b6001600160a01b0382166135415760405162461bcd60e51b815260206004820152601c60248201527f5472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156135a95760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610b04565b6001600160a01b038316600090815260fc6020526040812080548392906135d1908490614655565b90915550506001600160a01b038216600090815260fc6020526040812080548392906135fe90849061466c565b90915550506001600160a01b03808316908416600080516020614ca583398151915261362984612810565b604051908152602001612d6b565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b610101548110156109e85761010181815481106136ae576136ae614610565b906000526020600020906002020160010154826136cb919061466c565b9150806136d781614684565b91505061368f565b6001600160a01b0382166137355760405162461bcd60e51b815260206004820152601860248201527f4d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610b04565b8060fd6000828254613747919061466c565b90915550506001600160a01b038216600090815260fc60205260408120805483929061377490849061466c565b90915550505050565b600061378a858585612ff7565b833b15610b9157610b918585858561339c565b949350505050565b60fe5481905b8015610ced57600060fe6137c0600184614655565b815481106137d0576137d0614610565b600091825260208083209091015460408051635a8a2cff60e11b815290516001600160a01b039092169450849263b51459fe926004808401938290030181865afa158015613822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138469190614626565b905083811061387c57604051632e1a7d4d60e01b8152600481018590526001600160a01b03831690632e1a7d4d906024016133ce565b80156138eb57604051632e1a7d4d60e01b8152600481018290526001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156138c457600080fd5b505af11580156138d8573d6000803e3d6000fd5b5050505080846138e89190614655565b93505b505080806138f890614b03565b9150506137ab565b600061390b82611412565b90506001600160a01b0383166139635760405162461bcd60e51b815260206004820152601a60248201527f4275726e2066726f6d20746865207a65726f20616464726573730000000000006044820152606401610b04565b6001600160a01b038316600090815260fc60205260409020548111156139cb5760405162461bcd60e51b815260206004820152601b60248201527f4275726e20616d6f756e7420657863656564732062616c616e636500000000006044820152606401610b04565b8060fd60008282546139dd9190614655565b90915550506001600160a01b038316600090815260fc602052604081208054839290613a0a908490614655565b90915550506040518281526000906001600160a01b03851690600080516020614ca583398151915290602001612d6b565b6040516001600160a01b038316602482015260448101829052610ced90849063a9059cbb60e01b90606401612f4c565b6000613ac0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c719092919063ffffffff16565b9050805160001480613ae1575080806020019051810190613ae19190614b1a565b610ced5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b04565b6001600160a01b0381163b613bad5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b04565b600080516020614c5e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613be583613c80565b600082511180613bf25750805b15610ced576116d68383613cc0565b600054610100900460ff16613c285760405162461bcd60e51b8152600401610b0490614769565b6036613c348382614b82565b506037610ced8282614b82565b600054610100900460ff16613c685760405162461bcd60e51b8152600401610b0490614769565b6112a333613637565b606061379d8484600085613ce5565b613c8981613b40565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114488383604051806060016040528060278152602001614c7e60279139613dc0565b606082471015613d465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b04565b600080866001600160a01b03168587604051613d629190614c41565b60006040518083038185875af1925050503d8060008114613d9f576040519150601f19603f3d011682016040523d82523d6000602084013e613da4565b606091505b5091509150613db587838387613e38565b979650505050505050565b6060600080856001600160a01b031685604051613ddd9190614c41565b600060405180830381855af49150503d8060008114613e18576040519150601f19603f3d011682016040523d82523d6000602084013e613e1d565b606091505b5091509150613e2e86838387613e38565b9695505050505050565b60608315613ea7578251600003613ea0576001600160a01b0385163b613ea05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b04565b508161379d565b61379d8383815115613ebc5781518083602001fd5b8060405162461bcd60e51b8152600401610b049190613f2e565b60005b83811015613ef1578181015183820152602001613ed9565b838111156116d65750506000910152565b60008151808452613f1a816020860160208601613ed6565b601f01601f19169290920160200192915050565b6020815260006114486020830184613f02565b6001600160a01b0381168114610c7857600080fd5b60008060408385031215613f6957600080fd5b8235613f7481613f41565b946020939093013593505050565b600060208284031215613f9457600080fd5b813561144881613f41565b600080600060608486031215613fb457600080fd5b8335613fbf81613f41565b92506020840135613fcf81613f41565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561401857614018613fe0565b60405290565b604051601f8201601f191681016001600160401b038111828210171561404657614046613fe0565b604052919050565b600082601f83011261405f57600080fd5b81356001600160401b0381111561407857614078613fe0565b61408b601f8201601f191660200161401e565b8181528460208386010111156140a057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156140d257600080fd5b83356001600160401b03808211156140e957600080fd5b6140f58783880161404e565b9450602086013591508082111561410b57600080fd5b506141188682870161404e565b925050604084013590509250925092565b60008060006060848603121561413e57600080fd5b833561414981613f41565b92506020840135915060408401356001600160401b0381111561416b57600080fd5b6141778682870161404e565b9150509250925092565b6000806040838503121561419457600080fd5b823561419f81613f41565b915060208301356001600160401b038111156141ba57600080fd5b6141c68582860161404e565b9150509250929050565b6000806000606084860312156141e557600080fd5b83356141f081613f41565b925060208401356001600160401b038082111561420c57600080fd5b6142188783880161404e565b9350604086013591508082111561422e57600080fd5b506141778682870161404e565b6000806020838503121561424e57600080fd5b82356001600160401b038082111561426557600080fd5b818501915085601f83011261427957600080fd5b81358181111561428857600080fd5b8660208260051b850101111561429d57600080fd5b60209290920196919550909350505050565b600080604083850312156142c257600080fd5b50508035926020909101359150565b6000602082840312156142e357600080fd5b5035919050565b60006001600160401b0382111561430357614303613fe0565b5060051b60200190565b6000806040838503121561432057600080fd5b82356001600160401b038082111561433757600080fd5b818501915085601f83011261434b57600080fd5b8135602061436061435b836142ea565b61401e565b82815260059290921b8401810191818101908984111561437f57600080fd5b948201945b8386101561439d57853582529482019490820190614384565b965050860135925050808211156143b357600080fd5b506141c68582860161404e565b6000806000606084860312156143d557600080fd5b833592506020840135613fcf81613f41565b6020808252825182820181905260009190848201906040850190845b818110156144285783516001600160a01b031683529284019291840191600101614403565b50909695505050505050565b6000806040838503121561444757600080fd5b8235915060208301356001600160401b038111156141ba57600080fd5b6000806000806080858703121561447a57600080fd5b843561448581613f41565b93506020858101356001600160401b03808211156144a257600080fd5b6144ae89838a0161404e565b95506040915081880135818111156144c557600080fd5b6144d18a828b0161404e565b9550506060880135818111156144e657600080fd5b88019050601f810189136144f957600080fd5b803561450761435b826142ea565b81815260069190911b8201840190848101908b83111561452657600080fd5b928501925b8284101561456f5784848d0312156145435760008081fd5b61454b613ff6565b843561455681613f41565b815284870135878201528252928401929085019061452b565b989b979a50959850505050505050565b602080825282518282018190526000919060409081850190868401855b828110156145ca57815180516001600160a01b0316855286015186850152928401929085019060010161459c565b5091979650505050505050565b600080604083850312156145ea57600080fd5b82356145f581613f41565b9150602083013561460581613f41565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561463857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156146675761466761463f565b500390565b6000821982111561467f5761467f61463f565b500190565b6000600182016146965761469661463f565b5060010190565b600181811c908216806146b157607f821691505b6020821081036109e857634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600181815b808511156147ef5781600019048211156147d5576147d561463f565b808516156147e257918102915b93841c93908002906147b9565b509250929050565b60008261480657506001610a94565b8161481357506000610a94565b816001811461482957600281146148335761484f565b6001915050610a94565b60ff8411156148445761484461463f565b50506001821b610a94565b5060208310610133831016604e8410600b8410161715614872575081810a610a94565b61487c83836147b4565b80600019048211156148905761489061463f565b029392505050565b600061144883836147f7565b60008160001904831182151516156148be576148be61463f565b500290565b600080821280156001600160ff1b03849003851316156148e5576148e561463f565b600160ff1b83900384128116156148fe576148fe61463f565b50500190565b60008261492157634e487b7160e01b600052601260045260246000fd5b500490565b60208082526019908201527f546f74616c2066656573206d757374206265203c3d2035302500000000000000604082015260600190565b60208082526017908201527f537472617465677920646f6573206e6f74206578697374000000000000000000604082015260600190565b600082601f8301126149a557600080fd5b815160206149b561435b836142ea565b82815260059290921b840181019181810190868411156149d457600080fd5b8286015b848110156149ef57805183529183019183016149d8565b509695505050505050565b600080600060608486031215614a0f57600080fd5b835192506020808501516001600160401b0380821115614a2e57600080fd5b818701915087601f830112614a4257600080fd5b8151614a5061435b826142ea565b81815260059190911b8301840190848101908a831115614a6f57600080fd5b938501935b82851015614a96578451614a8781613f41565b82529385019390850190614a74565b60408a01519097509450505080831115614aaf57600080fd5b505061417786828701614994565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0384168152826020820152606060408201526000614afa6060830184613f02565b95945050505050565b600081614b1257614b1261463f565b506000190190565b600060208284031215614b2c57600080fd5b8151801515811461144857600080fd5b601f821115610ced57600081815260208120601f850160051c81016020861015614b635750805b601f850160051c820191505b8181101561140a57828155600101614b6f565b81516001600160401b03811115614b9b57614b9b613fe0565b614baf81614ba9845461469d565b84614b3c565b602080601f831160018114614be45760008415614bcc5750858301515b600019600386901b1c1916600185901b17855561140a565b600085815260208120601f198616915b82811015614c1357888601518255948401946001909101908401614bf4565b5085821015614c315787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251614c53818460208701613ed6565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220826d69c47b3f8eed0396253aa943e255a1ca4b3df4053933eb20b09803b6a0a764736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.