ETH Price: $3,797.45 (-1.09%)

Transaction Decoder

Block:
15020610 at Jun-24-2022 10:47:19 PM +UTC
Transaction Fee:
0.00167380718662185 ETH $6.36
Gas Used:
46,505 Gas / 35.99198337 Gwei

Emitted Events:

1 UTIL_TKN.Approval( owner=[Sender] 0x2e6d72131598e1401ab42d9f5ffcc595062ec581, spender=0x80C50231...b62e69B0C, value=115792089237316195423570985008687907853269984665640564039457584007913129639935 )

Account State Difference:

  Address   Before After State Difference Code
0x2e6D7213...5062EC581
0.137218442585283151 Eth
Nonce: 39
0.135544635398661301 Eth
Nonce: 40
0.00167380718662185
(F2Pool Old)
4,553.361372941983129204 Eth4,553.361948086804148719 Eth0.000575144821019515
0xa4981114...C811C4538

Execution Trace

UTIL_TKN.approve( spender=0x80C50231bBEAf678a950c4b9b7C68a6b62e69B0C, amount=115792089237316195423570985008687907853269984665640564039457584007913129639935 ) => ( True )
{"AccessControl.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./EnumerableSet.sol\";\nimport \"./Address.sol\";\nimport \"./Context.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\u0027s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context {\n    using EnumerableSet for EnumerableSet.AddressSet;\n    using Address for address;\n\n    struct RoleData {\n        EnumerableSet.AddressSet members;\n        bytes32 adminRole;\n    }\n\n    mapping (bytes32 =\u003e RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``\u0027s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view returns (bool) {\n        return _roles[role].members.contains(account);\n    }\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) public view returns (uint256) {\n        return _roles[role].members.length();\n    }\n\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {\n        return _roles[role].members.at(index);\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role\u0027s admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``\u0027s admin role.\n     */\n    function grantRole(bytes32 role, address account) public virtual {\n        require(hasRole(_roles[role].adminRole, _msgSender()), \"AccessControl: sender must be an admin to grant\");\n\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``\u0027s admin role.\n     */\n    function revokeRole(bytes32 role, address account) public virtual {\n        require(hasRole(_roles[role].adminRole, _msgSender()), \"AccessControl: sender must be an admin to revoke\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function\u0027s\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) public virtual {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn\u0027t perform any\n     * checks on the calling account.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``\u0027s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);\n        _roles[role].adminRole = adminRole;\n    }\n\n    function _grantRole(bytes32 role, address account) private {\n        if (_roles[role].members.add(account)) {\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    function _revokeRole(bytes32 role, address account) private {\n        if (_roles[role].members.remove(account)) {\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n}\n"},"Address.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        // solhint-disable-next-line no-inline-assembly\n        assembly { size := extcodesize(account) }\n        return size \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity\u0027s `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n        (bool success, ) = recipient.call{ value: amount }(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain`call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n      return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.3._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.3._\n     */\n    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                // solhint-disable-next-line no-inline-assembly\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"},"Arrays.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./Math.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary Arrays {\n   /**\n     * @dev Searches a sorted `array` and returns the first index that contains\n     * a value greater or equal to `element`. If no such index exists (i.e. all\n     * values in the array are strictly less than `element`), the array length is\n     * returned. Time complexity O(log n).\n     *\n     * `array` is expected to be sorted in ascending order, and to contain no\n     * repeated elements.\n     */\n    function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n        if (array.length == 0) {\n            return 0;\n        }\n\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        while (low \u003c high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds down (it does integer division with truncation).\n            if (array[mid] \u003e element) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n        if (low \u003e 0 \u0026\u0026 array[low - 1] == element) {\n            return low - 1;\n        } else {\n            return low;\n        }\n    }\n}\n"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address payable) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes memory) {\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n        return msg.data;\n    }\n}\n"},"Counters.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./SafeMath.sol\";\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}\n * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never\n * directly accessed.\n */\nlibrary Counters {\n    using SafeMath for uint256;\n\n    struct Counter {\n        // This variable should never be directly accessed by users of the library: interactions must be restricted to\n        // the library\u0027s function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n        // this feature: see https://github.com/ethereum/solidity/issues/4637\n        uint256 _value; // default: 0\n    }\n\n    function current(Counter storage counter) internal view returns (uint256) {\n        return counter._value;\n    }\n\n    function increment(Counter storage counter) internal {\n        // The {SafeMath} overflow check can be skipped here, see the comment at the top\n        counter._value += 1;\n    }\n\n    function decrement(Counter storage counter) internal {\n        counter._value = counter._value.sub(1);\n    }\n}\n"},"EnumerableSet.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n\n        // Position of the value in the `values` array, plus 1 because index 0\n        // means a value is not in the set.\n        mapping (bytes32 =\u003e uint256) _indexes;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._indexes[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We read and store the value\u0027s index to prevent multiple reads from the same storage slot\n        uint256 valueIndex = set._indexes[value];\n\n        if (valueIndex != 0) { // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as \u0027swap and pop\u0027).\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 toDeleteIndex = valueIndex - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n            // so rarely, we still do the swap anyway to avoid the gas cost of adding an \u0027if\u0027 statement.\n\n            bytes32 lastvalue = set._values[lastIndex];\n\n            // Move the last value to the index where the value to delete is\n            set._values[toDeleteIndex] = lastvalue;\n            // Update the index for the moved value\n            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the index for the deleted slot\n            delete set._indexes[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._indexes[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n   /**\n    * @dev Returns the value stored at position `index` in the set. O(1).\n    *\n    * Note that there are no guarantees on the ordering of values inside the\n    * array, and it may change when more values are added or removed.\n    *\n    * Requirements:\n    *\n    * - `index` must be strictly less than {length}.\n    */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        require(set._values.length \u003e index, \"EnumerableSet: index out of bounds\");\n        return set._values[index];\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n   /**\n    * @dev Returns the value stored at position `index` in the set. O(1).\n    *\n    * Note that there are no guarantees on the ordering of values inside the\n    * array, and it may change when more values are added or removed.\n    *\n    * Requirements:\n    *\n    * - `index` must be strictly less than {length}.\n    */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(value)));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(value)));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(value)));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n   /**\n    * @dev Returns the value stored at position `index` in the set. O(1).\n    *\n    * Note that there are no guarantees on the ordering of values inside the\n    * array, and it may change when more values are added or removed.\n    *\n    * Requirements:\n    *\n    * - `index` must be strictly less than {length}.\n    */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint256(_at(set._inner, index)));\n    }\n\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n   /**\n    * @dev Returns the value stored at position `index` in the set. O(1).\n    *\n    * Note that there are no guarantees on the ordering of values inside the\n    * array, and it may change when more values are added or removed.\n    *\n    * Requirements:\n    *\n    * - `index` must be strictly less than {length}.\n    */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n}\n"},"ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./Context.sol\";\nimport \"./IERC20.sol\";\nimport \"./SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn\u0027t required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n    using SafeMath for uint256;\n\n    mapping (address =\u003e uint256) private _balances;\n\n    mapping (address =\u003e mapping (address =\u003e uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n    uint8 private _decimals;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n     * a default value of 18.\n     *\n     * To select a different value for {decimals}, use {_setupDecimals}.\n     *\n     * All three of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor (string memory name, string memory symbol) public {\n        _name = name;\n        _symbol = symbol;\n        _decimals = 18;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n     * called.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view returns (uint8) {\n        return _decimals;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view override returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `recipient` cannot be the zero address.\n     * - the caller must have a balance of at least `amount`.\n     */\n    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n        _transfer(_msgSender(), recipient, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\n        _approve(_msgSender(), spender, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * Requirements:\n     *\n     * - `sender` and `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``sender``\u0027s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n        _transfer(sender, recipient, amount);\n        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n        return true;\n    }\n\n    /**\n     * @dev Moves tokens `amount` from `sender` to `recipient`.\n     *\n     * This is internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `sender` cannot be the zero address.\n     * - `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     */\n    function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n        require(sender != address(0), \"ERC20: transfer from the zero address\");\n        require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(sender, recipient, amount);\n\n        _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n        _balances[recipient] = _balances[recipient].add(amount);\n        emit Transfer(sender, recipient, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply = _totalSupply.add(amount);\n        _balances[account] = _balances[account].add(amount);\n        emit Transfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n        _totalSupply = _totalSupply.sub(amount);\n        emit Transfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Sets {decimals} to a value other than the default one of 18.\n     *\n     * WARNING: This function should only be called from the constructor. Most\n     * applications that interact with token contracts will not expect\n     * {decimals} to ever change, and may work incorrectly if it does.\n     */\n    function _setupDecimals(uint8 decimals_) internal {\n        _decimals = decimals_;\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``\u0027s tokens\n     * will be to transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``\u0027s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n"},"ERC20Burnable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./Context.sol\";\nimport \"./ERC20.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20Burnable is Context, ERC20 {\n    /**\n     * @dev Destroys `amount` tokens from the caller.\n     *\n     * See {ERC20-_burn}.\n     */\n    function burn(uint256 amount) public virtual {\n        _burn(_msgSender(), amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, deducting from the caller\u0027s\n     * allowance.\n     *\n     * See {ERC20-_burn} and {ERC20-allowance}.\n     *\n     * Requirements:\n     *\n     * - the caller must have allowance for ``accounts``\u0027s tokens of at least\n     * `amount`.\n     */\n    function burnFrom(address account, uint256 amount) public virtual {\n        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, \"ERC20: burn amount exceeds allowance\");\n\n        _approve(account, _msgSender(), decreasedAllowance);\n        _burn(account, amount);\n    }\n}\n"},"ERC20Snapshot.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./SafeMath.sol\";\nimport \"./Arrays.sol\";\nimport \"./Counters.sol\";\nimport \"./ERC20.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it\u0027s possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\nabstract contract ERC20Snapshot is ERC20 {\n    // Inspired by Jordi Baylina\u0027s MiniMeToken to record historical balances:\n    // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n    using SafeMath for uint256;\n    using Arrays for uint256[];\n    using Counters for Counters.Counter;\n\n    // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n    // Snapshot struct, but that would impede usage of functions that work on an array.\n    struct Snapshots {\n        uint256[] ids;\n        uint256[] values;\n    }\n\n    mapping (address =\u003e Snapshots) private _accountBalanceSnapshots;\n    Snapshots private _totalSupplySnapshots;\n\n    // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n    Counters.Counter private _currentSnapshotId;\n\n    /**\n     * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n     */\n    event Snapshot(uint256 id);\n\n    /**\n     * @dev Creates a new snapshot and returns its snapshot id.\n     *\n     * Emits a {Snapshot} event that contains the same id.\n     *\n     * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n     * set of accounts, for example using {AccessControl}, or it may be open to the public.\n     *\n     * [WARNING]\n     * ====\n     * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n     * you must consider that it can potentially be used by attackers in two ways.\n     *\n     * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n     * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n     * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n     * section above.\n     *\n     * We haven\u0027t measured the actual numbers; if this is something you\u0027re interested in please reach out to us.\n     * ====\n     */\n    function _snapshot() internal virtual returns (uint256) {\n        _currentSnapshotId.increment();\n\n        uint256 currentId = _currentSnapshotId.current();\n        emit Snapshot(currentId);\n        return currentId;\n    }\n\n    /**\n     * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n     */\n    function balanceOfAt(address account, uint256 snapshotId) public view returns (uint256) {\n        (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n        return snapshotted ? value : balanceOf(account);\n    }\n\n    /**\n     * @dev Retrieves the total supply at the time `snapshotId` was created.\n     */\n    function totalSupplyAt(uint256 snapshotId) public view returns(uint256) {\n        (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n        return snapshotted ? value : totalSupply();\n    }\n\n\n    // Update balance and/or total supply snapshots before the values are modified. This is implemented\n    // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {\n      super._beforeTokenTransfer(from, to, amount);\n\n      if (from == address(0)) {\n        // mint\n        _updateAccountSnapshot(to);\n        _updateTotalSupplySnapshot();\n      } else if (to == address(0)) {\n        // burn\n        _updateAccountSnapshot(from);\n        _updateTotalSupplySnapshot();\n      } else {\n        // transfer\n        _updateAccountSnapshot(from);\n        _updateAccountSnapshot(to);\n      }\n    }\n\n    function _valueAt(uint256 snapshotId, Snapshots storage snapshots)\n        private view returns (bool, uint256)\n    {\n        require(snapshotId \u003e 0, \"ERC20Snapshot: id is 0\");\n        // solhint-disable-next-line max-line-length\n        require(snapshotId \u003c= _currentSnapshotId.current(), \"ERC20Snapshot: nonexistent id\");\n\n        // When a valid snapshot is queried, there are three possibilities:\n        //  a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n        //  created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n        //  to this id is the current one.\n        //  b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n        //  requested id, and its value is the one to return.\n        //  c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n        //  no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n        //  larger than the requested one.\n        //\n        // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n        // it is not found, unless said value doesn\u0027t exist (e.g. when all values are smaller). Arrays.findUpperBound does\n        // exactly this.\n\n        uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n        if (index == snapshots.ids.length) {\n            return (false, 0);\n        } else {\n            return (true, snapshots.values[index]);\n        }\n    }\n\n    function _updateAccountSnapshot(address account) private {\n        _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n    }\n\n    function _updateTotalSupplySnapshot() private {\n        _updateSnapshot(_totalSupplySnapshots, totalSupply());\n    }\n\n    function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n        uint256 currentId = _currentSnapshotId.current();\n        if (_lastSnapshotId(snapshots.ids) \u003c currentId) {\n            snapshots.ids.push(currentId);\n            snapshots.values.push(currentValue);\n        }\n    }\n\n    function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n        if (ids.length == 0) {\n            return 0;\n        } else {\n            return ids[ids.length - 1];\n        }\n    }\n}\n"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender\u0027s allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller\u0027s\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"Math.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a \u003e= b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a \u003c b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow, so we distribute\n        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);\n    }\n}\n"},"Pausable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\ncontract Pausable is Context {\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    constructor () internal {\n        _paused = false;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        require(!_paused, \"Pausable: paused\");\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        require(_paused, \"Pausable: not paused\");\n        _;\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        _paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        _paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},"PRUF_INTERFACES.sol":{"content":"/*--------------------------------------------------------PRuF0.7.1\n__/\\\\\\\\\\\\\\\\\\\\\\\\\\ _____/\\\\\\\\\\\\\\\\\\ _______/\\\\./\\\\ ___/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n _\\/\\\\\\/////////\\\\\\ _/\\\\\\///////\\\\\\ ____\\//..\\//____\\/\\\\\\///////////__\n  _\\/\\\\\\.......\\/\\\\\\.\\/\\\\\\.....\\/\\\\\\ ________________\\/\\\\\\ ____________\n   _\\/\\\\\\\\\\\\\\\\\\\\\\\\\\/__\\/\\\\\\\\\\\\\\\\\\\\\\/_____/\\\\\\____/\\\\\\.\\/\\\\\\\\\\\\\\\\\\\\\\ ____\n    _\\/\\\\\\/////////____\\/\\\\\\//////\\\\\\ ___\\/\\\\\\___\\/\\\\\\.\\/\\\\\\///////______\n     _\\/\\\\\\ ____________\\/\\\\\\ ___\\//\\\\\\ __\\/\\\\\\___\\/\\\\\\.\\/\\\\\\ ____________\n      _\\/\\\\\\ ____________\\/\\\\\\ ____\\//\\\\\\ _\\/\\\\\\___\\/\\\\\\.\\/\\\\\\ ____________\n       _\\/\\\\\\ ____________\\/\\\\\\ _____\\//\\\\\\.\\//\\\\\\\\\\\\\\\\\\ _\\/\\\\\\ ____________\n        _\\/// _____________\\/// _______\\/// __\\///////// __\\/// _____________\n         *-------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------\n *  TO DO\n *\n *---------------------------------------------------------------*/\n\n// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.6.7;\n\n/*\n * @dev Interface for UTIL_TKN\n * INHERIANCE:\n    import \"./AccessControl.sol\";\n    import \"./ERC20.sol\";\n    import \"./ERC20Burnable.sol\";\n    import \"./ERC20Pausable.sol\";\n    import \"./ERC20Snapshot.sol\";\n */\ninterface UTIL_TKN_Interface {\n\n    /*\n     * @dev PERMENANTLY !!!  Kill trusted agent and payable\n     */\n    function killTrustedAgent(uint256 _key) external;\n\n    /*\n     * @dev Set calling wallet to a \"cold Wallet\" that cannot be manipulated by TRUSTED_AGENT or PAYABLE permissioned functions\n     */\n    function setColdWallet() external;\n\n    /*\n     * @dev un-set calling wallet to a \"cold Wallet\", enabling manipulation by TRUSTED_AGENT and PAYABLE permissioned functions\n     */\n    function unSetColdWallet() external;\n\n    /*\n     * @dev return an adresses \"cold wallet\" status\n     */\n    function isColdWallet (address _addr) external returns (uint256);\n   \n\n    /*\n     * @dev Set adress of payment contract\n     */\n    function AdminSetSharesAddress(address _paymentAddress) external;\n\n\n    /*\n     * @dev Deducts token payment from transaction\n     * Requirements:\n     * - the caller must have PAYABLE_ROLE.\n     * - the caller must have a pruf token balance of at least `_rootPrice + _ACTHprice`.\n     */\n    function payForService(\n        address _senderAddress,\n        address _rootAddress,\n        uint256 _rootPrice,\n        address _ACTHaddress,\n        uint256 _ACTHprice\n    ) external;\n\n    /*\n     * @dev arbitrary burn (requires TRUSTED_AGENT_ROLE)   ****USE WITH CAUTION\n     */\n    function trustedAgentBurn(address _addr, uint256 _amount) external;\n\n    /*\n     * @dev arbitrary transfer (requires TRUSTED_AGENT_ROLE)   ****USE WITH CAUTION\n     */\n    function trustedAgentTransfer(\n        address _from,\n        address _to,\n        uint256 _amount\n    ) external;\n\n    /*\n     * @dev Take a balance snapshot, returns snapshot ID\n     * - the caller must have the `SNAPSHOT_ROLE`.\n     */\n    function takeSnapshot() external returns (uint256);\n\n    /**\n     * @dev Creates `amount` new tokens for `to`.\n     *\n     * See {ERC20-_mint}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `MINTER_ROLE`.\n     */\n    function mint(address to, uint256 amount) external;\n\n    /**\n     * @dev Pauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_pause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function pause() external;\n\n    /**\n     * @dev Unpauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_unpause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function unpause() external;\n\n    /**\n     * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n     */\n    function balanceOfAt(address account, uint256 snapshotId)\n        external\n        returns (uint256);\n\n    /**\n     * @dev Retrieves the total supply at the time `snapshotId` was created.\n     */\n    function totalSupplyAt(uint256 snapshotId) external returns (uint256);\n\n   \n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount)\n        external\n        returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender)\n        external\n        returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender\u0027s allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller\u0027s\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) external returns (bool); \n    \n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);\n\n    /**\n     * @dev Destroys `amount` tokens from the caller.\n     *\n     * See {ERC20-_burn}.\n     */\n    function burn(uint256 amount) external; \n\n    /**\n     * @dev Destroys `amount` tokens from `account`, deducting from the caller\u0027s\n     * allowance.\n     *\n     * See {ERC20-_burn} and {ERC20-allowance}.\n     *\n     * Requirements:\n     *\n     * - the caller must have allowance for ``accounts``\u0027s tokens of at least\n     * `amount`.\n     */\n    function burnFrom(address account, uint256 amount) external;\n\n    /**\n     * @dev Returns the cap on the token\u0027s total supply.\n     */\n    function cap() external returns (uint256);\n\n        /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external returns (bool);\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) external returns (uint256);\n\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) external returns (address);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role\u0027s admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``\u0027s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``\u0027s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function\u0027s\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n       \n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for AC_TKN\n * INHERIANCE:\n    import \"./ERC721/ERC721.sol\";\n    import \"./Ownable.sol\";\n    import \"./ReentrancyGuard.sol\";\n */\ninterface AC_TKN_Interface {\n    /*\n     * @dev Set storage contract to interface with\n     */\n    function OO_setStorageContract(address _storageAddress) external;\n\n    /*\n     * @dev Address Setters\n     */\n    function OO_resolveContractAddresses() external;\n\n    /*\n     * @dev Mints assetClass token, must be isAdmin\n     */\n    function mintACToken(\n        address _recipientAddress,\n        uint256 tokenId,\n        string calldata _tokenURI\n    ) external returns (uint256);\n\n    /*\n     * @dev remint Asset Token\n     * must set a new and unuiqe rgtHash\n     * burns old token\n     * Sends new token to original Caller\n     */\n    function reMintACToken(\n        address _recipientAddress,\n        uint256 tokenId,\n        string calldata _tokenURI\n    ) external returns (uint256);\n\n    /**\n     * @dev Transfers the ownership of a given token ID to another address.\n     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     * Requires the msg.sender to be the owner, approved, or operator.\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely transfers the ownership of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the msg.sender to be the owner, approved, or operator\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely transfers the ownership of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the _msgSender() to be the owner, approved, or operator\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     * @param _data bytes data to send along with a safe transfer check\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata _data\n    ) external;\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId)\n        external\n        view\n        returns (address tokenHolderAdress);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external returns (uint256);\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory tokenName);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external view returns (string memory tokenSymbol);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId)\n        external\n        view\n        returns (string memory URI);\n\n    /**\n     * @dev Returns the total amount of tokens stored by the contract.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n     * Use along with {balanceOf} to enumerate all of ``owner``\u0027s tokens.\n     */\n    function tokenOfOwnerByIndex(address owner, uint256 index)\n        external\n        view\n        returns (uint256 tokenId);\n\n    /**\n     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n     * Use along with {totalSupply} to enumerate all tokens.\n     */\n    function tokenByIndex(uint256 index) external view returns (uint256);\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for A_TKN\n * INHERIANCE:\n    import \"./ERC721/ERC721.sol\";\n    import \"./Ownable.sol\";\n    import \"./ReentrancyGuard.sol\";\n */\ninterface A_TKN_Interface {\n    /*\n     * @dev Set storage contract to interface with\n     */\n    function OO_setStorageContract(address _storageAddress) external;\n\n    /*\n     * @dev Address Setters\n     */\n    function OO_resolveContractAddresses() external;\n\n    /*\n     * @dev Mint new asset token\n     */\n    function mintAssetToken(\n        address _recipientAddress,\n        uint256 tokenId,\n        string calldata _tokenURI\n    ) external returns (uint256);\n\n    /*\n     * @dev remint Asset Token\n     * must set a new and unuiqe rgtHash\n     * burns old token\n     * Sends new token to original Caller\n     */\n    function reMintAssetToken(address _recipientAddress, uint256 tokenId)\n        external\n        returns (uint256);\n\n    /*\n     * @dev Set new token URI String\n     */\n    function setURI(uint256 tokenId, string calldata _tokenURI)\n        external\n        returns (uint256);\n\n    /*\n     * @dev Reassures user that token is minted in the PRUF system\n     */\n    function validatePipToken(\n        uint256 tokenId,\n        uint32 _assetClass,\n        string calldata _authCode\n    ) external view;\n\n    /*\n     * @dev See if token exists\n     */\n    function tokenExists(uint256 tokenId) external view returns (uint8);\n\n    /**\n     * @dev Transfers the ownership of a given token ID to another address.\n     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     * Requires the msg.sender to be the owner, approved, or operator.\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely transfers the ownership of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the msg.sender to be the owner, approved, or operator\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely transfers the ownership of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the _msgSender() to be the owner, approved, or operator\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     * @param _data bytes data to send along with a safe transfer check\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata _data\n    ) external;\n\n    /**\n     * @dev Safely burns a token and sets the corresponding RGT to zero in storage.\n     */\n    function discard(uint256 tokenId) external;\n\n    /**\n     * @dev Converts uint256 to string form @OpenZeppelin.\n     */\n    function uint256toString(uint256 number) external returns (string memory);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId)\n        external\n        returns (address tokenHolderAdress);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external returns (uint256);\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external returns (string memory tokenName);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external returns (string memory tokenSymbol);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId) external returns (string memory URI);\n\n    /**\n     * @dev Returns the total amount of tokens stored by the contract.\n     */\n    function totalSupply() external returns (uint256);\n\n    /**\n     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n     * Use along with {balanceOf} to enumerate all of ``owner``\u0027s tokens.\n     */\n    function tokenOfOwnerByIndex(address owner, uint256 index)\n        external\n        returns (uint256 tokenId);\n\n    /**\n     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n     * Use along with {totalSupply} to enumerate all tokens.\n     */\n    function tokenByIndex(uint256 index) external returns (uint256);\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for ID_TKN\n * INHERIANCE:\n    import \"./ERC721/ERC721.sol\";\n    import \"./Ownable.sol\";\n    import \"./ReentrancyGuard.sol\";\n */\ninterface ID_TKN_Interface {\n    /*\n     * @dev Mint new PRUF_ID token\n     */\n    function mintPRUF_IDToken(address _recipientAddress, uint256 tokenId)\n        external\n        returns (uint256);\n\n    /*\n     * @dev remint Asset Token\n     * must set a new and unuiqe rgtHash\n     * burns old token\n     * Sends new token to original Caller\n     */\n    function reMintPRUF_IDToken(address _recipientAddress, uint256 tokenId)\n        external\n        returns (uint256);\n\n    /*\n     * @dev See if token exists\n     */\n    function tokenExists(uint256 tokenId) external view returns (uint8);\n\n    /**\n     * @dev @dev Blocks the transfer of a given token ID to another address\n     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     * Requires the msg.sender to be the owner, approved, or operator.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely blocks the transfer of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the msg.sender to be the owner, approved, or operator\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Safely blocks the transfer of a given token ID to another address\n     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},\n     * which is called upon a safe transfer, and return the magic value\n     * `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`; otherwise,\n     * the transfer is reverted.\n     * Requires the _msgSender() to be the owner, approved, or operator\n     * @param from current owner of the token\n     * @param to address to receive the ownership of the given token ID\n     * @param tokenId uint256 ID of the token to be transferred\n     * @param _data bytes data to send along with a safe transfer check\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata _data\n    ) external;\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId)\n        external\n        view\n        returns (address tokenHolderAdress);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external returns (uint256);\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory tokenName);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external view returns (string memory tokenSymbol);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId)\n        external\n        view\n        returns (string memory URI);\n\n    /**\n     * @dev Returns the total amount of tokens stored by the contract.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n     * Use along with {balanceOf} to enumerate all of ``owner``\u0027s tokens.\n     */\n    function tokenOfOwnerByIndex(address owner, uint256 index)\n        external\n        view\n        returns (uint256 tokenId);\n\n    /**\n     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n     * Use along with {totalSupply} to enumerate all tokens.\n     */\n    function tokenByIndex(uint256 index) external view returns (uint256);\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for AC_MGR\n * INHERIANCE:\n    import \"./PRUF_BASIC.sol\";\n    import \"./math/Safemath.sol\";\n */\ninterface AC_MGR_Interface {\n    /*\n     * @dev Authorize / Deauthorize / Authorize users for an address be permitted to make record modifications\n     */\n    function OO_addUser(\n        bytes32 _addrHash,\n        uint8 _userType,\n        uint32 _assetClass\n    ) external;\n\n    /*\n     * @dev Mints asset class token and creates an assetClass. Mints to @address\n     * Requires that:\n     *  name is unuiqe\n     *  AC is not provisioned with a root (proxy for not yet registered)\n     *  that ACtoken does not exist\n     */\n    function createAssetClass(\n        address _recipientAddress,\n        string calldata _name,\n        uint32 _assetClass,\n        uint32 _assetClassRoot,\n        uint8 _custodyType,\n        bytes32 _IPFS\n    ) external;\n\n    /*\n     * @dev Modifies an assetClass\n     * Sets a new AC name. Asset Classes cannot be moved to a new root or custody type.\n     * Requires that:\n     *  caller holds ACtoken\n     *  name is unuiqe or same as old name\n     */\n    function updateACname(string calldata _name, uint32 _assetClass) external;\n\n    /*\n     * @dev Modifies an assetClass\n     * Sets a new AC IPFS Address. Asset Classes cannot be moved to a new root or custody type.\n     * Requires that:\n     *  caller holds ACtoken\n     */\n    function updateACipfs(bytes32 _IPFS, uint32 _assetClass) external;\n\n    /*\n     * @dev Set function costs and payment address per asset class, in Wei\n     */\n    function ACTH_setCosts(\n        uint32 _assetClass,\n        uint16 _service,\n        uint256 _serviceCost,\n        address _paymentAddress\n    ) external;\n\n    /*\n     * @dev get a User Record\n     */\n    function getUserType(bytes32 _userHash, uint32 _assetClass)\n        external\n        view\n        returns (uint8);\n\n    /*\n     * @dev Retrieve AC_data @ _assetClass\n     */\n    function getAC_data(uint32 _assetClass)\n        external\n        view\n        returns (\n            uint32,\n            uint8,\n            uint32,\n            uint32,\n            bytes32\n        );\n\n    /*\n     * @dev Retrieve AC_discount @ _assetClass, in percent ACTH share, * 100 (9000 = 90%)\n     */\n    function getAC_discount(uint32 _assetClass) external view returns (uint32);\n\n    /*\n     * @dev compare the root of two asset classes\n     */\n    function isSameRootAC(uint32 _assetClass1, uint32 _assetClass2)\n        external\n        view\n        returns (uint8);\n\n    /*\n     * @dev Retrieve AC_name @ _tokenId\n     */\n    function getAC_name(uint32 _tokenId) external view returns (string memory);\n\n    /*\n     * @dev Retrieve AC_number @ AC_name\n     */\n    function resolveAssetClass(string calldata _name)\n        external\n        view\n        returns (uint32);\n\n    /*\n     * @dev Retrieve function costs per asset class, per service type, in Wei\n     */\n    function getServiceCosts(uint32 _assetClass, uint16 _service)\n        external\n        view\n        returns (\n            address,\n            uint256,\n            address,\n            uint256\n        );\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for STOR\n * INHERIANCE:\n    import \"./Ownable.sol\";\n    import \"./Pausable.sol\";\n    import \"./math/Safemath.sol\";\n    import \"./ReentrancyGuard.sol\";\n */\ninterface STOR_Interface {\n    /*\n     * @dev Triggers stopped state. (pausable)\n     */\n    function pause() external;\n\n    /*\n     * @dev Returns to normal state. (pausable)\n     */\n    function unpause() external;\n\n    /*\n     * @dev Authorize / Deauthorize / Authorize ADRESSES permitted to make record modifications, per AssetClass\n     * populates contract name resolution and data mappings\n     */\n    function OO_addContract(\n        string calldata _name,\n        address _addr,\n        uint32 _assetClass,\n        uint8 _contractAuthLevel\n    ) external;\n\n    /*\n     * @dev Authorize / Deauthorize / Authorize contract NAMES permitted to make record modifications, per AssetClass\n     * allows ACtokenHolder to auithorize or deauthorize specific contracts to work within their asset class\n     */\n    function enableContractForAC(\n        string calldata _name,\n        uint32 _assetClass,\n        uint8 _contractAuthLevel\n    ) external;\n\n    /*\n     * @dev Make a new record, writing to the \u0027database\u0027 mapping with basic initial asset data\n     */\n    function newRecord(\n        bytes32 _idxHash,\n        bytes32 _rgtHash,\n        uint32 _assetClass,\n        uint32 _countDownStart\n    ) external;\n\n    /*\n     * @dev Modify a record, writing to the \u0027database\u0027 mapping with updates to multiple fields\n     */\n    function modifyRecord(\n        bytes32 _idxHash,\n        bytes32 _rgtHash,\n        uint8 _newAssetStatus,\n        uint32 _countDown,\n        uint256 _incrementForceModCount,\n        uint256 _incrementNumberOfTransfers\n    ) external;\n\n    /*\n     * @dev Change asset class of an asset - writes to assetClass in the \u0027Record\u0027 struct of the \u0027database\u0027 at _idxHash\n     */\n    function changeAC(bytes32 _idxHash, uint32 _newAssetClass) external;\n\n    /*\n     * @dev Set an asset to stolen or lost. Allows narrow modification of status 6/12 assets, normally locked\n     */\n    function setStolenOrLost(bytes32 _idxHash, uint8 _newAssetStatus) external;\n\n    /*\n     * @dev Set an asset to escrow locked status (6/50/56).\n     */\n    function setEscrow(bytes32 _idxHash, uint8 _newAssetStatus) external;\n\n    /*\n     * @dev remove an asset from escrow status. Implicitly trusts escrowManager ECR_MGR contract\n     */\n    function endEscrow(bytes32 _idxHash) external;\n\n    /*\n     * @dev Modify record Ipfs1 data\n     */\n    function modifyIpfs1(bytes32 _idxHash, bytes32 _Ipfs1) external;\n\n    /*\n     * @dev Write record Ipfs2 data\n     */\n    function modifyIpfs2(bytes32 _idxHash, bytes32 _Ipfs2) external;\n\n    /*\n     * @dev return a record from the database, including rgt\n     */\n    function retrieveRecord(bytes32 _idxHash)\n        external\n        view\n        returns (\n            bytes32,\n            uint8,\n            uint32,\n            uint32,\n            uint32,\n            bytes32,\n            bytes32\n        );\n\n    /*\n     * @dev return a record from the database w/o rgt\n     */\n    function retrieveShortRecord(bytes32 _idxHash)\n        external\n        view\n        returns (\n            uint8,\n            uint8,\n            uint32,\n            uint32,\n            uint32,\n            bytes32,\n            bytes32,\n            uint16\n        );\n\n    /*\n     * @dev Compare record.rightsholder with supplied bytes32 rightsholder\n     * return 170 if matches, 0 if not\n     */\n    function _verifyRightsHolder(bytes32 _idxHash, bytes32 _rgtHash)\n        external\n        view\n        returns (uint256);\n\n    /*\n     * @dev Compare record.rightsholder with supplied bytes32 rightsholder (writes an emit in blockchain for independant verification)\n     */\n    function blockchainVerifyRightsHolder(bytes32 _idxHash, bytes32 _rgtHash)\n        external\n        returns (uint8);\n\n    /*\n     * @dev //returns the address of a contract with name _name. This is for web3 implementations to find the right contract to interact with\n     * example :  Frontend = ****** so web 3 first asks storage where to find frontend, then calls for frontend functions.\n     */\n    function resolveContractAddress(string calldata _name)\n        external\n        view\n        returns (address);\n\n    /*\n     * @dev //returns the contract type of a contract with address _addr.\n     */\n    function ContractInfoHash(address _addr, uint32 _assetClass)\n        external\n        view\n        returns (uint8, bytes32);\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for ECR_MGR\n * INHERIANCE:\n    import \"./PRUF_BASIC.sol\";\n    import \"./math/Safemath.sol\";\n */\ninterface ECR_MGR_Interface {\n    /*\n     * @dev Set an asset to escrow status (6/50/56). Sets timelock for unix timestamp of escrow end.\n     */\n    function setEscrow(\n        bytes32 _idxHash,\n        uint8 _newAssetStatus,\n        bytes32 _escrowOwnerAddressHash,\n        uint256 _timelock\n    ) external;\n\n    /*\n     * @dev remove an asset from escrow status\n     */\n    function endEscrow(bytes32 _idxHash) external;\n\n    /*\n     * @dev Set data in EDL mapping\n     * Must be setter contract\n     * Must be in  escrow\n     */\n    function setEscrowDataLight(\n        bytes32 _idxHash,\n        uint8 _escrowData,\n        uint8 _u8_1,\n        uint8 _u8_2,\n        uint8 _u8_3,\n        uint16 _u16_1,\n        uint16 _u16_2,\n        uint32 _u32_1,\n        address _addr_1\n    ) external;\n\n    /*\n     * @dev Set data in EDL mapping\n     * Must be setter contract\n     * Must be in  escrow\n     */\n    function setEscrowDataHeavy(\n        bytes32 _idxHash,\n        uint32 _u32_2,\n        uint32 _u32_3,\n        uint32 _u32_4,\n        address _addr_2,\n        bytes32 _b32_1,\n        bytes32 _b32_2,\n        uint256 _u256_1,\n        uint256 _u256_2\n    ) external;\n\n    /*\n     * @dev Permissive removal of asset from escrow status after time-out\n     */\n    function permissiveEndEscrow(bytes32 _idxHash) external;\n\n    /*\n     * @dev return escrow OwnerHash\n     */\n    function retrieveEscrowOwner(bytes32 _idxHash)\n        external\n        returns (bytes32 hashOfEscrowOwnerAdress);\n\n    /*\n     * @dev return escrow data @ IDX\n     */\n    function retrieveEscrowData(bytes32 _idxHash)\n        external\n        returns (\n            bytes32 controllingContractNameHash,\n            bytes32 escrowOwnerAddressHash,\n            uint256 timelock\n        );\n\n    /*\n     * @dev return EscrowDataLight @ IDX\n     */\n    function retrieveEscrowDataLight(bytes32 _idxHash)\n        external\n        view\n        returns (\n            uint8 _escrowData,\n            uint8 _u8_1,\n            uint8 _u8_2,\n            uint8 _u8_3,\n            uint16 _u16_1,\n            uint16 _u16_2,\n            uint32 _u32_1,\n            address _addr_1\n        );\n\n    /*\n     * @dev return EscrowDataHeavy @ IDX\n     */\n    function retrieveEscrowDataHeavy(bytes32 _idxHash)\n        external\n        view\n        returns (\n            uint32 _u32_2,\n            uint32 _u32_3,\n            uint32 _u32_4,\n            address _addr_2,\n            bytes32 _b32_1,\n            bytes32 _b32_2,\n            uint256 _u256_1,\n            uint256 _u256_2\n        );\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for RCLR\n * INHERIANCE:\n    import \"./PRUF_ECR_CORE.sol\";\n    import \"./PRUF_CORE.sol\";\n */\ninterface RCLR_Interface {\n    function discard(bytes32 _idxHash, address _sender) external;\n\n    function recycle(bytes32 _idxHash) external;\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for APP\n * INHERIANCE:\n    import \"./PRUF_CORE.sol\";\n */\ninterface APP_Interface {\n    function transferAssetToken(address _to, bytes32 _idxHash) external;\n\n    function $withdraw() external;\n}\n\n//------------------------------------------------------------------------------------------------\n/*\n * @dev Interface for APP_NC\n * INHERIANCE:\n    import \"./PRUF_CORE.sol\";\n */\ninterface APP_NC_Interface {\n    function transferAssetToken(address _to, bytes32 _idxHash) external;\n\n    function $withdraw() external;\n}\n"},"PRUF_UTIL_TKN.sol":{"content":"/*--------------------------------------------------------PRuF0.7.1\n__/\\\\\\\\\\\\\\\\\\\\\\\\\\ _____/\\\\\\\\\\\\\\\\\\ _______/\\\\./\\\\ ___/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n _\\/\\\\\\/////////\\\\\\ _/\\\\\\///////\\\\\\ ____\\//..\\//____\\/\\\\\\///////////__\n  _\\/\\\\\\.......\\/\\\\\\.\\/\\\\\\.....\\/\\\\\\ ________________\\/\\\\\\ ____________\n   _\\/\\\\\\\\\\\\\\\\\\\\\\\\\\/__\\/\\\\\\\\\\\\\\\\\\\\\\/_____/\\\\\\____/\\\\\\.\\/\\\\\\\\\\\\\\\\\\\\\\ ____\n    _\\/\\\\\\/////////____\\/\\\\\\//////\\\\\\ ___\\/\\\\\\___\\/\\\\\\.\\/\\\\\\///////______\n     _\\/\\\\\\ ____________\\/\\\\\\ ___\\//\\\\\\ __\\/\\\\\\___\\/\\\\\\.\\/\\\\\\ ____________\n      _\\/\\\\\\ ____________\\/\\\\\\ ____\\//\\\\\\ _\\/\\\\\\___\\/\\\\\\.\\/\\\\\\ ____________\n       _\\/\\\\\\ ____________\\/\\\\\\ _____\\//\\\\\\.\\//\\\\\\\\\\\\\\\\\\ _\\/\\\\\\ ____________\n        _\\/// _____________\\/// _______\\/// __\\///////// __\\/// _____________\n         *-------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------\n *  TO DO\n *-----------------------------------------------------------------\n * UTILITY TOKEN CONTRACT\n *---------------------------------------------------------------*/\n\n// SPDX-License-Identifier: UNLICENSED\n\npragma solidity ^0.6.7;\n\nimport \"./PRUF_INTERFACES.sol\";\nimport \"./AccessControl.sol\";\nimport \"./ERC20Burnable.sol\";\nimport \"./Pausable.sol\";\nimport \"./ERC20Snapshot.sol\";\n\n/**\n * @dev {ERC20} token, including:\n *\n *  - ability for holders to burn (destroy) their tokens\n *  - a MINTER_ROLE that allows for token minting (creation)\n *  - a PAUSER_ROLE that allows to stop all token transfers\n *  - a SNAPSHOT_ROLE that allows to take snapshots\n *  - a PAYABLE_ROLE role that allows authorized addresses to invoke the token splitting payment function (all paybale contracts)\n *  - a TRUSTED_AGENT_ROLE role that allows authorized addresses to transfer and burn tokens (AC_MGR)\n\n\n\n\n *\n * This contract uses {AccessControl} to lock permissioned functions using the\n * different roles - head to its documentation for details.\n *\n * The account that deploys the contract will be granted the minter and pauser\n * roles, as well as the default admin role, which will let it grant both minter\n * and pauser roles to other accounts.\n */\ncontract UTIL_TKN is\n    Context,\n    AccessControl,\n    ERC20Burnable,\n    Pausable,\n    ERC20Snapshot\n{\n    bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n    bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n    bytes32 public constant SNAPSHOT_ROLE = keccak256(\"SNAPSHOT_ROLE\");\n    bytes32 public constant PAYABLE_ROLE = keccak256(\"PAYABLE_ROLE\");\n    bytes32 public constant TRUSTED_AGENT_ROLE = keccak256(\n        \"TRUSTED_AGENT_ROLE\"\n    );\n\n    using SafeMath for uint256;\n\n    uint256 private _cap = 4000000000000000000000000000; //4billion max supply\n\n    address private sharesAddress = address(0);\n\n    struct Invoice {\n        //invoice struct to facilitate payment messaging in-contract\n        address rootAddress;\n        uint256 rootPrice;\n        address ACTHaddress;\n        uint256 ACTHprice;\n    }\n\n    uint256 trustedAgentEnabled = 1;\n\n    mapping(address =\u003e uint256) private coldWallet;\n\n    /**\n     * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the\n     * account that deploys the contract.\n     *\n     * See {ERC20-constructor}.\n     */\n    constructor() public ERC20(\"PRüF Network\", \"PRUF\") {\n        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\n        _setupRole(MINTER_ROLE, _msgSender());\n        _setupRole(PAUSER_ROLE, _msgSender());\n    }\n\n    //------------------------------------------------------------------------MODIFIERS\n\n    /*\n     * @dev Verify user credentials\n     * Originating Address:\n     *      is Admin\n     */\n    modifier isAdmin() {\n        require(\n            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),\n            \"PRuF:MOD: must have DEFAULT_ADMIN_ROLE\"\n        );\n        _;\n    }\n\n    /*\n     * @dev Verify user credentials\n     * Originating Address:\n     *      is Pauser\n     */\n    modifier isPauser() {\n        require(\n            hasRole(PAUSER_ROLE, _msgSender()),\n            \"PRuF:MOD: must have PAUSER_ROLE\"\n        );\n        _;\n    }\n\n    /*\n     * @dev Verify user credentials\n     * Originating Address:\n     *      is Minter\n     */\n    modifier isMinter() {\n        require(\n            hasRole(MINTER_ROLE, _msgSender()),\n            \"PRuF:MOD: must have MINTER_ROLE\"\n        );\n        _;\n    }\n\n    /*\n     * @dev Verify user credentials\n     * Originating Address:\n     *      is Payable in PRuF\n     */\n    modifier isPayable() {\n        require(\n            hasRole(PAYABLE_ROLE, _msgSender()),\n            \"PRuF:MOD: must have PAYABLE_ROLE\"\n        );\n        require( //---------------------------------------------------DPS:TEST : NEW\n            trustedAgentEnabled == 1,\n            \"PRuF:MOD: Trusted Payable Function permanently disabled - use allowance / transferFrom pattern\"\n        );\n        _;\n    }\n\n    /*\n     * @dev Verify user credentials\n     * Originating Address:\n     *      is Trusted Agent\n     */\n    modifier isTrustedAgent() {\n        require(\n            hasRole(TRUSTED_AGENT_ROLE, _msgSender()),\n            \"PRuF:MOD: must have TRUSTED_AGENT_ROLE\"\n        );\n        require( //---------------------------------------------------DPS:TEST : NEW\n            trustedAgentEnabled == 1,\n            \"PRuF:MOD: Trusted Agent function permanently disabled - use allowance / transferFrom pattern\"\n        );\n        _;\n    }\n\n    /*\n     * @dev ----------------------------------------PERMANANTLY !!!  Kills trusted agent and payable functions\n     * this will break the functionality of current payment mechanisms.\n     *\n     * The workaround for this is to create an allowance for pruf contracts for a single or multiple payments,\n     * either ahead of time \"loading up your PRUF account\" or on demand with an operation. On demand will use quite a bit more gas.\n     * \"preloading\" should be pretty gas efficient, but will add an extra step to the workflow, requiring users to have sufficient\n     * PRuF \"banked\" in an allowance for use in the system.\n     *\n     */\n    function adminKillTrustedAgent(uint256 _key) external isAdmin {\n        //---------------------------------------------------DPS:TEST : NEW\n        if (_key == 170) {\n            trustedAgentEnabled = 0; //-------------------THIS IS A PERMANENT ACTION AND CANNOT BE UNDONE\n        }\n    }\n\n    /*\n     * @dev Set calling wallet to a \"cold Wallet\" that cannot be manipulated by TRUSTED_AGENT or PAYABLE permissioned functions\n     * WALLET ADDRESSES SET TO \"Cold\" DO NOT WORK WITH TRUSTED_AGENT FUNCTIONS and must be unset from cold before it can interact with\n     * contract functions.\n     */\n    function setColdWallet() external {\n        //---------------------------------------------------DPS:TEST : NEW\n        coldWallet[_msgSender()] = 170;\n    }\n\n    /*\n     * @dev un-set calling wallet to a \"cold Wallet\", enabling manipulation by TRUSTED_AGENT and PAYABLE permissioned functions\n     * WALLET ADDRESSES SET TO \"Cold\" DO NOT WORK WITH TRUSTED_AGENT FUNCTIONS and must be unset from cold before it can interact with\n     * contract functions.\n     */\n    function unSetColdWallet() external {\n        //---------------------------------------------------DPS:TEST : NEW\n        coldWallet[_msgSender()] = 0;\n    }\n\n    /*\n     * @dev return an adresses \"cold wallet\" status\n     * WALLET ADDRESSES SET TO \"Cold\" DO NOT WORK WITH TRUSTED_AGENT FUNCTIONS\n     */\n    function isColdWallet(address _addr) external view returns (uint256) {\n        return coldWallet[_addr];\n    }\n\n    /*\n     * @dev Set address of SHARES payment contract. by default contract will use root address instead if set to zero.\n     */\n    function AdminSetSharesAddress(address _paymentAddress) external isAdmin {\n        require(\n            _paymentAddress != address(0),\n            \"PRuF:SSA: payment address cannot be zero\"\n        );\n\n        //^^^^^^^checks^^^^^^^^^\n\n        sharesAddress = _paymentAddress;\n        //^^^^^^^effects^^^^^^^^^\n    }\n\n    /*\n     * @dev Deducts token payment from transaction\n     */\n    function payForService(\n        address _senderAddress,\n        address _rootAddress,\n        uint256 _rootPrice,\n        address _ACTHaddress,\n        uint256 _ACTHprice\n    ) external isPayable {\n        require( //---------------------------------------------------DPS:TEST : NEW\n            coldWallet[_senderAddress] == 0,\n            \"PRuF:PFS: Cold Wallet - Trusted payable functions prohibited\"\n        );\n        require( //redundant? throws on transfer?\n            balanceOf(_senderAddress) \u003e= _rootPrice.add(_ACTHprice),\n            \"PRuF:PFS: insufficient balance\"\n        );\n        //^^^^^^^checks^^^^^^^^^\n\n        if (sharesAddress == address(0)) {\n            //IF SHARES ADDRESS IS NOT SET\n            _transfer(_senderAddress, _rootAddress, _rootPrice);\n            _transfer(_senderAddress, _ACTHaddress, _ACTHprice);\n        } else {\n            //IF SHARES ADDRESS IS SET\n            uint256 sharesShare = _rootPrice.div(uint256(4)); // sharesShare is 0.25 share of root costs\n            uint256 rootShare = _rootPrice.sub(sharesShare); // adjust root price to be root price - 0.25 share\n\n            _transfer(_senderAddress, _rootAddress, rootShare);\n            _transfer(_senderAddress, sharesAddress, sharesShare);\n            _transfer(_senderAddress, _ACTHaddress, _ACTHprice);\n        }\n        //^^^^^^^effects / interactions^^^^^^^^^\n    }\n\n    /*\n     * @dev arbitrary burn (requires TRUSTED_AGENT_ROLE)   ****USE WITH CAUTION\n     */\n    function trustedAgentBurn(address _addr, uint256 _amount)\n        public\n        isTrustedAgent\n    {\n        require( //---------------------------------------------------DPS:TEST : NEW\n            coldWallet[_addr] == 0,\n            \"PRuF:BRN: Cold Wallet - Trusted functions prohibited\"\n        );\n        //^^^^^^^checks^^^^^^^^^\n        _burn(_addr, _amount);\n        //^^^^^^^effects^^^^^^^^^\n    }\n\n    /*\n     * @dev arbitrary transfer (requires TRUSTED_AGENT_ROLE)   ****USE WITH CAUTION\n     */\n    function trustedAgentTransfer(\n        address _from,\n        address _to,\n        uint256 _amount\n    ) public isTrustedAgent {\n        require( //---------------------------------------------------DPS:TEST : NEW\n            coldWallet[_from] == 0,\n            \"PRuF:TAT: Cold Wallet - Trusted functions prohibited\"\n        );\n        //^^^^^^^checks^^^^^^^^^\n        _transfer(_from, _to, _amount);\n        //^^^^^^^effects^^^^^^^^^\n    }\n\n    /*\n     * @dev Take a balance snapshot, returns snapshot ID\n     */\n    function takeSnapshot() external returns (uint256) {\n        require(\n            hasRole(SNAPSHOT_ROLE, _msgSender()),\n            \"ERC20PresetMinterPauser: must have snapshot role to take a snapshot\"\n        );\n        return _snapshot();\n    }\n\n    /**\n     * @dev Creates `_amount` new tokens for `to`.\n     *\n     * See {ERC20-_mint}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `MINTER_ROLE`.\n     */\n    function mint(address to, uint256 _amount) public virtual {\n        require(\n            hasRole(MINTER_ROLE, _msgSender()),\n            \"PRuF:MOD: must have MINTER_ROLE\"\n        );\n        //^^^^^^^checks^^^^^^^^^\n\n        _mint(to, _amount);\n        //^^^^^^^interactions^^^^^^^^^\n    }\n\n    /**\n     * @dev Pauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_pause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function pause() public virtual isPauser {\n        //^^^^^^^checks^^^^^^^^^\n        _pause();\n        //^^^^^^^effects^^^^^^^^\n    }\n\n    /**\n     * @dev Unpauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_unpause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function unpause() public virtual isPauser {\n        //^^^^^^^checks^^^^^^^^^\n        _unpause();\n        //^^^^^^^effects^^^^^^^^\n    }\n\n    /**\n     * @dev Returns the cap on the token\u0027s total supply.\n     */\n    function cap() public view returns (uint256) {\n        return _cap;\n    }\n\n    /**\n     * @dev all paused functions are blocked here, unless caller has \"pauser\" role\n     */\n    function _beforeTokenTransfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual override(ERC20, ERC20Snapshot) {\n        super._beforeTokenTransfer(from, to, amount);\n\n        require(\n            (!paused()) || hasRole(PAUSER_ROLE, _msgSender()),\n            \"ERC20Pausable: function unavailble while contract is paused\"\n        );\n        if (from == address(0)) {\n            // When minting tokens\n            require(\n                totalSupply().add(amount) \u003c= _cap,\n                \"ERC20Capped: cap exceeded\"\n            );\n        }\n    }\n}\n"},"SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Wrappers over Solidity\u0027s arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it\u0027s recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity\u0027s `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c \u003e= a, \"SafeMath: addition overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity\u0027s `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return sub(a, b, \"SafeMath: subtraction overflow\");\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity\u0027s `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b \u003c= a, errorMessage);\n        uint256 c = a - b;\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity\u0027s `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\n        // benefit is lost if \u0027b\u0027 is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) {\n            return 0;\n        }\n\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return div(a, b, \"SafeMath: division by zero\");\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b \u003e 0, errorMessage);\n        uint256 c = a / b;\n        // assert(a == b * c + a % b); // There is no case in which this doesn\u0027t hold\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts when dividing by zero.\n     *\n     * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return mod(a, b, \"SafeMath: modulo by zero\");\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts with custom message when dividing by zero.\n     *\n     * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b != 0, errorMessage);\n        return a % b;\n    }\n}\n"}}