More Info
Private Name Tags
ContractCreator
Latest 10 from a total of 10 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deploy With Type... | 55170124 | 391 days ago | IN | 0 POL | 0.07240081 | ||||
Deploy With Type... | 55128597 | 392 days ago | IN | 0 POL | 0.05695672 | ||||
Deploy With Type... | 54172261 | 417 days ago | IN | 0 POL | 0.04764229 | ||||
Deploy With Type... | 54092673 | 419 days ago | IN | 0 POL | 0.06314033 | ||||
Deploy With Type... | 54064250 | 419 days ago | IN | 0 POL | 0.0943167 | ||||
Deploy With Type... | 53776759 | 427 days ago | IN | 0 POL | 0.06085118 | ||||
Deploy With Type... | 53702513 | 429 days ago | IN | 0 POL | 0.06294795 | ||||
Grant Role | 53701892 | 429 days ago | IN | 0 POL | 0.00439282 | ||||
Grant Role | 53701882 | 429 days ago | IN | 0 POL | 0.00452941 | ||||
Set Implementati... | 53572078 | 432 days ago | IN | 0 POL | 0.00261829 |
Latest 7 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
55170124 | 391 days ago | Contract Creation | 0 POL | |||
55128597 | 392 days ago | Contract Creation | 0 POL | |||
54172261 | 417 days ago | Contract Creation | 0 POL | |||
54092673 | 419 days ago | Contract Creation | 0 POL | |||
54064250 | 419 days ago | Contract Creation | 0 POL | |||
53776759 | 427 days ago | Contract Creation | 0 POL | |||
53702513 | 429 days ago | Contract Creation | 0 POL |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
LaunchpadCrowdsaleFactoryDefault
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {AdminPrivileges} from "./AdminPrivileges.sol"; import {IFactoryImplementation} from "./interfaces/IFactoryImplementation.sol"; import {ICrowdsale} from "./interfaces/ICrowdsale.sol"; import {ITimedCrowdsaleHelper} from "./interfaces/ITimedCrowdsaleHelper.sol"; import {ILaunchpadCrowdsaleFactoryDefault} from "./interfaces/ILaunchpadCrowdsaleFactoryDefault.sol"; /** * @title LaunchpadCrowdsaleFactoryDefault * @author Tim Loh * @notice Provides an implementation of launchpad crowdsale factory interface for deploying launchpad crowdsale * contracts based on reference implementation */ contract LaunchpadCrowdsaleFactoryDefault is AdminPrivileges, EIP712, Pausable, ILaunchpadCrowdsaleFactoryDefault { using Address for address; using Clones for address; using ECDSA for bytes32; struct DeployInfo { address implementationAddress; // address of reference implementation address deployedAddress; // address of deployed contract bool isInitialized; // `true` if initialized } struct LaunchpadCrowdsaleDefaultStruct { address implementationAddress; bytes32 deployId; string deployName; uint256 tokenWeiCap; uint256 lotWeiSize; ICrowdsale.PaymentTokenInfo[] paymentTokensInfo; bool requireNonEvmAddress; bool allowNativePaymentToken; ITimedCrowdsaleHelper.Timeframe timeframe; address backofficeAdminAddress; } bytes32 public constant LAUNCHPAD_CROWDSALE_DEFAULT_TYPEHASH = keccak256( "LaunchpadCrowdsaleDefaultStruct(" "address implementationAddress," "bytes32 deployId," "string deployName," "uint256 tokenWeiCap," "uint256 lotWeiSize," "PaymentTokenInfo[] paymentTokensInfo," "bool requireNonEvmAddress," "bool allowNativePaymentToken," "Timeframe timeframe," "address backofficeAdminAddress" ")PaymentTokenInfo(" "address paymentToken," "uint256 paymentDecimals," "uint256 paymentRate" ")Timeframe(" "uint256 startTimestamp," "uint256 endTimestamp" ")" ); bytes32 public constant PAYMENT_TOKEN_INFO_TYPEHASH = keccak256( "PaymentTokenInfo(" "address paymentToken," "uint256 paymentDecimals," "uint256 paymentRate" ")" ); bytes32 public constant TIMEFRAME_TYPEHASH = keccak256( "Timeframe(" "uint256 startTimestamp," "uint256 endTimestamp" ")" ); uint256 public constant SIGNATURE_LENGTH = 65; uint256 public constant TOKEN_DECIMALS_MAX = 18; uint256 public immutable factoryImplementationType; // solhint-disable-line immutable-vars-naming // https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-immutable // slither-disable-next-line immutable-states string public factoryName; // slither-disable-next-line immutable-states string public factoryVersion; address public implementationAddress; mapping(bytes32 => DeployInfo) private _deployments; /** * @notice The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator */ constructor(string memory name, string memory version, uint256 implementationType) EIP712(name, version) { _setRoleAdmin(BACKOFFICE_ROLE_ADMIN_ROLE, BACKOFFICE_ROLE_ADMIN_ROLE); _setRoleAdmin(BACKOFFICE_GOVERNANCE_ROLE, BACKOFFICE_ROLE_ADMIN_ROLE); _setRoleAdmin(BACKOFFICE_CONTRACT_ADMIN_ROLE, BACKOFFICE_ROLE_ADMIN_ROLE); _grantRole(BACKOFFICE_ROLE_ADMIN_ROLE, msg.sender); _grantRole(BACKOFFICE_GOVERNANCE_ROLE, msg.sender); _grantRole(BACKOFFICE_CONTRACT_ADMIN_ROLE, msg.sender); factoryName = name; factoryVersion = version; factoryImplementationType = implementationType; } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function deployWithTypedSignature( bytes32 deployId, string memory deployName, DeployConfig memory deployConfig, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe memory timeframe, bytes memory signature ) external virtual override whenNotPaused onlyRole(BACKOFFICE_CONTRACT_ADMIN_ROLE) { _deployWithTypedSignature( deployId, deployName, deployConfig, paymentTokensInfo, timeframe, msg.sender, signature ); } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function pauseContract() external virtual override onlyRole(BACKOFFICE_CONTRACT_ADMIN_ROLE) { _pause(); } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function setImplementationAddress( address newImplementation ) external virtual override onlyRole(BACKOFFICE_GOVERNANCE_ROLE) { require(newImplementation != address(0), "LCFD: new implementation"); address oldImplementation = implementationAddress; implementationAddress = newImplementation; emit ImplementationAddressChanged(oldImplementation, newImplementation, msg.sender); uint256 implementationType = IFactoryImplementation(newImplementation).factoryImplementationType(); require(implementationType == factoryImplementationType, "LCFD: implementation type"); } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function unpauseContract() external virtual override onlyRole(BACKOFFICE_CONTRACT_ADMIN_ROLE) { _unpause(); } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function deployInfoFor( bytes32 deployId ) external view virtual override returns (address implementation, address deployedContract) { require(_deployments[deployId].isInitialized, "LCFD: uninitialized"); implementation = _deployments[deployId].implementationAddress; deployedContract = _deployments[deployId].deployedAddress; } /** * @inheritdoc ILaunchpadCrowdsaleFactoryDefault */ function recoverTypedSignature( address implementation, bytes32 deployId, string memory deployName, DeployConfig memory deployConfig, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe memory timeframe, address backofficeAdminAddress, bytes memory signature ) external view virtual override returns (address recovered) { LaunchpadCrowdsaleDefaultStruct memory crowdsaleStruct = LaunchpadCrowdsaleDefaultStruct({ implementationAddress: implementation, deployId: deployId, deployName: deployName, tokenWeiCap: deployConfig.tokenWeiCap, lotWeiSize: deployConfig.weiLotSize, paymentTokensInfo: paymentTokensInfo, requireNonEvmAddress: deployConfig.requireNonEvmAddress, allowNativePaymentToken: deployConfig.allowNativePaymentToken, timeframe: timeframe, backofficeAdminAddress: backofficeAdminAddress }); recovered = _recoverTypedSignature(crowdsaleStruct, signature); } /** * @dev Deploy contract based on given typed signature * @param deployId The deploy identifier * @param deployName The deployment name * @param deployConfig The deploy config * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of tokens acceptable for payment * @param timeframe Crowdsale opening and closing times * @param backofficeAdminAddress The backoffice admin address that will be set for deploy contract * @param signature The typed signature must be from an authorized signer before contract is deployed */ function _deployWithTypedSignature( bytes32 deployId, string memory deployName, DeployConfig memory deployConfig, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe memory timeframe, address backofficeAdminAddress, bytes memory signature ) internal virtual { require(!_deployments[deployId].isInitialized, "LCFD: exists"); LaunchpadCrowdsaleDefaultStruct memory crowdsaleStruct = LaunchpadCrowdsaleDefaultStruct({ implementationAddress: implementationAddress, deployId: deployId, deployName: deployName, tokenWeiCap: deployConfig.tokenWeiCap, lotWeiSize: deployConfig.weiLotSize, paymentTokensInfo: paymentTokensInfo, requireNonEvmAddress: deployConfig.requireNonEvmAddress, allowNativePaymentToken: deployConfig.allowNativePaymentToken, timeframe: timeframe, backofficeAdminAddress: backofficeAdminAddress }); address recovered = _recoverTypedSignature(crowdsaleStruct, signature); require(msg.sender == recovered, "LCFD: sender"); bytes memory saltdata = _encodeSaltData(deployId); bytes32 salt = keccak256(saltdata); address deployedAddress = implementationAddress.cloneDeterministic(salt); require(deployedAddress != address(0), "LCFD: deployed address"); _deployments[deployId] = DeployInfo({ implementationAddress: implementationAddress, deployedAddress: deployedAddress, isInitialized: true }); bytes memory initializeData = _encodeInitializeData( deployConfig.tokenWeiCap, deployConfig.weiLotSize, paymentTokensInfo, deployConfig.requireNonEvmAddress, deployConfig.allowNativePaymentToken, timeframe, backofficeAdminAddress ); emit ContractDeployed( deployedAddress, deployId, deployName, deployConfig, paymentTokensInfo, timeframe, backofficeAdminAddress, recovered, implementationAddress ); // https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return // slither-disable-next-line unused-return deployedAddress.functionCall(initializeData); } /** * @dev Returns signer of given typed signature * @param crowdsaleStruct The crowdsale message structure * @param signature The typed signature is verified to be from an authorized signer before contract is deployed * @return recovered The signer address */ function _recoverTypedSignature( LaunchpadCrowdsaleDefaultStruct memory crowdsaleStruct, bytes memory signature ) internal view virtual returns (address recovered) { require(crowdsaleStruct.implementationAddress != address(0), "LCFD: implementation"); require(bytes(crowdsaleStruct.deployName).length > 0, "LCFD: name"); require(crowdsaleStruct.tokenWeiCap > 0, "LCFD: token cap"); require(crowdsaleStruct.lotWeiSize > 0, "LCFD: lot size"); require(crowdsaleStruct.paymentTokensInfo.length > 0, "LCFD: zero payment tokens"); require(crowdsaleStruct.timeframe.startTimestamp > block.timestamp, "LCFD: start timestamp"); require( crowdsaleStruct.timeframe.endTimestamp > crowdsaleStruct.timeframe.startTimestamp, "LCFD: end timestamp" ); require(crowdsaleStruct.backofficeAdminAddress != address(0), "LCFD: backoffice admin"); require(signature.length == SIGNATURE_LENGTH, "LCFD: signature"); bytes32 digest = _hashTypedDataV4( keccak256(_encodeLaunchpadCrowdsaleDefaultStruct(crowdsaleStruct)) ); recovered = digest.recover(signature); require(recovered != address(0), "LCFD: recovered"); } /** * @dev Returns encoded initialization data for deploy contract * @param tokenWeiCap Max wei amount of tokens to be sold * @param weiLotSize Lot size in wei * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of tokens acceptable for payment * @param isNonEvmAddressRequired True if require non-EVM address to participate in crowdsale * @param allowNativeTokenPayment True if native token is allowed for payment * @param timeframe Crowdsale opening and closing times * @param backofficeAdminAddress The backoffice admin address that will be set for deploy contract * @return encodedData The encoded initialization data for deploy contract */ function _encodeInitializeData( uint256 tokenWeiCap, uint256 weiLotSize, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, bool isNonEvmAddressRequired, bool allowNativeTokenPayment, ITimedCrowdsaleHelper.Timeframe memory timeframe, address backofficeAdminAddress ) internal pure virtual returns (bytes memory encodedData) { encodedData = abi.encodeWithSignature( "initialize(uint256,uint256,(address,uint256,uint256)[],bool,bool,(uint256,uint256),address)", tokenWeiCap, weiLotSize, paymentTokensInfo, isNonEvmAddressRequired, allowNativeTokenPayment, timeframe, backofficeAdminAddress ); } /** * @dev Returns encoded crowdsale message structure for deploy contract * @param crowdsaleStruct Crowdsale message structure * @return encodedData The encoded crowdsale message structure for deploy contract */ function _encodeLaunchpadCrowdsaleDefaultStruct(LaunchpadCrowdsaleDefaultStruct memory crowdsaleStruct) internal pure virtual returns (bytes memory encodedData) { bytes32[] memory encodedPaymentTokensInfo = new bytes32[](crowdsaleStruct.paymentTokensInfo.length); for (uint256 i = 0; i < crowdsaleStruct.paymentTokensInfo.length; i++) { encodedPaymentTokensInfo[i] = keccak256(_encodePaymentTokenInfo(crowdsaleStruct.paymentTokensInfo[i])); } bytes memory encodeTimeframe = _encodeTimeframe(crowdsaleStruct.timeframe); encodedData = abi.encode( LAUNCHPAD_CROWDSALE_DEFAULT_TYPEHASH, crowdsaleStruct.implementationAddress, crowdsaleStruct.deployId, keccak256(bytes(crowdsaleStruct.deployName)), crowdsaleStruct.tokenWeiCap, crowdsaleStruct.lotWeiSize, keccak256(abi.encodePacked(encodedPaymentTokensInfo)), crowdsaleStruct.requireNonEvmAddress, crowdsaleStruct.allowNativePaymentToken, keccak256(encodeTimeframe), crowdsaleStruct.backofficeAdminAddress ); } /** * @dev Returns encoded payment token info data for deploy contract * @param paymentTokenInfo Payment token info data * @return encodedData The encoded payment token info data for deploy contract */ function _encodePaymentTokenInfo(ICrowdsale.PaymentTokenInfo memory paymentTokenInfo) internal pure virtual returns (bytes memory encodedData) { encodedData = abi.encode( PAYMENT_TOKEN_INFO_TYPEHASH, paymentTokenInfo.paymentToken, paymentTokenInfo.paymentDecimals, paymentTokenInfo.paymentRate ); } /** * @dev Returns encoded salt data for deploy contract * @param deployId The deploy identifier * @return encodedData The encoded salt data for deploy contract */ function _encodeSaltData(bytes32 deployId) internal pure virtual returns (bytes memory encodedData) { encodedData = abi.encodeWithSignature("salt(bytes32)", deployId); } /** * @dev Returns encoded timeframe data for deploy contract * @param timeframe Timeframe data * @return encodedData The encoded timeframe data for deploy contract */ function _encodeTimeframe(ITimedCrowdsaleHelper.Timeframe memory timeframe) internal pure virtual returns (bytes memory encodedData) { encodedData = abi.encode( TIMEFRAME_TYPEHASH, timeframe.startTimestamp, timeframe.endTimestamp ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.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: * * ```solidity * 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}: * * ```solidity * 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. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) pragma solidity ^0.8.0; interface IERC5267 { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt ) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library 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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.8; import "./ECDSA.sol"; import "../ShortStrings.sol"; import "../../interfaces/IERC5267.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * _Available since v3.4._ * * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment */ abstract contract EIP712 is IERC5267 { using ShortStrings for *; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _cachedDomainSeparator; uint256 private immutable _cachedChainId; address private immutable _cachedThis; bytes32 private immutable _hashedName; bytes32 private immutable _hashedVersion; ShortString private immutable _name; ShortString private immutable _version; string private _nameFallback; string private _versionFallback; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { _name = name.toShortStringWithFallback(_nameFallback); _version = version.toShortStringWithFallback(_versionFallback); _hashedName = keccak256(bytes(name)); _hashedVersion = keccak256(bytes(version)); _cachedChainId = block.chainid; _cachedDomainSeparator = _buildDomainSeparator(); _cachedThis = address(this); } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _cachedThis && block.chainid == _cachedChainId) { return _cachedDomainSeparator; } else { return _buildDomainSeparator(); } } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {EIP-5267}. * * _Available since v4.9._ */ function eip712Domain() public view virtual override returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { return ( hex"0f", // 01111 _name.toStringWithFallback(_nameFallback), _version.toStringWithFallback(_versionFallback), block.chainid, address(this), bytes32(0), new uint256[](0) ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol) pragma solidity ^0.8.8; import "./StorageSlot.sol"; // | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | // | length | 0x BB | type ShortString is bytes32; /** * @dev This library provides functions to convert short memory strings * into a `ShortString` type that can be used as an immutable variable. * * Strings of arbitrary length can be optimized using this library if * they are short enough (up to 31 bytes) by packing them with their * length (1 byte) in a single EVM word (32 bytes). Additionally, a * fallback mechanism can be used for every other case. * * Usage example: * * ```solidity * contract Named { * using ShortStrings for *; * * ShortString private immutable _name; * string private _nameFallback; * * constructor(string memory contractName) { * _name = contractName.toShortStringWithFallback(_nameFallback); * } * * function name() external view returns (string memory) { * return _name.toStringWithFallback(_nameFallback); * } * } * ``` */ library ShortStrings { // Used as an identifier for strings longer than 31 bytes. bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; error StringTooLong(string str); error InvalidShortString(); /** * @dev Encode a string of at most 31 chars into a `ShortString`. * * This will trigger a `StringTooLong` error is the input string is too long. */ function toShortString(string memory str) internal pure returns (ShortString) { bytes memory bstr = bytes(str); if (bstr.length > 31) { revert StringTooLong(str); } return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); } /** * @dev Decode a `ShortString` back to a "normal" string. */ function toString(ShortString sstr) internal pure returns (string memory) { uint256 len = byteLength(sstr); // using `new string(len)` would work locally but is not memory safe. string memory str = new string(32); /// @solidity memory-safe-assembly assembly { mstore(str, len) mstore(add(str, 0x20), sstr) } return str; } /** * @dev Return the length of a `ShortString`. */ function byteLength(ShortString sstr) internal pure returns (uint256) { uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; if (result > 31) { revert InvalidShortString(); } return result; } /** * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. */ function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { if (bytes(value).length < 32) { return toShortString(value); } else { StorageSlot.getStringSlot(store).value = value; return ShortString.wrap(_FALLBACK_SENTINEL); } } /** * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. */ function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return toString(value); } else { return store; } } /** * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}. * * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. */ function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return byteLength(value); } else { return bytes(store).length; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {IAdminPrivileges} from "./interfaces/IAdminPrivileges.sol"; /** * @title AdminPrivileges * @author Tim Loh * @notice Provides admin privileges role definitions that are inherited by other contracts */ contract AdminPrivileges is AccessControl, IAdminPrivileges { bytes32 public constant BACKOFFICE_ROLE_ADMIN_ROLE = keccak256("BACKOFFICE_ROLE_ADMIN_ROLE"); bytes32 public constant BACKOFFICE_GOVERNANCE_ROLE = keccak256("BACKOFFICE_GOVERNANCE_ROLE"); bytes32 public constant BACKOFFICE_CONTRACT_ADMIN_ROLE = keccak256("BACKOFFICE_CONTRACT_ADMIN_ROLE"); bytes32 public constant TENANT_ROLE_ADMIN_ROLE = keccak256("TENANT_ROLE_ADMIN_ROLE"); bytes32 public constant TENANT_GOVERNANCE_ROLE = keccak256("TENANT_GOVERNANCE_ROLE"); bytes32 public constant TENANT_CONTRACT_ADMIN_ROLE = keccak256("TENANT_CONTRACT_ADMIN_ROLE"); }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; /** * @title AdminPrivileges Interface * @author Tim Loh * @notice Interface for admin privileges role definitions that are inherited by other contracts */ interface IAdminPrivileges { // solhint-disable func-name-mixedcase // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function BACKOFFICE_ROLE_ADMIN_ROLE() external view returns (bytes32); // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function BACKOFFICE_GOVERNANCE_ROLE() external view returns (bytes32); // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function BACKOFFICE_CONTRACT_ADMIN_ROLE() external view returns (bytes32); // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function TENANT_ROLE_ADMIN_ROLE() external view returns (bytes32); // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function TENANT_GOVERNANCE_ROLE() external view returns (bytes32); // https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions // slither-disable-next-line naming-convention function TENANT_CONTRACT_ADMIN_ROLE() external view returns (bytes32); // solhint-enable func-name-mixedcase }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; /** * @title AdminWallet Interface * @author Tim Loh * @notice Interface for admin wallet that will receive the funds */ interface IAdminWallet { /** * @notice Emitted when admin wallet has been changed from `oldWallet` to `newWallet` * @param oldWallet The wallet before the wallet was changed * @param newWallet The wallet after the wallet was changed * @param sender The address that changes the admin wallet */ event AdminWalletChanged(address indexed oldWallet, address indexed newWallet, address indexed sender); /** * @notice Returns the admin wallet address that will receive the funds * @return Admin wallet address */ function adminWallet() external view returns (address); }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; import {IAdminWallet} from "./IAdminWallet.sol"; /** * @title ICrowdsale * @author Tim Loh */ interface ICrowdsale is IAdminWallet { struct PaymentTokenInfo { address paymentToken; uint256 paymentDecimals; uint256 paymentRate; } /** * @notice Emitted when tokens have been purchased * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param paymentToken address of ERC20 token used for payment, * 0x0000000000000000000000000000000000000000 for native token * @param paymentWeiAmount weis paid for purchase * @param purchasedWeiAmount weis of crowdsale tokens purchased * @param nonEvmAddress recipient address on non-EVM blockchain */ event CrowdsaleTokensPurchased( address indexed purchaser, address indexed beneficiary, address indexed paymentToken, uint256 paymentWeiAmount, uint256 purchasedWeiAmount, string nonEvmAddress ); /** * @return `true` if native payment token is allowed */ function allowNativePaymentToken() external view returns (bool); /** * @return The wei amount of crowdsale tokens sold */ function crowdsaleTokensWeiSold() external view returns (uint256); /** * @return tokenList the payment tokens, 0x0000000000000000000000000000000000000000 for native token */ function getPaymentTokenAddresses() external view returns (address[] memory tokenList); /** * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @return isPaymentToken_ `true` if token is accepted for payment */ function isPaymentToken(address paymentToken) external view returns (bool isPaymentToken_); /** * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @return decimals how many decimals for payment token */ function paymentDecimalsFor(address paymentToken) external view returns (uint256 decimals); /** * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @return rate_ how many weis one token costs for specified payment token */ function paymentRateFor(address paymentToken) external view returns (uint256 rate_); /** * @notice Get wei amount of payment tokens required to purchase specified wei amount of crowdsale tokens. * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @param purchaseWeiAmount Number of crowdsale tokens being sold in wei * @return paymentWeiAmount Amount in wei of payment token */ function paymentWeiAmountFor( address paymentToken, uint256 purchaseWeiAmount ) external view returns (uint256 paymentWeiAmount); /** * @notice Get wei amount of crowdsale tokens being sold for specified wei amount of payment tokens. * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @param paymentWeiAmount Amount in wei of payment token * @return purchaseWeiAmount Number of crowdsale tokens being sold in wei */ function purchaseWeiAmountFor(address paymentToken, uint256 paymentWeiAmount) external view returns (uint256 purchaseWeiAmount); /** * @return `true` if require non-EVM address to participate in crowdsale */ function requireNonEvmAddress() external view returns (bool); /** * @param paymentToken ERC20 payment token address, 0x0000000000000000000000000000000000000000 for native token * @return weiRaised_ the amount of wei raised */ function weiRaisedFor(address paymentToken) external view returns (uint256 weiRaised_); }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; /** * @title IFactoryImplementation * @author Tim Loh * @notice Provides factory implementation type that is inherited by reference implementation contracts for matching * with corresponding factory contracts */ interface IFactoryImplementation { function factoryImplementationType() external view returns (uint256); }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {IAdminPrivileges} from "./IAdminPrivileges.sol"; import {ICrowdsale} from "./ICrowdsale.sol"; import {IFactoryImplementation} from "./IFactoryImplementation.sol"; import {ITimedCrowdsaleHelper} from "./ITimedCrowdsaleHelper.sol"; /** * @title ILaunchpadCrowdsaleFactoryDefault * @author Tim Loh * @notice Launchpad crowdsale factory interface for deploying launchpad crowdsale contracts based on implementation */ interface ILaunchpadCrowdsaleFactoryDefault is IAccessControl, IAdminPrivileges, IFactoryImplementation { struct DeployConfig { uint256 tokenWeiCap; uint256 weiLotSize; bool requireNonEvmAddress; bool allowNativePaymentToken; } /** * @notice Emitted when contract has been successfully deployed * @param deployedAddress The address of the deployed contract * @param deployId The deployment identifier * @param deployName The deployment name * @param deployConfig The deploy config * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of tokens acceptable for payment * @param timeframe Crowdsale opening and closing times * @param backofficeAdminAddress The backoffice admin address that is set for deploy contract * @param signer The signer address corresponding to the given signature * @param implementationAddress The reference contract implementation address */ event ContractDeployed( address indexed deployedAddress, bytes32 indexed deployId, string deployName, DeployConfig deployConfig, ICrowdsale.PaymentTokenInfo[] paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe timeframe, address backofficeAdminAddress, address signer, address implementationAddress ); /** * @notice Emitted when implementation address has been changed from `oldImplementation` to `newImplementation` * @param oldImplementation The implementation address before the change * @param newImplementation The implementation address after the change * @param sender The address that changes the implementation address */ event ImplementationAddressChanged( address indexed oldImplementation, address indexed newImplementation, address indexed sender ); /** * @notice Deploy contract based on given typed signature * @param deployId The deploy identifier * @param deployName The deployment name * @param deployConfig The deploy config * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of tokens acceptable for payment * @param timeframe Crowdsale opening and closing times * @param signature The typed signature must be from an authorized signer before contract is deployed */ function deployWithTypedSignature( bytes32 deployId, string memory deployName, DeployConfig memory deployConfig, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe memory timeframe, bytes memory signature ) external; /** * @notice Pause user functions (deploy) * @dev Must be called by backoffice contract admin role */ function pauseContract() external; /** * @notice Change implementation to a new address * @dev Must be called by backoffice governance role * @param newImplementation The new implementation address */ function setImplementationAddress(address newImplementation) external; /** * @notice Unpause user functions (deploy) * @dev Must be called by backoffice contract admin role */ function unpauseContract() external; /** * @notice Returns deployment info for given deploy identifier * @param deployId The deploy identifier * @return implementation The reference contract implementation address * @return deployedContract The deployed contract address */ function deployInfoFor(bytes32 deployId) external view returns (address implementation, address deployedContract); /** * @notice Get factory name * @return Returns factory name */ function factoryName() external view returns (string memory); /** * @notice Get factory version * @return Returns factory version */ function factoryVersion() external view returns (string memory); /** * @notice Get reference implementation contract address * @return Returns reference implementation contract address */ function implementationAddress() external view returns (address); /** * @notice Returns signer of given typed signature * @param implementation The reference contract implementation address * @param deployId The deploy identifier * @param deployName The deployment name * @param deployConfig The deploy config * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of tokens acceptable for payment * @param timeframe Crowdsale opening and closing times * @param backofficeAdminAddress The backoffice admin address that will be set for deploy contract * @param signature The typed signature is verified to be from an authorized signer before contract is deployed * @return recovered The signer address */ function recoverTypedSignature( address implementation, bytes32 deployId, string memory deployName, DeployConfig memory deployConfig, ICrowdsale.PaymentTokenInfo[] memory paymentTokensInfo, ITimedCrowdsaleHelper.Timeframe memory timeframe, address backofficeAdminAddress, bytes memory signature ) external view returns (address recovered); }
// SPDX-License-Identifier: Apache-2.0 // Copyright 2023 Enjinstarter pragma solidity 0.8.19; /** * @title ITimedCrowdsaleHelper * @author Tim Loh */ interface ITimedCrowdsaleHelper { struct Timeframe { uint256 startTimestamp; uint256 endTimestamp; } /** * @notice Emitted when crowdsale window has been cancelled * @param sender The address that cancelled the crowdsale * @param cancelledStartTimestamp Timestamp in seconds when cancelled refund window will start * @param cancelledEndTimestamp Timestamp in seconds when cancelled refund window will end */ event CrowdsaleWindowCancelled( address indexed sender, uint256 cancelledStartTimestamp, uint256 cancelledEndTimestamp ); /** * @notice Emitted when crowdsale window has been extended * @param sender The address that extended the crowdsale window * @param newEndTimestamp Timestamp in seconds when crowdsale window will end after extension * @param oldEndTimestamp Timestamp in seconds when crowdsale window will end before extension */ event CrowdsaleWindowExtended( address indexed sender, uint256 newEndTimestamp, uint256 oldEndTimestamp ); /** * @notice Emitted when crowdsale window has been set * @param sender The address that set the crowdsale window * @param startTimestamp Timestamp in seconds when crowdsale window will start after set * @param endTimestamp Timestamp in seconds when crowdsale window will end after set * @param oldStartTimestamp Timestamp when crowdsale window will start before set * @param oldEndTimestamp Timestamp when crowdsale window will end before set */ event CrowdsaleWindowSet( address indexed sender, uint256 startTimestamp, uint256 endTimestamp, uint256 oldStartTimestamp, uint256 oldEndTimestamp ); /** * @notice Get crowdsale window * @return startTimestamp The start timestamp of crowdsale window * @return endTimestamp The end timestamp of crowdsale window */ function getCrowdsaleWindow() external view returns (uint256 startTimestamp, uint256 endTimestamp); /** * @notice Checks whether the period in which the crowdsale is open has already elapsed. * @return hasAlreadyClosed `true` if crowdsale period has elapsed */ function hasCrowdsaleWindowAlreadyClosed() external view returns (bool hasAlreadyClosed); /** * @notice Check whether crowdsale window has already started now * @return hasStarted `true` if crowdsale window already started now */ function hasCrowdsaleWindowAlreadyStarted() external view returns (bool hasStarted); /** * @notice Check whether crowdsale window has been defined * @return isDefined `true` if crowdsale window has been defined */ function isCrowdsaleWindowDefined() external view returns (bool isDefined); /** * @notice Check whether crowdsale window is open now * @return isOpen `true` if crowdsale window is open now */ function isCrowdsaleWindowOpenNow() external view returns (bool isOpen); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"implementationType","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployedAddress","type":"address"},{"indexed":true,"internalType":"bytes32","name":"deployId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"deployName","type":"string"},{"components":[{"internalType":"uint256","name":"tokenWeiCap","type":"uint256"},{"internalType":"uint256","name":"weiLotSize","type":"uint256"},{"internalType":"bool","name":"requireNonEvmAddress","type":"bool"},{"internalType":"bool","name":"allowNativePaymentToken","type":"bool"}],"indexed":false,"internalType":"struct ILaunchpadCrowdsaleFactoryDefault.DeployConfig","name":"deployConfig","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentDecimals","type":"uint256"},{"internalType":"uint256","name":"paymentRate","type":"uint256"}],"indexed":false,"internalType":"struct ICrowdsale.PaymentTokenInfo[]","name":"paymentTokensInfo","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"indexed":false,"internalType":"struct ITimedCrowdsaleHelper.Timeframe","name":"timeframe","type":"tuple"},{"indexed":false,"internalType":"address","name":"backofficeAdminAddress","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"address","name":"implementationAddress","type":"address"}],"name":"ContractDeployed","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ImplementationAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BACKOFFICE_CONTRACT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BACKOFFICE_GOVERNANCE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BACKOFFICE_ROLE_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LAUNCHPAD_CROWDSALE_DEFAULT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYMENT_TOKEN_INFO_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNATURE_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TENANT_CONTRACT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TENANT_GOVERNANCE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TENANT_ROLE_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMEFRAME_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_DECIMALS_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"deployId","type":"bytes32"}],"name":"deployInfoFor","outputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"address","name":"deployedContract","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"deployId","type":"bytes32"},{"internalType":"string","name":"deployName","type":"string"},{"components":[{"internalType":"uint256","name":"tokenWeiCap","type":"uint256"},{"internalType":"uint256","name":"weiLotSize","type":"uint256"},{"internalType":"bool","name":"requireNonEvmAddress","type":"bool"},{"internalType":"bool","name":"allowNativePaymentToken","type":"bool"}],"internalType":"struct ILaunchpadCrowdsaleFactoryDefault.DeployConfig","name":"deployConfig","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentDecimals","type":"uint256"},{"internalType":"uint256","name":"paymentRate","type":"uint256"}],"internalType":"struct ICrowdsale.PaymentTokenInfo[]","name":"paymentTokensInfo","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"internalType":"struct ITimedCrowdsaleHelper.Timeframe","name":"timeframe","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"deployWithTypedSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryImplementationType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"bytes32","name":"deployId","type":"bytes32"},{"internalType":"string","name":"deployName","type":"string"},{"components":[{"internalType":"uint256","name":"tokenWeiCap","type":"uint256"},{"internalType":"uint256","name":"weiLotSize","type":"uint256"},{"internalType":"bool","name":"requireNonEvmAddress","type":"bool"},{"internalType":"bool","name":"allowNativePaymentToken","type":"bool"}],"internalType":"struct ILaunchpadCrowdsaleFactoryDefault.DeployConfig","name":"deployConfig","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentDecimals","type":"uint256"},{"internalType":"uint256","name":"paymentRate","type":"uint256"}],"internalType":"struct ICrowdsale.PaymentTokenInfo[]","name":"paymentTokensInfo","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"internalType":"struct ITimedCrowdsaleHelper.Timeframe","name":"timeframe","type":"tuple"},{"internalType":"address","name":"backofficeAdminAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"recoverTypedSignature","outputs":[{"internalType":"address","name":"recovered","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"setImplementationAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101806040523480156200001257600080fd5b5060405162002f7838038062002f7883398101604081905262000035916200041f565b828262000044826001620001e1565b6101205262000055816002620001e1565b61014052815160208084019190912060e052815190820120610100524660a052620000e360e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526003805460ff191690556200011160008051602062002f58833981519152806200021a565b6200013b60008051602062002f3883398151915260008051602062002f588339815191526200021a565b6200016560008051602062002f1883398151915260008051602062002f588339815191526200021a565b6200018060008051602062002f588339815191523362000265565b6200019b60008051602062002f388339815191523362000265565b620001b660008051602062002f188339815191523362000265565b6004620001c4848262000521565b506005620001d3838262000521565b506101605250620006479050565b60006020835110156200020157620001f98362000306565b905062000214565b816200020e848262000521565b5060ff90505b92915050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000302576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002c13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080829050601f815111156200033d578260405163305a27a960e01b8152600401620003349190620005ed565b60405180910390fd5b80516200034a8262000622565b179392505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620003855781810151838201526020016200036b565b50506000910152565b600082601f830112620003a057600080fd5b81516001600160401b0380821115620003bd57620003bd62000352565b604051601f8301601f19908116603f01168101908282118183101715620003e857620003e862000352565b816040528381528660208588010111156200040257600080fd5b6200041584602083016020890162000368565b9695505050505050565b6000806000606084860312156200043557600080fd5b83516001600160401b03808211156200044d57600080fd5b6200045b878388016200038e565b945060208601519150808211156200047257600080fd5b5062000481868287016200038e565b925050604084015190509250925092565b600181811c90821680620004a757607f821691505b602082108103620004c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200051c57600081815260208120601f850160051c81016020861015620004f75750805b601f850160051c820191505b81811015620005185782815560010162000503565b5050505b505050565b81516001600160401b038111156200053d576200053d62000352565b62000555816200054e845462000492565b84620004ce565b602080601f8311600181146200058d5760008415620005745750858301515b600019600386901b1c1916600185901b17855562000518565b600085815260208120601f198616915b82811015620005be578886015182559484019460019091019084016200059d565b5085821015620005dd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600082518060208401526200060e81604085016020870162000368565b601f01601f19169190910160400192915050565b80516020808301519190811015620004c85760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161016051612864620006b4600039600081816104da0152610a160152600061078b0152600061076001526000611c1401526000611bec01526000611b4701526000611b7101526000611b9b01526128646000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806384b0196e11610104578063bedecd4a116100a2578063ea8b8e9011610071578063ea8b8e9014610474578063eba94ba01461049b578063ecade2f0146104c2578063fb872e19146104d557600080fd5b8063bedecd4a1461041f578063d413048614610446578063d547741f1461044e578063d7f2e8141461046157600080fd5b8063991224fc116100de578063991224fc146103dc578063a217fddf146103e4578063b33712c5146103ec578063b97a2319146103f457600080fd5b806384b0196e1461039957806391d14854146103b457806398a389b4146103c757600080fd5b8063439766ce1161017c5780634ef7086b1161014b5780634ef7086b14610338578063540bc5ea1461035f578063557e6a6f146103675780635c975abb1461038e57600080fd5b8063439766ce146102cd578063462ebf44146102d55780634d5483f7146102fc5780634ef4e3871461032357600080fd5b8063248a9ca3116101b8578063248a9ca31461024f57806326a1f5cc146102805780632f2ff15d146102a757806336568abe146102ba57600080fd5b806301ffc9a7146101df5780630d8ccb551461020757806319218ace1461023a575b600080fd5b6101f26101ed366004611f60565b6104fc565b60405190151581526020015b60405180910390f35b61021a610215366004611f8a565b610533565b604080516001600160a01b039384168152929091166020830152016101fe565b61024d610248366004612227565b6105c1565b005b61027261025d366004611f8a565b60009081526020819052604090206001015490565b6040519081526020016101fe565b6102727f85485e0579110e3a8651ecc622c4a4de1af035fb88034e30905cf67a60881bfd81565b61024d6102b53660046122dd565b6105f9565b61024d6102c83660046122dd565b610623565b61024d6106a1565b6102727f96569a1fadb2d4dcc763ecf02934e5ddc4e41d9d5f44b6b99af57748b38b505881565b6102727ff8161834715015778c7aed8f29a8cd0fed724b5b07436fdb75cdf1fcf5ac93f681565b61032b6106c4565b6040516101fe9190612359565b6102727fb58f543c34fc3c79e1c358174f46808f77878cdc5ca730c4617cdbe574382eb681565b610272604181565b6102727fcea2d3b663a88375a8539d786beb27f447c15cdc6dc04c4db285400be066715781565b60035460ff166101f2565b6103a1610752565b6040516101fe979695949392919061236c565b6101f26103c23660046122dd565b6107db565b61027260008051602061280f83398151915281565b610272601281565b610272600081565b61024d610804565b600654610407906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b6102727f52bbfa6e876ba7eadc80dc9b099c193c6daea0056635c463ce4d9723fa6d773381565b61032b610824565b61024d61045c3660046122dd565b610831565b61040761046f366004612402565b610856565b6102727f435a04d640f7f2be6734e32e02dcef88b2828e3e7297d72cf5d2cfd3667c649381565b6102727f07258f049a6ded7f9eee4348cd5f072dca4852fa78e9604f2468ddeaa723e58881565b61024d6104d03660046124dc565b6108df565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b60006001600160e01b03198216637965db0b60e01b148061052d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000818152600760205260408120600101548190600160a01b900460ff166105985760405162461bcd60e51b81526020600482015260136024820152721310d1910e881d5b9a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b5050600090815260076020526040902080546001909101546001600160a01b0391821692911690565b6105c9610a89565b60008051602061280f8339815191526105e181610ad1565b6105f087878787873388610adb565b50505050505050565b60008281526020819052604090206001015461061481610ad1565b61061e8383610df1565b505050565b6001600160a01b03811633146106935760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161058f565b61069d8282610e75565b5050565b60008051602061280f8339815191526106b981610ad1565b6106c1610eda565b50565b600480546106d1906124f7565b80601f01602080910402602001604051908101604052809291908181526020018280546106fd906124f7565b801561074a5780601f1061071f5761010080835404028352916020019161074a565b820191906000526020600020905b81548152906001019060200180831161072d57829003601f168201915b505050505081565b6000606080828080836107867f00000000000000000000000000000000000000000000000000000000000000006001610f34565b6107b17f00000000000000000000000000000000000000000000000000000000000000006002610f34565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061280f83398151915261081c81610ad1565b6106c1610fdf565b600580546106d1906124f7565b60008281526020819052604090206001015461084c81610ad1565b61061e8383610e75565b6000806040518061014001604052808b6001600160a01b031681526020018a81526020018981526020018860000151815260200188602001518152602001878152602001886040015115158152602001886060015115158152602001868152602001856001600160a01b031681525090506108d18184611018565b9a9950505050505050505050565b7f85485e0579110e3a8651ecc622c4a4de1af035fb88034e30905cf67a60881bfd61090981610ad1565b6001600160a01b03821661095f5760405162461bcd60e51b815260206004820152601860248201527f4c4346443a206e657720696d706c656d656e746174696f6e0000000000000000604482015260640161058f565b600680546001600160a01b038481166001600160a01b031983168117909355604051911691339183907f5deda12a73eb2acd7628ea75f435c8cd1d523724c7c0a3cfdfd0174b62924f6090600090a46000836001600160a01b031663fb872e196040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a129190612531565b90507f00000000000000000000000000000000000000000000000000000000000000008114610a835760405162461bcd60e51b815260206004820152601960248201527f4c4346443a20696d706c656d656e746174696f6e207479706500000000000000604482015260640161058f565b50505050565b60035460ff1615610acf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161058f565b565b6106c18133611337565b600087815260076020526040902060010154600160a01b900460ff1615610b335760405162461bcd60e51b815260206004820152600c60248201526b4c4346443a2065786973747360a01b604482015260640161058f565b60408051610140810182526006546001600160a01b03908116825260208083018b90528284018a9052885160608085019190915290890151608084015260a0830188905292880151151560c083015291870151151560e082015261010081018590529083166101208201526000610baa8284611018565b9050336001600160a01b03821614610bf35760405162461bcd60e51b815260206004820152600c60248201526b2621a3221d1039b2b73232b960a11b604482015260640161058f565b6000610bfe8a611390565b8051602082012060065491925090600090610c22906001600160a01b0316836113d5565b90506001600160a01b038116610c735760405162461bcd60e51b81526020600482015260166024820152754c4346443a206465706c6f796564206164647265737360501b604482015260640161058f565b6040518060600160405280600660009054906101000a90046001600160a01b03166001600160a01b03168152602001826001600160a01b0316815260200160011515815250600760008e815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160146101000a81548160ff0219169083151502179055509050506000610d698b600001518c602001518c8e604001518f606001518e8e611472565b90508c826001600160a01b03167f8e71679f2f50203469a969ab4a9fc75a441b222d3cc590d173e2fbf0924a11188e8e8e8e8e8c600660009054906101000a90046001600160a01b0316604051610dc697969594939291906125a4565b60405180910390a3610de16001600160a01b038316826114c7565b5050505050505050505050505050565b610dfb82826107db565b61069d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610e313390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610e7f82826107db565b1561069d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610ee2610a89565b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f173390565b6040516001600160a01b03909116815260200160405180910390a1565b606060ff8314610f4e57610f4783611512565b905061052d565b818054610f5a906124f7565b80601f0160208091040260200160405190810160405280929190818152602001828054610f86906124f7565b8015610fd35780601f10610fa857610100808354040283529160200191610fd3565b820191906000526020600020905b815481529060010190602001808311610fb657829003601f168201915b5050505050905061052d565b610fe7611551565b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610f17565b81516000906001600160a01b03166110695760405162461bcd60e51b81526020600482015260146024820152732621a3221d1034b6b83632b6b2b73a30ba34b7b760611b604482015260640161058f565b6000836040015151116110ab5760405162461bcd60e51b815260206004820152600a6024820152694c4346443a206e616d6560b01b604482015260640161058f565b60008360600151116110f15760405162461bcd60e51b815260206004820152600f60248201526e04c4346443a20746f6b656e2063617608c1b604482015260640161058f565b60008360800151116111365760405162461bcd60e51b815260206004820152600e60248201526d4c4346443a206c6f742073697a6560901b604482015260640161058f565b60008360a00151511161118b5760405162461bcd60e51b815260206004820152601960248201527f4c4346443a207a65726f207061796d656e7420746f6b656e7300000000000000604482015260640161058f565b6101008301515142106111d85760405162461bcd60e51b815260206004820152601560248201527404c4346443a2073746172742074696d657374616d7605c1b604482015260640161058f565b6101008301518051602090910151116112295760405162461bcd60e51b815260206004820152601360248201527204c4346443a20656e642074696d657374616d7606c1b604482015260640161058f565b6101208301516001600160a01b031661127d5760405162461bcd60e51b81526020600482015260166024820152752621a3221d103130b1b5b7b33334b1b29030b236b4b760511b604482015260640161058f565b60418251146112c05760405162461bcd60e51b815260206004820152600f60248201526e4c4346443a207369676e617475726560881b604482015260640161058f565b60006112da6112ce8561159a565b8051906020012061176f565b90506112e6818461179c565b91506001600160a01b0382166113305760405162461bcd60e51b815260206004820152600f60248201526e1310d1910e881c9958dbdd995c9959608a1b604482015260640161058f565b5092915050565b61134182826107db565b61069d5761134e816117c0565b6113598360206117d2565b60405160200161136a929190612644565b60408051601f198184030181529082905262461bcd60e51b825261058f91600401612359565b6060816040516024016113a591815260200190565b60408051601f198184030181529190526020810180516001600160e01b0316638f9caa8960e01b17905292915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661052d5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015260640161058f565b60608787878787878760405160240161149197969594939291906126b9565b60408051601f198184030181529190526020810180516001600160e01b031663138f3d0960e31b17905298975050505050505050565b606061150b838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061196e565b9392505050565b6060600061151f83611a4b565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60035460ff16610acf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161058f565b606060008260a001515167ffffffffffffffff8111156115bc576115bc611fa3565b6040519080825280602002602001820160405280156115e5578160200160208202803683370190505b50905060005b8360a00151518110156116545761161e8460a00151828151811061161157611611612720565b6020026020010151611a73565b8051906020012082828151811061163757611637612720565b60209081029190910101528061164c8161274c565b9150506115eb565b506000611665846101000151611aed565b90507f435a04d640f7f2be6734e32e02dcef88b2828e3e7297d72cf5d2cfd3667c64938460000151856020015186604001518051906020012087606001518860800151876040516020016116b99190612765565b604051602081830303815290604052805190602001208a60c001518b60e0015189805190602001208d61012001516040516020016117579b9a999897969594939291909a8b526001600160a01b03998a1660208c015260408b019890985260608a0196909652608089019490945260a088019290925260c0870152151560e08601521515610100850152610120840152166101408201526101600190565b60405160208183030381529060405292505050919050565b600061052d61177c611b3a565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006117ab8585611c6a565b915091506117b881611caf565b509392505050565b606061052d6001600160a01b03831660145b606060006117e183600261279b565b6117ec9060026127b2565b67ffffffffffffffff81111561180457611804611fa3565b6040519080825280601f01601f19166020018201604052801561182e576020820181803683370190505b509050600360fc1b8160008151811061184957611849612720565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061187857611878612720565b60200101906001600160f81b031916908160001a905350600061189c84600261279b565b6118a79060016127b2565b90505b600181111561191f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118db576118db612720565b1a60f81b8282815181106118f1576118f1612720565b60200101906001600160f81b031916908160001a90535060049490941c93611918816127c5565b90506118aa565b50831561150b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161058f565b6060824710156119cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161058f565b600080866001600160a01b031685876040516119eb91906127dc565b60006040518083038185875af1925050503d8060008114611a28576040519150601f19603f3d011682016040523d82523d6000602084013e611a2d565b606091505b5091509150611a3e87838387611df9565b925050505b949350505050565b600060ff8216601f81111561052d57604051632cd44ac360e21b815260040160405180910390fd5b60607fcea2d3b663a88375a8539d786beb27f447c15cdc6dc04c4db285400be0667157826000015183602001518460400151604051602001611ad794939291909384526001600160a01b039290921660208401526040830152606082015260800190565b6040516020818303038152906040529050919050565b8051602080830151604051606093611ad7937ff8161834715015778c7aed8f29a8cd0fed724b5b07436fdb75cdf1fcf5ac93f6939192019283526020830191909152604082015260600190565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611b9357507f000000000000000000000000000000000000000000000000000000000000000046145b15611bbd57507f000000000000000000000000000000000000000000000000000000000000000090565b611c65604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b6000808251604103611ca05760208301516040840151606085015160001a611c9487828585611e72565b94509450505050611ca8565b506000905060025b9250929050565b6000816004811115611cc357611cc36127f8565b03611ccb5750565b6001816004811115611cdf57611cdf6127f8565b03611d2c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161058f565b6002816004811115611d4057611d406127f8565b03611d8d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161058f565b6003816004811115611da157611da16127f8565b036106c15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161058f565b60608315611e68578251600003611e61576001600160a01b0385163b611e615760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161058f565b5081611a43565b611a438383611f36565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611ea95750600090506003611f2d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611efd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611f2657600060019250925050611f2d565b9150600090505b94509492505050565b815115611f465781518083602001fd5b8060405162461bcd60e51b815260040161058f9190612359565b600060208284031215611f7257600080fd5b81356001600160e01b03198116811461150b57600080fd5b600060208284031215611f9c57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611fdc57611fdc611fa3565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561200b5761200b611fa3565b604052919050565b600082601f83011261202457600080fd5b813567ffffffffffffffff81111561203e5761203e611fa3565b612051601f8201601f1916602001611fe2565b81815284602083860101111561206657600080fd5b816020850160208301376000918101602001919091529392505050565b8035801515811461209357600080fd5b919050565b6000608082840312156120aa57600080fd5b6040516080810181811067ffffffffffffffff821117156120cd576120cd611fa3565b806040525080915082358152602083013560208201526120ef60408401612083565b604082015261210060608401612083565b60608201525092915050565b80356001600160a01b038116811461209357600080fd5b600082601f83011261213457600080fd5b8135602067ffffffffffffffff82111561215057612150611fa3565b61215e818360051b01611fe2565b8281526060928302850182019282820191908785111561217d57600080fd5b8387015b858110156121cb5781818a0312156121995760008081fd5b6121a1611fb9565b6121aa8261210c565b81528186013586820152604080830135908201528452928401928101612181565b5090979650505050505050565b6000604082840312156121ea57600080fd5b6040516040810181811067ffffffffffffffff8211171561220d5761220d611fa3565b604052823581526020928301359281019290925250919050565b600080600080600080610140878903121561224157600080fd5b86359550602087013567ffffffffffffffff8082111561226057600080fd5b61226c8a838b01612013565b965061227b8a60408b01612098565b955060c089013591508082111561229157600080fd5b61229d8a838b01612123565b94506122ac8a60e08b016121d8565b93506101208901359150808211156122c357600080fd5b506122d089828a01612013565b9150509295509295509295565b600080604083850312156122f057600080fd5b823591506123006020840161210c565b90509250929050565b60005b8381101561232457818101518382015260200161230c565b50506000910152565b60008151808452612345816020860160208601612309565b601f01601f19169290920160200192915050565b60208152600061150b602083018461232d565b60ff60f81b881681526000602060e08184015261238c60e084018a61232d565b838103604085015261239e818a61232d565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156123f0578351835292840192918401916001016123d4565b50909c9b505050505050505050505050565b600080600080600080600080610180898b03121561241f57600080fd5b6124288961210c565b975060208901359650604089013567ffffffffffffffff8082111561244c57600080fd5b6124588c838d01612013565b97506124678c60608d01612098565b965060e08b013591508082111561247d57600080fd5b6124898c838d01612123565b95506124998c6101008d016121d8565b94506124a86101408c0161210c565b93506101608b01359150808211156124bf57600080fd5b506124cc8b828c01612013565b9150509295985092959890939650565b6000602082840312156124ee57600080fd5b61150b8261210c565b600181811c9082168061250b57607f821691505b60208210810361252b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561254357600080fd5b5051919050565b600081518084526020808501945080840160005b8381101561259957815180516001600160a01b031688528381015184890152604090810151908801526060909601959082019060010161255e565b509495945050505050565b60006101608083526125b88184018b61232d565b9050885160208401526020890151604084015260408901511515606084015260608901511515608084015282810360a08401526125f5818961254a565b875160c0850152602088015160e0850152915061260f9050565b6001600160a01b0385811661010084015284166101208301526001600160a01b03831661014083015298975050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161267c816017850160208801612309565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516126ad816028840160208801612309565b01602801949350505050565b60006101008983528860208401528060408401526126d98184018961254a565b87151560608501528615156080850152855160a0850152602086015160c085015291506127039050565b6001600160a01b039290921660e091909101529695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161275e5761275e612736565b5060010190565b815160009082906020808601845b8381101561278f57815185529382019390820190600101612773565b50929695505050505050565b808202811582820484141761052d5761052d612736565b8082018082111561052d5761052d612736565b6000816127d4576127d4612736565b506000190190565b600082516127ee818460208701612309565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe1cc585a35ee40bc8e30be46c66514537f1953ad0977428ef905e8e0df71a6ee7a264697066735822122089a19738248dff46c387e68c4438d8fbca2f13116dde2b0e89d8f7af42311c7464736f6c634300081300331cc585a35ee40bc8e30be46c66514537f1953ad0977428ef905e8e0df71a6ee785485e0579110e3a8651ecc622c4a4de1af035fb88034e30905cf67a60881bfdb58f543c34fc3c79e1c358174f46808f77878cdc5ca730c4617cdbe574382eb6000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0a07f0b4ee126afd09bbd8d87840604d43563753e8be9a86560e0409d1d86430800000000000000000000000000000000000000000000000000000000000000194c61756e636870616443726f776473616c6544656661756c74000000000000000000000000000000000000000000000000000000000000000000000000000005302e312e30000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806384b0196e11610104578063bedecd4a116100a2578063ea8b8e9011610071578063ea8b8e9014610474578063eba94ba01461049b578063ecade2f0146104c2578063fb872e19146104d557600080fd5b8063bedecd4a1461041f578063d413048614610446578063d547741f1461044e578063d7f2e8141461046157600080fd5b8063991224fc116100de578063991224fc146103dc578063a217fddf146103e4578063b33712c5146103ec578063b97a2319146103f457600080fd5b806384b0196e1461039957806391d14854146103b457806398a389b4146103c757600080fd5b8063439766ce1161017c5780634ef7086b1161014b5780634ef7086b14610338578063540bc5ea1461035f578063557e6a6f146103675780635c975abb1461038e57600080fd5b8063439766ce146102cd578063462ebf44146102d55780634d5483f7146102fc5780634ef4e3871461032357600080fd5b8063248a9ca3116101b8578063248a9ca31461024f57806326a1f5cc146102805780632f2ff15d146102a757806336568abe146102ba57600080fd5b806301ffc9a7146101df5780630d8ccb551461020757806319218ace1461023a575b600080fd5b6101f26101ed366004611f60565b6104fc565b60405190151581526020015b60405180910390f35b61021a610215366004611f8a565b610533565b604080516001600160a01b039384168152929091166020830152016101fe565b61024d610248366004612227565b6105c1565b005b61027261025d366004611f8a565b60009081526020819052604090206001015490565b6040519081526020016101fe565b6102727f85485e0579110e3a8651ecc622c4a4de1af035fb88034e30905cf67a60881bfd81565b61024d6102b53660046122dd565b6105f9565b61024d6102c83660046122dd565b610623565b61024d6106a1565b6102727f96569a1fadb2d4dcc763ecf02934e5ddc4e41d9d5f44b6b99af57748b38b505881565b6102727ff8161834715015778c7aed8f29a8cd0fed724b5b07436fdb75cdf1fcf5ac93f681565b61032b6106c4565b6040516101fe9190612359565b6102727fb58f543c34fc3c79e1c358174f46808f77878cdc5ca730c4617cdbe574382eb681565b610272604181565b6102727fcea2d3b663a88375a8539d786beb27f447c15cdc6dc04c4db285400be066715781565b60035460ff166101f2565b6103a1610752565b6040516101fe979695949392919061236c565b6101f26103c23660046122dd565b6107db565b61027260008051602061280f83398151915281565b610272601281565b610272600081565b61024d610804565b600654610407906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b6102727f52bbfa6e876ba7eadc80dc9b099c193c6daea0056635c463ce4d9723fa6d773381565b61032b610824565b61024d61045c3660046122dd565b610831565b61040761046f366004612402565b610856565b6102727f435a04d640f7f2be6734e32e02dcef88b2828e3e7297d72cf5d2cfd3667c649381565b6102727f07258f049a6ded7f9eee4348cd5f072dca4852fa78e9604f2468ddeaa723e58881565b61024d6104d03660046124dc565b6108df565b6102727fa07f0b4ee126afd09bbd8d87840604d43563753e8be9a86560e0409d1d86430881565b60006001600160e01b03198216637965db0b60e01b148061052d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000818152600760205260408120600101548190600160a01b900460ff166105985760405162461bcd60e51b81526020600482015260136024820152721310d1910e881d5b9a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b5050600090815260076020526040902080546001909101546001600160a01b0391821692911690565b6105c9610a89565b60008051602061280f8339815191526105e181610ad1565b6105f087878787873388610adb565b50505050505050565b60008281526020819052604090206001015461061481610ad1565b61061e8383610df1565b505050565b6001600160a01b03811633146106935760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161058f565b61069d8282610e75565b5050565b60008051602061280f8339815191526106b981610ad1565b6106c1610eda565b50565b600480546106d1906124f7565b80601f01602080910402602001604051908101604052809291908181526020018280546106fd906124f7565b801561074a5780601f1061071f5761010080835404028352916020019161074a565b820191906000526020600020905b81548152906001019060200180831161072d57829003601f168201915b505050505081565b6000606080828080836107867f4c61756e636870616443726f776473616c6544656661756c74000000000000196001610f34565b6107b17f302e312e300000000000000000000000000000000000000000000000000000056002610f34565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061280f83398151915261081c81610ad1565b6106c1610fdf565b600580546106d1906124f7565b60008281526020819052604090206001015461084c81610ad1565b61061e8383610e75565b6000806040518061014001604052808b6001600160a01b031681526020018a81526020018981526020018860000151815260200188602001518152602001878152602001886040015115158152602001886060015115158152602001868152602001856001600160a01b031681525090506108d18184611018565b9a9950505050505050505050565b7f85485e0579110e3a8651ecc622c4a4de1af035fb88034e30905cf67a60881bfd61090981610ad1565b6001600160a01b03821661095f5760405162461bcd60e51b815260206004820152601860248201527f4c4346443a206e657720696d706c656d656e746174696f6e0000000000000000604482015260640161058f565b600680546001600160a01b038481166001600160a01b031983168117909355604051911691339183907f5deda12a73eb2acd7628ea75f435c8cd1d523724c7c0a3cfdfd0174b62924f6090600090a46000836001600160a01b031663fb872e196040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a129190612531565b90507fa07f0b4ee126afd09bbd8d87840604d43563753e8be9a86560e0409d1d8643088114610a835760405162461bcd60e51b815260206004820152601960248201527f4c4346443a20696d706c656d656e746174696f6e207479706500000000000000604482015260640161058f565b50505050565b60035460ff1615610acf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161058f565b565b6106c18133611337565b600087815260076020526040902060010154600160a01b900460ff1615610b335760405162461bcd60e51b815260206004820152600c60248201526b4c4346443a2065786973747360a01b604482015260640161058f565b60408051610140810182526006546001600160a01b03908116825260208083018b90528284018a9052885160608085019190915290890151608084015260a0830188905292880151151560c083015291870151151560e082015261010081018590529083166101208201526000610baa8284611018565b9050336001600160a01b03821614610bf35760405162461bcd60e51b815260206004820152600c60248201526b2621a3221d1039b2b73232b960a11b604482015260640161058f565b6000610bfe8a611390565b8051602082012060065491925090600090610c22906001600160a01b0316836113d5565b90506001600160a01b038116610c735760405162461bcd60e51b81526020600482015260166024820152754c4346443a206465706c6f796564206164647265737360501b604482015260640161058f565b6040518060600160405280600660009054906101000a90046001600160a01b03166001600160a01b03168152602001826001600160a01b0316815260200160011515815250600760008e815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160146101000a81548160ff0219169083151502179055509050506000610d698b600001518c602001518c8e604001518f606001518e8e611472565b90508c826001600160a01b03167f8e71679f2f50203469a969ab4a9fc75a441b222d3cc590d173e2fbf0924a11188e8e8e8e8e8c600660009054906101000a90046001600160a01b0316604051610dc697969594939291906125a4565b60405180910390a3610de16001600160a01b038316826114c7565b5050505050505050505050505050565b610dfb82826107db565b61069d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610e313390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610e7f82826107db565b1561069d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610ee2610a89565b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f173390565b6040516001600160a01b03909116815260200160405180910390a1565b606060ff8314610f4e57610f4783611512565b905061052d565b818054610f5a906124f7565b80601f0160208091040260200160405190810160405280929190818152602001828054610f86906124f7565b8015610fd35780601f10610fa857610100808354040283529160200191610fd3565b820191906000526020600020905b815481529060010190602001808311610fb657829003601f168201915b5050505050905061052d565b610fe7611551565b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610f17565b81516000906001600160a01b03166110695760405162461bcd60e51b81526020600482015260146024820152732621a3221d1034b6b83632b6b2b73a30ba34b7b760611b604482015260640161058f565b6000836040015151116110ab5760405162461bcd60e51b815260206004820152600a6024820152694c4346443a206e616d6560b01b604482015260640161058f565b60008360600151116110f15760405162461bcd60e51b815260206004820152600f60248201526e04c4346443a20746f6b656e2063617608c1b604482015260640161058f565b60008360800151116111365760405162461bcd60e51b815260206004820152600e60248201526d4c4346443a206c6f742073697a6560901b604482015260640161058f565b60008360a00151511161118b5760405162461bcd60e51b815260206004820152601960248201527f4c4346443a207a65726f207061796d656e7420746f6b656e7300000000000000604482015260640161058f565b6101008301515142106111d85760405162461bcd60e51b815260206004820152601560248201527404c4346443a2073746172742074696d657374616d7605c1b604482015260640161058f565b6101008301518051602090910151116112295760405162461bcd60e51b815260206004820152601360248201527204c4346443a20656e642074696d657374616d7606c1b604482015260640161058f565b6101208301516001600160a01b031661127d5760405162461bcd60e51b81526020600482015260166024820152752621a3221d103130b1b5b7b33334b1b29030b236b4b760511b604482015260640161058f565b60418251146112c05760405162461bcd60e51b815260206004820152600f60248201526e4c4346443a207369676e617475726560881b604482015260640161058f565b60006112da6112ce8561159a565b8051906020012061176f565b90506112e6818461179c565b91506001600160a01b0382166113305760405162461bcd60e51b815260206004820152600f60248201526e1310d1910e881c9958dbdd995c9959608a1b604482015260640161058f565b5092915050565b61134182826107db565b61069d5761134e816117c0565b6113598360206117d2565b60405160200161136a929190612644565b60408051601f198184030181529082905262461bcd60e51b825261058f91600401612359565b6060816040516024016113a591815260200190565b60408051601f198184030181529190526020810180516001600160e01b0316638f9caa8960e01b17905292915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661052d5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015260640161058f565b60608787878787878760405160240161149197969594939291906126b9565b60408051601f198184030181529190526020810180516001600160e01b031663138f3d0960e31b17905298975050505050505050565b606061150b838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061196e565b9392505050565b6060600061151f83611a4b565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60035460ff16610acf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161058f565b606060008260a001515167ffffffffffffffff8111156115bc576115bc611fa3565b6040519080825280602002602001820160405280156115e5578160200160208202803683370190505b50905060005b8360a00151518110156116545761161e8460a00151828151811061161157611611612720565b6020026020010151611a73565b8051906020012082828151811061163757611637612720565b60209081029190910101528061164c8161274c565b9150506115eb565b506000611665846101000151611aed565b90507f435a04d640f7f2be6734e32e02dcef88b2828e3e7297d72cf5d2cfd3667c64938460000151856020015186604001518051906020012087606001518860800151876040516020016116b99190612765565b604051602081830303815290604052805190602001208a60c001518b60e0015189805190602001208d61012001516040516020016117579b9a999897969594939291909a8b526001600160a01b03998a1660208c015260408b019890985260608a0196909652608089019490945260a088019290925260c0870152151560e08601521515610100850152610120840152166101408201526101600190565b60405160208183030381529060405292505050919050565b600061052d61177c611b3a565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006117ab8585611c6a565b915091506117b881611caf565b509392505050565b606061052d6001600160a01b03831660145b606060006117e183600261279b565b6117ec9060026127b2565b67ffffffffffffffff81111561180457611804611fa3565b6040519080825280601f01601f19166020018201604052801561182e576020820181803683370190505b509050600360fc1b8160008151811061184957611849612720565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061187857611878612720565b60200101906001600160f81b031916908160001a905350600061189c84600261279b565b6118a79060016127b2565b90505b600181111561191f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118db576118db612720565b1a60f81b8282815181106118f1576118f1612720565b60200101906001600160f81b031916908160001a90535060049490941c93611918816127c5565b90506118aa565b50831561150b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161058f565b6060824710156119cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161058f565b600080866001600160a01b031685876040516119eb91906127dc565b60006040518083038185875af1925050503d8060008114611a28576040519150601f19603f3d011682016040523d82523d6000602084013e611a2d565b606091505b5091509150611a3e87838387611df9565b925050505b949350505050565b600060ff8216601f81111561052d57604051632cd44ac360e21b815260040160405180910390fd5b60607fcea2d3b663a88375a8539d786beb27f447c15cdc6dc04c4db285400be0667157826000015183602001518460400151604051602001611ad794939291909384526001600160a01b039290921660208401526040830152606082015260800190565b6040516020818303038152906040529050919050565b8051602080830151604051606093611ad7937ff8161834715015778c7aed8f29a8cd0fed724b5b07436fdb75cdf1fcf5ac93f6939192019283526020830191909152604082015260600190565b6000306001600160a01b037f000000000000000000000000ea4ac8f9509a9b72ac98ef9c90b55d7b51b9146216148015611b9357507f000000000000000000000000000000000000000000000000000000000000008946145b15611bbd57507f104db3b02dd5b4fd6be6f085e5d07336fdcec66d4202ad5faa05ed591f7dc46690565b611c65604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0e1c04c117559dea06979329259b4da65337101dc3ecb7927fd510882290bca3918101919091527faa7cdbe2cce2ec7b606b0e199ddd9b264a6e645e767fb8479a7917dcd1b8693f60608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b6000808251604103611ca05760208301516040840151606085015160001a611c9487828585611e72565b94509450505050611ca8565b506000905060025b9250929050565b6000816004811115611cc357611cc36127f8565b03611ccb5750565b6001816004811115611cdf57611cdf6127f8565b03611d2c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161058f565b6002816004811115611d4057611d406127f8565b03611d8d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161058f565b6003816004811115611da157611da16127f8565b036106c15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161058f565b60608315611e68578251600003611e61576001600160a01b0385163b611e615760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161058f565b5081611a43565b611a438383611f36565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611ea95750600090506003611f2d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611efd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611f2657600060019250925050611f2d565b9150600090505b94509492505050565b815115611f465781518083602001fd5b8060405162461bcd60e51b815260040161058f9190612359565b600060208284031215611f7257600080fd5b81356001600160e01b03198116811461150b57600080fd5b600060208284031215611f9c57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611fdc57611fdc611fa3565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561200b5761200b611fa3565b604052919050565b600082601f83011261202457600080fd5b813567ffffffffffffffff81111561203e5761203e611fa3565b612051601f8201601f1916602001611fe2565b81815284602083860101111561206657600080fd5b816020850160208301376000918101602001919091529392505050565b8035801515811461209357600080fd5b919050565b6000608082840312156120aa57600080fd5b6040516080810181811067ffffffffffffffff821117156120cd576120cd611fa3565b806040525080915082358152602083013560208201526120ef60408401612083565b604082015261210060608401612083565b60608201525092915050565b80356001600160a01b038116811461209357600080fd5b600082601f83011261213457600080fd5b8135602067ffffffffffffffff82111561215057612150611fa3565b61215e818360051b01611fe2565b8281526060928302850182019282820191908785111561217d57600080fd5b8387015b858110156121cb5781818a0312156121995760008081fd5b6121a1611fb9565b6121aa8261210c565b81528186013586820152604080830135908201528452928401928101612181565b5090979650505050505050565b6000604082840312156121ea57600080fd5b6040516040810181811067ffffffffffffffff8211171561220d5761220d611fa3565b604052823581526020928301359281019290925250919050565b600080600080600080610140878903121561224157600080fd5b86359550602087013567ffffffffffffffff8082111561226057600080fd5b61226c8a838b01612013565b965061227b8a60408b01612098565b955060c089013591508082111561229157600080fd5b61229d8a838b01612123565b94506122ac8a60e08b016121d8565b93506101208901359150808211156122c357600080fd5b506122d089828a01612013565b9150509295509295509295565b600080604083850312156122f057600080fd5b823591506123006020840161210c565b90509250929050565b60005b8381101561232457818101518382015260200161230c565b50506000910152565b60008151808452612345816020860160208601612309565b601f01601f19169290920160200192915050565b60208152600061150b602083018461232d565b60ff60f81b881681526000602060e08184015261238c60e084018a61232d565b838103604085015261239e818a61232d565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156123f0578351835292840192918401916001016123d4565b50909c9b505050505050505050505050565b600080600080600080600080610180898b03121561241f57600080fd5b6124288961210c565b975060208901359650604089013567ffffffffffffffff8082111561244c57600080fd5b6124588c838d01612013565b97506124678c60608d01612098565b965060e08b013591508082111561247d57600080fd5b6124898c838d01612123565b95506124998c6101008d016121d8565b94506124a86101408c0161210c565b93506101608b01359150808211156124bf57600080fd5b506124cc8b828c01612013565b9150509295985092959890939650565b6000602082840312156124ee57600080fd5b61150b8261210c565b600181811c9082168061250b57607f821691505b60208210810361252b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561254357600080fd5b5051919050565b600081518084526020808501945080840160005b8381101561259957815180516001600160a01b031688528381015184890152604090810151908801526060909601959082019060010161255e565b509495945050505050565b60006101608083526125b88184018b61232d565b9050885160208401526020890151604084015260408901511515606084015260608901511515608084015282810360a08401526125f5818961254a565b875160c0850152602088015160e0850152915061260f9050565b6001600160a01b0385811661010084015284166101208301526001600160a01b03831661014083015298975050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161267c816017850160208801612309565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516126ad816028840160208801612309565b01602801949350505050565b60006101008983528860208401528060408401526126d98184018961254a565b87151560608501528615156080850152855160a0850152602086015160c085015291506127039050565b6001600160a01b039290921660e091909101529695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161275e5761275e612736565b5060010190565b815160009082906020808601845b8381101561278f57815185529382019390820190600101612773565b50929695505050505050565b808202811582820484141761052d5761052d612736565b8082018082111561052d5761052d612736565b6000816127d4576127d4612736565b506000190190565b600082516127ee818460208701612309565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe1cc585a35ee40bc8e30be46c66514537f1953ad0977428ef905e8e0df71a6ee7a264697066735822122089a19738248dff46c387e68c4438d8fbca2f13116dde2b0e89d8f7af42311c7464736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0a07f0b4ee126afd09bbd8d87840604d43563753e8be9a86560e0409d1d86430800000000000000000000000000000000000000000000000000000000000000194c61756e636870616443726f776473616c6544656661756c74000000000000000000000000000000000000000000000000000000000000000000000000000005302e312e30000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): LaunchpadCrowdsaleDefault
Arg [1] : version (string): 0.1.0
Arg [2] : implementationType (uint256): 72594523396346312125874079424869227875577099262699988432223909348498857149192
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : a07f0b4ee126afd09bbd8d87840604d43563753e8be9a86560e0409d1d864308
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [4] : 4c61756e636870616443726f776473616c6544656661756c7400000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 302e312e30000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.