Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
AlluoLockedCleanup
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// // SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./../interfaces/IExchange.sol"; import "./../interfaces/IBalancer.sol"; contract AlluoLockedCleanup is Initializable, UUPSUpgradeable, AccessControlUpgradeable, PausableUpgradeable, IBalancerStructs { using SafeERC20Upgradeable for IERC20Upgradeable; using AddressUpgradeable for address; bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); // Locking's reward amount produced per distribution time. uint256 public rewardPerDistribution; // Locking's reward distribution time. uint256 public constant distributionTime = 86400; // Amount of currently locked tokens from all users (in lp). uint256 public totalLocked; // Auxiliary parameter (tpl) for locking's math uint256 private tokensPerLock; // Аuxiliary parameter for locking's math uint256 private rewardProduced; // Аuxiliary parameter for locking's math uint256 private allProduced; // Аuxiliary parameter for locking's math uint256 private producedTime; //period of locking after lock function call uint256 public depositLockDuration; //period of locking after unlock function call uint256 public withdrawLockDuration; // Amount of locked tokens waiting for withdraw (in Alluo). uint256 public waitingForWithdrawal; // Amount of currently claimed rewards by the users. uint256 public totalDistributed; // flag for allowing upgrade bool public upgradeStatus; //erc20-like interface struct TokenInfo { string name; string symbol; uint8 decimals; } TokenInfo private token; // Locker contains info related to each locker. struct Locker { uint256 amount; // Tokens currently locked to the contract and vote power (in lp) uint256 rewardAllowed; // Rewards allowed to be paid out uint256 rewardDebt; // Param is needed for correct calculation locker's share uint256 distributed; // Amount of distributed tokens uint256 unlockAmount; // Amount of tokens which is available to withdraw (in alluo) uint256 depositUnlockTime; // The time when tokens are available to unlock uint256 withdrawUnlockTime; // The time when tokens are available to withdraw } // Lockers info by token holders. mapping(address => Locker) public _lockers; // ERC20 token locked on the contract and earned by locker as reward. IERC20Upgradeable public constant alluoToken = IERC20Upgradeable(0x1E5193ccC53f25638Aa22a940af899B692e10B09); IExchange public constant exchange = IExchange(0x29c66CF57a03d41Cfe6d9ecB6883aa0E2AbA21Ec); IBalancer public constant balancer = IBalancer(0xBA12222222228d8Ba445958a75a0704d566BF2C8); IERC20Upgradeable public constant alluoBalancerLp = IERC20Upgradeable(0x85Be1e46283f5f438D1f864c2d925506571d544f); IERC20Upgradeable public constant weth = IERC20Upgradeable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); bytes32 public constant poolId = 0x85be1e46283f5f438d1f864c2d925506571d544f0002000000000000000001aa; /** * @dev Emitted in `updateWithdrawLockDuration` when the lock time after unlock() was changed */ event WithdrawLockDurationUpdated(uint256 time, uint256 timestamp); /** * @dev Emitted in `updateDepositLockDuration` when the lock time after lock() was changed */ event DepositLockDurationUpdated(uint256 time, uint256 timestamp); /** * @dev Emitted in `setReward` when the new rewardPerDistribution was set */ event RewardAmountUpdated(uint256 amount, uint256 produced); /** * @dev Emitted in `lock` when the user locked the tokens */ event TokensLocked( address indexed sender, address tokenAddress, uint256 tokenAmount, uint256 lpAmount, uint256 time ); /** * @dev Emitted in `unlock` when the user unbinded his locked tokens */ event TokensUnlocked( address indexed sender, uint256 alluoAmount, uint256 lpAmount, uint256 time ); /** * @dev Emitted in `withdraw` when the user withdrew his locked tokens from the contract */ event TokensWithdrawed( address indexed sender, uint256 alluoAmount, uint256 time ); /** * @dev Emitted in `claim` when the user claimed his reward tokens */ event TokensClaimed( address indexed sender, uint256 alluoAmount, uint256 time ); // allows to see balances on etherscan event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Contract constructor without parameters */ /// @custom:oz-upgrades-unsafe-allow constructor constructor() initializer {} /** * @dev Contract initializer */ function initialize( address _multiSigWallet, uint256 _rewardPerDistribution ) public initializer{ __AccessControl_init(); __Pausable_init(); __UUPSUpgradeable_init(); require(_multiSigWallet.isContract(), "Locking: not contract"); _setupRole(DEFAULT_ADMIN_ROLE, _multiSigWallet); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(UPGRADER_ROLE, _multiSigWallet); token = TokenInfo({ name: "Vote Locked Alluo Token", symbol: "vlAlluo", decimals: 18 }); rewardPerDistribution = _rewardPerDistribution; producedTime = block.timestamp; depositLockDuration = 86400 * 7; withdrawLockDuration = 86400 * 5; alluoToken.approve(address(exchange), type(uint256).max); alluoBalancerLp.approve(address(balancer), type(uint256).max); weth.approve(address(exchange), type(uint256).max); } function decimals() public view returns (uint8) { return token.decimals; } function name() public view returns (string memory) { return token.name; } function symbol() public view returns (string memory) { return token.symbol; } /** * @dev Calculates the necessary parameters for locking * @return Totally produced rewards */ function produced() private view returns (uint256) { return allProduced + (rewardPerDistribution * (block.timestamp - producedTime)) / distributionTime; } /** * @dev Updates the produced rewards parameter for locking */ function update() public whenNotPaused { uint256 rewardProducedAtNow = produced(); if (rewardProducedAtNow > rewardProduced) { uint256 producedNew = rewardProducedAtNow - rewardProduced; if (totalLocked > 0) { tokensPerLock = tokensPerLock + (producedNew * 1e20) / totalLocked; } rewardProduced = rewardProduced + producedNew; } } /** * @dev Locks specified amount Alluo tokens in the contract * @param _amount An amount of Alluo tokens to lock */ function lock(uint256 _amount) public { Locker storage locker = _lockers[msg.sender]; alluoToken.safeTransferFrom( msg.sender, address(this), _amount ); uint256 lpAmount = exchange.exchange( address(alluoToken), address(alluoBalancerLp), _amount, 0 ); if (totalLocked > 0) { update(); } locker.rewardDebt = locker.rewardDebt + ((lpAmount * tokensPerLock) / 1e20); totalLocked = totalLocked + lpAmount; locker.amount = locker.amount + lpAmount; locker.depositUnlockTime = block.timestamp + depositLockDuration; emit TokensLocked(msg.sender, address(alluoToken), _amount, lpAmount, block.timestamp ); emit Transfer(address(0), msg.sender, lpAmount); } /** * @dev Locks specified amount WETH in the contract * @param _amount An amount of WETH tokens to lock */ function lockWETH(uint256 _amount) public { Locker storage locker = _lockers[msg.sender]; weth.safeTransferFrom( msg.sender, address(this), _amount ); uint256 lpAmount = exchange.exchange( address(weth), address(alluoBalancerLp), _amount, 0 ); if (totalLocked > 0) { update(); } locker.rewardDebt = locker.rewardDebt + ((lpAmount * tokensPerLock) / 1e20); totalLocked = totalLocked + lpAmount; locker.amount = locker.amount + lpAmount; locker.depositUnlockTime = block.timestamp + depositLockDuration; emit TokensLocked(msg.sender, address(weth), _amount, lpAmount, block.timestamp); emit Transfer(address(0), msg.sender, lpAmount); } /** * @dev Migrates all balances from old contract * @param _users list of lockers from old contract * @param _amounts list of amounts each equal to the share of locker on old contract * (locked amount + unlocked + claim) */ function migrationLock(address[] memory _users, uint256[] memory _amounts) external onlyRole(DEFAULT_ADMIN_ROLE){ for(uint i = 0; i < _users.length; i++){ Locker storage locker = _lockers[_users[i]]; if (totalLocked > 0) { update(); } locker.rewardDebt = locker.rewardDebt + ((_amounts[i] * tokensPerLock) / 1e20); totalLocked = totalLocked + _amounts[i]; locker.amount = _amounts[i]; locker.depositUnlockTime = block.timestamp + depositLockDuration; emit TokensLocked(_users[i], address(0), 0, _amounts[i], block.timestamp); emit Transfer(address(0), _users[i], _amounts[i]); } } /** * @dev Unbinds specified amount of tokens * @param _amount An amount to unbid */ function unlock(uint256 _amount) public { Locker storage locker = _lockers[msg.sender]; require( locker.depositUnlockTime <= block.timestamp, "Locking: tokens not available" ); require( locker.amount >= _amount, "Locking: not enough lp tokens" ); update(); uint256 alluoAmount = _exitAlluoPoolExactLp(_amount); locker.rewardAllowed = locker.rewardAllowed + ((_amount * tokensPerLock) / 1e20); locker.amount -= _amount; totalLocked -= _amount; waitingForWithdrawal += alluoAmount; locker.unlockAmount += alluoAmount; locker.withdrawUnlockTime = block.timestamp + withdrawLockDuration; emit TokensUnlocked(msg.sender, alluoAmount, _amount, block.timestamp); emit Transfer(msg.sender, address(0), _amount); } /** * @dev Unbinds all amount */ function unlockAll() public { Locker storage locker = _lockers[msg.sender]; require( locker.depositUnlockTime <= block.timestamp, "Locking: tokens not available" ); uint256 amount = locker.amount; require(amount > 0, "Locking: not enough lp tokens"); update(); uint256 alluoAmount = _exitAlluoPoolExactLp(amount); locker.rewardAllowed = locker.rewardAllowed + ((amount * tokensPerLock) / 1e20); locker.amount = 0; totalLocked -= amount; waitingForWithdrawal += alluoAmount; locker.unlockAmount += alluoAmount; locker.withdrawUnlockTime = block.timestamp + withdrawLockDuration; emit TokensUnlocked(msg.sender, alluoAmount, amount, block.timestamp); emit Transfer(msg.sender, address(0), amount); } /** * @dev Unlocks unbinded tokens and transfers them to locker's address */ function withdraw() public whenNotPaused { Locker storage locker = _lockers[msg.sender]; require( locker.unlockAmount > 0, "Locking: not enough tokens" ); require( block.timestamp >= locker.withdrawUnlockTime, "Locking: tokens not available" ); uint256 amount = locker.unlockAmount; locker.unlockAmount = 0; waitingForWithdrawal -= amount; alluoToken.safeTransfer(msg.sender, amount); emit TokensWithdrawed(msg.sender, amount, block.timestamp); } /** * @dev Сlaims available rewards */ function claim() public { if (totalLocked > 0) { update(); } uint256 reward = calcReward(msg.sender, tokensPerLock); require(reward > 0, "Locking: Nothing to claim"); Locker storage locker = _lockers[msg.sender]; locker.distributed = locker.distributed + reward; totalDistributed += reward; alluoToken.safeTransfer(msg.sender, reward); emit TokensClaimed(msg.sender, reward, block.timestamp); } /** * @dev Сalculates available reward * @param _locker Address of the locker * @param _tpl Tokens per lock parameter */ function calcReward(address _locker, uint256 _tpl) private view returns (uint256 reward) { Locker storage locker = _lockers[_locker]; reward = ((locker.amount * _tpl) / 1e20) + locker.rewardAllowed - locker.distributed - locker.rewardDebt; return reward; } /** * @dev Returns locker's available rewards * @param _locker Address of the locker * @return reward Available reward to claim */ function getClaim(address _locker) public view returns (uint256 reward) { uint256 _tpl = tokensPerLock; if (totalLocked > 0) { uint256 rewardProducedAtNow = produced(); if (rewardProducedAtNow > rewardProduced) { uint256 producedNew = rewardProducedAtNow - rewardProduced; _tpl = _tpl + ((producedNew * 1e20) / totalLocked); } } reward = calcReward(_locker, _tpl); return reward; } /** * @dev Returns balance of the specified locker * @param _address Locker's address * @return amount of vote/locked tokens */ function balanceOf(address _address) external view returns (uint256 amount) { return 0; } /** * @dev Returns unlocked balance of the specified locker * @param _address Locker's address * @return amount of unlocked tokens */ function unlockedBalanceOf(address _address) external view returns (uint256 amount) { return _lockers[_address].unlockAmount; } /** * @dev converts amount of Alluo to Lp based on current ratio * @param _amount amount of Alluo tokens * @return amount amount of Lp tokens */ function convertAlluoToLp(uint256 _amount) external view returns (uint256) { uint256 alluoOnBalancer = alluoToken.balanceOf(address(balancer)); uint256 totalBalancerAlluoLp = ERC20Upgradeable(address(alluoBalancerLp)).totalSupply(); uint256 alluoPerLp = alluoOnBalancer * 100 * 100000000 / totalBalancerAlluoLp / 80; return _amount * 100000000 / alluoPerLp; } /** * @dev converts amount of Lp to Alluo tokens based on current ratio * @param _amount amount of Lp tokens * @return amount amount of Alluo tokens */ function convertLpToAlluo(uint256 _amount) external view returns (uint256) { uint256 alluoOnBalancer = alluoToken.balanceOf(address(balancer)); uint256 totalBalancerAlluoLp = ERC20Upgradeable(address(alluoBalancerLp)).totalSupply(); uint256 alluoPerLp = alluoOnBalancer * 100 * 100000000 / totalBalancerAlluoLp / 80; return _amount * alluoPerLp / 100000000; } /** * @dev Returns total amount of locked tokens (in lp) * @return amount of locked */ function totalSupply() external view returns (uint256 amount) { return 0; } /** * @dev Returns information about the specified locker * @param _address Locker's address * @return locked_ Locked amount of tokens (in lp) * @return unlockAmount_ Unlocked amount of tokens (in Alluo) * @return claim_ Reward amount available to be claimed * @return depositUnlockTime_ Timestamp when tokens will be available to unlock * @return withdrawUnlockTime_ Timestamp when tokens will be available to withdraw */ function getInfoByAddress(address _address) external view returns ( uint256 locked_, uint256 unlockAmount_, uint256 claim_, uint256 depositUnlockTime_, uint256 withdrawUnlockTime_ ) { Locker memory locker = _lockers[_address]; locked_ = locker.amount; unlockAmount_ = locker.unlockAmount; depositUnlockTime_ = locker.depositUnlockTime; withdrawUnlockTime_ = locker.withdrawUnlockTime; claim_ = getClaim(_address); return ( locked_, unlockAmount_, claim_, depositUnlockTime_, withdrawUnlockTime_ ); } /* ========== ADMIN CONFIGURATION ========== */ ///@dev Pauses the locking function pause() external onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); } ///@dev Unpauses the locking function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); } /** * @dev Adds reward tokens to the contract * @param _amount Specifies the amount of tokens to be transferred to the contract */ function addReward(uint256 _amount) external { alluoToken.safeTransferFrom( msg.sender, address(this), _amount ); } /** * @dev Sets amount of reward during `distributionTime` * @param _amount Sets total reward amount per `distributionTime` */ function setReward(uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) { allProduced = produced(); producedTime = block.timestamp; rewardPerDistribution = _amount; emit RewardAmountUpdated(_amount, allProduced); } /** * @dev Allows to update the time when the rewards are available to unlock * @param _depositLockDuration Date in unix timestamp format */ function updateDepositLockDuration(uint256 _depositLockDuration) external onlyRole(DEFAULT_ADMIN_ROLE) { depositLockDuration = _depositLockDuration; emit DepositLockDurationUpdated(_depositLockDuration, block.timestamp); } /** * @dev Allows to update the time when the rewards are available to withdraw * @param _withdrawLockDuration Date in unix timestamp format */ function updateWithdrawLockDuration(uint256 _withdrawLockDuration) external onlyRole(DEFAULT_ADMIN_ROLE) { withdrawLockDuration = _withdrawLockDuration; emit WithdrawLockDurationUpdated(_withdrawLockDuration, block.timestamp); } function withdrawTokens( address withdrawToken, address to, uint256 amount ) external onlyRole(DEFAULT_ADMIN_ROLE) { IERC20Upgradeable(withdrawToken).safeTransfer(to, amount); } function _exitAlluoPoolExactLp(uint256 lpAmount) private returns (uint256) { address[] memory assets = new address[](2); assets[0] = 0x1E5193ccC53f25638Aa22a940af899B692e10B09; assets[1] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint256[] memory amounts = new uint256[](2); bytes memory data = abi.encode( uint256(ExitKind.EXACT_BPT_IN_FOR_ONE_TOKEN_OUT), lpAmount, 0 ); ExitPoolRequest memory request = ExitPoolRequest( assets, amounts, data, false ); uint256 alluoBalanceBefore = alluoToken.balanceOf(address(this)); balancer.exitPool( poolId, address(this), payable(address(this)), request ); return alluoToken.balanceOf(address(this)) - alluoBalanceBefore; } function clean(address[] calldata users) external onlyRole(UPGRADER_ROLE) { for (uint256 i = 0; i < users.length; i++) { emit Transfer(users[i], address(0), _lockers[users[i]].amount); } } /** * @dev allows and prohibits to upgrade contract * @param _status flag for allowing upgrade from gnosis */ function changeUpgradeStatus(bool _status) external onlyRole(DEFAULT_ADMIN_ROLE) { upgradeStatus = _status; } function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE) { require(upgradeStatus, "Locking: upgrade not allowed"); upgradeStatus = false; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "./IBalancerStructs.sol"; interface IBalancer is IBalancerStructs { function swap( SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline ) external payable returns (uint256 amountCalculated); function joinPool( bytes32 poolId, address sender, address recipient, JoinPoolRequest memory request ) external payable; function getPoolTokens(bytes32 poolId) external view returns ( address[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock ); function exitPool( bytes32 poolId, address sender, address payable recipient, ExitPoolRequest memory request ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; interface IExchange{ struct RouteEdge { uint32 swapProtocol; // 0 - unknown edge, 1 - UniswapV2, 2 - Curve... address pool; // address of pool to call address fromCoin; // address of coin to deposit to pool address toCoin; // address of coin to get from pool } function exchange( address from, address to, uint256 amountIn, uint256 minAmountOut ) external payable returns (uint256); function buildRoute(address from, address to) external view returns (RouteEdge[] memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract 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}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ 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 value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @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.6.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.5.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 that the this implementation remains valid after 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. */ function upgradeTo(address newImplementation) external 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. */ function upgradeToAndCall(address newImplementation, bytes memory data) external 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.7.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] * ``` * 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. Equivalent to `reinitializer(1)`. */ 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. * * `initializer` is equivalent to `reinitializer(1)`, so 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. * * 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. */ 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. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../extensions/draft-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; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } 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)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( 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"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; interface IBalancerStructs { enum SwapKind { GIVEN_IN, GIVEN_OUT } enum JoinKind { INIT, EXACT_TOKENS_IN_FOR_BPT_OUT, TOKEN_IN_FOR_EXACT_BPT_OUT, ALL_TOKENS_IN_FOR_EXACT_BPT_OUT } enum ExitKind { EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, EXACT_BPT_IN_FOR_TOKENS_OUT, BPT_IN_FOR_EXACT_TOKENS_OUT, MANAGEMENT_FEE_TOKENS_OUT // for InvestmentPool } struct SingleSwap { bytes32 poolId; SwapKind kind; address assetIn; address assetOut; uint256 amount; bytes userData; } struct FundManagement { address sender; bool fromInternalBalance; address payable recipient; bool toInternalBalance; } struct JoinPoolRequest { address[] assets; uint256[] maxAmountsIn; bytes userData; bool fromInternalBalance; } struct ExitPoolRequest { address[] assets; uint256[] minAmountsOut; bytes userData; bool toInternalBalance; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @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.7.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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// 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.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.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.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._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { 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 Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @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) { _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 Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @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 Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @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) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @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) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @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.7.0) (utils/StorageSlot.sol) 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: * ``` * 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`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 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 } } }
// 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 v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface 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":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"DepositLockDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"produced","type":"uint256"}],"name":"RewardAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"alluoAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"TokensLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"alluoAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"TokensUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"alluoAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"TokensWithdrawed","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WithdrawLockDurationUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_lockers","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardAllowed","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"distributed","type":"uint256"},{"internalType":"uint256","name":"unlockAmount","type":"uint256"},{"internalType":"uint256","name":"depositUnlockTime","type":"uint256"},{"internalType":"uint256","name":"withdrawUnlockTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"alluoBalancerLp","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"alluoToken","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balancer","outputs":[{"internalType":"contract IBalancer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"changeUpgradeStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"clean","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertAlluoToLp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertLpToAlluo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositLockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributionTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchange","outputs":[{"internalType":"contract IExchange","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_locker","type":"address"}],"name":"getClaim","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getInfoByAddress","outputs":[{"internalType":"uint256","name":"locked_","type":"uint256"},{"internalType":"uint256","name":"unlockAmount_","type":"uint256"},{"internalType":"uint256","name":"claim_","type":"uint256"},{"internalType":"uint256","name":"depositUnlockTime_","type":"uint256"},{"internalType":"uint256","name":"withdrawUnlockTime_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_multiSigWallet","type":"address"},{"internalType":"uint256","name":"_rewardPerDistribution","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lockWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"migrationLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"unlockedBalanceOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositLockDuration","type":"uint256"}],"name":"updateDepositLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawLockDuration","type":"uint256"}],"name":"updateWithdrawLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"name":"waitingForWithdrawal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"withdrawToken","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b50600054610100900460ff1615808015620000375750600054600160ff909116105b8062000067575062000054306200014160201b6200246e1760201c565b15801562000067575060005460ff166001145b620000cf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000f3576000805461ff0019166101001790555b80156200013a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5062000150565b6001600160a01b03163b151590565b608051613cef6200018860003960008181610de801528181610e28015281816113d00152818161141001526114e50152613cef6000f3fe6080604052600436106103505760003560e01c80635e35359e116101c6578063a2e62045116100f7578063d547741f11610095578063e4ea6ca81161006f578063e4ea6ca814610a27578063e563037e14610a47578063efca2eed14610a6f578063f72c0d8b14610a8657600080fd5b8063d547741f146109c7578063d701f523146109e7578063dd46706414610a0757600080fd5b8063cd6dc687116100d1578063cd6dc6871461093c578063d032ed4c1461095c578063d2f7265a14610984578063d4d543c5146109ac57600080fd5b8063a2e62045146108f2578063a46a66c514610907578063cd24b0a31461092757600080fd5b80639060688c1161016457806395d89b411161013e57806395d89b411461089a5780639c2d3638146108af5780639cc2fc5a146108c6578063a217fddf146108dd57600080fd5b80639060688c1461081257806391d148541461085a578063945bb2ba1461087a57600080fd5b806370a08231116101a057806370a082311461078257806374de4ec4146107a35780638456cb59146107c357806384955c88146107d857600080fd5b80635e35359e146106b45780636198e339146106d45780636f6b53b5146106f457600080fd5b80633f4ba83a116102a05780634e4072d01161023e578063514e2e8311610218578063514e2e831461065057806352d1902d1461067057806356891412146106855780635c975abb1461069c57600080fd5b80634e4072d0146106065780634e71d92d146106285780634f1ef2861461063d57600080fd5b806344928a241161027a57806344928a241461058f57806349c1cf6e146105af5780634c39cc84146105c65780634cd3723a146105e657600080fd5b80633f4ba83a146105235780633fc8cef314610538578063424c79ca1461057857600080fd5b80632f2ff15d1161030d5780633659cfe6116102e75780633659cfe6146104a3578063399d673a146104c35780633ccfd60b146104da5780633e0dc34e146104ef57600080fd5b80632f2ff15d14610440578063313ce5671461046057806336568abe1461048357600080fd5b806301ffc9a71461035557806306fdde031461038a578063101f8b7a146103ac57806318160ddd146103da578063248a9ca3146103ee578063293be4561461041e575b600080fd5b34801561036157600080fd5b506103756103703660046133b5565b610aa8565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610adf565b6040516103819190613437565b3480156103b857600080fd5b506103cc6103c736600461344a565b610b75565b604051908152602001610381565b3480156103e657600080fd5b5060006103cc565b3480156103fa57600080fd5b506103cc61040936600461344a565b600090815260c9602052604090206001015490565b34801561042a57600080fd5b5061043e61043936600461344a565b610ccd565b005b34801561044c57600080fd5b5061043e61045b36600461347f565b610d30565b34801561046c57600080fd5b5061013a5460405160ff9091168152602001610381565b34801561048f57600080fd5b5061043e61049e36600461347f565b610d5a565b3480156104af57600080fd5b5061043e6104be3660046134ab565b610ddd565b3480156104cf57600080fd5b506103cc6101345481565b3480156104e657600080fd5b5061043e610ebd565b3480156104fb57600080fd5b506103cc7f85be1e46283f5f438d1f864c2d925506571d544f0002000000000000000001aa81565b34801561052f57600080fd5b5061043e610fc8565b34801561054457600080fd5b5061056073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b039091168152602001610381565b34801561058457600080fd5b506103cc6101335481565b34801561059b57600080fd5b5061043e6105aa36600461359c565b610fdb565b3480156105bb57600080fd5b506103cc6201518081565b3480156105d257600080fd5b5061043e6105e136600461344a565b6111fe565b3480156105f257600080fd5b506103cc6106013660046134ab565b611244565b34801561061257600080fd5b50610560600080516020613c9a83398151915281565b34801561063457600080fd5b5061043e6112c2565b61043e61064b36600461365c565b6113c5565b34801561065c57600080fd5b5061043e61066b36600461344a565b611492565b34801561067c57600080fd5b506103cc6114d8565b34801561069157600080fd5b506103cc61012e5481565b3480156106a857600080fd5b5060fb5460ff16610375565b3480156106c057600080fd5b5061043e6106cf366004613702565b61158b565b3480156106e057600080fd5b5061043e6106ef36600461344a565b6115aa565b34801561070057600080fd5b5061074d61070f3660046134ab565b61013b602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949593949293919290919087565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e001610381565b34801561078e57600080fd5b506103cc61079d3660046134ab565b50600090565b3480156107af57600080fd5b5061043e6107be36600461344a565b611764565b3480156107cf57600080fd5b5061043e61177e565b3480156107e457600080fd5b506103cc6107f33660046134ab565b6001600160a01b0316600090815261013b602052604090206004015490565b34801561081e57600080fd5b5061083261082d3660046134ab565b611791565b604080519586526020860194909452928401919091526060830152608082015260a001610381565b34801561086657600080fd5b5061037561087536600461347f565b61181c565b34801561088657600080fd5b5061043e61089536600461373e565b611847565b3480156108a657600080fd5b5061039f611914565b3480156108bb57600080fd5b506103cc6101355481565b3480156108d257600080fd5b506103cc61012d5481565b3480156108e957600080fd5b506103cc600081565b3480156108fe57600080fd5b5061043e611927565b34801561091357600080fd5b506103cc61092236600461344a565b6119ae565b34801561093357600080fd5b5061043e611af3565b34801561094857600080fd5b5061043e6109573660046137b3565b611c8c565b34801561096857600080fd5b506105607385be1e46283f5f438d1f864c2d925506571d544f81565b34801561099057600080fd5b506105607329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec81565b3480156109b857600080fd5b50610137546103759060ff1681565b3480156109d357600080fd5b5061043e6109e236600461347f565b6120ac565b3480156109f357600080fd5b5061043e610a023660046137eb565b6120d1565b348015610a1357600080fd5b5061043e610a2236600461344a565b6120f1565b348015610a3357600080fd5b5061043e610a4236600461344a565b6122bc565b348015610a5357600080fd5b5061056073ba12222222228d8ba445958a75a0704d566bf2c881565b348015610a7b57600080fd5b506103cc6101365481565b348015610a9257600080fd5b506103cc600080516020613c1383398151915281565b60006001600160e01b03198216637965db0b60e01b1480610ad957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606101386000018054610af290613808565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1e90613808565b8015610b6b5780601f10610b4057610100808354040283529160200191610b6b565b820191906000526020600020905b815481529060010190602001808311610b4e57829003601f168201915b5050505050905090565b6040516370a0823160e01b815273ba12222222228d8ba445958a75a0704d566bf2c860048201526000908190600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015610bd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfb9190613843565b905060007385be1e46283f5f438d1f864c2d925506571d544f6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c759190613843565b90506000605082610c87856064613872565b610c95906305f5e100613872565b610c9f9190613891565b610ca99190613891565b90506305f5e100610cba8287613872565b610cc49190613891565b95945050505050565b6000610cd88161247d565b610ce0612487565b610131819055426101325561012d8390556040805184815260208101929092527ff0d37c3ae852021ac329281f604b658691cbfa6b9e9c22909f06b64a8ce87c9491015b60405180910390a15050565b600082815260c96020526040902060010154610d4b8161247d565b610d5583836124c7565b505050565b6001600160a01b0381163314610dcf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610dd9828261254d565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610e265760405162461bcd60e51b8152600401610dc6906138b3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e6f600080516020613c33833981519152546001600160a01b031690565b6001600160a01b031614610e955760405162461bcd60e51b8152600401610dc6906138ff565b610e9e816125b4565b60408051600080825260208201909252610eba9183919061262e565b50565b610ec5612799565b33600090815261013b602052604090206004810154610f265760405162461bcd60e51b815260206004820152601a60248201527f4c6f636b696e673a206e6f7420656e6f75676820746f6b656e730000000000006044820152606401610dc6565b8060060154421015610f4a5760405162461bcd60e51b8152600401610dc69061394b565b600481018054600091829055610135805491928392610f6a908490613982565b90915550610f899050600080516020613c9a83398151915233836127e1565b6040805182815242602082015233917f15fcba5c1a08673136c7dad5a972957fd199328047178347c2592e9bf269d66391015b60405180910390a25050565b6000610fd38161247d565b610eba612844565b6000610fe68161247d565b60005b83518110156111f857600061013b600086848151811061100b5761100b613999565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000209050600061012e54111561104957611049611927565b68056bc75e2d6310000061012f5485848151811061106957611069613999565b602002602001015161107b9190613872565b6110859190613891565b816002015461109491906139af565b600282015583518490839081106110ad576110ad613999565b602002602001015161012e546110c391906139af565b61012e5583518490839081106110db576110db613999565b60209081029190910101518155610133546110f690426139af565b6005820155845185908390811061110f5761110f613999565b60200260200101516001600160a01b03167fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc60008087868151811061115657611156613999565b60200260200101514260405161116f94939291906139c7565b60405180910390a284828151811061118957611189613999565b60200260200101516001600160a01b031660006001600160a01b0316600080516020613c7a8339815191528685815181106111c6576111c6613999565b60200260200101516040516111dd91815260200190565b60405180910390a350806111f0816139ed565b915050610fe9565b50505050565b60006112098161247d565b610134829055604080518381524260208201527f796a8967052608a0ab64c86a3896574d4b3ae0c3aefcf5c4501da1389538dc6a9101610d24565b61012f5461012e5460009190156112b157600061125f612487565b9050610130548111156112af576000610130548261127d9190613982565b61012e549091506112978268056bc75e2d63100000613872565b6112a19190613891565b6112ab90846139af565b9250505b505b6112bb8382612896565b9392505050565b61012e54156112d3576112d3611927565b60006112e23361012f54612896565b9050600081116113345760405162461bcd60e51b815260206004820152601960248201527f4c6f636b696e673a204e6f7468696e6720746f20636c61696d000000000000006044820152606401610dc6565b33600090815261013b6020526040902060038101546113549083906139af565b816003018190555081610136600082825461136f91906139af565b9091555061138e9050600080516020613c9a83398151915233846127e1565b6040805183815242602082015233917f9923b4306c6c030f2bdfbf156517d5983b87e15b96176da122cd4f2effa4ba7b9101610fbc565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561140e5760405162461bcd60e51b8152600401610dc6906138b3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611457600080516020613c33833981519152546001600160a01b031690565b6001600160a01b03161461147d5760405162461bcd60e51b8152600401610dc6906138ff565b611486826125b4565b610dd98282600161262e565b600061149d8161247d565b610133829055604080518381524260208201527fa9c4f03cdfbed61a2438fce108a73d6409a57430c2549bcef83c28795a7610c49101610d24565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610dc6565b50600080516020613c3383398151915290565b60006115968161247d565b6111f86001600160a01b03851684846127e1565b33600090815261013b6020526040902060058101544210156115de5760405162461bcd60e51b8152600401610dc69061394b565b805482111561162f5760405162461bcd60e51b815260206004820152601d60248201527f4c6f636b696e673a206e6f7420656e6f756768206c7020746f6b656e730000006044820152606401610dc6565b611637611927565b600061164283612906565b905068056bc75e2d6310000061012f548461165d9190613872565b6116679190613891565b826001015461167691906139af565b600183015581548390839060009061168f908490613982565b925050819055508261012e60008282546116a99190613982565b925050819055508061013560008282546116c391906139af565b92505081905550808260040160008282546116de91906139af565b9091555050610134546116f190426139af565b600683015560408051828152602081018590524281830152905133917f2736fb24d52f9268e829a25b5684fb0a60e6b37ae2297f7e62eea9f836a73da7919081900360600190a26040518381526000903390600080516020613c7a833981519152906020015b60405180910390a3505050565b610eba600080516020613c9a833981519152333084612b9f565b60006117898161247d565b610eba612bd7565b6001600160a01b038116600090815261013b60209081526040808320815160e081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600481015460808301819052600582015460a0840181905260069092015460c0840181905293949093909261181087611244565b93505091939590929450565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020613c1383398151915261185f8161247d565b60005b828110156111f857600084848381811061187e5761187e613999565b905060200201602081019061189391906134ab565b6001600160a01b0316600080516020613c7a83398151915261013b60008888878181106118c2576118c2613999565b90506020020160208101906118d791906134ab565b6001600160a01b0316815260208082019290925260409081016000205490519081520160405180910390a38061190c816139ed565b915050611862565b60606101386001018054610af290613808565b61192f612799565b6000611939612487565b905061013054811115610eba57600061013054826119579190613982565b61012e54909150156119975761012e5461197a8268056bc75e2d63100000613872565b6119849190613891565b61012f5461199291906139af565b61012f555b80610130546119a691906139af565b610130555050565b6040516370a0823160e01b815273ba12222222228d8ba445958a75a0704d566bf2c860048201526000908190600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015611a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a349190613843565b905060007385be1e46283f5f438d1f864c2d925506571d544f6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aae9190613843565b90506000605082611ac0856064613872565b611ace906305f5e100613872565b611ad89190613891565b611ae29190613891565b905080610cba866305f5e100613872565b33600090815261013b602052604090206005810154421015611b275760405162461bcd60e51b8152600401610dc69061394b565b805480611b765760405162461bcd60e51b815260206004820152601d60248201527f4c6f636b696e673a206e6f7420656e6f756768206c7020746f6b656e730000006044820152606401610dc6565b611b7e611927565b6000611b8982612906565b905068056bc75e2d6310000061012f5483611ba49190613872565b611bae9190613891565b8360010154611bbd91906139af565b6001840155600080845561012e8054849290611bda908490613982565b92505081905550806101356000828254611bf491906139af565b9250508190555080836004016000828254611c0f91906139af565b909155505061013454611c2290426139af565b600684015560408051828152602081018490524281830152905133917f2736fb24d52f9268e829a25b5684fb0a60e6b37ae2297f7e62eea9f836a73da7919081900360600190a26040518281526000903390600080516020613c7a83398151915290602001611757565b600054610100900460ff1615808015611cac5750600054600160ff909116105b80611cc65750303b158015611cc6575060005460ff166001145b611d295760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610dc6565b6000805460ff191660011790558015611d4c576000805461ff0019166101001790555b611d54612c14565b611d5c612c3b565b611d64612c14565b6001600160a01b0383163b611db35760405162461bcd60e51b8152602060048201526015602482015274131bd8dada5b99ce881b9bdd0818dbdb9d1c9858dd605a1b6044820152606401610dc6565b611dbe600084612c6a565b611dc9600033612c6a565b611de1600080516020613c1383398151915284612c6a565b6040805160a0810182526017606082019081527f566f7465204c6f636b656420416c6c756f20546f6b656e00000000000000000060808301528152815180830183526007815266766c416c6c756f60c81b6020828101919091528083019190915260129282019290925280518051919261013892611e62928492019061331c565b506020828101518051611e7b926001850192019061331c565b50604091820151600291909101805460ff191660ff90921691909117905561012d839055426101325562093a806101335562069780610134555163095ea7b360e01b81527329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec60048201526000196024820152600080516020613c9a8339815191529063095ea7b3906044016020604051808303816000875af1158015611f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3d9190613a08565b5060405163095ea7b360e01b815273ba12222222228d8ba445958a75a0704d566bf2c8600482015260001960248201527385be1e46283f5f438d1f864c2d925506571d544f9063095ea7b3906044016020604051808303816000875af1158015611fab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcf9190613a08565b5060405163095ea7b360e01b81527329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec6004820152600019602482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29063095ea7b3906044016020604051808303816000875af115801561203d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120619190613a08565b508015610d55576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b600082815260c960205260409020600101546120c78161247d565b610d55838361254d565b60006120dc8161247d565b50610137805460ff1916911515919091179055565b33600081815261013b602052604090209061211d90600080516020613c9a833981519152903085612b9f565b604051630ed2fc9560e01b8152600080516020613c9a83398151915260048201527385be1e46283f5f438d1f864c2d925506571d544f602482015260448101839052600060648201819052907329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec90630ed2fc95906084016020604051808303816000875af11580156121a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121cb9190613843565b61012e54909150156121df576121df611927565b68056bc75e2d6310000061012f54826121f89190613872565b6122029190613891565b826002015461221191906139af565b600283015561012e546122259082906139af565b61012e5581546122369082906139af565b82556101335461224690426139af565b600583015560405133907fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc9061229190600080516020613c9a833981519152908790869042906139c7565b60405180910390a26040518181523390600090600080516020613c7a83398151915290602001611757565b33600081815261013b60205260409020906122ee9073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2903085612b9f565b604051630ed2fc9560e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260048201527385be1e46283f5f438d1f864c2d925506571d544f602482015260448101839052600060648201819052907329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec90630ed2fc95906084016020604051808303816000875af115801561237e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a29190613843565b61012e54909150156123b6576123b6611927565b68056bc75e2d6310000061012f54826123cf9190613872565b6123d99190613891565b82600201546123e891906139af565b600283015561012e546123fc9082906139af565b61012e55815461240d9082906139af565b82556101335461241d90426139af565b600583015560405133907fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc906122919073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2908790869042906139c7565b6001600160a01b03163b151590565b610eba8133612c74565b600062015180610132544261249c9190613982565b61012d546124aa9190613872565b6124b49190613891565b610131546124c291906139af565b905090565b6124d1828261181c565b610dd957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191660011790556125093390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612557828261181c565b15610dd957600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613c138339815191526125cc8161247d565b6101375460ff1661261f5760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b696e673a2075706772616465206e6f7420616c6c6f776564000000006044820152606401610dc6565b5050610137805460ff19169055565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561266157610d5583612cd8565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156126bb575060408051601f3d908101601f191682019092526126b891810190613843565b60015b61271e5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610dc6565b600080516020613c33833981519152811461278d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610dc6565b50610d55838383612d74565b60fb5460ff16156127df5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610dc6565b565b6040516001600160a01b038316602482015260448101829052610d5590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612d99565b61284c612e6b565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216600090815261013b60205260408120600281015460038201546001830154835468056bc75e2d63100000906128d6908890613872565b6128e09190613891565b6128ea91906139af565b6128f49190613982565b6128fe9190613982565b949350505050565b60408051600280825260608201835260009283929190602083019080368337019050509050600080516020613c9a8339815191528160008151811061294d5761294d613999565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061299557612995613999565b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905060008060408051602081019290925281018690526000606082015260800160408051808303601f190181526080830182528583526020830185905282820181905260006060840181905291516370a0823160e01b8152306004820152909350600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015612a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a899190613843565b604051638bdb391360e01b815290915073ba12222222228d8ba445958a75a0704d566bf2c890638bdb391390612ae9907f85be1e46283f5f438d1f864c2d925506571d544f0002000000000000000001aa90309081908890600401613a60565b600060405180830381600087803b158015612b0357600080fd5b505af1158015612b17573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152839250600080516020613c9a83398151915291506370a0823190602401602060405180830381865afa158015612b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8a9190613843565b612b949190613982565b979650505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111f89085906323b872dd60e01b9060840161280d565b612bdf612799565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586128793390565b600054610100900460ff166127df5760405162461bcd60e51b8152600401610dc690613b1f565b600054610100900460ff16612c625760405162461bcd60e51b8152600401610dc690613b1f565b6127df612eb4565b610dd982826124c7565b612c7e828261181c565b610dd957612c96816001600160a01b03166014612ee7565b612ca1836020612ee7565b604051602001612cb2929190613b6a565b60408051601f198184030181529082905262461bcd60e51b8252610dc691600401613437565b6001600160a01b0381163b612d455760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610dc6565b600080516020613c3383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d7d83613083565b600082511180612d8a5750805b15610d55576111f883836130c3565b6000612dee826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131ae9092919063ffffffff16565b805190915015610d555780806020019051810190612e0c9190613a08565b610d555760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dc6565b60fb5460ff166127df5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610dc6565b600054610100900460ff16612edb5760405162461bcd60e51b8152600401610dc690613b1f565b60fb805460ff19169055565b60606000612ef6836002613872565b612f019060026139af565b67ffffffffffffffff811115612f1957612f196134c6565b6040519080825280601f01601f191660200182016040528015612f43576020820181803683370190505b509050600360fc1b81600081518110612f5e57612f5e613999565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612f8d57612f8d613999565b60200101906001600160f81b031916908160001a9053506000612fb1846002613872565b612fbc9060016139af565b90505b6001811115613034576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612ff057612ff0613999565b1a60f81b82828151811061300657613006613999565b60200101906001600160f81b031916908160001a90535060049490941c9361302d81613bdf565b9050612fbf565b5083156112bb5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610dc6565b61308c81612cd8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61312b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610dc6565b600080846001600160a01b0316846040516131469190613bf6565b600060405180830381855af49150503d8060008114613181576040519150601f19603f3d011682016040523d82523d6000602084013e613186565b606091505b5091509150610cc48282604051806060016040528060278152602001613c53602791396131bd565b60606128fe84846000856131f6565b606083156131cc5750816112bb565b8251156131dc5782518084602001fd5b8160405162461bcd60e51b8152600401610dc69190613437565b6060824710156132575760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610dc6565b6001600160a01b0385163b6132ae5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dc6565b600080866001600160a01b031685876040516132ca9190613bf6565b60006040518083038185875af1925050503d8060008114613307576040519150601f19603f3d011682016040523d82523d6000602084013e61330c565b606091505b5091509150612b948282866131bd565b82805461332890613808565b90600052602060002090601f01602090048101928261334a5760008555613390565b82601f1061336357805160ff1916838001178555613390565b82800160010185558215613390579182015b82811115613390578251825591602001919060010190613375565b5061339c9291506133a0565b5090565b5b8082111561339c57600081556001016133a1565b6000602082840312156133c757600080fd5b81356001600160e01b0319811681146112bb57600080fd5b60005b838110156133fa5781810151838201526020016133e2565b838111156111f85750506000910152565b600081518084526134238160208601602086016133df565b601f01601f19169290920160200192915050565b6020815260006112bb602083018461340b565b60006020828403121561345c57600080fd5b5035919050565b80356001600160a01b038116811461347a57600080fd5b919050565b6000806040838503121561349257600080fd5b823591506134a260208401613463565b90509250929050565b6000602082840312156134bd57600080fd5b6112bb82613463565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613505576135056134c6565b604052919050565b600067ffffffffffffffff821115613527576135276134c6565b5060051b60200190565b600082601f83011261354257600080fd5b813560206135576135528361350d565b6134dc565b82815260059290921b8401810191818101908684111561357657600080fd5b8286015b84811015613591578035835291830191830161357a565b509695505050505050565b600080604083850312156135af57600080fd5b823567ffffffffffffffff808211156135c757600080fd5b818501915085601f8301126135db57600080fd5b813560206135eb6135528361350d565b82815260059290921b8401810191818101908984111561360a57600080fd5b948201945b8386101561362f5761362086613463565b8252948201949082019061360f565b9650508601359250508082111561364557600080fd5b5061365285828601613531565b9150509250929050565b6000806040838503121561366f57600080fd5b61367883613463565b915060208084013567ffffffffffffffff8082111561369657600080fd5b818601915086601f8301126136aa57600080fd5b8135818111156136bc576136bc6134c6565b6136ce601f8201601f191685016134dc565b915080825287848285010111156136e457600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561371757600080fd5b61372084613463565b925061372e60208501613463565b9150604084013590509250925092565b6000806020838503121561375157600080fd5b823567ffffffffffffffff8082111561376957600080fd5b818501915085601f83011261377d57600080fd5b81358181111561378c57600080fd5b8660208260051b85010111156137a157600080fd5b60209290920196919550909350505050565b600080604083850312156137c657600080fd5b6137cf83613463565b946020939093013593505050565b8015158114610eba57600080fd5b6000602082840312156137fd57600080fd5b81356112bb816137dd565b600181811c9082168061381c57607f821691505b6020821081141561383d57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561385557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561388c5761388c61385c565b500290565b6000826138ae57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252601d908201527f4c6f636b696e673a20746f6b656e73206e6f7420617661696c61626c65000000604082015260600190565b6000828210156139945761399461385c565b500390565b634e487b7160e01b600052603260045260246000fd5b600082198211156139c2576139c261385c565b500190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6000600019821415613a0157613a0161385c565b5060010190565b600060208284031215613a1a57600080fd5b81516112bb816137dd565b600081518084526020808501945080840160005b83811015613a5557815187529582019590820190600101613a39565b509495945050505050565b8481526000602060018060a01b038087168285015280861660408501526080606085015261010084018551608080870152818151808452610120880191508583019350600092505b80831015613aca57835185168252928501926001929092019190850190613aa8565b50848801519450607f199350838782030160a0880152613aea8186613a25565b94505050506040850151818584030160c0860152613b08838261340b565b92505050606084015161359160e085018215159052565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ba28160178501602088016133df565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613bd38160288401602088016133df565b01602801949350505050565b600081613bee57613bee61385c565b506000190190565b60008251613c088184602087016133df565b919091019291505056fe189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0000000000000000000000001e5193ccc53f25638aa22a940af899b692e10b09a26469706673582212204fc28988ba5d75e04fd042447ab015b850419cdc1a7f221c05bcdb57a1547f5264736f6c634300080b0033
Deployed Bytecode
0x6080604052600436106103505760003560e01c80635e35359e116101c6578063a2e62045116100f7578063d547741f11610095578063e4ea6ca81161006f578063e4ea6ca814610a27578063e563037e14610a47578063efca2eed14610a6f578063f72c0d8b14610a8657600080fd5b8063d547741f146109c7578063d701f523146109e7578063dd46706414610a0757600080fd5b8063cd6dc687116100d1578063cd6dc6871461093c578063d032ed4c1461095c578063d2f7265a14610984578063d4d543c5146109ac57600080fd5b8063a2e62045146108f2578063a46a66c514610907578063cd24b0a31461092757600080fd5b80639060688c1161016457806395d89b411161013e57806395d89b411461089a5780639c2d3638146108af5780639cc2fc5a146108c6578063a217fddf146108dd57600080fd5b80639060688c1461081257806391d148541461085a578063945bb2ba1461087a57600080fd5b806370a08231116101a057806370a082311461078257806374de4ec4146107a35780638456cb59146107c357806384955c88146107d857600080fd5b80635e35359e146106b45780636198e339146106d45780636f6b53b5146106f457600080fd5b80633f4ba83a116102a05780634e4072d01161023e578063514e2e8311610218578063514e2e831461065057806352d1902d1461067057806356891412146106855780635c975abb1461069c57600080fd5b80634e4072d0146106065780634e71d92d146106285780634f1ef2861461063d57600080fd5b806344928a241161027a57806344928a241461058f57806349c1cf6e146105af5780634c39cc84146105c65780634cd3723a146105e657600080fd5b80633f4ba83a146105235780633fc8cef314610538578063424c79ca1461057857600080fd5b80632f2ff15d1161030d5780633659cfe6116102e75780633659cfe6146104a3578063399d673a146104c35780633ccfd60b146104da5780633e0dc34e146104ef57600080fd5b80632f2ff15d14610440578063313ce5671461046057806336568abe1461048357600080fd5b806301ffc9a71461035557806306fdde031461038a578063101f8b7a146103ac57806318160ddd146103da578063248a9ca3146103ee578063293be4561461041e575b600080fd5b34801561036157600080fd5b506103756103703660046133b5565b610aa8565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610adf565b6040516103819190613437565b3480156103b857600080fd5b506103cc6103c736600461344a565b610b75565b604051908152602001610381565b3480156103e657600080fd5b5060006103cc565b3480156103fa57600080fd5b506103cc61040936600461344a565b600090815260c9602052604090206001015490565b34801561042a57600080fd5b5061043e61043936600461344a565b610ccd565b005b34801561044c57600080fd5b5061043e61045b36600461347f565b610d30565b34801561046c57600080fd5b5061013a5460405160ff9091168152602001610381565b34801561048f57600080fd5b5061043e61049e36600461347f565b610d5a565b3480156104af57600080fd5b5061043e6104be3660046134ab565b610ddd565b3480156104cf57600080fd5b506103cc6101345481565b3480156104e657600080fd5b5061043e610ebd565b3480156104fb57600080fd5b506103cc7f85be1e46283f5f438d1f864c2d925506571d544f0002000000000000000001aa81565b34801561052f57600080fd5b5061043e610fc8565b34801561054457600080fd5b5061056073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b039091168152602001610381565b34801561058457600080fd5b506103cc6101335481565b34801561059b57600080fd5b5061043e6105aa36600461359c565b610fdb565b3480156105bb57600080fd5b506103cc6201518081565b3480156105d257600080fd5b5061043e6105e136600461344a565b6111fe565b3480156105f257600080fd5b506103cc6106013660046134ab565b611244565b34801561061257600080fd5b50610560600080516020613c9a83398151915281565b34801561063457600080fd5b5061043e6112c2565b61043e61064b36600461365c565b6113c5565b34801561065c57600080fd5b5061043e61066b36600461344a565b611492565b34801561067c57600080fd5b506103cc6114d8565b34801561069157600080fd5b506103cc61012e5481565b3480156106a857600080fd5b5060fb5460ff16610375565b3480156106c057600080fd5b5061043e6106cf366004613702565b61158b565b3480156106e057600080fd5b5061043e6106ef36600461344a565b6115aa565b34801561070057600080fd5b5061074d61070f3660046134ab565b61013b602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949593949293919290919087565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e001610381565b34801561078e57600080fd5b506103cc61079d3660046134ab565b50600090565b3480156107af57600080fd5b5061043e6107be36600461344a565b611764565b3480156107cf57600080fd5b5061043e61177e565b3480156107e457600080fd5b506103cc6107f33660046134ab565b6001600160a01b0316600090815261013b602052604090206004015490565b34801561081e57600080fd5b5061083261082d3660046134ab565b611791565b604080519586526020860194909452928401919091526060830152608082015260a001610381565b34801561086657600080fd5b5061037561087536600461347f565b61181c565b34801561088657600080fd5b5061043e61089536600461373e565b611847565b3480156108a657600080fd5b5061039f611914565b3480156108bb57600080fd5b506103cc6101355481565b3480156108d257600080fd5b506103cc61012d5481565b3480156108e957600080fd5b506103cc600081565b3480156108fe57600080fd5b5061043e611927565b34801561091357600080fd5b506103cc61092236600461344a565b6119ae565b34801561093357600080fd5b5061043e611af3565b34801561094857600080fd5b5061043e6109573660046137b3565b611c8c565b34801561096857600080fd5b506105607385be1e46283f5f438d1f864c2d925506571d544f81565b34801561099057600080fd5b506105607329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec81565b3480156109b857600080fd5b50610137546103759060ff1681565b3480156109d357600080fd5b5061043e6109e236600461347f565b6120ac565b3480156109f357600080fd5b5061043e610a023660046137eb565b6120d1565b348015610a1357600080fd5b5061043e610a2236600461344a565b6120f1565b348015610a3357600080fd5b5061043e610a4236600461344a565b6122bc565b348015610a5357600080fd5b5061056073ba12222222228d8ba445958a75a0704d566bf2c881565b348015610a7b57600080fd5b506103cc6101365481565b348015610a9257600080fd5b506103cc600080516020613c1383398151915281565b60006001600160e01b03198216637965db0b60e01b1480610ad957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606101386000018054610af290613808565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1e90613808565b8015610b6b5780601f10610b4057610100808354040283529160200191610b6b565b820191906000526020600020905b815481529060010190602001808311610b4e57829003601f168201915b5050505050905090565b6040516370a0823160e01b815273ba12222222228d8ba445958a75a0704d566bf2c860048201526000908190600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015610bd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfb9190613843565b905060007385be1e46283f5f438d1f864c2d925506571d544f6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c759190613843565b90506000605082610c87856064613872565b610c95906305f5e100613872565b610c9f9190613891565b610ca99190613891565b90506305f5e100610cba8287613872565b610cc49190613891565b95945050505050565b6000610cd88161247d565b610ce0612487565b610131819055426101325561012d8390556040805184815260208101929092527ff0d37c3ae852021ac329281f604b658691cbfa6b9e9c22909f06b64a8ce87c9491015b60405180910390a15050565b600082815260c96020526040902060010154610d4b8161247d565b610d5583836124c7565b505050565b6001600160a01b0381163314610dcf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610dd9828261254d565b5050565b306001600160a01b037f000000000000000000000000b0a4265a4b407d1ca98dff65c620ca6a5ce44fd0161415610e265760405162461bcd60e51b8152600401610dc6906138b3565b7f000000000000000000000000b0a4265a4b407d1ca98dff65c620ca6a5ce44fd06001600160a01b0316610e6f600080516020613c33833981519152546001600160a01b031690565b6001600160a01b031614610e955760405162461bcd60e51b8152600401610dc6906138ff565b610e9e816125b4565b60408051600080825260208201909252610eba9183919061262e565b50565b610ec5612799565b33600090815261013b602052604090206004810154610f265760405162461bcd60e51b815260206004820152601a60248201527f4c6f636b696e673a206e6f7420656e6f75676820746f6b656e730000000000006044820152606401610dc6565b8060060154421015610f4a5760405162461bcd60e51b8152600401610dc69061394b565b600481018054600091829055610135805491928392610f6a908490613982565b90915550610f899050600080516020613c9a83398151915233836127e1565b6040805182815242602082015233917f15fcba5c1a08673136c7dad5a972957fd199328047178347c2592e9bf269d66391015b60405180910390a25050565b6000610fd38161247d565b610eba612844565b6000610fe68161247d565b60005b83518110156111f857600061013b600086848151811061100b5761100b613999565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000209050600061012e54111561104957611049611927565b68056bc75e2d6310000061012f5485848151811061106957611069613999565b602002602001015161107b9190613872565b6110859190613891565b816002015461109491906139af565b600282015583518490839081106110ad576110ad613999565b602002602001015161012e546110c391906139af565b61012e5583518490839081106110db576110db613999565b60209081029190910101518155610133546110f690426139af565b6005820155845185908390811061110f5761110f613999565b60200260200101516001600160a01b03167fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc60008087868151811061115657611156613999565b60200260200101514260405161116f94939291906139c7565b60405180910390a284828151811061118957611189613999565b60200260200101516001600160a01b031660006001600160a01b0316600080516020613c7a8339815191528685815181106111c6576111c6613999565b60200260200101516040516111dd91815260200190565b60405180910390a350806111f0816139ed565b915050610fe9565b50505050565b60006112098161247d565b610134829055604080518381524260208201527f796a8967052608a0ab64c86a3896574d4b3ae0c3aefcf5c4501da1389538dc6a9101610d24565b61012f5461012e5460009190156112b157600061125f612487565b9050610130548111156112af576000610130548261127d9190613982565b61012e549091506112978268056bc75e2d63100000613872565b6112a19190613891565b6112ab90846139af565b9250505b505b6112bb8382612896565b9392505050565b61012e54156112d3576112d3611927565b60006112e23361012f54612896565b9050600081116113345760405162461bcd60e51b815260206004820152601960248201527f4c6f636b696e673a204e6f7468696e6720746f20636c61696d000000000000006044820152606401610dc6565b33600090815261013b6020526040902060038101546113549083906139af565b816003018190555081610136600082825461136f91906139af565b9091555061138e9050600080516020613c9a83398151915233846127e1565b6040805183815242602082015233917f9923b4306c6c030f2bdfbf156517d5983b87e15b96176da122cd4f2effa4ba7b9101610fbc565b306001600160a01b037f000000000000000000000000b0a4265a4b407d1ca98dff65c620ca6a5ce44fd016141561140e5760405162461bcd60e51b8152600401610dc6906138b3565b7f000000000000000000000000b0a4265a4b407d1ca98dff65c620ca6a5ce44fd06001600160a01b0316611457600080516020613c33833981519152546001600160a01b031690565b6001600160a01b03161461147d5760405162461bcd60e51b8152600401610dc6906138ff565b611486826125b4565b610dd98282600161262e565b600061149d8161247d565b610133829055604080518381524260208201527fa9c4f03cdfbed61a2438fce108a73d6409a57430c2549bcef83c28795a7610c49101610d24565b6000306001600160a01b037f000000000000000000000000b0a4265a4b407d1ca98dff65c620ca6a5ce44fd016146115785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610dc6565b50600080516020613c3383398151915290565b60006115968161247d565b6111f86001600160a01b03851684846127e1565b33600090815261013b6020526040902060058101544210156115de5760405162461bcd60e51b8152600401610dc69061394b565b805482111561162f5760405162461bcd60e51b815260206004820152601d60248201527f4c6f636b696e673a206e6f7420656e6f756768206c7020746f6b656e730000006044820152606401610dc6565b611637611927565b600061164283612906565b905068056bc75e2d6310000061012f548461165d9190613872565b6116679190613891565b826001015461167691906139af565b600183015581548390839060009061168f908490613982565b925050819055508261012e60008282546116a99190613982565b925050819055508061013560008282546116c391906139af565b92505081905550808260040160008282546116de91906139af565b9091555050610134546116f190426139af565b600683015560408051828152602081018590524281830152905133917f2736fb24d52f9268e829a25b5684fb0a60e6b37ae2297f7e62eea9f836a73da7919081900360600190a26040518381526000903390600080516020613c7a833981519152906020015b60405180910390a3505050565b610eba600080516020613c9a833981519152333084612b9f565b60006117898161247d565b610eba612bd7565b6001600160a01b038116600090815261013b60209081526040808320815160e081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600481015460808301819052600582015460a0840181905260069092015460c0840181905293949093909261181087611244565b93505091939590929450565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020613c1383398151915261185f8161247d565b60005b828110156111f857600084848381811061187e5761187e613999565b905060200201602081019061189391906134ab565b6001600160a01b0316600080516020613c7a83398151915261013b60008888878181106118c2576118c2613999565b90506020020160208101906118d791906134ab565b6001600160a01b0316815260208082019290925260409081016000205490519081520160405180910390a38061190c816139ed565b915050611862565b60606101386001018054610af290613808565b61192f612799565b6000611939612487565b905061013054811115610eba57600061013054826119579190613982565b61012e54909150156119975761012e5461197a8268056bc75e2d63100000613872565b6119849190613891565b61012f5461199291906139af565b61012f555b80610130546119a691906139af565b610130555050565b6040516370a0823160e01b815273ba12222222228d8ba445958a75a0704d566bf2c860048201526000908190600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015611a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a349190613843565b905060007385be1e46283f5f438d1f864c2d925506571d544f6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aae9190613843565b90506000605082611ac0856064613872565b611ace906305f5e100613872565b611ad89190613891565b611ae29190613891565b905080610cba866305f5e100613872565b33600090815261013b602052604090206005810154421015611b275760405162461bcd60e51b8152600401610dc69061394b565b805480611b765760405162461bcd60e51b815260206004820152601d60248201527f4c6f636b696e673a206e6f7420656e6f756768206c7020746f6b656e730000006044820152606401610dc6565b611b7e611927565b6000611b8982612906565b905068056bc75e2d6310000061012f5483611ba49190613872565b611bae9190613891565b8360010154611bbd91906139af565b6001840155600080845561012e8054849290611bda908490613982565b92505081905550806101356000828254611bf491906139af565b9250508190555080836004016000828254611c0f91906139af565b909155505061013454611c2290426139af565b600684015560408051828152602081018490524281830152905133917f2736fb24d52f9268e829a25b5684fb0a60e6b37ae2297f7e62eea9f836a73da7919081900360600190a26040518281526000903390600080516020613c7a83398151915290602001611757565b600054610100900460ff1615808015611cac5750600054600160ff909116105b80611cc65750303b158015611cc6575060005460ff166001145b611d295760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610dc6565b6000805460ff191660011790558015611d4c576000805461ff0019166101001790555b611d54612c14565b611d5c612c3b565b611d64612c14565b6001600160a01b0383163b611db35760405162461bcd60e51b8152602060048201526015602482015274131bd8dada5b99ce881b9bdd0818dbdb9d1c9858dd605a1b6044820152606401610dc6565b611dbe600084612c6a565b611dc9600033612c6a565b611de1600080516020613c1383398151915284612c6a565b6040805160a0810182526017606082019081527f566f7465204c6f636b656420416c6c756f20546f6b656e00000000000000000060808301528152815180830183526007815266766c416c6c756f60c81b6020828101919091528083019190915260129282019290925280518051919261013892611e62928492019061331c565b506020828101518051611e7b926001850192019061331c565b50604091820151600291909101805460ff191660ff90921691909117905561012d839055426101325562093a806101335562069780610134555163095ea7b360e01b81527329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec60048201526000196024820152600080516020613c9a8339815191529063095ea7b3906044016020604051808303816000875af1158015611f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3d9190613a08565b5060405163095ea7b360e01b815273ba12222222228d8ba445958a75a0704d566bf2c8600482015260001960248201527385be1e46283f5f438d1f864c2d925506571d544f9063095ea7b3906044016020604051808303816000875af1158015611fab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcf9190613a08565b5060405163095ea7b360e01b81527329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec6004820152600019602482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29063095ea7b3906044016020604051808303816000875af115801561203d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120619190613a08565b508015610d55576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b600082815260c960205260409020600101546120c78161247d565b610d55838361254d565b60006120dc8161247d565b50610137805460ff1916911515919091179055565b33600081815261013b602052604090209061211d90600080516020613c9a833981519152903085612b9f565b604051630ed2fc9560e01b8152600080516020613c9a83398151915260048201527385be1e46283f5f438d1f864c2d925506571d544f602482015260448101839052600060648201819052907329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec90630ed2fc95906084016020604051808303816000875af11580156121a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121cb9190613843565b61012e54909150156121df576121df611927565b68056bc75e2d6310000061012f54826121f89190613872565b6122029190613891565b826002015461221191906139af565b600283015561012e546122259082906139af565b61012e5581546122369082906139af565b82556101335461224690426139af565b600583015560405133907fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc9061229190600080516020613c9a833981519152908790869042906139c7565b60405180910390a26040518181523390600090600080516020613c7a83398151915290602001611757565b33600081815261013b60205260409020906122ee9073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2903085612b9f565b604051630ed2fc9560e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260048201527385be1e46283f5f438d1f864c2d925506571d544f602482015260448101839052600060648201819052907329c66cf57a03d41cfe6d9ecb6883aa0e2aba21ec90630ed2fc95906084016020604051808303816000875af115801561237e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a29190613843565b61012e54909150156123b6576123b6611927565b68056bc75e2d6310000061012f54826123cf9190613872565b6123d99190613891565b82600201546123e891906139af565b600283015561012e546123fc9082906139af565b61012e55815461240d9082906139af565b82556101335461241d90426139af565b600583015560405133907fa6782d3322abbfbe850e6d5c5c78e8e1df603ea07608bb9a62dd83f40d4feccc906122919073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2908790869042906139c7565b6001600160a01b03163b151590565b610eba8133612c74565b600062015180610132544261249c9190613982565b61012d546124aa9190613872565b6124b49190613891565b610131546124c291906139af565b905090565b6124d1828261181c565b610dd957600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191660011790556125093390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b612557828261181c565b15610dd957600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613c138339815191526125cc8161247d565b6101375460ff1661261f5760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b696e673a2075706772616465206e6f7420616c6c6f776564000000006044820152606401610dc6565b5050610137805460ff19169055565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561266157610d5583612cd8565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156126bb575060408051601f3d908101601f191682019092526126b891810190613843565b60015b61271e5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610dc6565b600080516020613c33833981519152811461278d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610dc6565b50610d55838383612d74565b60fb5460ff16156127df5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610dc6565b565b6040516001600160a01b038316602482015260448101829052610d5590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612d99565b61284c612e6b565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216600090815261013b60205260408120600281015460038201546001830154835468056bc75e2d63100000906128d6908890613872565b6128e09190613891565b6128ea91906139af565b6128f49190613982565b6128fe9190613982565b949350505050565b60408051600280825260608201835260009283929190602083019080368337019050509050600080516020613c9a8339815191528160008151811061294d5761294d613999565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061299557612995613999565b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905060008060408051602081019290925281018690526000606082015260800160408051808303601f190181526080830182528583526020830185905282820181905260006060840181905291516370a0823160e01b8152306004820152909350600080516020613c9a833981519152906370a0823190602401602060405180830381865afa158015612a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a899190613843565b604051638bdb391360e01b815290915073ba12222222228d8ba445958a75a0704d566bf2c890638bdb391390612ae9907f85be1e46283f5f438d1f864c2d925506571d544f0002000000000000000001aa90309081908890600401613a60565b600060405180830381600087803b158015612b0357600080fd5b505af1158015612b17573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152839250600080516020613c9a83398151915291506370a0823190602401602060405180830381865afa158015612b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8a9190613843565b612b949190613982565b979650505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111f89085906323b872dd60e01b9060840161280d565b612bdf612799565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586128793390565b600054610100900460ff166127df5760405162461bcd60e51b8152600401610dc690613b1f565b600054610100900460ff16612c625760405162461bcd60e51b8152600401610dc690613b1f565b6127df612eb4565b610dd982826124c7565b612c7e828261181c565b610dd957612c96816001600160a01b03166014612ee7565b612ca1836020612ee7565b604051602001612cb2929190613b6a565b60408051601f198184030181529082905262461bcd60e51b8252610dc691600401613437565b6001600160a01b0381163b612d455760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610dc6565b600080516020613c3383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d7d83613083565b600082511180612d8a5750805b15610d55576111f883836130c3565b6000612dee826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131ae9092919063ffffffff16565b805190915015610d555780806020019051810190612e0c9190613a08565b610d555760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dc6565b60fb5460ff166127df5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610dc6565b600054610100900460ff16612edb5760405162461bcd60e51b8152600401610dc690613b1f565b60fb805460ff19169055565b60606000612ef6836002613872565b612f019060026139af565b67ffffffffffffffff811115612f1957612f196134c6565b6040519080825280601f01601f191660200182016040528015612f43576020820181803683370190505b509050600360fc1b81600081518110612f5e57612f5e613999565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612f8d57612f8d613999565b60200101906001600160f81b031916908160001a9053506000612fb1846002613872565b612fbc9060016139af565b90505b6001811115613034576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612ff057612ff0613999565b1a60f81b82828151811061300657613006613999565b60200101906001600160f81b031916908160001a90535060049490941c9361302d81613bdf565b9050612fbf565b5083156112bb5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610dc6565b61308c81612cd8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61312b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610dc6565b600080846001600160a01b0316846040516131469190613bf6565b600060405180830381855af49150503d8060008114613181576040519150601f19603f3d011682016040523d82523d6000602084013e613186565b606091505b5091509150610cc48282604051806060016040528060278152602001613c53602791396131bd565b60606128fe84846000856131f6565b606083156131cc5750816112bb565b8251156131dc5782518084602001fd5b8160405162461bcd60e51b8152600401610dc69190613437565b6060824710156132575760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610dc6565b6001600160a01b0385163b6132ae5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dc6565b600080866001600160a01b031685876040516132ca9190613bf6565b60006040518083038185875af1925050503d8060008114613307576040519150601f19603f3d011682016040523d82523d6000602084013e61330c565b606091505b5091509150612b948282866131bd565b82805461332890613808565b90600052602060002090601f01602090048101928261334a5760008555613390565b82601f1061336357805160ff1916838001178555613390565b82800160010185558215613390579182015b82811115613390578251825591602001919060010190613375565b5061339c9291506133a0565b5090565b5b8082111561339c57600081556001016133a1565b6000602082840312156133c757600080fd5b81356001600160e01b0319811681146112bb57600080fd5b60005b838110156133fa5781810151838201526020016133e2565b838111156111f85750506000910152565b600081518084526134238160208601602086016133df565b601f01601f19169290920160200192915050565b6020815260006112bb602083018461340b565b60006020828403121561345c57600080fd5b5035919050565b80356001600160a01b038116811461347a57600080fd5b919050565b6000806040838503121561349257600080fd5b823591506134a260208401613463565b90509250929050565b6000602082840312156134bd57600080fd5b6112bb82613463565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613505576135056134c6565b604052919050565b600067ffffffffffffffff821115613527576135276134c6565b5060051b60200190565b600082601f83011261354257600080fd5b813560206135576135528361350d565b6134dc565b82815260059290921b8401810191818101908684111561357657600080fd5b8286015b84811015613591578035835291830191830161357a565b509695505050505050565b600080604083850312156135af57600080fd5b823567ffffffffffffffff808211156135c757600080fd5b818501915085601f8301126135db57600080fd5b813560206135eb6135528361350d565b82815260059290921b8401810191818101908984111561360a57600080fd5b948201945b8386101561362f5761362086613463565b8252948201949082019061360f565b9650508601359250508082111561364557600080fd5b5061365285828601613531565b9150509250929050565b6000806040838503121561366f57600080fd5b61367883613463565b915060208084013567ffffffffffffffff8082111561369657600080fd5b818601915086601f8301126136aa57600080fd5b8135818111156136bc576136bc6134c6565b6136ce601f8201601f191685016134dc565b915080825287848285010111156136e457600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561371757600080fd5b61372084613463565b925061372e60208501613463565b9150604084013590509250925092565b6000806020838503121561375157600080fd5b823567ffffffffffffffff8082111561376957600080fd5b818501915085601f83011261377d57600080fd5b81358181111561378c57600080fd5b8660208260051b85010111156137a157600080fd5b60209290920196919550909350505050565b600080604083850312156137c657600080fd5b6137cf83613463565b946020939093013593505050565b8015158114610eba57600080fd5b6000602082840312156137fd57600080fd5b81356112bb816137dd565b600181811c9082168061381c57607f821691505b6020821081141561383d57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561385557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561388c5761388c61385c565b500290565b6000826138ae57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252601d908201527f4c6f636b696e673a20746f6b656e73206e6f7420617661696c61626c65000000604082015260600190565b6000828210156139945761399461385c565b500390565b634e487b7160e01b600052603260045260246000fd5b600082198211156139c2576139c261385c565b500190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6000600019821415613a0157613a0161385c565b5060010190565b600060208284031215613a1a57600080fd5b81516112bb816137dd565b600081518084526020808501945080840160005b83811015613a5557815187529582019590820190600101613a39565b509495945050505050565b8481526000602060018060a01b038087168285015280861660408501526080606085015261010084018551608080870152818151808452610120880191508583019350600092505b80831015613aca57835185168252928501926001929092019190850190613aa8565b50848801519450607f199350838782030160a0880152613aea8186613a25565b94505050506040850151818584030160c0860152613b08838261340b565b92505050606084015161359160e085018215159052565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ba28160178501602088016133df565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613bd38160288401602088016133df565b01602801949350505050565b600081613bee57613bee61385c565b506000190190565b60008251613c088184602087016133df565b919091019291505056fe189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0000000000000000000000001e5193ccc53f25638aa22a940af899b692e10b09a26469706673582212204fc28988ba5d75e04fd042447ab015b850419cdc1a7f221c05bcdb57a1547f5264736f6c634300080b0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.