Source Code
Overview
POL Balance
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Contract Name:
EventEmitter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./interface/IEventEmitter.sol"; // Define the EventEmitter contract contract EventEmitter is Initializable, IEventEmitter, AccessControlUpgradeable { using ECDSA for bytes32; address internal constant ZERO_ADDRESS = address(0); bytes32 public constant AUTHORIZED_ADMIN_ROLE = keccak256("AUTHORIZED_ADMIN_ROLE"); /** * @notice Emits the InitLedger event with provided keys and values. * @param ledger The address of the ledger to be logged in the event. * @param ledgerKeys An array of string keys to be logged in the event. * @param ledgerValues An array of string values corresponding to the keys to be logged in the event. */ event InitLedger(address ledger, string[] ledgerKeys, string[] ledgerValues); /** * @notice Emits the UpdateLedger event with provided keys and values. * @param ledger The address of the ledger to be logged in the event. * @param ledgerKeys An array of string keys to be logged in the event. * @param ledgerValues An array of string values corresponding to the keys to be logged in the event. */ event UpdateLedger(address ledger, string[] ledgerKeys, string[] ledgerValues); /** * @notice Emits the LockLedger event to indicate the ledger is locked. * @param ledger The address of the ledger to be logged in the event. * @param isLocked A boolean indicating if the ledger is locked. */ event LockLedger(address ledger, bool isLocked); /** * @notice Emits the NewRule event with provided rule keys and values. * @param ledger The address of the ledger to be logged in the event. * @param rules A array of rules to be logged in the event. */ event NewRule(address ledger, Rule[] rules); /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract minted * @param businessRecipient The address to the business recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ event VDTMinted(address vdtContractAddress, address businessRecipient, address consumerRecipient, string nftTokenURI, uint256 tokenId); /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract minted * @param businessRecipient The address to the business recipient * @param sellerRecipient The address to the seller recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ event ServiceVDTMinted(address vdtContractAddress, address businessRecipient, address sellerRecipient, address consumerRecipient, string nftTokenURI, uint256 tokenId); /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param tokenId The ID of the token to update * @param nftTokenURI The new URI of the NFT metadata */ event TokenURIUpdated(address vdtContractAddress, string nftTokenURI, uint256 tokenId); /** * @notice Emits the VDTTransfer event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param from The address of the sender * @param to The address of the recipient * @param tokenId The token Id of the token transferred */ event VDTTransferEvent(address vdtContractAddress, address from, address to, uint256 tokenId); /** * @notice Emits the EditRule event with provided rule keys and values. * @param ledger The address of the ledger to be logged in the event. * @param ruleKeys An array of string rule keys to be logged in the event. * @param ruleValues An array of string rule values corresponding to the rule keys to be logged in the event. * @param rule The index of the rule being edited. */ event EditRule(address ledger, string[] ruleKeys, string[] ruleValues, uint256 rule); /** * @notice Emits the FullPaymentDisbursed event with provided ledgerAddress and listingId. * @param ledger The address of the ledger to be logged in the event. * @param listingId The unique identifier for the listing for which the event is emitted. */ event FullPaymentDisbursed(address ledger, string listingId); /** * @notice Emits the RuleDisbursed event with provided ledgerAddress and ruleId. * @param ledger The address of the ledger to be logged in the event. * @param ruleId The unique identifier for the rule for which the event is emitted. */ event RuleDisbursed(address ledger, uint256 ruleId); /** * @notice Emits the Delisted event with provided ledgerAddress and listingId. * @param ledger The address of the ledger to be logged in the event. * @param listingId The unique identifier for the listing for which the event is emitted. */ event Delisted(address ledger, string listingId); /** * @notice Emits the ListVDT event with provided data. * @param vdtName The name of the VDT to be logged in the event. * @param vdtAddress The address of the VDT to be logged in the event. * @param listingId The unique identifier for the listing for which the event is emitted. * @param from The address from which the VDT is being transferred. * @param to The address to which the VDT is being transferred. * @param tokenId The unique identifier of the token being transferred. */ event ListVDT(string vdtName, address vdtAddress, string listingId, address from, address to, uint256 tokenId); event VDTCreated(VDTTokenDetail[] VDTTokenDetails); event DisburseDetail(DisburseDetails disburseDetail, DisburseData disburseData); function initialize(address[] calldata _authorizeAddress) public initializer { require(_authorizeAddress.length > 0, "EventEmitter: Authorize address length cannot be zero"); __AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); for (uint index = 0; index < _authorizeAddress.length; index++) { require(_authorizeAddress[index] != address(0), "EventEmitter: Authorize address cannot be zero"); _setupRole(AUTHORIZED_ADMIN_ROLE, _authorizeAddress[index]); } } /** * @notice Emits the InitLedger event with provided keys and values. * @param ledgerKeys An array of string keys to be logged in the event. * @param ledgerValues An array of string values corresponding to the keys to be logged in the event. * @param uniqueSecret The uniqueSecret to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitInitLedgerEvent(string[] memory ledgerKeys, string[] memory ledgerValues, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature), "EventEmitter: Invalid signature"); emit InitLedger(msg.sender, ledgerKeys, ledgerValues); } /** * @notice Emits the UpdateLedger event with provided keys and values. * @param ledgerKeys An array of string keys to be logged in the event. * @param ledgerValues An array of string values corresponding to the keys to be logged in the event. * @param uniqueSecret The uniqueSecret to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitUpdateLedgerEvent(string[] memory ledgerKeys, string[] memory ledgerValues, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit UpdateLedger(msg.sender, ledgerKeys, ledgerValues); } /** * @notice Emits the LockLedger event with the provided lock status. * @param isLocked A boolean indicating whether the ledger is locked or not. * @param uniqueSecret The unique secret to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitLedgerLockEvent(bool isLocked, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit LockLedger(msg.sender, isLocked); } /** * @notice Emits the NewRuleAdded event with the provided rule keys and values. * @param rules Array of rules. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitNewRuleAddedEvent(Rule[] memory rules, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit NewRule(msg.sender, rules); } /** * @notice Emits the FullPaymentDisbursed event for the given listing ID. * @param listingId The unique identifier for the listing for which the event is emitted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitFullPaymentDisbursedEvent(string memory listingId, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit FullPaymentDisbursed(msg.sender, listingId); } /** * @notice Emits the RuleDisbursed event for the given rule ID. * @param ruleId The unique identifier for the rule for which the event is emitted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitRulePaymentDisbursedEvent(uint256 ruleId, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit RuleDisbursed(msg.sender, ruleId); } /** * @notice Emits the Delisted event for the given listing ID. * @param listingId The unique identifier for the listing that is being delisted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitDelistedEvent(string memory listingId, uint256 uniqueSecret, bytes memory signature) override external { require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit Delisted(msg.sender, listingId); } /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param businessRecipient The address to the business recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ function emitVDTMintedEvent(address vdtContractAddress, address businessRecipient, address consumerRecipient, string memory nftTokenURI, uint256 tokenId) override external { require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit VDTMinted(vdtContractAddress, businessRecipient, consumerRecipient, nftTokenURI, tokenId); } /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param businessRecipient The address to the business recipient * @param sellerRecipient The address to the seller recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ function emitServiceVDTMintedEvent(address vdtContractAddress, address businessRecipient, address sellerRecipient, address consumerRecipient, string memory nftTokenURI, uint256 tokenId) override external { require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit ServiceVDTMinted(vdtContractAddress, businessRecipient, sellerRecipient, consumerRecipient, nftTokenURI, tokenId); } /** * @notice Emits the TokenURIUpdated event with the new tokenURI details. * @param vdtContractAddress The address of the VDT contract * @param tokenId The ID of the token to update * @param nftTokenURI The new URI of the NFT metadata */ function emitTokenURIUpdatedEvent(address vdtContractAddress, string memory nftTokenURI, uint256 tokenId) override external { require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit TokenURIUpdated(vdtContractAddress, nftTokenURI, tokenId); } /** * @notice Emits the VDTTransfer event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param from The address of the sender * @param to The address of the recipient * @param tokenId The token Id of the token transferred */ function emitVDTTransferEvent(address vdtContractAddress, address from, address to, uint256 tokenId) override external { require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit VDTTransferEvent(vdtContractAddress, from, to, tokenId); } /** * @notice Emits the VDTCreated event with the VDT details. * @param VDTTokenDetails The details of the VDTs created. */ function emitMultiVDTCreated(VDTTokenDetail[] memory VDTTokenDetails) override external { require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit VDTCreated(VDTTokenDetails); } /** * @notice Emits the ListVDT event with the VDT details. * @param vdtName The name of the VDT * @param vdtAddress The address of the VDT contract * @param listingId The unique identifier for the listing * @param from The address of the sender * @param to The address of the recipient * @param tokenId The ID of the token being transferred */ function emitListVDT(string memory vdtName, address vdtAddress, string memory listingId, address from, address to, uint256 tokenId) override external{ require(hasRole(AUTHORIZED_ADMIN_ROLE, _msgSender()), "EventEmitter: Caller is not authorize"); emit ListVDT(vdtName, vdtAddress, listingId, from, to, tokenId); } /** * @notice Emits the DisburseDetailsAdded event with the provided disbursement details. * @param disburseDetails A struct containing the details of the disbursement to be logged in the event. * @param disburseData A struct containing the data of the disbursement amount to be logged in the event. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitDisburseDetailsAddedEvent(DisburseDetails memory disburseDetails, DisburseData memory disburseData, uint256 uniqueSecret, bytes memory signature) override external{ require(checkSignature(uniqueSecret, signature),"EventEmitter: Invalid signature"); emit DisburseDetail(disburseDetails, disburseData); } /** * @notice This function is responsible for checking the signature. * @param uniqueSecret The uniqueSecret of the transaction. * @param signature A cryptographic signature to validate the caller. * @return bool Returns true if the signature is valid and not expired. */ function checkSignature(uint256 uniqueSecret, bytes memory signature) internal view returns (bool) { { bytes32 messageHash = keccak256(abi.encodePacked(uniqueSecret)); bytes32 signedMessage = messageHash.toEthSignedMessageHash(); address signer = signedMessage.recover(signature); if(hasRole(AUTHORIZED_ADMIN_ROLE, signer) && block.timestamp <= uniqueSecret){ return true; } } return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./IBase.sol"; import "./IBaseOrchestrator.sol"; interface IEventEmitter is IBase, IBaseOrchestrator { /** * @notice Emits the InitLedger event with the provided keys, values, unique secret and signature.. * @param keys An array of string keys to be logged in the event. * @param values An array of string values corresponding to the keys to be logged in the event. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitInitLedgerEvent(string[] memory keys, string[] memory values, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the UpdateLedger event event with the provided keys, values, unique secret, and signature.. * @param keys An array of string keys to be logged in the event. * @param values An array of string values corresponding to the keys to be logged in the event. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitUpdateLedgerEvent(string[] memory keys, string[] memory values, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the LockLedger event with the provided lock status, unique secret and signature.. * @param isLocked A boolean indicating whether the ledger is locked or not. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitLedgerLockEvent(bool isLocked, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the NewRuleAdded event with the provided rule keys, values, unique secret, signature.. * @param rule The rules which is newly added. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitNewRuleAddedEvent(Rule[] memory rule, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the FullPaymentDisbursed event for the given listing ID. * @param listingId The unique identifier for the listing for which the event is emitted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitFullPaymentDisbursedEvent(string memory listingId, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the Delisted event for the given listing ID. * @param listingId The unique identifier for the listing that is being delisted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitDelistedEvent(string memory listingId, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the RuleDisbursed event for the given rule ID. * @param ruleId The unique identifier for the rule for which the event is emitted. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature to validate the caller. */ function emitRulePaymentDisbursedEvent(uint256 ruleId, uint256 uniqueSecret, bytes memory signature) external; /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param businessRecipient The address to the business recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ function emitVDTMintedEvent(address vdtContractAddress, address businessRecipient, address consumerRecipient, string memory nftTokenURI, uint256 tokenId) external; /** * @notice Emits the VDTMinted event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param businessRecipient The address to the business recipient * @param sellerRecipient The address to the seller recipient * @param consumerRecipient The address to the consumer recipient * @param nftTokenURI The URI of the NFT metadata * @param tokenId The token ID of the minted NFT */ function emitServiceVDTMintedEvent(address vdtContractAddress, address businessRecipient, address sellerRecipient, address consumerRecipient, string memory nftTokenURI, uint256 tokenId) external; /** * @notice Emits the TokenURIUpdated event with the new tokenURI details. * @param vdtContractAddress The address of the VDT contract * @param tokenId The ID of the token to update * @param nftTokenURI The new URI of the NFT metadata */ function emitTokenURIUpdatedEvent(address vdtContractAddress, string memory nftTokenURI, uint256 tokenId) external; /** * @notice Emits the VDTCreated event with the VDT details. * @param VDTTokenDetails The details of the VDTs created. */ function emitMultiVDTCreated(VDTTokenDetail[] memory VDTTokenDetails) external; /** * @notice Emits the VDTTransfer event with the VDT details. * @param vdtContractAddress The address of the VDT contract * @param from The address of the sender * @param to The address of the recipient * @param tokenId The token Id of the token transferred */ function emitVDTTransferEvent(address vdtContractAddress, address from, address to, uint256 tokenId) external; /** * @notice Emits the ListVDT event with the provided data. * @param vdtName The name of the VDT to be logged in the event. * @param vdtAddress The address of the VDT to be logged in the event. * @param listingId The unique identifier for the listing for which the event is emitted. * @param from The address from which the VDT is being transferred. * @param to The address to which the VDT is being transferred. * @param tokenId The unique identifier of the token being transferred. */ function emitListVDT(string memory vdtName, address vdtAddress, string memory listingId, address from, address to, uint256 tokenId) external; /** * @notice Emits the DisburseDetailsAdded event with the provided disbursement details. * @param disburseDetail A struct containing the details of the disbursement to be logged in the event. * @param disburseData A struct containing the data of the disbursement amount to be logged in the event. * @param uniqueSecret The unique secret used to validate the signature. * @param signature A cryptographic signature used to validate the caller. */ function emitDisburseDetailsAddedEvent(DisburseDetails memory disburseDetail, DisburseData memory disburseData, uint256 uniqueSecret, bytes memory signature) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.3) (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 } 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"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' 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 (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // 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) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @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) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IBaseOrchestrator { struct VDTTokenDetail { address user; address vdtContract; uint256 vdtId; string vdtName; string metadataURI; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /** * @title IBase * @dev Interface defining structures and enumerations for payment disbursement * and transaction rules involving ERC721 and ERC1155 tokens. */ interface IBase { /** * @dev Enumeration specifying the type of rule value. * PERCENT - Represents a percentage-based value. * FIX - Represents a fixed value. */ enum RuleValueType { PERCENT, FIX } /** * @dev Struct defining the details for disbursing payments in a transaction. * @param royaltyWallet Address where royalty payments are sent. * @param affiliateWallet Address where affiliate payments are sent. * @param sellerWallet Address of the seller who will receive payment. * @param buyerWallet Address of the buyer involved in the transaction. * @param bitWallet Address used for platform fees or additional charges. * @param vdtContract Address of a contract, possibly involved in managing disbursement. * @param royalty Amount allocated for royalties. * @param affiliate Amount allocated for affiliate commission. * @param seller Amount allocated for the seller. * @param bit Amount allocated for platform or additional fees. * @param assetId Identifier for the asset being transacted. * @param quantity Number of tokens or assets being transferred. */ struct DisburseDetails { address royaltyWallet; address affiliateWallet; address sellerWallet; address buyerWallet; address CIPWallet; address ChainITWallet; address BITWallet; address shippingWallet; address taxWallet; address rewardWallet; address vdtContract; } struct DisburseData { uint256 royalty; uint256 affiliate; uint256 seller; uint256 CIP; uint256 shipping; uint256 tax; uint256 assetId; uint256 quantity; uint256 ChainIT; uint256 BIT; uint256 reward; } /** * @dev Struct defining a rule for payment disbursement. * @param ruleId Unique identifier for the rule. * @param ruleValue Array of values associated with the rule (e.g., thresholds, limits). * @param disburseValue Array of values determining how much to disburse according to the rule. * @param toWallet Array of wallet addresses where the payments will be sent. * @param valueType Array indicating if each disbursement is a percentage or fixed amount. * @param isDisbursed Flag indicating if the disbursement has already been completed. */ struct Rule { string ruleId; uint256[] ruleValue; uint256[] disburseValue; address[] toWallet; RuleValueType[] valueType; bool isDisbursed; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"string","name":"listingId","type":"string"}],"name":"Delisted","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"royaltyWallet","type":"address"},{"internalType":"address","name":"affiliateWallet","type":"address"},{"internalType":"address","name":"sellerWallet","type":"address"},{"internalType":"address","name":"buyerWallet","type":"address"},{"internalType":"address","name":"CIPWallet","type":"address"},{"internalType":"address","name":"ChainITWallet","type":"address"},{"internalType":"address","name":"BITWallet","type":"address"},{"internalType":"address","name":"shippingWallet","type":"address"},{"internalType":"address","name":"taxWallet","type":"address"},{"internalType":"address","name":"rewardWallet","type":"address"},{"internalType":"address","name":"vdtContract","type":"address"}],"indexed":false,"internalType":"struct IBase.DisburseDetails","name":"disburseDetail","type":"tuple"},{"components":[{"internalType":"uint256","name":"royalty","type":"uint256"},{"internalType":"uint256","name":"affiliate","type":"uint256"},{"internalType":"uint256","name":"seller","type":"uint256"},{"internalType":"uint256","name":"CIP","type":"uint256"},{"internalType":"uint256","name":"shipping","type":"uint256"},{"internalType":"uint256","name":"tax","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"ChainIT","type":"uint256"},{"internalType":"uint256","name":"BIT","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"}],"indexed":false,"internalType":"struct IBase.DisburseData","name":"disburseData","type":"tuple"}],"name":"DisburseDetail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"string[]","name":"ruleKeys","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"ruleValues","type":"string[]"},{"indexed":false,"internalType":"uint256","name":"rule","type":"uint256"}],"name":"EditRule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"string","name":"listingId","type":"string"}],"name":"FullPaymentDisbursed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"string[]","name":"ledgerKeys","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"ledgerValues","type":"string[]"}],"name":"InitLedger","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"vdtName","type":"string"},{"indexed":false,"internalType":"address","name":"vdtAddress","type":"address"},{"indexed":false,"internalType":"string","name":"listingId","type":"string"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ListVDT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"bool","name":"isLocked","type":"bool"}],"name":"LockLedger","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"components":[{"internalType":"string","name":"ruleId","type":"string"},{"internalType":"uint256[]","name":"ruleValue","type":"uint256[]"},{"internalType":"uint256[]","name":"disburseValue","type":"uint256[]"},{"internalType":"address[]","name":"toWallet","type":"address[]"},{"internalType":"enum IBase.RuleValueType[]","name":"valueType","type":"uint8[]"},{"internalType":"bool","name":"isDisbursed","type":"bool"}],"indexed":false,"internalType":"struct IBase.Rule[]","name":"rules","type":"tuple[]"}],"name":"NewRule","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":"ledger","type":"address"},{"indexed":false,"internalType":"uint256","name":"ruleId","type":"uint256"}],"name":"RuleDisbursed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vdtContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"businessRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"sellerRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"consumerRecipient","type":"address"},{"indexed":false,"internalType":"string","name":"nftTokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ServiceVDTMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vdtContractAddress","type":"address"},{"indexed":false,"internalType":"string","name":"nftTokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ledger","type":"address"},{"indexed":false,"internalType":"string[]","name":"ledgerKeys","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"ledgerValues","type":"string[]"}],"name":"UpdateLedger","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"vdtContract","type":"address"},{"internalType":"uint256","name":"vdtId","type":"uint256"},{"internalType":"string","name":"vdtName","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"}],"indexed":false,"internalType":"struct IBaseOrchestrator.VDTTokenDetail[]","name":"VDTTokenDetails","type":"tuple[]"}],"name":"VDTCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vdtContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"businessRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"consumerRecipient","type":"address"},{"indexed":false,"internalType":"string","name":"nftTokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"VDTMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vdtContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"VDTTransferEvent","type":"event"},{"inputs":[],"name":"AUTHORIZED_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":[{"internalType":"string","name":"listingId","type":"string"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitDelistedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"royaltyWallet","type":"address"},{"internalType":"address","name":"affiliateWallet","type":"address"},{"internalType":"address","name":"sellerWallet","type":"address"},{"internalType":"address","name":"buyerWallet","type":"address"},{"internalType":"address","name":"CIPWallet","type":"address"},{"internalType":"address","name":"ChainITWallet","type":"address"},{"internalType":"address","name":"BITWallet","type":"address"},{"internalType":"address","name":"shippingWallet","type":"address"},{"internalType":"address","name":"taxWallet","type":"address"},{"internalType":"address","name":"rewardWallet","type":"address"},{"internalType":"address","name":"vdtContract","type":"address"}],"internalType":"struct IBase.DisburseDetails","name":"disburseDetails","type":"tuple"},{"components":[{"internalType":"uint256","name":"royalty","type":"uint256"},{"internalType":"uint256","name":"affiliate","type":"uint256"},{"internalType":"uint256","name":"seller","type":"uint256"},{"internalType":"uint256","name":"CIP","type":"uint256"},{"internalType":"uint256","name":"shipping","type":"uint256"},{"internalType":"uint256","name":"tax","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"ChainIT","type":"uint256"},{"internalType":"uint256","name":"BIT","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"}],"internalType":"struct IBase.DisburseData","name":"disburseData","type":"tuple"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitDisburseDetailsAddedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"listingId","type":"string"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitFullPaymentDisbursedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"ledgerKeys","type":"string[]"},{"internalType":"string[]","name":"ledgerValues","type":"string[]"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitInitLedgerEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isLocked","type":"bool"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitLedgerLockEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"vdtName","type":"string"},{"internalType":"address","name":"vdtAddress","type":"address"},{"internalType":"string","name":"listingId","type":"string"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"emitListVDT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"vdtContract","type":"address"},{"internalType":"uint256","name":"vdtId","type":"uint256"},{"internalType":"string","name":"vdtName","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"}],"internalType":"struct IBaseOrchestrator.VDTTokenDetail[]","name":"VDTTokenDetails","type":"tuple[]"}],"name":"emitMultiVDTCreated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"ruleId","type":"string"},{"internalType":"uint256[]","name":"ruleValue","type":"uint256[]"},{"internalType":"uint256[]","name":"disburseValue","type":"uint256[]"},{"internalType":"address[]","name":"toWallet","type":"address[]"},{"internalType":"enum IBase.RuleValueType[]","name":"valueType","type":"uint8[]"},{"internalType":"bool","name":"isDisbursed","type":"bool"}],"internalType":"struct IBase.Rule[]","name":"rules","type":"tuple[]"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitNewRuleAddedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ruleId","type":"uint256"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitRulePaymentDisbursedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vdtContractAddress","type":"address"},{"internalType":"address","name":"businessRecipient","type":"address"},{"internalType":"address","name":"sellerRecipient","type":"address"},{"internalType":"address","name":"consumerRecipient","type":"address"},{"internalType":"string","name":"nftTokenURI","type":"string"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"emitServiceVDTMintedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vdtContractAddress","type":"address"},{"internalType":"string","name":"nftTokenURI","type":"string"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"emitTokenURIUpdatedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"ledgerKeys","type":"string[]"},{"internalType":"string[]","name":"ledgerValues","type":"string[]"},{"internalType":"uint256","name":"uniqueSecret","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"emitUpdateLedgerEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vdtContractAddress","type":"address"},{"internalType":"address","name":"businessRecipient","type":"address"},{"internalType":"address","name":"consumerRecipient","type":"address"},{"internalType":"string","name":"nftTokenURI","type":"string"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"emitVDTMintedEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vdtContractAddress","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"emitVDTTransferEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_authorizeAddress","type":"address[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612863806100206000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806391d14854116100c3578063b70c5e0a1161007c578063b70c5e0a146102c1578063bc265ffc146102d4578063bec3e746146102e7578063c896e001146102fa578063d547741f1461030d578063fc7050eb1461032057600080fd5b806391d148541461025a5780639840fcbc1461026d5780639d7fa22214610280578063a217fddf14610293578063a224cee71461029b578063ab8697a9146102ae57600080fd5b806336568abe1161011557806336568abe146101e65780634d2ee68f146101f957806364c897e61461020c57806378ffa8321461021f578063897e4864146102345780638c1d0dcd1461024757600080fd5b806301ffc9a714610152578063248a9ca31461017a57806324e04a71146101ab578063263199e4146101c05780632f2ff15d146101d3575b600080fd5b6101656101603660046113da565b610333565b60405190151581526020015b60405180910390f35b61019d610188366004611404565b60009081526065602052604090206001015490565b604051908152602001610171565b6101be6101b936600461155b565b61036a565b005b6101be6101ce366004611683565b6103ed565b6101be6101e1366004611714565b610454565b6101be6101f4366004611714565b61047e565b6101be610207366004611740565b6104fc565b6101be61021a3660046119b1565b61056a565b61019d60008051602061280e83398151915281565b6101be610242366004611683565b6105ce565b6101be610255366004611b67565b610627565b610165610268366004611714565b6106a4565b6101be61027b366004611c95565b6106cf565b6101be61028e366004611dc1565b610726565b61019d600081565b6101be6102a9366004611e0c565b6107ad565b6101be6102bc366004611e80565b610a1f565b6101be6102cf366004611f07565b610a8c565b6101be6102e2366004611f5c565b610ae3565b6101be6102f5366004611f07565b610b4a565b6101be610308366004611fb2565b610ba1565b6101be61031b366004611714565b610bfd565b6101be61032e366004611ff7565b610c22565b60006001600160e01b03198216637965db0b60e01b148061036457506301ffc9a760e01b6001600160e01b03198316145b92915050565b61038260008051602061280e833981519152336106a4565b6103a75760405162461bcd60e51b815260040161039e90612037565b60405180910390fd5b7f8d1b3e5e987309defa3658d792853893675b3c4ea5a0f44d365dee3eef5a799785858585856040516103de9594939291906120cc565b60405180910390a15050505050565b6103f78282610c7f565b6104135760405162461bcd60e51b815260040161039e90612112565b7f701341dab53daa195c150879af86e9bd05e9d8dedd9b4df4543025e84a27a9913385856040516104469392919061219e565b60405180910390a150505050565b60008281526065602052604090206001015461046f81610d57565b6104798383610d64565b505050565b6001600160a01b03811633146104ee5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161039e565b6104f88282610dea565b5050565b61051460008051602061280e833981519152336106a4565b6105305760405162461bcd60e51b815260040161039e90612037565b7f880e4042538d02e4b256409508f7f73ee2cb6de6e4181f8b689cd2b8226501e48160405161055f91906121de565b60405180910390a150565b6105748282610c7f565b6105905760405162461bcd60e51b815260040161039e90612112565b7fc136759827e36818952a05c802f4264ef6968620d3c63015814eb33a450cc5d333846040516105c192919061233e565b60405180910390a1505050565b6105d88282610c7f565b6105f45760405162461bcd60e51b815260040161039e90612112565b7fab2fa6303270d31c057bae3c5b6904c0eb7a8e20869d7f73966b12c73f79b26d3385856040516104469392919061219e565b61063f60008051602061280e833981519152336106a4565b61065b5760405162461bcd60e51b815260040161039e90612037565b7f55b794dafa1f1abc152641c2503ca3f5fbab6e78a8bcdd32003040ca4fdde1e386868686868660405161069496959493929190612468565b60405180910390a1505050505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6106d98282610c7f565b6106f55760405162461bcd60e51b815260040161039e90612112565b7f5d333432362e35b0d098fe50ff366868b334be014a6480658f4d02f70edcea0a84846040516104469291906124bb565b61073e60008051602061280e833981519152336106a4565b61075a5760405162461bcd60e51b815260040161039e90612037565b604080516001600160a01b0380871682528086166020830152841691810191909152606081018290527f84a378a2b0bf43510ca7fcc04c9178dc4032679ec14d066b2a04eefe512d5b9590608001610446565b600054610100900460ff16158080156107cd5750600054600160ff909116105b806107e75750303b1580156107e7575060005460ff166001145b61084a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161039e565b6000805460ff19166001179055801561086d576000805461ff0019166101001790555b816108d85760405162461bcd60e51b815260206004820152603560248201527f4576656e74456d69747465723a20417574686f72697a652061646472657373206044820152746c656e6774682063616e6e6f74206265207a65726f60581b606482015260840161039e565b6108e0610e51565b6108eb600033610ebe565b60005b828110156109dc57600084848381811061090a5761090a612635565b905060200201602081019061091f919061264b565b6001600160a01b03160361098c5760405162461bcd60e51b815260206004820152602e60248201527f4576656e74456d69747465723a20417574686f72697a6520616464726573732060448201526d63616e6e6f74206265207a65726f60901b606482015260840161039e565b6109ca60008051602061280e8339815191528585848181106109b0576109b0612635565b90506020020160208101906109c5919061264b565b610ebe565b806109d48161267c565b9150506108ee565b508015610479576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016105c1565b610a3760008051602061280e833981519152336106a4565b610a535760405162461bcd60e51b815260040161039e90612037565b7f0c618048b7e8b3cec866d5700002ef66ea863a99893d0898229b2e54468eb0a886868686868660405161069496959493929190612695565b610a968282610c7f565b610ab25760405162461bcd60e51b815260040161039e90612112565b7f48b5f95cd6149600cd336157cbf68db6f6b77c87005d04c8e25b540b3884d5b433846040516105c19291906126e4565b610afb60008051602061280e833981519152336106a4565b610b175760405162461bcd60e51b815260040161039e90612037565b7ff8b89dd6495dcbf6b7783539fbde530ce681c43e264ec25d61deffcfd78cd0d98383836040516105c193929190612710565b610b548282610c7f565b610b705760405162461bcd60e51b815260040161039e90612112565b7f248613fae139fc21335148b61f730ca3b0f6de4ccec10fa5f1915e40d062eb9d33846040516105c19291906126e4565b610bab8282610c7f565b610bc75760405162461bcd60e51b815260040161039e90612112565b60408051338152602081018590527f68a1b031530d1e16f5d8d8bcdff1c086c1084a4084c7f5390eaaa31a651d896b91016105c1565b600082815260656020526040902060010154610c1881610d57565b6104798383610dea565b610c2c8282610c7f565b610c485760405162461bcd60e51b815260040161039e90612112565b6040805133815284151560208201527f127630bd852635b8265c4bcf6825010a294c8b032e9ee0e8e57a47cbaa6bffc691016105c1565b60008083604051602001610c9591815260200190565b6040516020818303038152906040528051906020012090506000610d06826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000610d148286610ec8565b9050610d2e60008051602061280e833981519152826106a4565b8015610d3a5750854211155b15610d4b5760019350505050610364565b50600095945050505050565b610d618133610eec565b50565b610d6e82826106a4565b6104f85760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610da63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610df482826106a4565b156104f85760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff16610ebc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161039e565b565b6104f88282610d64565b6000806000610ed78585610f50565b91509150610ee481610f95565b509392505050565b610ef682826106a4565b6104f857610f0e816001600160a01b0316601461114b565b610f1983602061114b565b604051602001610f2a929190612744565b60408051601f198184030181529082905262461bcd60e51b825261039e916004016127b9565b6000808251604103610f865760208301516040840151606085015160001a610f7a878285856112ed565b94509450505050610f8e565b506000905060025b9250929050565b6000816004811115610fa957610fa96122cf565b03610fb15750565b6001816004811115610fc557610fc56122cf565b036110125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161039e565b6002816004811115611026576110266122cf565b036110735760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161039e565b6003816004811115611087576110876122cf565b036110df5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161039e565b60048160048111156110f3576110f36122cf565b03610d615760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161039e565b6060600061115a8360026127cc565b6111659060026127e3565b6001600160401b0381111561117c5761117c611439565b6040519080825280601f01601f1916602001820160405280156111a6576020820181803683370190505b509050600360fc1b816000815181106111c1576111c1612635565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106111f0576111f0612635565b60200101906001600160f81b031916908160001a90535060006112148460026127cc565b61121f9060016127e3565b90505b6001811115611297576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061125357611253612635565b1a60f81b82828151811061126957611269612635565b60200101906001600160f81b031916908160001a90535060049490941c93611290816127f6565b9050611222565b5083156112e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161039e565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561132457506000905060036113d1565b8460ff16601b1415801561133c57508460ff16601c14155b1561134d57506000905060046113d1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156113a1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166113ca576000600192509250506113d1565b9150600090505b94509492505050565b6000602082840312156113ec57600080fd5b81356001600160e01b0319811681146112e657600080fd5b60006020828403121561141657600080fd5b5035919050565b80356001600160a01b038116811461143457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171561147157611471611439565b60405290565b60405160c081016001600160401b038111828210171561147157611471611439565b60405161016081016001600160401b038111828210171561147157611471611439565b604051601f8201601f191681016001600160401b03811182821017156114e4576114e4611439565b604052919050565b600082601f8301126114fd57600080fd5b81356001600160401b0381111561151657611516611439565b611529601f8201601f19166020016114bc565b81815284602083860101111561153e57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561157357600080fd5b61157c8661141d565b945061158a6020870161141d565b93506115986040870161141d565b925060608601356001600160401b038111156115b357600080fd5b6115bf888289016114ec565b95989497509295608001359392505050565b60006001600160401b038211156115ea576115ea611439565b5060051b60200190565b600082601f83011261160557600080fd5b8135602061161a611615836115d1565b6114bc565b82815260059290921b8401810191818101908684111561163957600080fd5b8286015b848110156116785780356001600160401b0381111561165c5760008081fd5b61166a8986838b01016114ec565b84525091830191830161163d565b509695505050505050565b6000806000806080858703121561169957600080fd5b84356001600160401b03808211156116b057600080fd5b6116bc888389016115f4565b955060208701359150808211156116d257600080fd5b6116de888389016115f4565b94506040870135935060608701359150808211156116fb57600080fd5b50611708878288016114ec565b91505092959194509250565b6000806040838503121561172757600080fd5b823591506117376020840161141d565b90509250929050565b6000602080838503121561175357600080fd5b82356001600160401b038082111561176a57600080fd5b818501915085601f83011261177e57600080fd5b813561178c611615826115d1565b81815260059190911b830184019084810190888311156117ab57600080fd5b8585015b8381101561186e578035858111156117c657600080fd5b860160a0818c03601f190112156117dd5760008081fd5b6117e561144f565b6117f089830161141d565b815260406117ff81840161141d565b8a830152606080840135828401526080915081840135898111156118235760008081fd5b6118318f8d838801016114ec565b82850152505060a08301358881111561184a5760008081fd5b6118588e8c838701016114ec565b91830191909152508452509186019186016117af565b5098975050505050505050565b600082601f83011261188c57600080fd5b8135602061189c611615836115d1565b82815260059290921b840181019181810190868411156118bb57600080fd5b8286015b8481101561167857803583529183019183016118bf565b600082601f8301126118e757600080fd5b813560206118f7611615836115d1565b82815260059290921b8401810191818101908684111561191657600080fd5b8286015b848110156116785761192b8161141d565b835291830191830161191a565b600082601f83011261194957600080fd5b81356020611959611615836115d1565b82815260059290921b8401810191818101908684111561197857600080fd5b8286015b84811015611678578035600281106119945760008081fd5b835291830191830161197c565b8035801515811461143457600080fd5b6000806000606084860312156119c657600080fd5b83356001600160401b03808211156119dd57600080fd5b818601915086601f8301126119f157600080fd5b81356020611a01611615836115d1565b82815260059290921b8401810191818101908a841115611a2057600080fd5b8286015b84811015611b3257803586811115611a3b57600080fd5b870160c0818e03601f19011215611a5157600080fd5b611a59611477565b8582013588811115611a6a57600080fd5b611a788f88838601016114ec565b825250604082013588811115611a8d57600080fd5b611a9b8f888386010161187b565b8783015250606082013588811115611ab257600080fd5b611ac08f888386010161187b565b604083015250608082013588811115611ad857600080fd5b611ae68f88838601016118d6565b60608301525060a082013588811115611aff5760008081fd5b611b0d8f8883860101611938565b608083015250611b1f60c083016119a1565b60a0820152845250918301918301611a24565b509750508701359450506040860135915080821115611b5057600080fd5b50611b5d868287016114ec565b9150509250925092565b60008060008060008060c08789031215611b8057600080fd5b86356001600160401b0380821115611b9757600080fd5b611ba38a838b016114ec565b9750611bb160208a0161141d565b96506040890135915080821115611bc757600080fd5b50611bd489828a016114ec565b945050611be36060880161141d565b9250611bf16080880161141d565b915060a087013590509295509295509295565b60006101608284031215611c1757600080fd5b611c1f611499565b9050813581526020820135602082015260408201356040820152606082013560608201526080820135608082015260a082013560a082015260c082013560c082015260e082013560e082015261010080830135818301525061012080830135818301525061014080830135818301525092915050565b600080600080848603610300811215611cad57600080fd5b61016080821215611cbd57600080fd5b611cc5611499565b9150611cd08761141d565b8252611cde6020880161141d565b6020830152611cef6040880161141d565b6040830152611d006060880161141d565b6060830152611d116080880161141d565b6080830152611d2260a0880161141d565b60a0830152611d3360c0880161141d565b60c0830152611d4460e0880161141d565b60e0830152610100611d5781890161141d565b90830152610120611d6988820161141d565b90830152610140611d7b88820161141d565b8184015250819550611d8f88828901611c04565b945050506102c085013591506102e08501356001600160401b03811115611db557600080fd5b611708878288016114ec565b60008060008060808587031215611dd757600080fd5b611de08561141d565b9350611dee6020860161141d565b9250611dfc6040860161141d565b9396929550929360600135925050565b60008060208385031215611e1f57600080fd5b82356001600160401b0380821115611e3657600080fd5b818501915085601f830112611e4a57600080fd5b813581811115611e5957600080fd5b8660208260051b8501011115611e6e57600080fd5b60209290920196919550909350505050565b60008060008060008060c08789031215611e9957600080fd5b611ea28761141d565b9550611eb06020880161141d565b9450611ebe6040880161141d565b9350611ecc6060880161141d565b925060808701356001600160401b03811115611ee757600080fd5b611ef389828a016114ec565b92505060a087013590509295509295509295565b600080600060608486031215611f1c57600080fd5b83356001600160401b0380821115611f3357600080fd5b611f3f878388016114ec565b9450602086013593506040860135915080821115611b5057600080fd5b600080600060608486031215611f7157600080fd5b611f7a8461141d565b925060208401356001600160401b03811115611f9557600080fd5b611fa1868287016114ec565b925050604084013590509250925092565b600080600060608486031215611fc757600080fd5b833592506020840135915060408401356001600160401b03811115611feb57600080fd5b611b5d868287016114ec565b60008060006060848603121561200c57600080fd5b612015846119a1565b92506020840135915060408401356001600160401b03811115611feb57600080fd5b60208082526025908201527f4576656e74456d69747465723a2043616c6c6572206973206e6f7420617574686040820152646f72697a6560d81b606082015260800190565b60005b8381101561209757818101518382015260200161207f565b50506000910152565b600081518084526120b881602086016020860161207c565b601f01601f19169290920160200192915050565b6001600160a01b03868116825285811660208301528416604082015260a060608201819052600090612100908301856120a0565b90508260808301529695505050505050565b6020808252601f908201527f4576656e74456d69747465723a20496e76616c6964207369676e617475726500604082015260600190565b600081518084526020808501808196508360051b8101915082860160005b8581101561219157828403895261217f8483516120a0565b98850198935090840190600101612167565b5091979650505050505050565b6001600160a01b03841681526060602082018190526000906121c290830185612149565b82810360408401526121d48185612149565b9695505050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561228657888303603f19018552815180516001600160a01b039081168552888201511688850152868101518785015260608082015160a08287018190529190612254838801826120a0565b925050506080808301519250858203818701525061227281836120a0565b968901969450505090860190600101612205565b509098975050505050505050565b600081518084526020808501945080840160005b838110156122c4578151875295820195908201906001016122a8565b509495945050505050565b634e487b7160e01b600052602160045260246000fd5b60008151808452602080850194508084016000805b848110156123325782516002811061232057634e487b7160e01b83526021600452602483fd5b885296830196918301916001016122fa565b50959695505050505050565b6001600160a01b038381168252604060208084018290528451848301819052600093606092909183870190600581901b8801850189840188805b8481101561245657605f198c8503018652825160c0815181875261239e828801826120a0565b915050888201518682038a8801526123b68282612294565b9150508b8201518682038d8801526123ce8282612294565b838d0151888203898f01528051808352908c019350869250908b01905b8083101561240d5783518d168252928b019260019290920191908b01906123eb565b50608092508284015191508781038389015261242981836122e5565b9250505060a08083015192506124428188018415159052565b509688019694505091860191600101612378565b50919c9b505050505050505050505050565b60c08152600061247b60c08301896120a0565b6001600160a01b038881166020850152838203604085015261249d82896120a0565b96811660608501529490941660808301525060a00152509392505050565b82516001600160a01b031681526102c0810160208401516124e760208401826001600160a01b03169052565b50604084015161250260408401826001600160a01b03169052565b50606084015161251d60608401826001600160a01b03169052565b50608084015161253860808401826001600160a01b03169052565b5060a084015161255360a08401826001600160a01b03169052565b5060c084015161256e60c08401826001600160a01b03169052565b5060e084015161258960e08401826001600160a01b03169052565b50610100848101516001600160a01b03908116848301526101208087015182168186015261014096870151909116868501528451610160850152602085015161018085015260408501516101a085015260608501516101c085015260808501516101e085015260a085015161020085015260c085015161022085015260e08501516102408501529084015161026084015283015161028083015291909201516102a09092019190915290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561265d57600080fd5b6112e68261141d565b634e487b7160e01b600052601160045260246000fd5b60006001820161268e5761268e612666565b5060010190565b6001600160a01b038781168252868116602083015285811660408301528416606082015260c0608082018190526000906126d1908301856120a0565b90508260a0830152979650505050505050565b6001600160a01b0383168152604060208201819052600090612708908301846120a0565b949350505050565b6001600160a01b0384168152606060208201819052600090612734908301856120a0565b9050826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161277c81601785016020880161207c565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516127ad81602884016020880161207c565b01602801949350505050565b6020815260006112e660208301846120a0565b808202811582820484141761036457610364612666565b8082018082111561036457610364612666565b60008161280557612805612666565b50600019019056fec57cfbdcb027dc772277efccd5a056d9cfab3cf1ce9f17260b4b1e52fa1cb01da2646970667358221220fee19e5635a531aa561c5f145e21358f2652acecf1c370a18b76c741d1f5ad2464736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806391d14854116100c3578063b70c5e0a1161007c578063b70c5e0a146102c1578063bc265ffc146102d4578063bec3e746146102e7578063c896e001146102fa578063d547741f1461030d578063fc7050eb1461032057600080fd5b806391d148541461025a5780639840fcbc1461026d5780639d7fa22214610280578063a217fddf14610293578063a224cee71461029b578063ab8697a9146102ae57600080fd5b806336568abe1161011557806336568abe146101e65780634d2ee68f146101f957806364c897e61461020c57806378ffa8321461021f578063897e4864146102345780638c1d0dcd1461024757600080fd5b806301ffc9a714610152578063248a9ca31461017a57806324e04a71146101ab578063263199e4146101c05780632f2ff15d146101d3575b600080fd5b6101656101603660046113da565b610333565b60405190151581526020015b60405180910390f35b61019d610188366004611404565b60009081526065602052604090206001015490565b604051908152602001610171565b6101be6101b936600461155b565b61036a565b005b6101be6101ce366004611683565b6103ed565b6101be6101e1366004611714565b610454565b6101be6101f4366004611714565b61047e565b6101be610207366004611740565b6104fc565b6101be61021a3660046119b1565b61056a565b61019d60008051602061280e83398151915281565b6101be610242366004611683565b6105ce565b6101be610255366004611b67565b610627565b610165610268366004611714565b6106a4565b6101be61027b366004611c95565b6106cf565b6101be61028e366004611dc1565b610726565b61019d600081565b6101be6102a9366004611e0c565b6107ad565b6101be6102bc366004611e80565b610a1f565b6101be6102cf366004611f07565b610a8c565b6101be6102e2366004611f5c565b610ae3565b6101be6102f5366004611f07565b610b4a565b6101be610308366004611fb2565b610ba1565b6101be61031b366004611714565b610bfd565b6101be61032e366004611ff7565b610c22565b60006001600160e01b03198216637965db0b60e01b148061036457506301ffc9a760e01b6001600160e01b03198316145b92915050565b61038260008051602061280e833981519152336106a4565b6103a75760405162461bcd60e51b815260040161039e90612037565b60405180910390fd5b7f8d1b3e5e987309defa3658d792853893675b3c4ea5a0f44d365dee3eef5a799785858585856040516103de9594939291906120cc565b60405180910390a15050505050565b6103f78282610c7f565b6104135760405162461bcd60e51b815260040161039e90612112565b7f701341dab53daa195c150879af86e9bd05e9d8dedd9b4df4543025e84a27a9913385856040516104469392919061219e565b60405180910390a150505050565b60008281526065602052604090206001015461046f81610d57565b6104798383610d64565b505050565b6001600160a01b03811633146104ee5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161039e565b6104f88282610dea565b5050565b61051460008051602061280e833981519152336106a4565b6105305760405162461bcd60e51b815260040161039e90612037565b7f880e4042538d02e4b256409508f7f73ee2cb6de6e4181f8b689cd2b8226501e48160405161055f91906121de565b60405180910390a150565b6105748282610c7f565b6105905760405162461bcd60e51b815260040161039e90612112565b7fc136759827e36818952a05c802f4264ef6968620d3c63015814eb33a450cc5d333846040516105c192919061233e565b60405180910390a1505050565b6105d88282610c7f565b6105f45760405162461bcd60e51b815260040161039e90612112565b7fab2fa6303270d31c057bae3c5b6904c0eb7a8e20869d7f73966b12c73f79b26d3385856040516104469392919061219e565b61063f60008051602061280e833981519152336106a4565b61065b5760405162461bcd60e51b815260040161039e90612037565b7f55b794dafa1f1abc152641c2503ca3f5fbab6e78a8bcdd32003040ca4fdde1e386868686868660405161069496959493929190612468565b60405180910390a1505050505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6106d98282610c7f565b6106f55760405162461bcd60e51b815260040161039e90612112565b7f5d333432362e35b0d098fe50ff366868b334be014a6480658f4d02f70edcea0a84846040516104469291906124bb565b61073e60008051602061280e833981519152336106a4565b61075a5760405162461bcd60e51b815260040161039e90612037565b604080516001600160a01b0380871682528086166020830152841691810191909152606081018290527f84a378a2b0bf43510ca7fcc04c9178dc4032679ec14d066b2a04eefe512d5b9590608001610446565b600054610100900460ff16158080156107cd5750600054600160ff909116105b806107e75750303b1580156107e7575060005460ff166001145b61084a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161039e565b6000805460ff19166001179055801561086d576000805461ff0019166101001790555b816108d85760405162461bcd60e51b815260206004820152603560248201527f4576656e74456d69747465723a20417574686f72697a652061646472657373206044820152746c656e6774682063616e6e6f74206265207a65726f60581b606482015260840161039e565b6108e0610e51565b6108eb600033610ebe565b60005b828110156109dc57600084848381811061090a5761090a612635565b905060200201602081019061091f919061264b565b6001600160a01b03160361098c5760405162461bcd60e51b815260206004820152602e60248201527f4576656e74456d69747465723a20417574686f72697a6520616464726573732060448201526d63616e6e6f74206265207a65726f60901b606482015260840161039e565b6109ca60008051602061280e8339815191528585848181106109b0576109b0612635565b90506020020160208101906109c5919061264b565b610ebe565b806109d48161267c565b9150506108ee565b508015610479576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016105c1565b610a3760008051602061280e833981519152336106a4565b610a535760405162461bcd60e51b815260040161039e90612037565b7f0c618048b7e8b3cec866d5700002ef66ea863a99893d0898229b2e54468eb0a886868686868660405161069496959493929190612695565b610a968282610c7f565b610ab25760405162461bcd60e51b815260040161039e90612112565b7f48b5f95cd6149600cd336157cbf68db6f6b77c87005d04c8e25b540b3884d5b433846040516105c19291906126e4565b610afb60008051602061280e833981519152336106a4565b610b175760405162461bcd60e51b815260040161039e90612037565b7ff8b89dd6495dcbf6b7783539fbde530ce681c43e264ec25d61deffcfd78cd0d98383836040516105c193929190612710565b610b548282610c7f565b610b705760405162461bcd60e51b815260040161039e90612112565b7f248613fae139fc21335148b61f730ca3b0f6de4ccec10fa5f1915e40d062eb9d33846040516105c19291906126e4565b610bab8282610c7f565b610bc75760405162461bcd60e51b815260040161039e90612112565b60408051338152602081018590527f68a1b031530d1e16f5d8d8bcdff1c086c1084a4084c7f5390eaaa31a651d896b91016105c1565b600082815260656020526040902060010154610c1881610d57565b6104798383610dea565b610c2c8282610c7f565b610c485760405162461bcd60e51b815260040161039e90612112565b6040805133815284151560208201527f127630bd852635b8265c4bcf6825010a294c8b032e9ee0e8e57a47cbaa6bffc691016105c1565b60008083604051602001610c9591815260200190565b6040516020818303038152906040528051906020012090506000610d06826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000610d148286610ec8565b9050610d2e60008051602061280e833981519152826106a4565b8015610d3a5750854211155b15610d4b5760019350505050610364565b50600095945050505050565b610d618133610eec565b50565b610d6e82826106a4565b6104f85760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610da63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610df482826106a4565b156104f85760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff16610ebc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161039e565b565b6104f88282610d64565b6000806000610ed78585610f50565b91509150610ee481610f95565b509392505050565b610ef682826106a4565b6104f857610f0e816001600160a01b0316601461114b565b610f1983602061114b565b604051602001610f2a929190612744565b60408051601f198184030181529082905262461bcd60e51b825261039e916004016127b9565b6000808251604103610f865760208301516040840151606085015160001a610f7a878285856112ed565b94509450505050610f8e565b506000905060025b9250929050565b6000816004811115610fa957610fa96122cf565b03610fb15750565b6001816004811115610fc557610fc56122cf565b036110125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161039e565b6002816004811115611026576110266122cf565b036110735760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161039e565b6003816004811115611087576110876122cf565b036110df5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161039e565b60048160048111156110f3576110f36122cf565b03610d615760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161039e565b6060600061115a8360026127cc565b6111659060026127e3565b6001600160401b0381111561117c5761117c611439565b6040519080825280601f01601f1916602001820160405280156111a6576020820181803683370190505b509050600360fc1b816000815181106111c1576111c1612635565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106111f0576111f0612635565b60200101906001600160f81b031916908160001a90535060006112148460026127cc565b61121f9060016127e3565b90505b6001811115611297576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061125357611253612635565b1a60f81b82828151811061126957611269612635565b60200101906001600160f81b031916908160001a90535060049490941c93611290816127f6565b9050611222565b5083156112e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161039e565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561132457506000905060036113d1565b8460ff16601b1415801561133c57508460ff16601c14155b1561134d57506000905060046113d1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156113a1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166113ca576000600192509250506113d1565b9150600090505b94509492505050565b6000602082840312156113ec57600080fd5b81356001600160e01b0319811681146112e657600080fd5b60006020828403121561141657600080fd5b5035919050565b80356001600160a01b038116811461143457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171561147157611471611439565b60405290565b60405160c081016001600160401b038111828210171561147157611471611439565b60405161016081016001600160401b038111828210171561147157611471611439565b604051601f8201601f191681016001600160401b03811182821017156114e4576114e4611439565b604052919050565b600082601f8301126114fd57600080fd5b81356001600160401b0381111561151657611516611439565b611529601f8201601f19166020016114bc565b81815284602083860101111561153e57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561157357600080fd5b61157c8661141d565b945061158a6020870161141d565b93506115986040870161141d565b925060608601356001600160401b038111156115b357600080fd5b6115bf888289016114ec565b95989497509295608001359392505050565b60006001600160401b038211156115ea576115ea611439565b5060051b60200190565b600082601f83011261160557600080fd5b8135602061161a611615836115d1565b6114bc565b82815260059290921b8401810191818101908684111561163957600080fd5b8286015b848110156116785780356001600160401b0381111561165c5760008081fd5b61166a8986838b01016114ec565b84525091830191830161163d565b509695505050505050565b6000806000806080858703121561169957600080fd5b84356001600160401b03808211156116b057600080fd5b6116bc888389016115f4565b955060208701359150808211156116d257600080fd5b6116de888389016115f4565b94506040870135935060608701359150808211156116fb57600080fd5b50611708878288016114ec565b91505092959194509250565b6000806040838503121561172757600080fd5b823591506117376020840161141d565b90509250929050565b6000602080838503121561175357600080fd5b82356001600160401b038082111561176a57600080fd5b818501915085601f83011261177e57600080fd5b813561178c611615826115d1565b81815260059190911b830184019084810190888311156117ab57600080fd5b8585015b8381101561186e578035858111156117c657600080fd5b860160a0818c03601f190112156117dd5760008081fd5b6117e561144f565b6117f089830161141d565b815260406117ff81840161141d565b8a830152606080840135828401526080915081840135898111156118235760008081fd5b6118318f8d838801016114ec565b82850152505060a08301358881111561184a5760008081fd5b6118588e8c838701016114ec565b91830191909152508452509186019186016117af565b5098975050505050505050565b600082601f83011261188c57600080fd5b8135602061189c611615836115d1565b82815260059290921b840181019181810190868411156118bb57600080fd5b8286015b8481101561167857803583529183019183016118bf565b600082601f8301126118e757600080fd5b813560206118f7611615836115d1565b82815260059290921b8401810191818101908684111561191657600080fd5b8286015b848110156116785761192b8161141d565b835291830191830161191a565b600082601f83011261194957600080fd5b81356020611959611615836115d1565b82815260059290921b8401810191818101908684111561197857600080fd5b8286015b84811015611678578035600281106119945760008081fd5b835291830191830161197c565b8035801515811461143457600080fd5b6000806000606084860312156119c657600080fd5b83356001600160401b03808211156119dd57600080fd5b818601915086601f8301126119f157600080fd5b81356020611a01611615836115d1565b82815260059290921b8401810191818101908a841115611a2057600080fd5b8286015b84811015611b3257803586811115611a3b57600080fd5b870160c0818e03601f19011215611a5157600080fd5b611a59611477565b8582013588811115611a6a57600080fd5b611a788f88838601016114ec565b825250604082013588811115611a8d57600080fd5b611a9b8f888386010161187b565b8783015250606082013588811115611ab257600080fd5b611ac08f888386010161187b565b604083015250608082013588811115611ad857600080fd5b611ae68f88838601016118d6565b60608301525060a082013588811115611aff5760008081fd5b611b0d8f8883860101611938565b608083015250611b1f60c083016119a1565b60a0820152845250918301918301611a24565b509750508701359450506040860135915080821115611b5057600080fd5b50611b5d868287016114ec565b9150509250925092565b60008060008060008060c08789031215611b8057600080fd5b86356001600160401b0380821115611b9757600080fd5b611ba38a838b016114ec565b9750611bb160208a0161141d565b96506040890135915080821115611bc757600080fd5b50611bd489828a016114ec565b945050611be36060880161141d565b9250611bf16080880161141d565b915060a087013590509295509295509295565b60006101608284031215611c1757600080fd5b611c1f611499565b9050813581526020820135602082015260408201356040820152606082013560608201526080820135608082015260a082013560a082015260c082013560c082015260e082013560e082015261010080830135818301525061012080830135818301525061014080830135818301525092915050565b600080600080848603610300811215611cad57600080fd5b61016080821215611cbd57600080fd5b611cc5611499565b9150611cd08761141d565b8252611cde6020880161141d565b6020830152611cef6040880161141d565b6040830152611d006060880161141d565b6060830152611d116080880161141d565b6080830152611d2260a0880161141d565b60a0830152611d3360c0880161141d565b60c0830152611d4460e0880161141d565b60e0830152610100611d5781890161141d565b90830152610120611d6988820161141d565b90830152610140611d7b88820161141d565b8184015250819550611d8f88828901611c04565b945050506102c085013591506102e08501356001600160401b03811115611db557600080fd5b611708878288016114ec565b60008060008060808587031215611dd757600080fd5b611de08561141d565b9350611dee6020860161141d565b9250611dfc6040860161141d565b9396929550929360600135925050565b60008060208385031215611e1f57600080fd5b82356001600160401b0380821115611e3657600080fd5b818501915085601f830112611e4a57600080fd5b813581811115611e5957600080fd5b8660208260051b8501011115611e6e57600080fd5b60209290920196919550909350505050565b60008060008060008060c08789031215611e9957600080fd5b611ea28761141d565b9550611eb06020880161141d565b9450611ebe6040880161141d565b9350611ecc6060880161141d565b925060808701356001600160401b03811115611ee757600080fd5b611ef389828a016114ec565b92505060a087013590509295509295509295565b600080600060608486031215611f1c57600080fd5b83356001600160401b0380821115611f3357600080fd5b611f3f878388016114ec565b9450602086013593506040860135915080821115611b5057600080fd5b600080600060608486031215611f7157600080fd5b611f7a8461141d565b925060208401356001600160401b03811115611f9557600080fd5b611fa1868287016114ec565b925050604084013590509250925092565b600080600060608486031215611fc757600080fd5b833592506020840135915060408401356001600160401b03811115611feb57600080fd5b611b5d868287016114ec565b60008060006060848603121561200c57600080fd5b612015846119a1565b92506020840135915060408401356001600160401b03811115611feb57600080fd5b60208082526025908201527f4576656e74456d69747465723a2043616c6c6572206973206e6f7420617574686040820152646f72697a6560d81b606082015260800190565b60005b8381101561209757818101518382015260200161207f565b50506000910152565b600081518084526120b881602086016020860161207c565b601f01601f19169290920160200192915050565b6001600160a01b03868116825285811660208301528416604082015260a060608201819052600090612100908301856120a0565b90508260808301529695505050505050565b6020808252601f908201527f4576656e74456d69747465723a20496e76616c6964207369676e617475726500604082015260600190565b600081518084526020808501808196508360051b8101915082860160005b8581101561219157828403895261217f8483516120a0565b98850198935090840190600101612167565b5091979650505050505050565b6001600160a01b03841681526060602082018190526000906121c290830185612149565b82810360408401526121d48185612149565b9695505050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561228657888303603f19018552815180516001600160a01b039081168552888201511688850152868101518785015260608082015160a08287018190529190612254838801826120a0565b925050506080808301519250858203818701525061227281836120a0565b968901969450505090860190600101612205565b509098975050505050505050565b600081518084526020808501945080840160005b838110156122c4578151875295820195908201906001016122a8565b509495945050505050565b634e487b7160e01b600052602160045260246000fd5b60008151808452602080850194508084016000805b848110156123325782516002811061232057634e487b7160e01b83526021600452602483fd5b885296830196918301916001016122fa565b50959695505050505050565b6001600160a01b038381168252604060208084018290528451848301819052600093606092909183870190600581901b8801850189840188805b8481101561245657605f198c8503018652825160c0815181875261239e828801826120a0565b915050888201518682038a8801526123b68282612294565b9150508b8201518682038d8801526123ce8282612294565b838d0151888203898f01528051808352908c019350869250908b01905b8083101561240d5783518d168252928b019260019290920191908b01906123eb565b50608092508284015191508781038389015261242981836122e5565b9250505060a08083015192506124428188018415159052565b509688019694505091860191600101612378565b50919c9b505050505050505050505050565b60c08152600061247b60c08301896120a0565b6001600160a01b038881166020850152838203604085015261249d82896120a0565b96811660608501529490941660808301525060a00152509392505050565b82516001600160a01b031681526102c0810160208401516124e760208401826001600160a01b03169052565b50604084015161250260408401826001600160a01b03169052565b50606084015161251d60608401826001600160a01b03169052565b50608084015161253860808401826001600160a01b03169052565b5060a084015161255360a08401826001600160a01b03169052565b5060c084015161256e60c08401826001600160a01b03169052565b5060e084015161258960e08401826001600160a01b03169052565b50610100848101516001600160a01b03908116848301526101208087015182168186015261014096870151909116868501528451610160850152602085015161018085015260408501516101a085015260608501516101c085015260808501516101e085015260a085015161020085015260c085015161022085015260e08501516102408501529084015161026084015283015161028083015291909201516102a09092019190915290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561265d57600080fd5b6112e68261141d565b634e487b7160e01b600052601160045260246000fd5b60006001820161268e5761268e612666565b5060010190565b6001600160a01b038781168252868116602083015285811660408301528416606082015260c0608082018190526000906126d1908301856120a0565b90508260a0830152979650505050505050565b6001600160a01b0383168152604060208201819052600090612708908301846120a0565b949350505050565b6001600160a01b0384168152606060208201819052600090612734908301856120a0565b9050826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161277c81601785016020880161207c565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516127ad81602884016020880161207c565b01602801949350505050565b6020815260006112e660208301846120a0565b808202811582820484141761036457610364612666565b8082018082111561036457610364612666565b60008161280557612805612666565b50600019019056fec57cfbdcb027dc772277efccd5a056d9cfab3cf1ce9f17260b4b1e52fa1cb01da2646970667358221220fee19e5635a531aa561c5f145e21358f2652acecf1c370a18b76c741d1f5ad2464736f6c63430008110033
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.