Address Details
contract
0xE8dE876c066BEDbB0C4D65e4c28020E4cA9cFc45
- Contract Name
- TalentFactory
- Creator
- 0xeea6c4–57700f at 0x1d6fea–70696d
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 2 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 2,585,531
- Last Balance Update
- 16895092
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- TalentFactory
- Optimization enabled
- true
- Compiler version
- v0.8.7+commit.e28d00a7
- Optimization runs
- 1000
- EVM Version
- london
- Verified at
- 2022-06-09T11:53:03.149983Z
contracts/TalentFactory.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import {IAccessControlEnumerableUpgradeable, AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol"; import {TalentToken} from "./TalentToken.sol"; interface ITalentFactory { /// Returns true is a given address corresponds to a registered Talent Token /// /// @param addr address of the token to find /// @return true if the address corresponds to a talent token function isTalentToken(address addr) external view returns (bool); /// Returns true is a given symbol corresponds to a registered Talent Token /// /// @param symbol Symbol of the token to find /// @return true if the symbol corresponds to an existing talent token function isSymbol(string memory symbol) external view returns (bool); } /// @title Factory in charge of deploying Talent Token contracts /// /// @notice This contract relies on ERC1167 proxies to cheaply deploy talent tokens /// /// @notice Roles: /// A minter role defines who is allowed to deploy talent tokens. Deploying /// a talent token grants you the right to mint that talent token, meaning the /// same deployer will be granted that role /// /// @notice beacon: /// TalentTokens are implemented with BeaconProxies, allowing an update of /// the underlying beacon, to target all existing talent tokens. contract TalentFactory is Initializable, ContextUpgradeable, ERC165Upgradeable, AccessControlEnumerableUpgradeable, ITalentFactory { /// creator role bytes32 public constant ROLE_MINTER = keccak256("MINTER"); /// initial supply of each new token minted uint256 public constant INITIAL_SUPPLY = 2000 ether; /// maps each talent's address to their talent token mapping(address => address) public talentsToTokens; /// maps each talent tokens' address to their talent mapping(address => address) public tokensToTalents; /// maps each token's symbol to the token address mapping(string => address) public symbolsToTokens; /// minter for new tokens address public minter; /// implementation template to clone address public implementationBeacon; event TalentCreated(address indexed talent, address indexed token); function initialize() public virtual initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControlEnumerable_init_unchained(); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); UpgradeableBeacon _beacon = new UpgradeableBeacon(address(new TalentToken())); _beacon.transferOwnership(msg.sender); implementationBeacon = address(_beacon); } function setMinter(address _minter) public onlyRole(DEFAULT_ADMIN_ROLE) { require(minter == address(0x0), "minter already set"); minter = _minter; _setupRole(ROLE_MINTER, _minter); } /// Creates a new talent token /// /// @param _talent The talent's address /// @param _name The new token's name /// @param _symbol The new token's symbol function createTalent( address _talent, string memory _name, string memory _symbol ) public returns (address) { require(!isSymbol(_symbol), "talent token with this symbol already exists"); require(_isMinterSet(), "minter not yet set"); BeaconProxy proxy = new BeaconProxy( implementationBeacon, abi.encodeWithSelector( TalentToken(address(0x0)).initialize.selector, _name, _symbol, INITIAL_SUPPLY, _talent, minter, getRoleMember(DEFAULT_ADMIN_ROLE, 0) ) ); // address token = ClonesUpgradeable.clone(implementation); // TalentToken(token).initialize( // _name, // _symbol, // INITIAL_SUPPLY, // _talent, // minter, // getRoleMember(DEFAULT_ADMIN_ROLE, 0) // ); address token = address(proxy); symbolsToTokens[_symbol] = token; tokensToTalents[token] = _talent; emit TalentCreated(_talent, token); return token; } // // Begin: ERC165 // /// @inheritdoc ERC165Upgradeable function supportsInterface(bytes4 interfaceId) public view override(ERC165Upgradeable, AccessControlEnumerableUpgradeable) returns (bool) { return AccessControlEnumerableUpgradeable.supportsInterface(interfaceId); } // // End: ERC165 // // // Begin: ITalentFactory // function isTalentToken(address addr) public view override(ITalentFactory) returns (bool) { return tokensToTalents[addr] != address(0x0); } function isSymbol(string memory _symbol) public view override(ITalentFactory) returns (bool) { return symbolsToTokens[_symbol] != address(0x0); } // // End: ITalentFactory // function _isMinterSet() private view returns (bool) { return minter != address(0x0); } }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../Proxy.sol"; import "./ERC1967Upgrade.sol"; /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an * implementation address that can be changed. This address is stored in storage in the location specified by * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the * implementation behind the proxy. */ contract ERC1967Proxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded * function call, and allows initializating the storage of the proxy like a Solidity constructor. */ constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _upgradeToAndCall(_logic, _data, false); } /** * @dev Returns the current implementation address. */ function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.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 ERC1967Upgrade { // 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 StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.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) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @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 StorageSlot.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"); StorageSlot.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 StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.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) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
/_openzeppelin/contracts/proxy/Proxy.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
/_openzeppelin/contracts/proxy/beacon/BeaconProxy.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IBeacon.sol"; import "../Proxy.sol"; import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _upgradeBeaconToAndCall(beacon, data, false); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address) { return _getBeacon(); } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_getBeacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { _upgradeBeaconToAndCall(beacon, data, false); } }
/_openzeppelin/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @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); }
/_openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IBeacon.sol"; import "../../access/Ownable.sol"; import "../../utils/Address.sol"; /** * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their * implementation contract, which is where they will delegate all function calls. * * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon. */ contract UpgradeableBeacon is IBeacon, Ownable { address private _implementation; /** * @dev Emitted when the implementation returned by the beacon is changed. */ event Upgraded(address indexed implementation); /** * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the * beacon. */ constructor(address implementation_) { _setImplementation(implementation_); } /** * @dev Returns the current implementation address. */ function implementation() public view virtual override returns (address) { return _implementation; } /** * @dev Upgrades the beacon to a new implementation. * * Emits an {Upgraded} event. * * Requirements: * * - msg.sender must be the owner of the contract. * - `newImplementation` must be a contract. */ function upgradeTo(address newImplementation) public virtual onlyOwner { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation contract address for this beacon * * Requirements: * * - `newImplementation` must be a contract. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract"); _implementation = newImplementation; } }
/_openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC1967/ERC1967Upgrade.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 ERC1967Upgrade { /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, bytes(""), 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 { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(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; }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
/_openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT 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 StorageSlot { 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) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
/_openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); } function __AccessControlEnumerable_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } uint256[49] private __gap; }
/_openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT 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 initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } 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, _msgSender()); _; } /** * @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 override returns (bool) { return _roles[role].members[account]; } /** * @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 { 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 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. */ 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. */ 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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ 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. * * [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}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
/_openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
/_openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT 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; }
/_openzeppelin/contracts-upgradeable/interfaces/IERC1363ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC1363ReceiverUpgradeable { /* * Note: the ERC-165 identifier for this interface is 0x88a7ca5c. * 0x88a7ca5c === bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)")) */ /** * @notice Handle the receipt of ERC1363 tokens * @dev Any ERC1363 smart contract calls this function on the recipient * after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the * transfer. Return of other than the magic value MUST result in the * transaction being reverted. * Note: the token contract address is always the message sender. * @param operator address The address which called `transferAndCall` or `transferFromAndCall` function * @param from address The address which are token transferred from * @param value uint256 The amount of tokens transferred * @param data bytes Additional data with no specified format * @return `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))` * unless throwing */ function onTransferReceived( address operator, address from, uint256 value, bytes memory data ) external returns (bytes4); }
/_openzeppelin/contracts-upgradeable/interfaces/IERC1363SpenderUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC1363SpenderUpgradeable { /* * Note: the ERC-165 identifier for this interface is 0x7b04a2d0. * 0x7b04a2d0 === bytes4(keccak256("onApprovalReceived(address,uint256,bytes)")) */ /** * @notice Handle the approval of ERC1363 tokens * @dev Any ERC1363 smart contract calls this function on the recipient * after an `approve`. This function MAY throw to revert and reject the * approval. Return of other than the magic value MUST result in the * transaction being reverted. * Note: the token contract address is always the message sender. * @param owner address The address which called `approveAndCall` function * @param value uint256 The amount of tokens to be spent * @param data bytes Additional data with no specified format * @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))` * unless throwing */ function onApprovalReceived( address owner, uint256 value, bytes memory data ) external returns (bytes4); }
/_openzeppelin/contracts-upgradeable/interfaces/IERC1363Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./IERC165Upgradeable.sol"; interface IERC1363Upgradeable is IERC165Upgradeable, IERC20Upgradeable { /* * Note: the ERC-165 identifier for this interface is 0x4bbee2df. * 0x4bbee2df === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) */ /* * Note: the ERC-165 identifier for this interface is 0xfb9ec8ce. * 0xfb9ec8ce === * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param to address The address which you want to transfer to * @param value uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param to address The address which you want to transfer to * @param value uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `to` * @return true unless throwing */ function transferAndCall( address to, uint256 value, bytes memory data ) external returns (bool); /** * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferFromAndCall( address from, address to, uint256 value ) external returns (bool); /** * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `to` * @return true unless throwing */ function transferFromAndCall( address from, address to, uint256 value, bytes memory data ) external returns (bool); /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * @param spender address The address which will spend the funds * @param value uint256 The amount of tokens to be spent */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * @param spender address The address which will spend the funds * @param value uint256 The amount of tokens to be spent * @param data bytes Additional data with no specified format, sent in call to `spender` */ function approveAndCall( address spender, uint256 value, bytes memory data ) external returns (bool); }
/_openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol";
/_openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../token/ERC20/IERC20Upgradeable.sol";
/_openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 a proxied contract can't have 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. * * 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. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
/_openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT 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 initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _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: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, 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}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), 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}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - 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) { _approve(_msgSender(), spender, _allowances[_msgSender()][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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * 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: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, 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 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 {} uint256[45] private __gap; }
/_openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
/_openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT 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); }
/_openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT 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 initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
/_openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @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); } }
/_openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT 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 initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
/_openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT 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); }
/_openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
/contracts/TalentToken.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol"; import {IERC1363Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC1363Upgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; // import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; import {ERC1363Upgradeable} from "./tokens/ERC1363Upgradeable.sol"; interface ITalentToken is IERC20Upgradeable { // mints new talent tokens function mint(address _owner, uint256 _amount) external; // burns existing talent tokens function burn(address _owner, uint256 _amount) external; // talent's wallet function talent() external view returns (address); // timestamp at which MAX_SUPPLY was reached (or 0 if never reached) function mintingFinishedAt() external view returns (uint256); // how much is available to be minted function mintingAvailability() external view returns (uint256); } /// @title The base contract for Talent Tokens /// /// @notice a standard ERC20 contract, upgraded with ERC1363 functionality, and /// upgradeability and AccessControl functions from OpenZeppelin /// /// @notice Minting: /// A TalentToken has a fixed MAX_SUPPLY, after which no more minting can occur /// Minting & burning is only allowed by a specific role, assigned on initialization /// /// @notice Burning: /// If tokens are burnt before MAX_SUPPLY is ever reached, they are added /// back into the `mintingAvailability` pool / If MAX_SUPPLY has already been /// reached at some point, then future burns can no longer be minted back, /// effectively making the burn permanent contract TalentToken is Initializable, ContextUpgradeable, ERC165Upgradeable, AccessControlUpgradeable, ERC1363Upgradeable, UUPSUpgradeable, ITalentToken { /// Talent role bytes32 public constant ROLE_TALENT = keccak256("TALENT"); /// Minter role bytes32 public constant ROLE_MINTER = keccak256("MINTER"); uint256 public constant MAX_SUPPLY = 1000000 ether; // amount available to be minted uint256 public override(ITalentToken) mintingAvailability; // timestamp at which minting reached MAX_SUPPLY uint256 public override(ITalentToken) mintingFinishedAt; // talent's wallet address public override(ITalentToken) talent; function initialize( string memory _name, string memory _symbol, uint256 _initialSupply, address _talent, address _minter, address _admin ) public initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC20_init_unchained(_name, _symbol); __AccessControl_init_unchained(); talent = _talent; _setupRole(DEFAULT_ADMIN_ROLE, _admin); _setupRole(ROLE_TALENT, _talent); _setupRole(ROLE_MINTER, _minter); _setRoleAdmin(ROLE_TALENT, ROLE_TALENT); _mint(_talent, _initialSupply); mintingAvailability = MAX_SUPPLY - _initialSupply; } function _authorizeUpgrade(address newImplementation) internal override(UUPSUpgradeable) onlyRole(DEFAULT_ADMIN_ROLE) {} /// Mints new supply /// /// @notice Only accessible to the role MINTER /// /// @param _to Recipient of the new tokens /// @param _amount Amount to mint function mint(address _to, uint256 _amount) public override(ITalentToken) onlyRole(ROLE_MINTER) { require(mintingAvailability >= _amount, "_amount exceeds minting availability"); mintingAvailability -= _amount; if (mintingAvailability == 0) { mintingFinishedAt = block.timestamp; } _mint(_to, _amount); } /// Burns existing supply /// /// @notice Only accessible to the role MINTER /// /// @param _from Owner of the tokens to burn /// @param _amount Amount to mint function burn(address _from, uint256 _amount) public override(ITalentToken) onlyRole(ROLE_MINTER) { // if we have already reached MAX_SUPPLY, we don't ever want to allow // minting, even if a burn has occured afterwards if (mintingAvailability > 0) { mintingAvailability += _amount; } _burn(_from, _amount); } /// Changes the talent's wallet /// /// @notice Callable by the talent to chance his own ownership address /// /// @notice onlyRole() is not needed here, since the equivalent check is /// already done by `grantRole`, which only allows the role's admin, which /// is the TALENT role itself, to grant the role. /// /// @param _newTalent address for the new talent's wallet function transferTalentWallet(address _newTalent) public { talent = _newTalent; grantRole(ROLE_TALENT, _newTalent); revokeRole(ROLE_TALENT, msg.sender); } // // Begin: ERC165 // /// @inheritdoc ERC165Upgradeable function supportsInterface(bytes4 interfaceId) public view override(ERC165Upgradeable, AccessControlUpgradeable, ERC1363Upgradeable) returns (bool) { return interfaceId == type(IERC20Upgradeable).interfaceId || interfaceId == type(IERC1363Upgradeable).interfaceId || super.supportsInterface(interfaceId); } // // End: ERC165 // }
/contracts/tokens/ERC1363Upgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC1363Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC1363ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC1363SpenderUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title ERC1363 * @author Vittorio Minacori (https://github.com/vittominacori) * @dev Implementation of an ERC1363 interface */ abstract contract ERC1363Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, ERC20Upgradeable, IERC1363Upgradeable { using AddressUpgradeable for address; function __ERC1363_init(string memory _name, string memory _symbol) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC20_init_unchained(_name, _symbol); } function __ERC1363_init_unchained(string memory _name, string memory _symbol) internal initializer {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1363Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Transfer tokens to a specified address and then execute a callback on recipient. * @param recipient The address to transfer to. * @param amount The amount to be transferred. * @return A boolean that indicates if the operation was successful. */ function transferAndCall(address recipient, uint256 amount) public virtual override returns (bool) { return transferAndCall(recipient, amount, ""); } /** * @dev Transfer tokens to a specified address and then execute a callback on recipient. * @param recipient The address to transfer to * @param amount The amount to be transferred * @param data Additional data with no specified format * @return A boolean that indicates if the operation was successful. */ function transferAndCall( address recipient, uint256 amount, bytes memory data ) public virtual override returns (bool) { transfer(recipient, amount); require(_checkAndCallTransfer(_msgSender(), recipient, amount, data), "ERC1363: _checkAndCallTransfer reverts"); return true; } /** * @dev Transfer tokens from one address to another and then execute a callback on recipient. * @param sender The address which you want to send tokens from * @param recipient The address which you want to transfer to * @param amount The amount of tokens to be transferred * @return A boolean that indicates if the operation was successful. */ function transferFromAndCall( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { return transferFromAndCall(sender, recipient, amount, ""); } /** * @dev Transfer tokens from one address to another and then execute a callback on recipient. * @param sender The address which you want to send tokens from * @param recipient The address which you want to transfer to * @param amount The amount of tokens to be transferred * @param data Additional data with no specified format * @return A boolean that indicates if the operation was successful. */ function transferFromAndCall( address sender, address recipient, uint256 amount, bytes memory data ) public virtual override returns (bool) { transferFrom(sender, recipient, amount); require(_checkAndCallTransfer(sender, recipient, amount, data), "ERC1363: _checkAndCallTransfer reverts"); return true; } /** * @dev Approve spender to transfer tokens and then execute a callback on recipient. * @param spender The address allowed to transfer to * @param amount The amount allowed to be transferred * @return A boolean that indicates if the operation was successful. */ function approveAndCall(address spender, uint256 amount) public virtual override returns (bool) { return approveAndCall(spender, amount, ""); } /** * @dev Approve spender to transfer tokens and then execute a callback on recipient. * @param spender The address allowed to transfer to. * @param amount The amount allowed to be transferred. * @param data Additional daa with no specified format. * @return A boolean that indicates if the operation was successful. */ function approveAndCall( address spender, uint256 amount, bytes memory data ) public virtual override returns (bool) { approve(spender, amount); require(_checkAndCallApprove(spender, amount, data), "ERC1363: _checkAndCallApprove reverts"); return true; } /** * @dev Internal function to invoke `onTransferReceived` on a target address * The call is not executed if the target address is not a contract * @param sender address Representing the previous owner of the given token value * @param recipient address Target address that will receive the tokens * @param amount uint256 The amount mount of tokens to be transferred * @param data bytes Optional data to send along with the call * @return whether the call correctly returned the expected magic value */ function _checkAndCallTransfer( address sender, address recipient, uint256 amount, bytes memory data ) internal virtual returns (bool) { if (!recipient.isContract()) { return false; } bytes4 retval = IERC1363ReceiverUpgradeable(recipient).onTransferReceived(_msgSender(), sender, amount, data); return (retval == IERC1363ReceiverUpgradeable(recipient).onTransferReceived.selector); } /** * @dev Internal function to invoke `onApprovalReceived` on a target address * The call is not executed if the target address is not a contract * @param spender address The address which will spend the funds * @param amount uint256 The amount of tokens to be spent * @param data bytes Optional data to send along with the call * @return whether the call correctly returned the expected magic value */ function _checkAndCallApprove( address spender, uint256 amount, bytes memory data ) internal virtual returns (bool) { if (!spender.isContract()) { return false; } bytes4 retval = IERC1363SpenderUpgradeable(spender).onApprovalReceived(_msgSender(), amount, data); return (retval == IERC1363SpenderUpgradeable(spender).onApprovalReceived.selector); } }
Contract ABI
[{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TalentCreated","inputs":[{"type":"address","name":"talent","internalType":"address","indexed":true},{"type":"address","name":"token","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_SUPPLY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"ROLE_MINTER","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"createTalent","inputs":[{"type":"address","name":"_talent","internalType":"address"},{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getRoleMember","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRoleMemberCount","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"implementationBeacon","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isSymbol","inputs":[{"type":"string","name":"_symbol","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isTalentToken","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"minter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinter","inputs":[{"type":"address","name":"_minter","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"symbolsToTokens","inputs":[{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"talentsToTokens","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"tokensToTalents","inputs":[{"type":"address","name":"","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50614fc2806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620001955760003560e01c806357bc3cd911620000e957806392afc33a1162000097578063d547741f116200006e578063d547741f14620003e4578063ef31f42414620003fb578063fca3b5aa146200042757600080fd5b806392afc33a146200039c578063a217fddf14620003c4578063ca15c87314620003cd57600080fd5b80638129fc1c11620000cc5780638129fc1c146200033f5780639010d07c146200034957806391d14854146200036057600080fd5b806357bc3cd914620002ff5780637ffed926146200031357600080fd5b8063248a9ca311620001475780632f2ff15d116200012a5780632f2ff15d14620002be5780632ff2e9dc14620002d757806336568abe14620002e857600080fd5b8063248a9ca314620002525780632dbc679c146200028757600080fd5b8063099aba56116200017c578063099aba5614620001f35780631b0f28741462000224578063242fa5db146200023b57600080fd5b806301ffc9a7146200019a5780630754617214620001c6575b600080fd5b620001b1620001ab3660046200141a565b6200043e565b60405190151581526020015b60405180910390f35b60cc54620001da906001600160a01b031681565b6040516001600160a01b039091168152602001620001bd565b620001b16200020436600462001313565b6001600160a01b03908116600090815260ca602052604090205416151590565b620001b16200023536600462001446565b62000451565b620001da6200024c36600462001331565b62000490565b6200027862000263366004620013ae565b60009081526065602052604090206001015490565b604051908152602001620001bd565b620001da6200029836600462001446565b805160208183018101805160cb825292820191909301209152546001600160a01b031681565b620002d5620002cf366004620013c8565b620006fc565b005b62000278686c6b935b8bbd40000081565b620002d5620002f9366004620013c8565b62000727565b60cd54620001da906001600160a01b031681565b620001da6200032436600462001313565b60c9602052600090815260409020546001600160a01b031681565b620002d56200074d565b620001da6200035a366004620013f7565b6200094e565b620001b162000371366004620013c8565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b620002787ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b62000278600081565b62000278620003de366004620013ae565b6200096f565b620002d5620003f5366004620013c8565b62000988565b620001da6200040c36600462001313565b60ca602052600090815260409020546001600160a01b031681565b620002d56200043836600462001313565b62000994565b60006200044b8262000a55565b92915050565b6000806001600160a01b031660cb836040516200046f9190620014b5565b908152604051908190036020019020546001600160a01b0316141592915050565b60006200049d8262000451565b15620005165760405162461bcd60e51b815260206004820152602c60248201527f74616c656e7420746f6b656e207769746820746869732073796d626f6c20616c60448201527f726561647920657869737473000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60cc546001600160a01b0316620005705760405162461bcd60e51b815260206004820152601260248201527f6d696e746572206e6f742079657420736574000000000000000000000000000060448201526064016200050d565b60cd5460cc546000916001600160a01b03908116917f6ef7626c000000000000000000000000000000000000000000000000000000009187918791686c6b935b8bbd400000918b9116620005c588806200094e565b604051602401620005dc9695949392919062001591565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909416939093179092529051620006309062001237565b6200063d92919062001558565b604051809103906000f0801580156200065a573d6000803e3d6000fd5b50905060008190508060cb85604051620006759190620014b5565b9081526040805160209281900383018120805473ffffffffffffffffffffffffffffffffffffffff199081166001600160a01b0396871617909155858516600081815260ca9095529284208054909116948b1694851790559092917fc3cff6724200e4907489fef1d1ede51dd32ca7ac86d62c448475be4c3b1d5b5091a395945050505050565b62000708828262000a96565b600082815260976020526040902062000722908262000ac0565b505050565b62000733828262000ad7565b600082815260976020526040902062000722908262000b63565b600054610100900460ff168062000767575060005460ff16155b620007db5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200050d565b600054610100900460ff16158015620007fe576000805461ffff19166101011790555b6200080862000b7a565b6200081262000b7a565b6200081c62000b7a565b6200082960003362000c40565b6000604051620008399062001245565b604051809103906000f08015801562000856573d6000803e3d6000fd5b50604051620008659062001253565b6001600160a01b039091168152602001604051809103906000f08015801562000892573d6000803e3d6000fd5b506040517ff2fde38b0000000000000000000000000000000000000000000000000000000081523360048201529091506001600160a01b0382169063f2fde38b90602401600060405180830381600087803b158015620008f157600080fd5b505af115801562000906573d6000803e3d6000fd5b505060cd805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039490941693909317909255505080156200094b576000805461ff00191690555b50565b600082815260976020526040812062000968908362000c4c565b9392505050565b60008181526097602052604081206200044b9062000c5a565b62000733828262000c65565b6000620009a2813362000c8f565b60cc546001600160a01b031615620009fd5760405162461bcd60e51b815260206004820152601260248201527f6d696e74657220616c726561647920736574000000000000000000000000000060448201526064016200050d565b60cc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841617905562000a517ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc98362000c40565b5050565b60006001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806200044b57506200044b8262000d18565b60008281526065602052604090206001015462000ab4813362000c8f565b62000722838362000d81565b600062000968836001600160a01b03841662000e25565b6001600160a01b038116331462000b575760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016200050d565b62000a51828262000e77565b600062000968836001600160a01b03841662000efb565b600054610100900460ff168062000b94575060005460ff16155b62000c085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200050d565b600054610100900460ff1615801562000c2b576000805461ffff19166101011790555b80156200094b576000805461ff001916905550565b62000708828262000fff565b60006200096883836200100b565b60006200044b825490565b60008281526065602052604090206001015462000c83813362000c8f565b62000722838362000e77565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1662000a515762000cd0816001600160a01b0316601462001038565b62000cdd83602062001038565b60405160200162000cf0929190620014d3565b60408051601f198184030181529082905262461bcd60e51b82526200050d916004016200157c565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806200044b57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146200044b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1662000a515760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905562000de13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205462000e6e575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200044b565b5060006200044b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff161562000a515760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801562000ff457600062000f2260018362001628565b855490915060009062000f389060019062001628565b905081811462000fa457600086600001828154811062000f5c5762000f5c620016bb565b906000526020600020015490508087600001848154811062000f825762000f82620016bb565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000fb85762000fb8620016a5565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200044b565b60009150506200044b565b62000a51828262000d81565b6000826000018281548110620010255762001025620016bb565b9060005260206000200154905092915050565b606060006200104983600262001606565b62001056906002620015eb565b67ffffffffffffffff811115620010715762001071620016d1565b6040519080825280601f01601f1916602001820160405280156200109c576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110620010d657620010d6620016bb565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110620011245762001124620016bb565b60200101906001600160f81b031916908160001a90535060006200114a84600262001606565b62001157906001620015eb565b90505b6001811115620011e6577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106200119c576200119c620016bb565b1a60f81b828281518110620011b557620011b5620016bb565b60200101906001600160f81b031916908160001a90535060049490941c93620011de8162001675565b90506200115a565b508315620009685760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016200050d565b610a3280620016e883390190565b6128c3806200211a83390190565b6105b080620049dd83390190565b80356001600160a01b03811681146200127957600080fd5b919050565b600082601f8301126200129057600080fd5b813567ffffffffffffffff80821115620012ae57620012ae620016d1565b604051601f8301601f19908116603f01168101908282118183101715620012d957620012d9620016d1565b81604052838152866020858801011115620012f357600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156200132657600080fd5b620009688262001261565b6000806000606084860312156200134757600080fd5b620013528462001261565b9250602084013567ffffffffffffffff808211156200137057600080fd5b6200137e878388016200127e565b935060408601359150808211156200139557600080fd5b50620013a4868287016200127e565b9150509250925092565b600060208284031215620013c157600080fd5b5035919050565b60008060408385031215620013dc57600080fd5b82359150620013ee6020840162001261565b90509250929050565b600080604083850312156200140b57600080fd5b50508035926020909101359150565b6000602082840312156200142d57600080fd5b81356001600160e01b0319811681146200096857600080fd5b6000602082840312156200145957600080fd5b813567ffffffffffffffff8111156200147157600080fd5b6200147f848285016200127e565b949350505050565b60008151808452620014a181602086016020860162001642565b601f01601f19169290920160200192915050565b60008251620014c981846020870162001642565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516200150d81601785016020880162001642565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516200154c81602884016020880162001642565b01602801949350505050565b6001600160a01b03831681526040602082015260006200147f604083018462001487565b60208152600062000968602083018462001487565b60c081526000620015a660c083018962001487565b8281036020840152620015ba818962001487565b604084019790975250506001600160a01b039384166060820152918316608083015290911660a09091015292915050565b600082198211156200160157620016016200168f565b500190565b60008160001904831182151516156200162357620016236200168f565b500290565b6000828210156200163d576200163d6200168f565b500390565b60005b838110156200165f57818101518382015260200162001645565b838111156200166f576000848401525b50505050565b6000816200168757620016876200168f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe608060405260405162000a3238038062000a328339810160408190526200002691620004ad565b6200005360017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51620005ce565b600080516020620009eb8339815191521462000073576200007362000623565b620000818282600062000089565b50506200064f565b62000094836200016e565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a2600082511180620000d65750805b15620001695762000167836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200011a57600080fd5b505afa1580156200012f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015591906200048f565b836200031f60201b620000291760201c565b505b505050565b62000184816200034e60201b620000551760201c565b620001e45760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6200026e816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022257600080fd5b505afa15801562000237573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025d91906200048f565b6200034e60201b620000551760201c565b620002d55760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401620001db565b80620002fe600080516020620009eb83398151915260001b6200035460201b6200005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606062000347838360405180606001604052806027815260200162000a0b6027913962000357565b9392505050565b3b151590565b90565b6060833b620003b85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001db565b600080856001600160a01b031685604051620003d591906200057b565b600060405180830381855af49150503d806000811462000412576040519150601f19603f3d011682016040523d82523d6000602084013e62000417565b606091505b5090925090506200042a82828662000434565b9695505050505050565b606083156200044557508162000347565b825115620004565782518084602001fd5b8160405162461bcd60e51b8152600401620001db919062000599565b80516001600160a01b03811681146200048a57600080fd5b919050565b600060208284031215620004a257600080fd5b620003478262000472565b60008060408385031215620004c157600080fd5b620004cc8362000472565b60208401519092506001600160401b0380821115620004ea57600080fd5b818501915085601f830112620004ff57600080fd5b81518181111562000514576200051462000639565b604051601f8201601f19908116603f011681019083821181831017156200053f576200053f62000639565b816040528281528860208487010111156200055957600080fd5b6200056c836020830160208801620005f4565b80955050505050509250929050565b600082516200058f818460208701620005f4565b9190910192915050565b6020815260008251806020840152620005ba816040850160208701620005f4565b601f01601f19169190910160400192915050565b600082821015620005ef57634e487b7160e01b600052601160045260246000fd5b500390565b60005b8381101562000611578181015183820152602001620005f7565b83811115620001675750506000910152565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61038c806200065f6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610120565b565b606061004e838360405180606001604052806027815260200161033060279139610144565b9392505050565b3b151590565b90565b600061009e7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100e357600080fd5b505afa1580156100f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011b919061027a565b905090565b3660008037600080366000845af43d6000803e80801561013f573d6000f35b3d6000fd5b6060833b6101bf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101e791906102b0565b600060405180830381855af49150503d8060008114610222576040519150601f19603f3d011682016040523d82523d6000602084013e610227565b606091505b5091509150610237828286610241565b9695505050505050565b6060831561025057508161004e565b8251156102605782518084602001fd5b8160405162461bcd60e51b81526004016101b691906102cc565b60006020828403121561028c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461004e57600080fd5b600082516102c28184602087016102ff565b9190910192915050565b60208152600082518060208401526102eb8160408501602087016102ff565b601f01601f19169190910160400192915050565b60005b8381101561031a578181015183820152602001610302565b83811115610329576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c78e7371ca68688f7b8f6147187f38bd2198c8404ee8d30abd6eca306ba6402164736f6c63430008070033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b506128a3806100206000396000f3fe60806040526004361061024f5760003560e01c80636ef7626c11610138578063a9059cbb116100b0578063cae9ca511161007f578063d547741f11610064578063d547741f146106db578063d8fbe994146106fb578063dd62ed3e1461071b57600080fd5b8063cae9ca511461069b578063ccf00634146106bb57600080fd5b8063a9059cbb1461060d578063aafa93711461062d578063c1d34b8914610643578063c4daa5931461066357600080fd5b806392afc33a116101075780639dc29fac116100ec5780639dc29fac146105b8578063a217fddf146105d8578063a457c2d7146105ed57600080fd5b806392afc33a1461056f57806395d89b41146105a357600080fd5b80636ef7626c1461049f57806370a08231146104bf5780637a12083a146104f557806391d148541461052957600080fd5b80633177029f116101cb578063395093511161019a5780634000aea01161017f5780634000aea01461044c57806340c10f191461046c5780634f1ef2861461048c57600080fd5b806339509351146104165780633e0075a11461043657600080fd5b80633177029f1461039857806332cb6b0c146103b857806336568abe146103d65780633659cfe6146103f657600080fd5b806318160ddd11610222578063248a9ca311610207578063248a9ca31461032a5780632f2ff15d1461035a578063313ce5671461037c57600080fd5b806318160ddd146102eb57806323b872dd1461030a57600080fd5b806301ffc9a71461025457806306fdde0314610289578063095ea7b3146102ab5780631296ee62146102cb575b600080fd5b34801561026057600080fd5b5061027461026f36600461250b565b610761565b60405190151581526020015b60405180910390f35b34801561029557600080fd5b5061029e6107c0565b604051610280919061270f565b3480156102b757600080fd5b506102746102c636600461244e565b610852565b3480156102d757600080fd5b506102746102e636600461244e565b610868565b3480156102f757600080fd5b506099545b604051908152602001610280565b34801561031657600080fd5b5061027461032536600461235c565b61088b565b34801561033657600080fd5b506102fc6103453660046124cf565b60009081526065602052604090206001015490565b34801561036657600080fd5b5061037a6103753660046124e8565b61094f565b005b34801561038857600080fd5b5060405160128152602001610280565b3480156103a457600080fd5b506102746103b336600461244e565b61097a565b3480156103c457600080fd5b506102fc69d3c21bcecceda100000081565b3480156103e257600080fd5b5061037a6103f13660046124e8565b610996565b34801561040257600080fd5b5061037a61041136600461230e565b610a22565b34801561042257600080fd5b5061027461043136600461244e565b610a49565b34801561044257600080fd5b506102fc60ca5481565b34801561045857600080fd5b50610274610467366004612478565b610a85565b34801561047857600080fd5b5061037a61048736600461244e565b610b03565b61037a61049a366004612400565b610bd2565b3480156104ab57600080fd5b5061037a6104ba366004612545565b610be7565b3480156104cb57600080fd5b506102fc6104da36600461230e565b6001600160a01b031660009081526097602052604090205490565b34801561050157600080fd5b506102fc7f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9481565b34801561053557600080fd5b506102746105443660046124e8565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561057b57600080fd5b506102fc7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b3480156105af57600080fd5b5061029e610d94565b3480156105c457600080fd5b5061037a6105d336600461244e565b610da3565b3480156105e457600080fd5b506102fc600081565b3480156105f957600080fd5b5061027461060836600461244e565b610df8565b34801561061957600080fd5b5061027461062836600461244e565b610e9f565b34801561063957600080fd5b506102fc60c95481565b34801561064f57600080fd5b5061027461065e366004612398565b610eac565b34801561066f57600080fd5b5060cb54610683906001600160a01b031681565b6040516001600160a01b039091168152602001610280565b3480156106a757600080fd5b506102746106b6366004612478565b610f29565b3480156106c757600080fd5b5061037a6106d636600461230e565b610fb3565b3480156106e757600080fd5b5061037a6106f63660046124e8565b61102b565b34801561070757600080fd5b5061027461071636600461235c565b611051565b34801561072757600080fd5b506102fc610736366004612329565b6001600160a01b03918216600090815260986020908152604080832093909416825291909152205490565b60006001600160e01b031982167f36372b070000000000000000000000000000000000000000000000000000000014806107ab57506001600160e01b0319821663b0202a1160e01b145b806107ba57506107ba8261106e565b92915050565b6060609a80546107cf906127b3565b80601f01602080910402602001604051908101604052809291908181526020018280546107fb906127b3565b80156108485780601f1061081d57610100808354040283529160200191610848565b820191906000526020600020905b81548152906001019060200180831161082b57829003601f168201915b5050505050905090565b600061085f338484611093565b50600192915050565b6000610884838360405180602001604052806000815250610a85565b9392505050565b60006108988484846111eb565b6001600160a01b0384166000908152609860209081526040808320338452909152902054828110156109375760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6109448533858403611093565b506001949350505050565b60008281526065602052604090206001015461096b8133611404565b6109758383611484565b505050565b6000610884838360405180602001604052806000815250610f29565b6001600160a01b0381163314610a145760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161092e565b610a1e8282611526565b5050565b610a2b816115a9565b610a46816040518060200160405280600081525060006115b5565b50565b3360008181526098602090815260408083206001600160a01b0387168452909152812054909161085f918590610a80908690612722565b611093565b6000610a918484610e9f565b50610a9e33858585611779565b610af95760405162461bcd60e51b815260206004820152602660248201527f455243313336333a205f636865636b416e6443616c6c5472616e73666572207260448201526565766572747360d01b606482015260840161092e565b5060019392505050565b7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610b2e8133611404565b8160c9541015610ba55760405162461bcd60e51b8152602060048201526024808201527f5f616d6f756e742065786365656473206d696e74696e6720617661696c61626960448201527f6c69747900000000000000000000000000000000000000000000000000000000606482015260840161092e565b8160c96000828254610bb79190612759565b909155505060c954610bc8574260ca555b6109758383611837565b610bdb826115a9565b610a1e828260016115b5565b600054610100900460ff1680610c00575060005460ff16155b610c635760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff16158015610c85576000805461ffff19166101011790555b610c8d611916565b610c95611916565b610c9f87876119c8565b610ca7611916565b60cb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616179055610cda600083611aa4565b610d047f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9485611aa4565b610d2e7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc984611aa4565b610d587f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9480611aae565b610d628486611837565b610d768569d3c21bcecceda1000000612759565b60c9558015610d8b576000805461ff00191690555b50505050505050565b6060609b80546107cf906127b3565b7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610dce8133611404565b60c95415610dee578160c96000828254610de89190612722565b90915550505b6109758383611af9565b3360009081526098602090815260408083206001600160a01b038616845290915281205482811015610e925760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161092e565b610af93385858403611093565b600061085f3384846111eb565b6000610eb985858561088b565b50610ec685858585611779565b6109445760405162461bcd60e51b815260206004820152602660248201527f455243313336333a205f636865636b416e6443616c6c5472616e73666572207260448201526565766572747360d01b606482015260840161092e565b949350505050565b6000610f358484610852565b50610f41848484611c7e565b610af95760405162461bcd60e51b815260206004820152602560248201527f455243313336333a205f636865636b416e6443616c6c417070726f766520726560448201527f7665727473000000000000000000000000000000000000000000000000000000606482015260840161092e565b60cb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383161790556110057f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c948261094f565b610a467f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c94335b6000828152606560205260409020600101546110478133611404565b6109758383611526565b6000610f2184848460405180602001604052806000815250610eac565b60006001600160e01b0319821663b0202a1160e01b14806107ba57506107ba82611d39565b6001600160a01b03831661110e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b03821661118a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0383811660008181526098602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112675760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0382166112e35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b038316600090815260976020526040902054818110156113725760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b038085166000908152609760205260408082208585039055918516815290812080548492906113a9908490612722565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113f591815260200190565b60405180910390a35b50505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a1e57611442816001600160a01b03166014611da0565b61144d836020611da0565b60405160200161145e92919061262b565b60408051601f198184030181529082905262461bcd60e51b825261092e9160040161270f565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a1e5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556114e23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610a1e5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610a1e8133611404565b60006115e87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506115f384611f81565b6000835111806116005750815b156116115761160f8484612043565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661177257805460ff191660011781556040516001600160a01b03831660248201526116be90869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f3659cfe600000000000000000000000000000000000000000000000000000000179052612043565b50805460ff191681557f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b038381169116146117695760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f7572746865722075706772616465730000000000000000000000000000000000606482015260840161092e565b61177285612068565b5050505050565b60006001600160a01b0384163b61179257506000610f21565b604051632229f29760e21b81526000906001600160a01b038616906388a7ca5c906117c79033908a90899089906004016126ac565b602060405180830381600087803b1580156117e157600080fd5b505af11580156117f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118199190612528565b6001600160e01b031916632229f29760e21b14915050949350505050565b6001600160a01b03821661188d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161092e565b806099600082825461189f9190612722565b90915550506001600160a01b038216600090815260976020526040812080548392906118cc908490612722565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600054610100900460ff168061192f575060005460ff16155b6119925760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff161580156119b4576000805461ffff19166101011790555b8015610a46576000805461ff001916905550565b600054610100900460ff16806119e1575060005460ff16155b611a445760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff16158015611a66576000805461ffff19166101011790555b8251611a7990609a9060208601906121cc565b508151611a8d90609b9060208501906121cc565b508015610975576000805461ff0019169055505050565b610a1e8282611484565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6001600160a01b038216611b755760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b03821660009081526097602052604090205481811015611c045760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0383166000908152609760205260408120838303905560998054849290611c33908490612759565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006001600160a01b0384163b611c9757506000610884565b6040516307b04a2d60e41b81526000906001600160a01b03861690637b04a2d090611cca903390889088906004016126de565b602060405180830381600087803b158015611ce457600080fd5b505af1158015611cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1c9190612528565b6001600160e01b0319166307b04a2d60e41b149150509392505050565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806107ba57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146107ba565b60606000611daf83600261273a565b611dba906002612722565b67ffffffffffffffff811115611dd257611dd261281a565b6040519080825280601f01601f191660200182016040528015611dfc576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611e3357611e33612804565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611e7e57611e7e612804565b60200101906001600160f81b031916908160001a9053506000611ea284600261273a565b611ead906001612722565b90505b6001811115611f32577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611eee57611eee612804565b1a60f81b828281518110611f0457611f04612804565b60200101906001600160f81b031916908160001a90535060049490941c93611f2b8161279c565b9050611eb0565b5083156108845760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161092e565b803b611ff55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161092e565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60606108848383604051806060016040528060278152602001612847602791396120a8565b61207181611f81565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b61211e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161092e565b600080856001600160a01b031685604051612139919061260f565b600060405180830381855af49150503d8060008114612174576040519150601f19603f3d011682016040523d82523d6000602084013e612179565b606091505b5091509150612189828286612193565b9695505050505050565b606083156121a2575081610884565b8251156121b25782518084602001fd5b8160405162461bcd60e51b815260040161092e919061270f565b8280546121d8906127b3565b90600052602060002090601f0160209004810192826121fa5760008555612240565b82601f1061221357805160ff1916838001178555612240565b82800160010185558215612240579182015b82811115612240578251825591602001919060010190612225565b5061224c929150612250565b5090565b5b8082111561224c5760008155600101612251565b80356001600160a01b038116811461227c57600080fd5b919050565b600082601f83011261229257600080fd5b813567ffffffffffffffff808211156122ad576122ad61281a565b604051601f8301601f19908116603f011681019082821181831017156122d5576122d561281a565b816040528381528660208588010111156122ee57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561232057600080fd5b61088482612265565b6000806040838503121561233c57600080fd5b61234583612265565b915061235360208401612265565b90509250929050565b60008060006060848603121561237157600080fd5b61237a84612265565b925061238860208501612265565b9150604084013590509250925092565b600080600080608085870312156123ae57600080fd5b6123b785612265565b93506123c560208601612265565b925060408501359150606085013567ffffffffffffffff8111156123e857600080fd5b6123f487828801612281565b91505092959194509250565b6000806040838503121561241357600080fd5b61241c83612265565b9150602083013567ffffffffffffffff81111561243857600080fd5b61244485828601612281565b9150509250929050565b6000806040838503121561246157600080fd5b61246a83612265565b946020939093013593505050565b60008060006060848603121561248d57600080fd5b61249684612265565b925060208401359150604084013567ffffffffffffffff8111156124b957600080fd5b6124c586828701612281565b9150509250925092565b6000602082840312156124e157600080fd5b5035919050565b600080604083850312156124fb57600080fd5b8235915061235360208401612265565b60006020828403121561251d57600080fd5b813561088481612830565b60006020828403121561253a57600080fd5b815161088481612830565b60008060008060008060c0878903121561255e57600080fd5b863567ffffffffffffffff8082111561257657600080fd5b6125828a838b01612281565b9750602089013591508082111561259857600080fd5b506125a589828a01612281565b955050604087013593506125bb60608801612265565b92506125c960808801612265565b91506125d760a08801612265565b90509295509295509295565b600081518084526125fb816020860160208601612770565b601f01601f19169290920160200192915050565b60008251612621818460208701612770565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612663816017850160208801612770565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516126a0816028840160208801612770565b01602801949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261218960808301846125e3565b6001600160a01b038416815282602082015260606040820152600061270660608301846125e3565b95945050505050565b60208152600061088460208301846125e3565b60008219821115612735576127356127ee565b500190565b6000816000190483118215151615612754576127546127ee565b500290565b60008282101561276b5761276b6127ee565b500390565b60005b8381101561278b578181015183820152602001612773565b838111156113fe5750506000910152565b6000816127ab576127ab6127ee565b506000190190565b600181811c908216806127c757607f821691505b602082108114156127e857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610a4657600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f797de56cc89b29df1847a01755aba52b4f16513029b1ee7556a1a13530182f864736f6c63430008070033608060405234801561001057600080fd5b506040516105b03803806105b083398101604081905261002f91610148565b61003833610047565b61004181610097565b50610178565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b6102bd1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b9392505050565b610429806101876000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100aa5780638da5cb5b146100b2578063f2fde38b146100c357600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a3660046103c3565b6100d6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61007f610175565b6000546001600160a01b031661008e565b61007f6100d13660046103c3565b6101db565b6000546001600160a01b031633146101355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61013e816102c3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161012c565b6101d96000610366565b565b6000546001600160a01b031633146102355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161012c565b6001600160a01b0381166102b15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161012c565b6102ba81610366565b50565b3b151590565b803b6103375760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161012c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156103d557600080fd5b81356001600160a01b03811681146103ec57600080fd5b939250505056fea26469706673582212202951755a9086a4fb48b130c4c935b9a5661f5eae8ce9a8365451d900d3161c8464736f6c63430008070033a2646970667358221220b14ab027103f0ada81ff5333bf37d46ab6f30cd2bf3913e706764bf193969f7d64736f6c63430008070033
Deployed ByteCode
0x60806040523480156200001157600080fd5b5060043610620001955760003560e01c806357bc3cd911620000e957806392afc33a1162000097578063d547741f116200006e578063d547741f14620003e4578063ef31f42414620003fb578063fca3b5aa146200042757600080fd5b806392afc33a146200039c578063a217fddf14620003c4578063ca15c87314620003cd57600080fd5b80638129fc1c11620000cc5780638129fc1c146200033f5780639010d07c146200034957806391d14854146200036057600080fd5b806357bc3cd914620002ff5780637ffed926146200031357600080fd5b8063248a9ca311620001475780632f2ff15d116200012a5780632f2ff15d14620002be5780632ff2e9dc14620002d757806336568abe14620002e857600080fd5b8063248a9ca314620002525780632dbc679c146200028757600080fd5b8063099aba56116200017c578063099aba5614620001f35780631b0f28741462000224578063242fa5db146200023b57600080fd5b806301ffc9a7146200019a5780630754617214620001c6575b600080fd5b620001b1620001ab3660046200141a565b6200043e565b60405190151581526020015b60405180910390f35b60cc54620001da906001600160a01b031681565b6040516001600160a01b039091168152602001620001bd565b620001b16200020436600462001313565b6001600160a01b03908116600090815260ca602052604090205416151590565b620001b16200023536600462001446565b62000451565b620001da6200024c36600462001331565b62000490565b6200027862000263366004620013ae565b60009081526065602052604090206001015490565b604051908152602001620001bd565b620001da6200029836600462001446565b805160208183018101805160cb825292820191909301209152546001600160a01b031681565b620002d5620002cf366004620013c8565b620006fc565b005b62000278686c6b935b8bbd40000081565b620002d5620002f9366004620013c8565b62000727565b60cd54620001da906001600160a01b031681565b620001da6200032436600462001313565b60c9602052600090815260409020546001600160a01b031681565b620002d56200074d565b620001da6200035a366004620013f7565b6200094e565b620001b162000371366004620013c8565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b620002787ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b62000278600081565b62000278620003de366004620013ae565b6200096f565b620002d5620003f5366004620013c8565b62000988565b620001da6200040c36600462001313565b60ca602052600090815260409020546001600160a01b031681565b620002d56200043836600462001313565b62000994565b60006200044b8262000a55565b92915050565b6000806001600160a01b031660cb836040516200046f9190620014b5565b908152604051908190036020019020546001600160a01b0316141592915050565b60006200049d8262000451565b15620005165760405162461bcd60e51b815260206004820152602c60248201527f74616c656e7420746f6b656e207769746820746869732073796d626f6c20616c60448201527f726561647920657869737473000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60cc546001600160a01b0316620005705760405162461bcd60e51b815260206004820152601260248201527f6d696e746572206e6f742079657420736574000000000000000000000000000060448201526064016200050d565b60cd5460cc546000916001600160a01b03908116917f6ef7626c000000000000000000000000000000000000000000000000000000009187918791686c6b935b8bbd400000918b9116620005c588806200094e565b604051602401620005dc9695949392919062001591565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909416939093179092529051620006309062001237565b6200063d92919062001558565b604051809103906000f0801580156200065a573d6000803e3d6000fd5b50905060008190508060cb85604051620006759190620014b5565b9081526040805160209281900383018120805473ffffffffffffffffffffffffffffffffffffffff199081166001600160a01b0396871617909155858516600081815260ca9095529284208054909116948b1694851790559092917fc3cff6724200e4907489fef1d1ede51dd32ca7ac86d62c448475be4c3b1d5b5091a395945050505050565b62000708828262000a96565b600082815260976020526040902062000722908262000ac0565b505050565b62000733828262000ad7565b600082815260976020526040902062000722908262000b63565b600054610100900460ff168062000767575060005460ff16155b620007db5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200050d565b600054610100900460ff16158015620007fe576000805461ffff19166101011790555b6200080862000b7a565b6200081262000b7a565b6200081c62000b7a565b6200082960003362000c40565b6000604051620008399062001245565b604051809103906000f08015801562000856573d6000803e3d6000fd5b50604051620008659062001253565b6001600160a01b039091168152602001604051809103906000f08015801562000892573d6000803e3d6000fd5b506040517ff2fde38b0000000000000000000000000000000000000000000000000000000081523360048201529091506001600160a01b0382169063f2fde38b90602401600060405180830381600087803b158015620008f157600080fd5b505af115801562000906573d6000803e3d6000fd5b505060cd805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039490941693909317909255505080156200094b576000805461ff00191690555b50565b600082815260976020526040812062000968908362000c4c565b9392505050565b60008181526097602052604081206200044b9062000c5a565b62000733828262000c65565b6000620009a2813362000c8f565b60cc546001600160a01b031615620009fd5760405162461bcd60e51b815260206004820152601260248201527f6d696e74657220616c726561647920736574000000000000000000000000000060448201526064016200050d565b60cc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841617905562000a517ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc98362000c40565b5050565b60006001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806200044b57506200044b8262000d18565b60008281526065602052604090206001015462000ab4813362000c8f565b62000722838362000d81565b600062000968836001600160a01b03841662000e25565b6001600160a01b038116331462000b575760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016200050d565b62000a51828262000e77565b600062000968836001600160a01b03841662000efb565b600054610100900460ff168062000b94575060005460ff16155b62000c085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200050d565b600054610100900460ff1615801562000c2b576000805461ffff19166101011790555b80156200094b576000805461ff001916905550565b62000708828262000fff565b60006200096883836200100b565b60006200044b825490565b60008281526065602052604090206001015462000c83813362000c8f565b62000722838362000e77565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1662000a515762000cd0816001600160a01b0316601462001038565b62000cdd83602062001038565b60405160200162000cf0929190620014d3565b60408051601f198184030181529082905262461bcd60e51b82526200050d916004016200157c565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806200044b57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146200044b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1662000a515760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905562000de13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205462000e6e575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200044b565b5060006200044b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff161562000a515760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801562000ff457600062000f2260018362001628565b855490915060009062000f389060019062001628565b905081811462000fa457600086600001828154811062000f5c5762000f5c620016bb565b906000526020600020015490508087600001848154811062000f825762000f82620016bb565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000fb85762000fb8620016a5565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200044b565b60009150506200044b565b62000a51828262000d81565b6000826000018281548110620010255762001025620016bb565b9060005260206000200154905092915050565b606060006200104983600262001606565b62001056906002620015eb565b67ffffffffffffffff811115620010715762001071620016d1565b6040519080825280601f01601f1916602001820160405280156200109c576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110620010d657620010d6620016bb565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110620011245762001124620016bb565b60200101906001600160f81b031916908160001a90535060006200114a84600262001606565b62001157906001620015eb565b90505b6001811115620011e6577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106200119c576200119c620016bb565b1a60f81b828281518110620011b557620011b5620016bb565b60200101906001600160f81b031916908160001a90535060049490941c93620011de8162001675565b90506200115a565b508315620009685760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016200050d565b610a3280620016e883390190565b6128c3806200211a83390190565b6105b080620049dd83390190565b80356001600160a01b03811681146200127957600080fd5b919050565b600082601f8301126200129057600080fd5b813567ffffffffffffffff80821115620012ae57620012ae620016d1565b604051601f8301601f19908116603f01168101908282118183101715620012d957620012d9620016d1565b81604052838152866020858801011115620012f357600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156200132657600080fd5b620009688262001261565b6000806000606084860312156200134757600080fd5b620013528462001261565b9250602084013567ffffffffffffffff808211156200137057600080fd5b6200137e878388016200127e565b935060408601359150808211156200139557600080fd5b50620013a4868287016200127e565b9150509250925092565b600060208284031215620013c157600080fd5b5035919050565b60008060408385031215620013dc57600080fd5b82359150620013ee6020840162001261565b90509250929050565b600080604083850312156200140b57600080fd5b50508035926020909101359150565b6000602082840312156200142d57600080fd5b81356001600160e01b0319811681146200096857600080fd5b6000602082840312156200145957600080fd5b813567ffffffffffffffff8111156200147157600080fd5b6200147f848285016200127e565b949350505050565b60008151808452620014a181602086016020860162001642565b601f01601f19169290920160200192915050565b60008251620014c981846020870162001642565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516200150d81601785016020880162001642565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516200154c81602884016020880162001642565b01602801949350505050565b6001600160a01b03831681526040602082015260006200147f604083018462001487565b60208152600062000968602083018462001487565b60c081526000620015a660c083018962001487565b8281036020840152620015ba818962001487565b604084019790975250506001600160a01b039384166060820152918316608083015290911660a09091015292915050565b600082198211156200160157620016016200168f565b500190565b60008160001904831182151516156200162357620016236200168f565b500290565b6000828210156200163d576200163d6200168f565b500390565b60005b838110156200165f57818101518382015260200162001645565b838111156200166f576000848401525b50505050565b6000816200168757620016876200168f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe608060405260405162000a3238038062000a328339810160408190526200002691620004ad565b6200005360017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51620005ce565b600080516020620009eb8339815191521462000073576200007362000623565b620000818282600062000089565b50506200064f565b62000094836200016e565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a2600082511180620000d65750805b15620001695762000167836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200011a57600080fd5b505afa1580156200012f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015591906200048f565b836200031f60201b620000291760201c565b505b505050565b62000184816200034e60201b620000551760201c565b620001e45760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6200026e816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022257600080fd5b505afa15801562000237573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025d91906200048f565b6200034e60201b620000551760201c565b620002d55760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401620001db565b80620002fe600080516020620009eb83398151915260001b6200035460201b6200005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606062000347838360405180606001604052806027815260200162000a0b6027913962000357565b9392505050565b3b151590565b90565b6060833b620003b85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001db565b600080856001600160a01b031685604051620003d591906200057b565b600060405180830381855af49150503d806000811462000412576040519150601f19603f3d011682016040523d82523d6000602084013e62000417565b606091505b5090925090506200042a82828662000434565b9695505050505050565b606083156200044557508162000347565b825115620004565782518084602001fd5b8160405162461bcd60e51b8152600401620001db919062000599565b80516001600160a01b03811681146200048a57600080fd5b919050565b600060208284031215620004a257600080fd5b620003478262000472565b60008060408385031215620004c157600080fd5b620004cc8362000472565b60208401519092506001600160401b0380821115620004ea57600080fd5b818501915085601f830112620004ff57600080fd5b81518181111562000514576200051462000639565b604051601f8201601f19908116603f011681019083821181831017156200053f576200053f62000639565b816040528281528860208487010111156200055957600080fd5b6200056c836020830160208801620005f4565b80955050505050509250929050565b600082516200058f818460208701620005f4565b9190910192915050565b6020815260008251806020840152620005ba816040850160208701620005f4565b601f01601f19169190910160400192915050565b600082821015620005ef57634e487b7160e01b600052601160045260246000fd5b500390565b60005b8381101562000611578181015183820152602001620005f7565b83811115620001675750506000910152565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61038c806200065f6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610120565b565b606061004e838360405180606001604052806027815260200161033060279139610144565b9392505050565b3b151590565b90565b600061009e7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100e357600080fd5b505afa1580156100f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011b919061027a565b905090565b3660008037600080366000845af43d6000803e80801561013f573d6000f35b3d6000fd5b6060833b6101bf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101e791906102b0565b600060405180830381855af49150503d8060008114610222576040519150601f19603f3d011682016040523d82523d6000602084013e610227565b606091505b5091509150610237828286610241565b9695505050505050565b6060831561025057508161004e565b8251156102605782518084602001fd5b8160405162461bcd60e51b81526004016101b691906102cc565b60006020828403121561028c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461004e57600080fd5b600082516102c28184602087016102ff565b9190910192915050565b60208152600082518060208401526102eb8160408501602087016102ff565b601f01601f19169190910160400192915050565b60005b8381101561031a578181015183820152602001610302565b83811115610329576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c78e7371ca68688f7b8f6147187f38bd2198c8404ee8d30abd6eca306ba6402164736f6c63430008070033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b506128a3806100206000396000f3fe60806040526004361061024f5760003560e01c80636ef7626c11610138578063a9059cbb116100b0578063cae9ca511161007f578063d547741f11610064578063d547741f146106db578063d8fbe994146106fb578063dd62ed3e1461071b57600080fd5b8063cae9ca511461069b578063ccf00634146106bb57600080fd5b8063a9059cbb1461060d578063aafa93711461062d578063c1d34b8914610643578063c4daa5931461066357600080fd5b806392afc33a116101075780639dc29fac116100ec5780639dc29fac146105b8578063a217fddf146105d8578063a457c2d7146105ed57600080fd5b806392afc33a1461056f57806395d89b41146105a357600080fd5b80636ef7626c1461049f57806370a08231146104bf5780637a12083a146104f557806391d148541461052957600080fd5b80633177029f116101cb578063395093511161019a5780634000aea01161017f5780634000aea01461044c57806340c10f191461046c5780634f1ef2861461048c57600080fd5b806339509351146104165780633e0075a11461043657600080fd5b80633177029f1461039857806332cb6b0c146103b857806336568abe146103d65780633659cfe6146103f657600080fd5b806318160ddd11610222578063248a9ca311610207578063248a9ca31461032a5780632f2ff15d1461035a578063313ce5671461037c57600080fd5b806318160ddd146102eb57806323b872dd1461030a57600080fd5b806301ffc9a71461025457806306fdde0314610289578063095ea7b3146102ab5780631296ee62146102cb575b600080fd5b34801561026057600080fd5b5061027461026f36600461250b565b610761565b60405190151581526020015b60405180910390f35b34801561029557600080fd5b5061029e6107c0565b604051610280919061270f565b3480156102b757600080fd5b506102746102c636600461244e565b610852565b3480156102d757600080fd5b506102746102e636600461244e565b610868565b3480156102f757600080fd5b506099545b604051908152602001610280565b34801561031657600080fd5b5061027461032536600461235c565b61088b565b34801561033657600080fd5b506102fc6103453660046124cf565b60009081526065602052604090206001015490565b34801561036657600080fd5b5061037a6103753660046124e8565b61094f565b005b34801561038857600080fd5b5060405160128152602001610280565b3480156103a457600080fd5b506102746103b336600461244e565b61097a565b3480156103c457600080fd5b506102fc69d3c21bcecceda100000081565b3480156103e257600080fd5b5061037a6103f13660046124e8565b610996565b34801561040257600080fd5b5061037a61041136600461230e565b610a22565b34801561042257600080fd5b5061027461043136600461244e565b610a49565b34801561044257600080fd5b506102fc60ca5481565b34801561045857600080fd5b50610274610467366004612478565b610a85565b34801561047857600080fd5b5061037a61048736600461244e565b610b03565b61037a61049a366004612400565b610bd2565b3480156104ab57600080fd5b5061037a6104ba366004612545565b610be7565b3480156104cb57600080fd5b506102fc6104da36600461230e565b6001600160a01b031660009081526097602052604090205490565b34801561050157600080fd5b506102fc7f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9481565b34801561053557600080fd5b506102746105443660046124e8565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561057b57600080fd5b506102fc7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b3480156105af57600080fd5b5061029e610d94565b3480156105c457600080fd5b5061037a6105d336600461244e565b610da3565b3480156105e457600080fd5b506102fc600081565b3480156105f957600080fd5b5061027461060836600461244e565b610df8565b34801561061957600080fd5b5061027461062836600461244e565b610e9f565b34801561063957600080fd5b506102fc60c95481565b34801561064f57600080fd5b5061027461065e366004612398565b610eac565b34801561066f57600080fd5b5060cb54610683906001600160a01b031681565b6040516001600160a01b039091168152602001610280565b3480156106a757600080fd5b506102746106b6366004612478565b610f29565b3480156106c757600080fd5b5061037a6106d636600461230e565b610fb3565b3480156106e757600080fd5b5061037a6106f63660046124e8565b61102b565b34801561070757600080fd5b5061027461071636600461235c565b611051565b34801561072757600080fd5b506102fc610736366004612329565b6001600160a01b03918216600090815260986020908152604080832093909416825291909152205490565b60006001600160e01b031982167f36372b070000000000000000000000000000000000000000000000000000000014806107ab57506001600160e01b0319821663b0202a1160e01b145b806107ba57506107ba8261106e565b92915050565b6060609a80546107cf906127b3565b80601f01602080910402602001604051908101604052809291908181526020018280546107fb906127b3565b80156108485780601f1061081d57610100808354040283529160200191610848565b820191906000526020600020905b81548152906001019060200180831161082b57829003601f168201915b5050505050905090565b600061085f338484611093565b50600192915050565b6000610884838360405180602001604052806000815250610a85565b9392505050565b60006108988484846111eb565b6001600160a01b0384166000908152609860209081526040808320338452909152902054828110156109375760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6109448533858403611093565b506001949350505050565b60008281526065602052604090206001015461096b8133611404565b6109758383611484565b505050565b6000610884838360405180602001604052806000815250610f29565b6001600160a01b0381163314610a145760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161092e565b610a1e8282611526565b5050565b610a2b816115a9565b610a46816040518060200160405280600081525060006115b5565b50565b3360008181526098602090815260408083206001600160a01b0387168452909152812054909161085f918590610a80908690612722565b611093565b6000610a918484610e9f565b50610a9e33858585611779565b610af95760405162461bcd60e51b815260206004820152602660248201527f455243313336333a205f636865636b416e6443616c6c5472616e73666572207260448201526565766572747360d01b606482015260840161092e565b5060019392505050565b7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610b2e8133611404565b8160c9541015610ba55760405162461bcd60e51b8152602060048201526024808201527f5f616d6f756e742065786365656473206d696e74696e6720617661696c61626960448201527f6c69747900000000000000000000000000000000000000000000000000000000606482015260840161092e565b8160c96000828254610bb79190612759565b909155505060c954610bc8574260ca555b6109758383611837565b610bdb826115a9565b610a1e828260016115b5565b600054610100900460ff1680610c00575060005460ff16155b610c635760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff16158015610c85576000805461ffff19166101011790555b610c8d611916565b610c95611916565b610c9f87876119c8565b610ca7611916565b60cb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616179055610cda600083611aa4565b610d047f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9485611aa4565b610d2e7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc984611aa4565b610d587f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c9480611aae565b610d628486611837565b610d768569d3c21bcecceda1000000612759565b60c9558015610d8b576000805461ff00191690555b50505050505050565b6060609b80546107cf906127b3565b7ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610dce8133611404565b60c95415610dee578160c96000828254610de89190612722565b90915550505b6109758383611af9565b3360009081526098602090815260408083206001600160a01b038616845290915281205482811015610e925760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161092e565b610af93385858403611093565b600061085f3384846111eb565b6000610eb985858561088b565b50610ec685858585611779565b6109445760405162461bcd60e51b815260206004820152602660248201527f455243313336333a205f636865636b416e6443616c6c5472616e73666572207260448201526565766572747360d01b606482015260840161092e565b949350505050565b6000610f358484610852565b50610f41848484611c7e565b610af95760405162461bcd60e51b815260206004820152602560248201527f455243313336333a205f636865636b416e6443616c6c417070726f766520726560448201527f7665727473000000000000000000000000000000000000000000000000000000606482015260840161092e565b60cb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383161790556110057f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c948261094f565b610a467f8fad061cdace53638a92e8940b81545ab8169bcf17f044b6ab490075da827c94335b6000828152606560205260409020600101546110478133611404565b6109758383611526565b6000610f2184848460405180602001604052806000815250610eac565b60006001600160e01b0319821663b0202a1160e01b14806107ba57506107ba82611d39565b6001600160a01b03831661110e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b03821661118a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0383811660008181526098602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112675760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0382166112e35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b038316600090815260976020526040902054818110156113725760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b038085166000908152609760205260408082208585039055918516815290812080548492906113a9908490612722565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113f591815260200190565b60405180910390a35b50505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a1e57611442816001600160a01b03166014611da0565b61144d836020611da0565b60405160200161145e92919061262b565b60408051601f198184030181529082905262461bcd60e51b825261092e9160040161270f565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a1e5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556114e23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610a1e5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610a1e8133611404565b60006115e87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506115f384611f81565b6000835111806116005750815b156116115761160f8484612043565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661177257805460ff191660011781556040516001600160a01b03831660248201526116be90869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f3659cfe600000000000000000000000000000000000000000000000000000000179052612043565b50805460ff191681557f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b038381169116146117695760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f7572746865722075706772616465730000000000000000000000000000000000606482015260840161092e565b61177285612068565b5050505050565b60006001600160a01b0384163b61179257506000610f21565b604051632229f29760e21b81526000906001600160a01b038616906388a7ca5c906117c79033908a90899089906004016126ac565b602060405180830381600087803b1580156117e157600080fd5b505af11580156117f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118199190612528565b6001600160e01b031916632229f29760e21b14915050949350505050565b6001600160a01b03821661188d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161092e565b806099600082825461189f9190612722565b90915550506001600160a01b038216600090815260976020526040812080548392906118cc908490612722565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600054610100900460ff168061192f575060005460ff16155b6119925760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff161580156119b4576000805461ffff19166101011790555b8015610a46576000805461ff001916905550565b600054610100900460ff16806119e1575060005460ff16155b611a445760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b600054610100900460ff16158015611a66576000805461ffff19166101011790555b8251611a7990609a9060208601906121cc565b508151611a8d90609b9060208501906121cc565b508015610975576000805461ff0019169055505050565b610a1e8282611484565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6001600160a01b038216611b755760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b03821660009081526097602052604090205481811015611c045760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161092e565b6001600160a01b0383166000908152609760205260408120838303905560998054849290611c33908490612759565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006001600160a01b0384163b611c9757506000610884565b6040516307b04a2d60e41b81526000906001600160a01b03861690637b04a2d090611cca903390889088906004016126de565b602060405180830381600087803b158015611ce457600080fd5b505af1158015611cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1c9190612528565b6001600160e01b0319166307b04a2d60e41b149150509392505050565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806107ba57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146107ba565b60606000611daf83600261273a565b611dba906002612722565b67ffffffffffffffff811115611dd257611dd261281a565b6040519080825280601f01601f191660200182016040528015611dfc576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611e3357611e33612804565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611e7e57611e7e612804565b60200101906001600160f81b031916908160001a9053506000611ea284600261273a565b611ead906001612722565b90505b6001811115611f32577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611eee57611eee612804565b1a60f81b828281518110611f0457611f04612804565b60200101906001600160f81b031916908160001a90535060049490941c93611f2b8161279c565b9050611eb0565b5083156108845760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161092e565b803b611ff55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161092e565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60606108848383604051806060016040528060278152602001612847602791396120a8565b61207181611f81565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b61211e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161092e565b600080856001600160a01b031685604051612139919061260f565b600060405180830381855af49150503d8060008114612174576040519150601f19603f3d011682016040523d82523d6000602084013e612179565b606091505b5091509150612189828286612193565b9695505050505050565b606083156121a2575081610884565b8251156121b25782518084602001fd5b8160405162461bcd60e51b815260040161092e919061270f565b8280546121d8906127b3565b90600052602060002090601f0160209004810192826121fa5760008555612240565b82601f1061221357805160ff1916838001178555612240565b82800160010185558215612240579182015b82811115612240578251825591602001919060010190612225565b5061224c929150612250565b5090565b5b8082111561224c5760008155600101612251565b80356001600160a01b038116811461227c57600080fd5b919050565b600082601f83011261229257600080fd5b813567ffffffffffffffff808211156122ad576122ad61281a565b604051601f8301601f19908116603f011681019082821181831017156122d5576122d561281a565b816040528381528660208588010111156122ee57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561232057600080fd5b61088482612265565b6000806040838503121561233c57600080fd5b61234583612265565b915061235360208401612265565b90509250929050565b60008060006060848603121561237157600080fd5b61237a84612265565b925061238860208501612265565b9150604084013590509250925092565b600080600080608085870312156123ae57600080fd5b6123b785612265565b93506123c560208601612265565b925060408501359150606085013567ffffffffffffffff8111156123e857600080fd5b6123f487828801612281565b91505092959194509250565b6000806040838503121561241357600080fd5b61241c83612265565b9150602083013567ffffffffffffffff81111561243857600080fd5b61244485828601612281565b9150509250929050565b6000806040838503121561246157600080fd5b61246a83612265565b946020939093013593505050565b60008060006060848603121561248d57600080fd5b61249684612265565b925060208401359150604084013567ffffffffffffffff8111156124b957600080fd5b6124c586828701612281565b9150509250925092565b6000602082840312156124e157600080fd5b5035919050565b600080604083850312156124fb57600080fd5b8235915061235360208401612265565b60006020828403121561251d57600080fd5b813561088481612830565b60006020828403121561253a57600080fd5b815161088481612830565b60008060008060008060c0878903121561255e57600080fd5b863567ffffffffffffffff8082111561257657600080fd5b6125828a838b01612281565b9750602089013591508082111561259857600080fd5b506125a589828a01612281565b955050604087013593506125bb60608801612265565b92506125c960808801612265565b91506125d760a08801612265565b90509295509295509295565b600081518084526125fb816020860160208601612770565b601f01601f19169290920160200192915050565b60008251612621818460208701612770565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612663816017850160208801612770565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516126a0816028840160208801612770565b01602801949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261218960808301846125e3565b6001600160a01b038416815282602082015260606040820152600061270660608301846125e3565b95945050505050565b60208152600061088460208301846125e3565b60008219821115612735576127356127ee565b500190565b6000816000190483118215151615612754576127546127ee565b500290565b60008282101561276b5761276b6127ee565b500390565b60005b8381101561278b578181015183820152602001612773565b838111156113fe5750506000910152565b6000816127ab576127ab6127ee565b506000190190565b600181811c908216806127c757607f821691505b602082108114156127e857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610a4657600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f797de56cc89b29df1847a01755aba52b4f16513029b1ee7556a1a13530182f864736f6c63430008070033608060405234801561001057600080fd5b506040516105b03803806105b083398101604081905261002f91610148565b61003833610047565b61004181610097565b50610178565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b6102bd1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b9392505050565b610429806101876000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100aa5780638da5cb5b146100b2578063f2fde38b146100c357600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a3660046103c3565b6100d6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61007f610175565b6000546001600160a01b031661008e565b61007f6100d13660046103c3565b6101db565b6000546001600160a01b031633146101355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61013e816102c3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161012c565b6101d96000610366565b565b6000546001600160a01b031633146102355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161012c565b6001600160a01b0381166102b15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161012c565b6102ba81610366565b50565b3b151590565b803b6103375760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161012c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156103d557600080fd5b81356001600160a01b03811681146103ec57600080fd5b939250505056fea26469706673582212202951755a9086a4fb48b130c4c935b9a5661f5eae8ce9a8365451d900d3161c8464736f6c63430008070033a2646970667358221220b14ab027103f0ada81ff5333bf37d46ab6f30cd2bf3913e706764bf193969f7d64736f6c63430008070033