Source Code
Overview
POL Balance
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6872CAcD...F5D91F4db The constructor portion of the code might be different and could alter the actual behaviour of the contract
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); 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 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 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 bitWallet; address vdtContract; uint256 royalty; uint256 affiliate; uint256 seller; uint256 bit; uint256 assetId; uint256 quantity; } /** * @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 pragma solidity ^0.8.17; interface IBaseOrchestrator { struct VDTTokenDetail { address user; address vdtContract; uint256 vdtId; string vdtName; string metadataURI; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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":[{"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":[{"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"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806391d14854116100b8578063b70c5e0a1161007c578063b70c5e0a146102a3578063bc265ffc146102b6578063bec3e746146102c9578063c896e001146102dc578063d547741f146102ef578063fc7050eb1461030257600080fd5b806391d148541461024f5780639d7fa22214610262578063a217fddf14610275578063a224cee71461027d578063ab8697a91461029057600080fd5b806336568abe1161010a57806336568abe146101db5780634d2ee68f146101ee57806364c897e61461020157806378ffa83214610214578063897e4864146102295780638c1d0dcd1461023c57600080fd5b806301ffc9a714610147578063248a9ca31461016f57806324e04a71146101a0578063263199e4146101b55780632f2ff15d146101c8575b600080fd5b61015a610155366004611365565b610315565b60405190151581526020015b60405180910390f35b61019261017d36600461138f565b60009081526065602052604090206001015490565b604051908152602001610166565b6101b36101ae3660046114c3565b61034c565b005b6101b36101c33660046115eb565b6103cf565b6101b36101d636600461167c565b610436565b6101b36101e936600461167c565b610460565b6101b36101fc3660046116a8565b6104de565b6101b361020f366004611919565b61054c565b61019260008051602061243f83398151915281565b6101b36102373660046115eb565b6105b0565b6101b361024a366004611acf565b610609565b61015a61025d36600461167c565b610686565b6101b3610270366004611b6c565b6106b1565b610192600081565b6101b361028b366004611bb7565b610738565b6101b361029e366004611c2b565b6109aa565b6101b36102b1366004611cb2565b610a17565b6101b36102c4366004611d07565b610a6e565b6101b36102d7366004611cb2565b610ad5565b6101b36102ea366004611d5d565b610b2c565b6101b36102fd36600461167c565b610b88565b6101b3610310366004611da2565b610bad565b60006001600160e01b03198216637965db0b60e01b148061034657506301ffc9a760e01b6001600160e01b03198316145b92915050565b61036460008051602061243f83398151915233610686565b6103895760405162461bcd60e51b815260040161038090611de2565b60405180910390fd5b7f8d1b3e5e987309defa3658d792853893675b3c4ea5a0f44d365dee3eef5a799785858585856040516103c0959493929190611e77565b60405180910390a15050505050565b6103d98282610c0a565b6103f55760405162461bcd60e51b815260040161038090611ebd565b7f701341dab53daa195c150879af86e9bd05e9d8dedd9b4df4543025e84a27a99133858560405161042893929190611f49565b60405180910390a150505050565b60008281526065602052604090206001015461045181610ce2565b61045b8383610cef565b505050565b6001600160a01b03811633146104d05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610380565b6104da8282610d75565b5050565b6104f660008051602061243f83398151915233610686565b6105125760405162461bcd60e51b815260040161038090611de2565b7f880e4042538d02e4b256409508f7f73ee2cb6de6e4181f8b689cd2b8226501e4816040516105419190611f89565b60405180910390a150565b6105568282610c0a565b6105725760405162461bcd60e51b815260040161038090611ebd565b7fc136759827e36818952a05c802f4264ef6968620d3c63015814eb33a450cc5d333846040516105a39291906120e9565b60405180910390a1505050565b6105ba8282610c0a565b6105d65760405162461bcd60e51b815260040161038090611ebd565b7fab2fa6303270d31c057bae3c5b6904c0eb7a8e20869d7f73966b12c73f79b26d33858560405161042893929190611f49565b61062160008051602061243f83398151915233610686565b61063d5760405162461bcd60e51b815260040161038090611de2565b7f55b794dafa1f1abc152641c2503ca3f5fbab6e78a8bcdd32003040ca4fdde1e386868686868660405161067696959493929190612213565b60405180910390a1505050505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6106c960008051602061243f83398151915233610686565b6106e55760405162461bcd60e51b815260040161038090611de2565b604080516001600160a01b0380871682528086166020830152841691810191909152606081018290527f84a378a2b0bf43510ca7fcc04c9178dc4032679ec14d066b2a04eefe512d5b9590608001610428565b600054610100900460ff16158080156107585750600054600160ff909116105b806107725750303b158015610772575060005460ff166001145b6107d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610380565b6000805460ff1916600117905580156107f8576000805461ff0019166101001790555b816108635760405162461bcd60e51b815260206004820152603560248201527f4576656e74456d69747465723a20417574686f72697a652061646472657373206044820152746c656e6774682063616e6e6f74206265207a65726f60581b6064820152608401610380565b61086b610ddc565b610876600033610e49565b60005b8281101561096757600084848381811061089557610895612266565b90506020020160208101906108aa919061227c565b6001600160a01b0316036109175760405162461bcd60e51b815260206004820152602e60248201527f4576656e74456d69747465723a20417574686f72697a6520616464726573732060448201526d63616e6e6f74206265207a65726f60901b6064820152608401610380565b61095560008051602061243f83398151915285858481811061093b5761093b612266565b9050602002016020810190610950919061227c565b610e49565b8061095f816122ad565b915050610879565b50801561045b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016105a3565b6109c260008051602061243f83398151915233610686565b6109de5760405162461bcd60e51b815260040161038090611de2565b7f0c618048b7e8b3cec866d5700002ef66ea863a99893d0898229b2e54468eb0a8868686868686604051610676969594939291906122c6565b610a218282610c0a565b610a3d5760405162461bcd60e51b815260040161038090611ebd565b7f48b5f95cd6149600cd336157cbf68db6f6b77c87005d04c8e25b540b3884d5b433846040516105a3929190612315565b610a8660008051602061243f83398151915233610686565b610aa25760405162461bcd60e51b815260040161038090611de2565b7ff8b89dd6495dcbf6b7783539fbde530ce681c43e264ec25d61deffcfd78cd0d98383836040516105a393929190612341565b610adf8282610c0a565b610afb5760405162461bcd60e51b815260040161038090611ebd565b7f248613fae139fc21335148b61f730ca3b0f6de4ccec10fa5f1915e40d062eb9d33846040516105a3929190612315565b610b368282610c0a565b610b525760405162461bcd60e51b815260040161038090611ebd565b60408051338152602081018590527f68a1b031530d1e16f5d8d8bcdff1c086c1084a4084c7f5390eaaa31a651d896b91016105a3565b600082815260656020526040902060010154610ba381610ce2565b61045b8383610d75565b610bb78282610c0a565b610bd35760405162461bcd60e51b815260040161038090611ebd565b6040805133815284151560208201527f127630bd852635b8265c4bcf6825010a294c8b032e9ee0e8e57a47cbaa6bffc691016105a3565b60008083604051602001610c2091815260200190565b6040516020818303038152906040528051906020012090506000610c91826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000610c9f8286610e53565b9050610cb960008051602061243f83398151915282610686565b8015610cc55750854211155b15610cd65760019350505050610346565b50600095945050505050565b610cec8133610e77565b50565b610cf98282610686565b6104da5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610d313390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610d7f8282610686565b156104da5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff16610e475760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610380565b565b6104da8282610cef565b6000806000610e628585610edb565b91509150610e6f81610f20565b509392505050565b610e818282610686565b6104da57610e99816001600160a01b031660146110d6565b610ea48360206110d6565b604051602001610eb5929190612375565b60408051601f198184030181529082905262461bcd60e51b8252610380916004016123ea565b6000808251604103610f115760208301516040840151606085015160001a610f0587828585611278565b94509450505050610f19565b506000905060025b9250929050565b6000816004811115610f3457610f3461207a565b03610f3c5750565b6001816004811115610f5057610f5061207a565b03610f9d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610380565b6002816004811115610fb157610fb161207a565b03610ffe5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610380565b60038160048111156110125761101261207a565b0361106a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610380565b600481600481111561107e5761107e61207a565b03610cec5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610380565b606060006110e58360026123fd565b6110f0906002612414565b6001600160401b03811115611107576111076113c4565b6040519080825280601f01601f191660200182016040528015611131576020820181803683370190505b509050600360fc1b8160008151811061114c5761114c612266565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061117b5761117b612266565b60200101906001600160f81b031916908160001a905350600061119f8460026123fd565b6111aa906001612414565b90505b6001811115611222576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106111de576111de612266565b1a60f81b8282815181106111f4576111f4612266565b60200101906001600160f81b031916908160001a90535060049490941c9361121b81612427565b90506111ad565b5083156112715760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610380565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156112af575060009050600361135c565b8460ff16601b141580156112c757508460ff16601c14155b156112d8575060009050600461135c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561132c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166113555760006001925092505061135c565b9150600090505b94509492505050565b60006020828403121561137757600080fd5b81356001600160e01b03198116811461127157600080fd5b6000602082840312156113a157600080fd5b5035919050565b80356001600160a01b03811681146113bf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b03811182821017156113fc576113fc6113c4565b60405290565b60405160c081016001600160401b03811182821017156113fc576113fc6113c4565b604051601f8201601f191681016001600160401b038111828210171561144c5761144c6113c4565b604052919050565b600082601f83011261146557600080fd5b81356001600160401b0381111561147e5761147e6113c4565b611491601f8201601f1916602001611424565b8181528460208386010111156114a657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156114db57600080fd5b6114e4866113a8565b94506114f2602087016113a8565b9350611500604087016113a8565b925060608601356001600160401b0381111561151b57600080fd5b61152788828901611454565b95989497509295608001359392505050565b60006001600160401b03821115611552576115526113c4565b5060051b60200190565b600082601f83011261156d57600080fd5b8135602061158261157d83611539565b611424565b82815260059290921b840181019181810190868411156115a157600080fd5b8286015b848110156115e05780356001600160401b038111156115c45760008081fd5b6115d28986838b0101611454565b8452509183019183016115a5565b509695505050505050565b6000806000806080858703121561160157600080fd5b84356001600160401b038082111561161857600080fd5b6116248883890161155c565b9550602087013591508082111561163a57600080fd5b6116468883890161155c565b945060408701359350606087013591508082111561166357600080fd5b5061167087828801611454565b91505092959194509250565b6000806040838503121561168f57600080fd5b8235915061169f602084016113a8565b90509250929050565b600060208083850312156116bb57600080fd5b82356001600160401b03808211156116d257600080fd5b818501915085601f8301126116e657600080fd5b81356116f461157d82611539565b81815260059190911b8301840190848101908883111561171357600080fd5b8585015b838110156117d65780358581111561172e57600080fd5b860160a0818c03601f190112156117455760008081fd5b61174d6113da565b6117588983016113a8565b815260406117678184016113a8565b8a8301526060808401358284015260809150818401358981111561178b5760008081fd5b6117998f8d83880101611454565b82850152505060a0830135888111156117b25760008081fd5b6117c08e8c83870101611454565b9183019190915250845250918601918601611717565b5098975050505050505050565b600082601f8301126117f457600080fd5b8135602061180461157d83611539565b82815260059290921b8401810191818101908684111561182357600080fd5b8286015b848110156115e05780358352918301918301611827565b600082601f83011261184f57600080fd5b8135602061185f61157d83611539565b82815260059290921b8401810191818101908684111561187e57600080fd5b8286015b848110156115e057611893816113a8565b8352918301918301611882565b600082601f8301126118b157600080fd5b813560206118c161157d83611539565b82815260059290921b840181019181810190868411156118e057600080fd5b8286015b848110156115e0578035600281106118fc5760008081fd5b83529183019183016118e4565b803580151581146113bf57600080fd5b60008060006060848603121561192e57600080fd5b83356001600160401b038082111561194557600080fd5b818601915086601f83011261195957600080fd5b8135602061196961157d83611539565b82815260059290921b8401810191818101908a84111561198857600080fd5b8286015b84811015611a9a578035868111156119a357600080fd5b870160c0818e03601f190112156119b957600080fd5b6119c1611402565b85820135888111156119d257600080fd5b6119e08f8883860101611454565b8252506040820135888111156119f557600080fd5b611a038f88838601016117e3565b8783015250606082013588811115611a1a57600080fd5b611a288f88838601016117e3565b604083015250608082013588811115611a4057600080fd5b611a4e8f888386010161183e565b60608301525060a082013588811115611a675760008081fd5b611a758f88838601016118a0565b608083015250611a8760c08301611909565b60a082015284525091830191830161198c565b509750508701359450506040860135915080821115611ab857600080fd5b50611ac586828701611454565b9150509250925092565b60008060008060008060c08789031215611ae857600080fd5b86356001600160401b0380821115611aff57600080fd5b611b0b8a838b01611454565b9750611b1960208a016113a8565b96506040890135915080821115611b2f57600080fd5b50611b3c89828a01611454565b945050611b4b606088016113a8565b9250611b59608088016113a8565b915060a087013590509295509295509295565b60008060008060808587031215611b8257600080fd5b611b8b856113a8565b9350611b99602086016113a8565b9250611ba7604086016113a8565b9396929550929360600135925050565b60008060208385031215611bca57600080fd5b82356001600160401b0380821115611be157600080fd5b818501915085601f830112611bf557600080fd5b813581811115611c0457600080fd5b8660208260051b8501011115611c1957600080fd5b60209290920196919550909350505050565b60008060008060008060c08789031215611c4457600080fd5b611c4d876113a8565b9550611c5b602088016113a8565b9450611c69604088016113a8565b9350611c77606088016113a8565b925060808701356001600160401b03811115611c9257600080fd5b611c9e89828a01611454565b92505060a087013590509295509295509295565b600080600060608486031215611cc757600080fd5b83356001600160401b0380821115611cde57600080fd5b611cea87838801611454565b9450602086013593506040860135915080821115611ab857600080fd5b600080600060608486031215611d1c57600080fd5b611d25846113a8565b925060208401356001600160401b03811115611d4057600080fd5b611d4c86828701611454565b925050604084013590509250925092565b600080600060608486031215611d7257600080fd5b833592506020840135915060408401356001600160401b03811115611d9657600080fd5b611ac586828701611454565b600080600060608486031215611db757600080fd5b611dc084611909565b92506020840135915060408401356001600160401b03811115611d9657600080fd5b60208082526025908201527f4576656e74456d69747465723a2043616c6c6572206973206e6f7420617574686040820152646f72697a6560d81b606082015260800190565b60005b83811015611e42578181015183820152602001611e2a565b50506000910152565b60008151808452611e63816020860160208601611e27565b601f01601f19169290920160200192915050565b6001600160a01b03868116825285811660208301528416604082015260a060608201819052600090611eab90830185611e4b565b90508260808301529695505050505050565b6020808252601f908201527f4576656e74456d69747465723a20496e76616c6964207369676e617475726500604082015260600190565b600081518084526020808501808196508360051b8101915082860160005b85811015611f3c578284038952611f2a848351611e4b565b98850198935090840190600101611f12565b5091979650505050505050565b6001600160a01b0384168152606060208201819052600090611f6d90830185611ef4565b8281036040840152611f7f8185611ef4565b9695505050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561203157888303603f19018552815180516001600160a01b039081168552888201511688850152868101518785015260608082015160a08287018190529190611fff83880182611e4b565b925050506080808301519250858203818701525061201d8183611e4b565b968901969450505090860190600101611fb0565b509098975050505050505050565b600081518084526020808501945080840160005b8381101561206f57815187529582019590820190600101612053565b509495945050505050565b634e487b7160e01b600052602160045260246000fd5b60008151808452602080850194508084016000805b848110156120dd578251600281106120cb57634e487b7160e01b83526021600452602483fd5b885296830196918301916001016120a5565b50959695505050505050565b6001600160a01b038381168252604060208084018290528451848301819052600093606092909183870190600581901b8801850189840188805b8481101561220157605f198c8503018652825160c0815181875261214982880182611e4b565b915050888201518682038a880152612161828261203f565b9150508b8201518682038d880152612179828261203f565b838d0151888203898f01528051808352908c019350869250908b01905b808310156121b85783518d168252928b019260019290920191908b0190612196565b5060809250828401519150878103838901526121d48183612090565b9250505060a08083015192506121ed8188018415159052565b509688019694505091860191600101612123565b50919c9b505050505050505050505050565b60c08152600061222660c0830189611e4b565b6001600160a01b03888116602085015283820360408501526122488289611e4b565b96811660608501529490941660808301525060a00152509392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561228e57600080fd5b611271826113a8565b634e487b7160e01b600052601160045260246000fd5b6000600182016122bf576122bf612297565b5060010190565b6001600160a01b038781168252868116602083015285811660408301528416606082015260c06080820181905260009061230290830185611e4b565b90508260a0830152979650505050505050565b6001600160a01b038316815260406020820181905260009061233990830184611e4b565b949350505050565b6001600160a01b038416815260606020820181905260009061236590830185611e4b565b9050826040830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516123ad816017850160208801611e27565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516123de816028840160208801611e27565b01602801949350505050565b6020815260006112716020830184611e4b565b808202811582820484141761034657610346612297565b8082018082111561034657610346612297565b60008161243657612436612297565b50600019019056fec57cfbdcb027dc772277efccd5a056d9cfab3cf1ce9f17260b4b1e52fa1cb01da2646970667358221220b37f85b6de9da71a6f6f008ff0eee67f97d41c69c0fbc37fbb10698a591149ef64736f6c63430008110033
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.