Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
PairedWorldRDF
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@semanticSBT/contracts/interfaces/ISemanticSBT.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface SPOProxyInterface { function addSPO(uint256 tokenId, uint8 predicateIdx, uint8 objectIdx, string memory object) external; function removeRDF(uint256 tokenId, uint8 predicateIdx, uint8 objectIdx) external; function getObject(uint256 tokenId, uint8 predicateIdx, uint8 objectIdx) external view returns (string memory); } contract PairedWorldRDF is Ownable, ISemanticSBT, ReentrancyGuard { address public _sbt; address public _admin; SPOProxyInterface public _spoProxy; string public _schemaUri; string constant TURTLE_LINE_SUFFIX = " ;\n "; string constant TURTLE_END_SUFFIX = " ."; string constant public ENTITY_PREFIX = ":"; string constant public PROPERTY_PREFIX = "p:"; string constant public SOUL_PREFIX = "SOUL_"; string constant CONCATENATION_CHARACTER = "_"; string constant BLANK_SPACE = " "; mapping (uint8 => string) public _predicates; mapping (string => uint8) public _predicatesToIdx; mapping (uint8 => string) public _objectClasses; mapping (string => uint8) public _objectClassesToIdx; // Predicates have a 1-to-1 mapping to both subjectClasses and objectClasses mapping (uint8 => uint8) public _POPairs; // _maxPredicate[tokenID] = highest filled predicate for tokenID mapping (uint256 => uint8) public _maxPredicate; constructor(address sbt, address spoProxy, string memory schemaUri) { _sbt = sbt; _schemaUri = schemaUri; _spoProxy = SPOProxyInterface(spoProxy); _predicates[1] = "ownedBy"; _predicatesToIdx["ownedBy"] = 1; _objectClasses[1] = "address"; _objectClassesToIdx["address"] = 1; _POPairs[1] = 1; } modifier onlyAdmin() { require(msg.sender == _admin || msg.sender == owner(), "Only Admin"); _; } modifier onlySbt() { require(msg.sender == _sbt, "Only callable by the SBT contract"); _; } // MARK: - Only Owner function setAdmin(address admin) external onlyOwner { _admin = admin; } function setSbt(address sbt) external onlyOwner { _sbt = sbt; } function setSPOProxy(address spoProxy) external onlyOwner { _spoProxy = SPOProxyInterface(spoProxy); } // MARK: - Only Admin function setSchemaUri(string memory schemaUri) external onlyAdmin { _schemaUri = schemaUri; } function setPOPair( uint8 predicateIdx, string memory predicate, uint8 objectClassIdx, string memory objectClass ) external onlyAdmin { require(_isStringEmpty(_predicates[predicateIdx]), "Predicate already exists in the same index"); require(_isStringEmpty(_objectClasses[objectClassIdx]), "Object class already exists in the same index"); require(!(objectClassIdx == 0 || predicateIdx == 0), "Cannot set reserved index"); require(_predicatesToIdx[predicate] == 0, "Predicate already exists"); require(_objectClassesToIdx[objectClass] == 0, "Object class already exists"); _predicates[predicateIdx] = predicate; _predicatesToIdx[predicate] = predicateIdx; _objectClasses[objectClassIdx] = objectClass; _objectClassesToIdx[objectClass] = objectClassIdx; _POPairs[predicateIdx] = objectClassIdx; } function updatePOPair( uint8 predicateIdx, string memory predicate, uint8 objectClassIdx, string memory objectClass ) external onlyAdmin { require(!_isStringEmpty(_predicates[predicateIdx]), "Predicate doesn't exist. Use setPOPair instead"); require(!_isStringEmpty(_objectClasses[objectClassIdx]), "Object class doesn't exist. User setPOPair instead"); require(_POPairs[predicateIdx] == objectClassIdx, "Attempting to beak 1-to-1 PO relationship"); require(_predicatesToIdx[predicate] == 0 || _predicatesToIdx[predicate] == predicateIdx, "Predicate already exists"); require(_objectClassesToIdx[objectClass] == 0 || _objectClassesToIdx[objectClass] == objectClassIdx, "Object class already exists"); _predicates[predicateIdx] = predicate; _predicatesToIdx[predicate] = predicateIdx; _objectClasses[objectClassIdx] = objectClass; _objectClassesToIdx[objectClass] = objectClassIdx; } // MARK: - onlySbt function addSPO( uint256 tokenId, uint8 predicateIdx, uint8 objectIdx, string memory object ) external nonReentrant onlySbt { require(!_isStringEmpty(_predicates[predicateIdx]), "Predicate doesn't exist"); require(!_isStringEmpty(_objectClasses[objectIdx]), "Object doesn't exist"); require(_POPairs[predicateIdx] == objectIdx, "Invalid SPO, predicate and object don't match"); bool creation = _maxPredicate[tokenId] == 0; if (!creation) { require(predicateIdx != 1, "cannot change owner SPO"); } _spoProxy.addSPO(tokenId, predicateIdx, objectIdx, object); if (_isStringEmpty(object)) { _maxPredicate[tokenId] = _maxPredicate[tokenId] == predicateIdx ? predicateIdx - 1 : _maxPredicate[tokenId]; } else { _maxPredicate[tokenId] = _maxPredicate[tokenId] < predicateIdx ? predicateIdx : _maxPredicate[tokenId]; } if (creation) { emit CreateRDF(tokenId, _buildRdfString(tokenId)); } else { emit UpdateRDF(tokenId, _buildRdfString(tokenId)); } } function removeRDF(uint256 tokenId) external nonReentrant onlySbt { require(_maxPredicate[tokenId] > 0, "No RDF to remove"); string memory oldData = _buildRdfString(tokenId); for (uint8 i = 1; i <= _maxPredicate[tokenId]; i++) { _spoProxy.removeRDF(tokenId, i, _POPairs[i]); } _maxPredicate[tokenId] = 0; emit RemoveRDF(tokenId, oldData); } function rdfOf(uint256 tokenId) external view override onlySbt() returns (string memory) { return _buildRdfString(tokenId); } // MARK: - Private function _buildRdfString(uint256 tokenId) internal view returns (string memory) { string memory rdf = ""; for (uint8 i = 1; i <= _maxPredicate[tokenId]; i++) { string memory subject = string(abi.encodePacked(ENTITY_PREFIX, SOUL_PREFIX, Strings.toString(tokenId))); string memory predicate = string(abi.encodePacked(PROPERTY_PREFIX, _predicates[i])); string memory object = _spoProxy.getObject(tokenId, i, _POPairs[i]); if (_isStringEmpty(object)) { continue; } object = string(abi.encodePacked(ENTITY_PREFIX, _objectClasses[_POPairs[i]], CONCATENATION_CHARACTER, object)); // If it's the same subject as the previous iteration, use a semicolon to separate predicate-object pairs if (!_isStringEmpty(rdf)) { rdf = string(abi.encodePacked(rdf, TURTLE_LINE_SUFFIX, predicate, BLANK_SPACE, object)); } else { rdf = string(abi.encodePacked(rdf, subject, BLANK_SPACE, predicate, BLANK_SPACE, object)); } } // Add a period at the end if rdf is not empty if (!_isStringEmpty(rdf)) { rdf = string(abi.encodePacked(rdf, TURTLE_END_SUFFIX)); } return rdf; } function _isStringEmpty(string memory data) internal pure returns (bool) { return bytes(data).length == 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; /** * @title Semantic Soulbound Token * Note: the EIP-165 identifier for this interface is 0xfbafb698 */ interface ISemanticSBT { /** * @dev This emits when minting a Semantic Soulbound Token. * @param tokenId The identifier for the Semantic Soulbound Token. * @param rdfStatements The RDF statements for the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple. */ event CreateRDF ( uint256 indexed tokenId, string rdfStatements ); /** * @dev This emits when updating the RDF data of Semantic Soulbound Token. RDF data is a collection of RDF statements that are used to represent information about resources. * @param tokenId The identifier for the Semantic Soulbound Token. * @param rdfStatements The RDF statements for the semantic soulbound token. An RDF statement is the statement made by an RDF triple. */ event UpdateRDF ( uint256 indexed tokenId, string rdfStatements ); /** * @dev This emits when burning or revoking Semantic Soulbound Token. * @param tokenId The identifier for the Semantic Soulbound Token. * @param rdfStatements The RDF statements for the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple. */ event RemoveRDF ( uint256 indexed tokenId, string rdfStatements ); /** * @dev Returns the RDF statements of the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple. * @param tokenId The identifier for the Semantic Soulbound Token. */ function rdfOf(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "@semanticSBT/=lib/semanticSBT/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "semanticSBT/=lib/semanticSBT/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"sbt","type":"address"},{"internalType":"address","name":"spoProxy","type":"address"},{"internalType":"string","name":"schemaUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"rdfStatements","type":"string"}],"name":"CreateRDF","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"rdfStatements","type":"string"}],"name":"RemoveRDF","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"rdfStatements","type":"string"}],"name":"UpdateRDF","type":"event"},{"inputs":[],"name":"ENTITY_PREFIX","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROPERTY_PREFIX","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SOUL_PREFIX","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"_POPairs","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_maxPredicate","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"_objectClasses","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"_objectClassesToIdx","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"_predicates","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"_predicatesToIdx","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_sbt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_schemaUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_spoProxy","outputs":[{"internalType":"contract SPOProxyInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8","name":"predicateIdx","type":"uint8"},{"internalType":"uint8","name":"objectIdx","type":"uint8"},{"internalType":"string","name":"object","type":"string"}],"name":"addSPO","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"rdfOf","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"removeRDF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"predicateIdx","type":"uint8"},{"internalType":"string","name":"predicate","type":"string"},{"internalType":"uint8","name":"objectClassIdx","type":"uint8"},{"internalType":"string","name":"objectClass","type":"string"}],"name":"setPOPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spoProxy","type":"address"}],"name":"setSPOProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sbt","type":"address"}],"name":"setSbt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schemaUri","type":"string"}],"name":"setSchemaUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"predicateIdx","type":"uint8"},{"internalType":"string","name":"predicate","type":"string"},{"internalType":"uint8","name":"objectClassIdx","type":"uint8"},{"internalType":"string","name":"objectClass","type":"string"}],"name":"updatePOPair","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200256938038062002569833981016040819052620000349162000279565b6200003f33620001f6565b60018055600280546001600160a01b0319166001600160a01b03851617905560056200006c828262000402565b50600480546001600160a01b0319166001600160a01b0384161790556040805180820190915260078152666f776e6564427960c81b6020808301919091526001600052600690527f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a3190620000e1908262000402565b50600160076040516200010190666f776e6564427960c81b815260070190565b9081526040805160209281900383018120805460ff191660ff9590951694909417909355828101905260078252666164647265737360c81b818301526001600052600890527fad67d757c34507f157cacfa2e3153e9f260a2244f30428821be7be64587ac55f9062000174908262000402565b50600160096040516200019490666164647265737360c81b815260070190565b908152604051908190036020908101909120805460ff9390931660ff1993841617905560016000819052600a9091527fbbc70db1b6c7afd11e79c0fb0051300458f1a3acb8ee9789d9b6b26c61ad9bc7805490921617905550620004ce915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200025e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156200028f57600080fd5b6200029a8462000246565b92506020620002ab81860162000246565b60408601519093506001600160401b0380821115620002c957600080fd5b818701915087601f830112620002de57600080fd5b815181811115620002f357620002f362000263565b604051601f8201601f19908116603f011681019083821181831017156200031e576200031e62000263565b816040528281528a868487010111156200033757600080fd5b600093505b828410156200035b57848401860151818501870152928501926200033c565b60008684830101528096505050505050509250925092565b600181811c908216806200038857607f821691505b602082108103620003a957634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003fd57600081815260208120601f850160051c81016020861015620003d85750805b601f850160051c820191505b81811015620003f957828155600101620003e4565b5050505b505050565b81516001600160401b038111156200041e576200041e62000263565b62000436816200042f845462000373565b84620003af565b602080601f8311600181146200046e5760008415620004555750858301515b600019600386901b1c1916600185901b178555620003f9565b600085815260208120601f198616915b828110156200049f578886015182559484019460019091019084016200047e565b5085821015620004be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61208b80620004de6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c8063a686b011116100de578063d69b5c0b11610097578063edfbfd0c11610071578063edfbfd0c1461039f578063f2fde38b146103cd578063f3ae9fff146103e0578063fbafb698146103e857600080fd5b8063d69b5c0b1461033d578063e14c532d1461036b578063edcc591a1461037e57600080fd5b8063a686b01114610299578063a8b5dc0e146102ce578063ac3865a3146102f1578063ad3e103f14610304578063ce6ecc0d14610317578063d25db5ac1461032a57600080fd5b8063715018a611610130578063715018a614610234578063757ef7d01461023c578063835331771461024f57806383f854a0146102625780638830c475146102755780638da5cb5b1461028857600080fd5b806301bc45c9146101785780630b98e9a7146101a8578063228dc360146101bd57806343e0f2b7146101d0578063594e5b87146101fd578063704b6c0214610221575b600080fd5b60035461018b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101bb6101b636600461189b565b6103fb565b005b6101bb6101cb3660046118b4565b6105a3565b6101f0604051806040016040528060018152602001601d60f91b81525081565b60405161019f9190611934565b6101f060405180604001604052806005815260200164534f554c5f60d81b81525081565b6101bb61022f3660046118b4565b6105cd565b6101bb6105f7565b6101bb61024a366004611a0c565b61060b565b6101f061025d366004611a5a565b61065a565b6101bb6102703660046118b4565b6106f4565b6101bb610283366004611a75565b61071e565b6000546001600160a01b031661018b565b6102bc6102a736600461189b565b600b6020526000908152604090205460ff1681565b60405160ff909116815260200161019f565b6102bc6102dc366004611a5a565b600a6020526000908152604090205460ff1681565b60045461018b906001600160a01b031681565b6101bb610312366004611a75565b610b41565b60025461018b906001600160a01b031681565b6101f0610338366004611a5a565b610e78565b6102bc61034b366004611a0c565b805160208183018101805160078252928201919093012091525460ff1681565b6101bb610379366004611afa565b610e91565b6101f060405180604001604052806002815260200161381d60f11b81525081565b6102bc6103ad366004611a0c565b805160208183018101805160098252928201919093012091525460ff1681565b6101bb6103db3660046118b4565b611246565b6101f06112bc565b6101f06103f636600461189b565b6112c9565b610403611307565b6002546001600160a01b031633146104365760405162461bcd60e51b815260040161042d90611b56565b60405180910390fd5b6000818152600b602052604090205460ff166104875760405162461bcd60e51b815260206004820152601060248201526f4e6f2052444620746f2072656d6f766560801b604482015260640161042d565b600061049282611360565b905060015b6000838152600b602052604090205460ff90811690821611610545576004805460ff8381166000818152600a6020526040908190205490516302a6a24760e41b815294850188905260248501919091521660448301526001600160a01b031690632a6a247090606401600060405180830381600087803b15801561051a57600080fd5b505af115801561052e573d6000803e3d6000fd5b50505050808061053d90611bad565b915050610497565b506000828152600b602052604090819020805460ff191690555182907f66c8585c3e15ccf8c11639fb9250cc64d2dd63c3bd7f4c5d20cd68dd9c554b059061058e908490611934565b60405180910390a2506105a060018055565b50565b6105ab611686565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6105d5611686565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6105ff611686565b61060960006116e0565b565b6003546001600160a01b031633148061062e57506000546001600160a01b031633145b61064a5760405162461bcd60e51b815260040161042d90611bcc565b60056106568282611c79565b5050565b6008602052600090815260409020805461067390611bf0565b80601f016020809104026020016040519081016040528092919081815260200182805461069f90611bf0565b80156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b505050505081565b6106fc611686565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633148061074157506000546001600160a01b031633145b61075d5760405162461bcd60e51b815260040161042d90611bcc565b60ff841660009081526006602052604090208054610802919061077f90611bf0565b80601f01602080910402602001604051908101604052809291908181526020018280546107ab90611bf0565b80156107f85780601f106107cd576101008083540402835291602001916107f8565b820191906000526020600020905b8154815290600101906020018083116107db57829003601f168201915b5050505050511590565b156108665760405162461bcd60e51b815260206004820152602e60248201527f50726564696361746520646f65736e27742065786973742e205573652073657460448201526d1413d4185a5c881a5b9cdd19585960921b606482015260840161042d565b60ff821660009081526008602052604090208054610888919061077f90611bf0565b156108f05760405162461bcd60e51b815260206004820152603260248201527f4f626a65637420636c61737320646f65736e27742065786973742e2055736572604482015271081cd95d1413d4185a5c881a5b9cdd19585960721b606482015260840161042d565b60ff8481166000908152600a60205260409020548116908316146109685760405162461bcd60e51b815260206004820152602960248201527f417474656d7074696e6720746f206265616b20312d746f2d3120504f2072656c60448201526806174696f6e736869760bc1b606482015260840161042d565b6007836040516109789190611d39565b9081526040519081900360200190205460ff1615806109bb57508360ff166007846040516109a69190611d39565b9081526040519081900360200190205460ff16145b610a025760405162461bcd60e51b815260206004820152601860248201527750726564696361746520616c72656164792065786973747360401b604482015260640161042d565b600981604051610a129190611d39565b9081526040519081900360200190205460ff161580610a5557508160ff16600982604051610a409190611d39565b9081526040519081900360200190205460ff16145b610aa15760405162461bcd60e51b815260206004820152601b60248201527f4f626a65637420636c61737320616c7265616479206578697374730000000000604482015260640161042d565b60ff84166000908152600660205260409020610abd8482611c79565b5083600784604051610acf9190611d39565b9081526040805160209281900383019020805460ff191660ff9485161790559184166000908152600890915220610b068282611c79565b5081600982604051610b189190611d39565b908152604051908190036020019020805460ff9290921660ff1990921691909117905550505050565b6003546001600160a01b0316331480610b6457506000546001600160a01b031633145b610b805760405162461bcd60e51b815260040161042d90611bcc565b60ff841660009081526006602052604090208054610ba2919061077f90611bf0565b610c015760405162461bcd60e51b815260206004820152602a60248201527f50726564696361746520616c72656164792065786973747320696e20746865206044820152690e6c2daca40d2dcc8caf60b31b606482015260840161042d565b60ff821660009081526008602052604090208054610c23919061077f90611bf0565b610c855760405162461bcd60e51b815260206004820152602d60248201527f4f626a65637420636c61737320616c72656164792065786973747320696e207460448201526c0d0ca40e6c2daca40d2dcc8caf609b1b606482015260840161042d565b60ff82161580610c96575060ff8416155b15610ce35760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f742073657420726573657276656420696e64657800000000000000604482015260640161042d565b600783604051610cf39190611d39565b9081526040519081900360200190205460ff1615610d4e5760405162461bcd60e51b815260206004820152601860248201527750726564696361746520616c72656164792065786973747360401b604482015260640161042d565b600981604051610d5e9190611d39565b9081526040519081900360200190205460ff1615610dbe5760405162461bcd60e51b815260206004820152601b60248201527f4f626a65637420636c61737320616c7265616479206578697374730000000000604482015260640161042d565b60ff84166000908152600660205260409020610dda8482611c79565b5083600784604051610dec9190611d39565b9081526040805160209281900383019020805460ff191660ff9485161790559184166000908152600890915220610e238282611c79565b5081600982604051610e359190611d39565b9081526040805160209281900383019020805460ff1990811660ff958616179091559683166000908152600a909252902080549095169216919091179092555050565b6006602052600090815260409020805461067390611bf0565b610e99611307565b6002546001600160a01b03163314610ec35760405162461bcd60e51b815260040161042d90611b56565b60ff831660009081526006602052604090208054610ee5919061077f90611bf0565b15610f325760405162461bcd60e51b815260206004820152601760248201527f50726564696361746520646f65736e2774206578697374000000000000000000604482015260640161042d565b60ff821660009081526008602052604090208054610f54919061077f90611bf0565b15610f985760405162461bcd60e51b815260206004820152601460248201527313d89a9958dd08191bd95cdb89dd08195e1a5cdd60621b604482015260640161042d565b60ff8381166000908152600a60205260409020548116908316146110145760405162461bcd60e51b815260206004820152602d60248201527f496e76616c69642053504f2c2070726564696361746520616e64206f626a656360448201526c0e840c8dedc4ee840dac2e8c6d609b1b606482015260840161042d565b6000848152600b602052604090205460ff16158061107f578360ff1660010361107f5760405162461bcd60e51b815260206004820152601760248201527f63616e6e6f74206368616e6765206f776e65722053504f000000000000000000604482015260640161042d565b6004805460405163e14c532d60e01b81526001600160a01b039091169163e14c532d916110b491899189918991899101611d55565b600060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506110ef82511590565b15611156576000858152600b602052604090205460ff858116911614611126576000858152600b602052604090205460ff16611131565b611131600185611d8a565b6000868152600b60205260409020805460ff191660ff929092169190911790556111ab565b6000858152600b602052604090205460ff808616911610611188576000858152600b602052604090205460ff1661118a565b835b6000868152600b60205260409020805460ff191660ff929092169190911790555b80156111f557847e1ff0a7f9f9bfa6a3d5d102a071d2bcae92556caf0da1318cfc2783796bab176111db87611360565b6040516111e89190611934565b60405180910390a2611236565b847f80bce0080e65769d8eee2ab07368f695e8e98b7875f29deedd95b1f202a0414961122087611360565b60405161122d9190611934565b60405180910390a25b5061124060018055565b50505050565b61124e611686565b6001600160a01b0381166112b35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161042d565b6105a0816116e0565b6005805461067390611bf0565b6002546060906001600160a01b031633146112f65760405162461bcd60e51b815260040161042d90611b56565b6112ff82611360565b90505b919050565b6002600154036113595760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161042d565b6002600155565b60408051602081019091526000815260609060015b6000848152600b602052604090205460ff90811690821611611639576000604051806040016040528060018152602001601d60f91b81525060405180604001604052806005815260200164534f554c5f60d81b8152506113d487611730565b6040516020016113e693929190611da3565b60408051601f1981840301815282820182526002835261381d60f11b60208481019190915260ff861660009081526006825283812093519295509361142f939092909101611e59565b60408051808303601f190181528282526004805460ff8881166000818152600a6020529586205463db73972760e01b88529387018d9052602487015291909116604485015290935090916001600160a01b039091169063db73972790606401600060405180830381865afa1580156114ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114d39190810190611e80565b90506114de81511590565b156114eb57505050611627565b6040805180820182526001808252601d60f91b60208084019190915260ff8089166000908152600a83528581205490911681526008825284902084518086018652928352605f60f81b838301529351611548949291869101611eee565b604051602081830303815290604052905061156285511590565b6115c45760408051808201825260078152660101d85101010160cd1b6020808301919091528251808401845260018152600160fd1b8183015292516115ae938993928792879101611f3c565b6040516020818303038152906040529450611623565b8483604051806040016040528060018152602001600160fd1b81525084604051806040016040528060018152602001600160fd1b8152508560405160200161161196959493929190611fa7565b60405160208183030381529060405294505b5050505b8061163181611bad565b915050611375565b50805115611680578060405180604001604052806002815260200161101760f11b81525060405160200161166e929190612026565b60405160208183030381529060405290505b92915050565b6000546001600160a01b031633146106095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161042d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060600061173d836117c3565b600101905060008167ffffffffffffffff81111561175d5761175d611947565b6040519080825280601f01601f191660200182016040528015611787576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461179157509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118025772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061182e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061184c57662386f26fc10000830492506010015b6305f5e1008310611864576305f5e100830492506008015b612710831061187857612710830492506004015b6064831061188a576064830492506002015b600a83106116805760010192915050565b6000602082840312156118ad57600080fd5b5035919050565b6000602082840312156118c657600080fd5b81356001600160a01b03811681146118dd57600080fd5b9392505050565b60005b838110156118ff5781810151838201526020016118e7565b50506000910152565b600081518084526119208160208601602086016118e4565b601f01601f19169290920160200192915050565b6020815260006118dd6020830184611908565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561198657611986611947565b604052919050565b600067ffffffffffffffff8211156119a8576119a8611947565b50601f01601f191660200190565b600082601f8301126119c757600080fd5b81356119da6119d58261198e565b61195d565b8181528460208386010111156119ef57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215611a1e57600080fd5b813567ffffffffffffffff811115611a3557600080fd5b611a41848285016119b6565b949350505050565b803560ff8116811461130257600080fd5b600060208284031215611a6c57600080fd5b6118dd82611a49565b60008060008060808587031215611a8b57600080fd5b611a9485611a49565b9350602085013567ffffffffffffffff80821115611ab157600080fd5b611abd888389016119b6565b9450611acb60408801611a49565b93506060870135915080821115611ae157600080fd5b50611aee878288016119b6565b91505092959194509250565b60008060008060808587031215611b1057600080fd5b84359350611b2060208601611a49565b9250611b2e60408601611a49565b9150606085013567ffffffffffffffff811115611b4a57600080fd5b611aee878288016119b6565b60208082526021908201527f4f6e6c792063616c6c61626c65206279207468652053425420636f6e747261636040820152601d60fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff8103611bc357611bc3611b97565b60010192915050565b6020808252600a908201526927b7363c9020b236b4b760b11b604082015260600190565b600181811c90821680611c0457607f821691505b602082108103611c2457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c7457600081815260208120601f850160051c81016020861015611c515750805b601f850160051c820191505b81811015611c7057828155600101611c5d565b5050505b505050565b815167ffffffffffffffff811115611c9357611c93611947565b611ca781611ca18454611bf0565b84611c2a565b602080601f831160018114611cdc5760008415611cc45750858301515b600019600386901b1c1916600185901b178555611c70565b600085815260208120601f198616915b82811015611d0b57888601518255948401946001909101908401611cec565b5085821015611d295787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251611d4b8184602087016118e4565b9190910192915050565b84815260ff8416602082015260ff83166040820152608060608201526000611d806080830184611908565b9695505050505050565b60ff828116828216039081111561168057611680611b97565b60008451611db58184602089016118e4565b845190830190611dc98183602089016118e4565b8451910190611ddc8183602088016118e4565b0195945050505050565b60008154611df381611bf0565b60018281168015611e0b5760018114611e2057611e4f565b60ff1984168752821515830287019450611e4f565b8560005260208060002060005b85811015611e465781548a820152908401908201611e2d565b50505082870194505b5050505092915050565b60008351611e6b8184602088016118e4565b611e7781840185611de6565b95945050505050565b600060208284031215611e9257600080fd5b815167ffffffffffffffff811115611ea957600080fd5b8201601f81018413611eba57600080fd5b8051611ec86119d58261198e565b818152856020838501011115611edd57600080fd5b611e778260208301602086016118e4565b60008551611f00818460208a016118e4565b611f0c81840187611de6565b90508451611f1e8183602089016118e4565b8451910190611f318183602088016118e4565b019695505050505050565b60008651611f4e818460208b016118e4565b865190830190611f62818360208b016118e4565b8651910190611f75818360208a016118e4565b8551910190611f888183602089016118e4565b8451910190611f9b8183602088016118e4565b01979650505050505050565b600087516020611fba8285838d016118e4565b885191840191611fcd8184848d016118e4565b8851920191611fdf8184848c016118e4565b8751920191611ff18184848b016118e4565b86519201916120038184848a016118e4565b855192019161201581848489016118e4565b919091019998505050505050505050565b600083516120388184602088016118e4565b83519083019061204c8183602088016118e4565b0194935050505056fea26469706673582212209189d4e007cd133ad58d5d6a94e30022fbea1bfcd964f386c7d68dca414b5b6b64736f6c634300081100330000000000000000000000004e03cf4cce1388532e6341515c6d401ff3888480000000000000000000000000d18cd5b2f75b2dc1b6a34e09d989e1a39ef4def40000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f697066732e696f2f697066732f516d5a337932503542356f627261616561354763685258535552646f613174726477624c663469574d465a524c6d3f66696c656e616d653d736368656d612e74746c2e7478740000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063a686b011116100de578063d69b5c0b11610097578063edfbfd0c11610071578063edfbfd0c1461039f578063f2fde38b146103cd578063f3ae9fff146103e0578063fbafb698146103e857600080fd5b8063d69b5c0b1461033d578063e14c532d1461036b578063edcc591a1461037e57600080fd5b8063a686b01114610299578063a8b5dc0e146102ce578063ac3865a3146102f1578063ad3e103f14610304578063ce6ecc0d14610317578063d25db5ac1461032a57600080fd5b8063715018a611610130578063715018a614610234578063757ef7d01461023c578063835331771461024f57806383f854a0146102625780638830c475146102755780638da5cb5b1461028857600080fd5b806301bc45c9146101785780630b98e9a7146101a8578063228dc360146101bd57806343e0f2b7146101d0578063594e5b87146101fd578063704b6c0214610221575b600080fd5b60035461018b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101bb6101b636600461189b565b6103fb565b005b6101bb6101cb3660046118b4565b6105a3565b6101f0604051806040016040528060018152602001601d60f91b81525081565b60405161019f9190611934565b6101f060405180604001604052806005815260200164534f554c5f60d81b81525081565b6101bb61022f3660046118b4565b6105cd565b6101bb6105f7565b6101bb61024a366004611a0c565b61060b565b6101f061025d366004611a5a565b61065a565b6101bb6102703660046118b4565b6106f4565b6101bb610283366004611a75565b61071e565b6000546001600160a01b031661018b565b6102bc6102a736600461189b565b600b6020526000908152604090205460ff1681565b60405160ff909116815260200161019f565b6102bc6102dc366004611a5a565b600a6020526000908152604090205460ff1681565b60045461018b906001600160a01b031681565b6101bb610312366004611a75565b610b41565b60025461018b906001600160a01b031681565b6101f0610338366004611a5a565b610e78565b6102bc61034b366004611a0c565b805160208183018101805160078252928201919093012091525460ff1681565b6101bb610379366004611afa565b610e91565b6101f060405180604001604052806002815260200161381d60f11b81525081565b6102bc6103ad366004611a0c565b805160208183018101805160098252928201919093012091525460ff1681565b6101bb6103db3660046118b4565b611246565b6101f06112bc565b6101f06103f636600461189b565b6112c9565b610403611307565b6002546001600160a01b031633146104365760405162461bcd60e51b815260040161042d90611b56565b60405180910390fd5b6000818152600b602052604090205460ff166104875760405162461bcd60e51b815260206004820152601060248201526f4e6f2052444620746f2072656d6f766560801b604482015260640161042d565b600061049282611360565b905060015b6000838152600b602052604090205460ff90811690821611610545576004805460ff8381166000818152600a6020526040908190205490516302a6a24760e41b815294850188905260248501919091521660448301526001600160a01b031690632a6a247090606401600060405180830381600087803b15801561051a57600080fd5b505af115801561052e573d6000803e3d6000fd5b50505050808061053d90611bad565b915050610497565b506000828152600b602052604090819020805460ff191690555182907f66c8585c3e15ccf8c11639fb9250cc64d2dd63c3bd7f4c5d20cd68dd9c554b059061058e908490611934565b60405180910390a2506105a060018055565b50565b6105ab611686565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6105d5611686565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6105ff611686565b61060960006116e0565b565b6003546001600160a01b031633148061062e57506000546001600160a01b031633145b61064a5760405162461bcd60e51b815260040161042d90611bcc565b60056106568282611c79565b5050565b6008602052600090815260409020805461067390611bf0565b80601f016020809104026020016040519081016040528092919081815260200182805461069f90611bf0565b80156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b505050505081565b6106fc611686565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633148061074157506000546001600160a01b031633145b61075d5760405162461bcd60e51b815260040161042d90611bcc565b60ff841660009081526006602052604090208054610802919061077f90611bf0565b80601f01602080910402602001604051908101604052809291908181526020018280546107ab90611bf0565b80156107f85780601f106107cd576101008083540402835291602001916107f8565b820191906000526020600020905b8154815290600101906020018083116107db57829003601f168201915b5050505050511590565b156108665760405162461bcd60e51b815260206004820152602e60248201527f50726564696361746520646f65736e27742065786973742e205573652073657460448201526d1413d4185a5c881a5b9cdd19585960921b606482015260840161042d565b60ff821660009081526008602052604090208054610888919061077f90611bf0565b156108f05760405162461bcd60e51b815260206004820152603260248201527f4f626a65637420636c61737320646f65736e27742065786973742e2055736572604482015271081cd95d1413d4185a5c881a5b9cdd19585960721b606482015260840161042d565b60ff8481166000908152600a60205260409020548116908316146109685760405162461bcd60e51b815260206004820152602960248201527f417474656d7074696e6720746f206265616b20312d746f2d3120504f2072656c60448201526806174696f6e736869760bc1b606482015260840161042d565b6007836040516109789190611d39565b9081526040519081900360200190205460ff1615806109bb57508360ff166007846040516109a69190611d39565b9081526040519081900360200190205460ff16145b610a025760405162461bcd60e51b815260206004820152601860248201527750726564696361746520616c72656164792065786973747360401b604482015260640161042d565b600981604051610a129190611d39565b9081526040519081900360200190205460ff161580610a5557508160ff16600982604051610a409190611d39565b9081526040519081900360200190205460ff16145b610aa15760405162461bcd60e51b815260206004820152601b60248201527f4f626a65637420636c61737320616c7265616479206578697374730000000000604482015260640161042d565b60ff84166000908152600660205260409020610abd8482611c79565b5083600784604051610acf9190611d39565b9081526040805160209281900383019020805460ff191660ff9485161790559184166000908152600890915220610b068282611c79565b5081600982604051610b189190611d39565b908152604051908190036020019020805460ff9290921660ff1990921691909117905550505050565b6003546001600160a01b0316331480610b6457506000546001600160a01b031633145b610b805760405162461bcd60e51b815260040161042d90611bcc565b60ff841660009081526006602052604090208054610ba2919061077f90611bf0565b610c015760405162461bcd60e51b815260206004820152602a60248201527f50726564696361746520616c72656164792065786973747320696e20746865206044820152690e6c2daca40d2dcc8caf60b31b606482015260840161042d565b60ff821660009081526008602052604090208054610c23919061077f90611bf0565b610c855760405162461bcd60e51b815260206004820152602d60248201527f4f626a65637420636c61737320616c72656164792065786973747320696e207460448201526c0d0ca40e6c2daca40d2dcc8caf609b1b606482015260840161042d565b60ff82161580610c96575060ff8416155b15610ce35760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f742073657420726573657276656420696e64657800000000000000604482015260640161042d565b600783604051610cf39190611d39565b9081526040519081900360200190205460ff1615610d4e5760405162461bcd60e51b815260206004820152601860248201527750726564696361746520616c72656164792065786973747360401b604482015260640161042d565b600981604051610d5e9190611d39565b9081526040519081900360200190205460ff1615610dbe5760405162461bcd60e51b815260206004820152601b60248201527f4f626a65637420636c61737320616c7265616479206578697374730000000000604482015260640161042d565b60ff84166000908152600660205260409020610dda8482611c79565b5083600784604051610dec9190611d39565b9081526040805160209281900383019020805460ff191660ff9485161790559184166000908152600890915220610e238282611c79565b5081600982604051610e359190611d39565b9081526040805160209281900383019020805460ff1990811660ff958616179091559683166000908152600a909252902080549095169216919091179092555050565b6006602052600090815260409020805461067390611bf0565b610e99611307565b6002546001600160a01b03163314610ec35760405162461bcd60e51b815260040161042d90611b56565b60ff831660009081526006602052604090208054610ee5919061077f90611bf0565b15610f325760405162461bcd60e51b815260206004820152601760248201527f50726564696361746520646f65736e2774206578697374000000000000000000604482015260640161042d565b60ff821660009081526008602052604090208054610f54919061077f90611bf0565b15610f985760405162461bcd60e51b815260206004820152601460248201527313d89a9958dd08191bd95cdb89dd08195e1a5cdd60621b604482015260640161042d565b60ff8381166000908152600a60205260409020548116908316146110145760405162461bcd60e51b815260206004820152602d60248201527f496e76616c69642053504f2c2070726564696361746520616e64206f626a656360448201526c0e840c8dedc4ee840dac2e8c6d609b1b606482015260840161042d565b6000848152600b602052604090205460ff16158061107f578360ff1660010361107f5760405162461bcd60e51b815260206004820152601760248201527f63616e6e6f74206368616e6765206f776e65722053504f000000000000000000604482015260640161042d565b6004805460405163e14c532d60e01b81526001600160a01b039091169163e14c532d916110b491899189918991899101611d55565b600060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506110ef82511590565b15611156576000858152600b602052604090205460ff858116911614611126576000858152600b602052604090205460ff16611131565b611131600185611d8a565b6000868152600b60205260409020805460ff191660ff929092169190911790556111ab565b6000858152600b602052604090205460ff808616911610611188576000858152600b602052604090205460ff1661118a565b835b6000868152600b60205260409020805460ff191660ff929092169190911790555b80156111f557847e1ff0a7f9f9bfa6a3d5d102a071d2bcae92556caf0da1318cfc2783796bab176111db87611360565b6040516111e89190611934565b60405180910390a2611236565b847f80bce0080e65769d8eee2ab07368f695e8e98b7875f29deedd95b1f202a0414961122087611360565b60405161122d9190611934565b60405180910390a25b5061124060018055565b50505050565b61124e611686565b6001600160a01b0381166112b35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161042d565b6105a0816116e0565b6005805461067390611bf0565b6002546060906001600160a01b031633146112f65760405162461bcd60e51b815260040161042d90611b56565b6112ff82611360565b90505b919050565b6002600154036113595760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161042d565b6002600155565b60408051602081019091526000815260609060015b6000848152600b602052604090205460ff90811690821611611639576000604051806040016040528060018152602001601d60f91b81525060405180604001604052806005815260200164534f554c5f60d81b8152506113d487611730565b6040516020016113e693929190611da3565b60408051601f1981840301815282820182526002835261381d60f11b60208481019190915260ff861660009081526006825283812093519295509361142f939092909101611e59565b60408051808303601f190181528282526004805460ff8881166000818152600a6020529586205463db73972760e01b88529387018d9052602487015291909116604485015290935090916001600160a01b039091169063db73972790606401600060405180830381865afa1580156114ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114d39190810190611e80565b90506114de81511590565b156114eb57505050611627565b6040805180820182526001808252601d60f91b60208084019190915260ff8089166000908152600a83528581205490911681526008825284902084518086018652928352605f60f81b838301529351611548949291869101611eee565b604051602081830303815290604052905061156285511590565b6115c45760408051808201825260078152660101d85101010160cd1b6020808301919091528251808401845260018152600160fd1b8183015292516115ae938993928792879101611f3c565b6040516020818303038152906040529450611623565b8483604051806040016040528060018152602001600160fd1b81525084604051806040016040528060018152602001600160fd1b8152508560405160200161161196959493929190611fa7565b60405160208183030381529060405294505b5050505b8061163181611bad565b915050611375565b50805115611680578060405180604001604052806002815260200161101760f11b81525060405160200161166e929190612026565b60405160208183030381529060405290505b92915050565b6000546001600160a01b031633146106095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161042d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060600061173d836117c3565b600101905060008167ffffffffffffffff81111561175d5761175d611947565b6040519080825280601f01601f191660200182016040528015611787576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461179157509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118025772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061182e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061184c57662386f26fc10000830492506010015b6305f5e1008310611864576305f5e100830492506008015b612710831061187857612710830492506004015b6064831061188a576064830492506002015b600a83106116805760010192915050565b6000602082840312156118ad57600080fd5b5035919050565b6000602082840312156118c657600080fd5b81356001600160a01b03811681146118dd57600080fd5b9392505050565b60005b838110156118ff5781810151838201526020016118e7565b50506000910152565b600081518084526119208160208601602086016118e4565b601f01601f19169290920160200192915050565b6020815260006118dd6020830184611908565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561198657611986611947565b604052919050565b600067ffffffffffffffff8211156119a8576119a8611947565b50601f01601f191660200190565b600082601f8301126119c757600080fd5b81356119da6119d58261198e565b61195d565b8181528460208386010111156119ef57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215611a1e57600080fd5b813567ffffffffffffffff811115611a3557600080fd5b611a41848285016119b6565b949350505050565b803560ff8116811461130257600080fd5b600060208284031215611a6c57600080fd5b6118dd82611a49565b60008060008060808587031215611a8b57600080fd5b611a9485611a49565b9350602085013567ffffffffffffffff80821115611ab157600080fd5b611abd888389016119b6565b9450611acb60408801611a49565b93506060870135915080821115611ae157600080fd5b50611aee878288016119b6565b91505092959194509250565b60008060008060808587031215611b1057600080fd5b84359350611b2060208601611a49565b9250611b2e60408601611a49565b9150606085013567ffffffffffffffff811115611b4a57600080fd5b611aee878288016119b6565b60208082526021908201527f4f6e6c792063616c6c61626c65206279207468652053425420636f6e747261636040820152601d60fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff8103611bc357611bc3611b97565b60010192915050565b6020808252600a908201526927b7363c9020b236b4b760b11b604082015260600190565b600181811c90821680611c0457607f821691505b602082108103611c2457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611c7457600081815260208120601f850160051c81016020861015611c515750805b601f850160051c820191505b81811015611c7057828155600101611c5d565b5050505b505050565b815167ffffffffffffffff811115611c9357611c93611947565b611ca781611ca18454611bf0565b84611c2a565b602080601f831160018114611cdc5760008415611cc45750858301515b600019600386901b1c1916600185901b178555611c70565b600085815260208120601f198616915b82811015611d0b57888601518255948401946001909101908401611cec565b5085821015611d295787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251611d4b8184602087016118e4565b9190910192915050565b84815260ff8416602082015260ff83166040820152608060608201526000611d806080830184611908565b9695505050505050565b60ff828116828216039081111561168057611680611b97565b60008451611db58184602089016118e4565b845190830190611dc98183602089016118e4565b8451910190611ddc8183602088016118e4565b0195945050505050565b60008154611df381611bf0565b60018281168015611e0b5760018114611e2057611e4f565b60ff1984168752821515830287019450611e4f565b8560005260208060002060005b85811015611e465781548a820152908401908201611e2d565b50505082870194505b5050505092915050565b60008351611e6b8184602088016118e4565b611e7781840185611de6565b95945050505050565b600060208284031215611e9257600080fd5b815167ffffffffffffffff811115611ea957600080fd5b8201601f81018413611eba57600080fd5b8051611ec86119d58261198e565b818152856020838501011115611edd57600080fd5b611e778260208301602086016118e4565b60008551611f00818460208a016118e4565b611f0c81840187611de6565b90508451611f1e8183602089016118e4565b8451910190611f318183602088016118e4565b019695505050505050565b60008651611f4e818460208b016118e4565b865190830190611f62818360208b016118e4565b8651910190611f75818360208a016118e4565b8551910190611f888183602089016118e4565b8451910190611f9b8183602088016118e4565b01979650505050505050565b600087516020611fba8285838d016118e4565b885191840191611fcd8184848d016118e4565b8851920191611fdf8184848c016118e4565b8751920191611ff18184848b016118e4565b86519201916120038184848a016118e4565b855192019161201581848489016118e4565b919091019998505050505050505050565b600083516120388184602088016118e4565b83519083019061204c8183602088016118e4565b0194935050505056fea26469706673582212209189d4e007cd133ad58d5d6a94e30022fbea1bfcd964f386c7d68dca414b5b6b64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004e03cf4cce1388532e6341515c6d401ff3888480000000000000000000000000d18cd5b2f75b2dc1b6a34e09d989e1a39ef4def40000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f697066732e696f2f697066732f516d5a337932503542356f627261616561354763685258535552646f613174726477624c663469574d465a524c6d3f66696c656e616d653d736368656d612e74746c2e7478740000000000
-----Decoded View---------------
Arg [0] : sbt (address): 0x4E03cf4CCE1388532e6341515C6D401Ff3888480
Arg [1] : spoProxy (address): 0xd18cD5b2F75b2dC1b6A34e09d989e1A39Ef4dEF4
Arg [2] : schemaUri (string): https://ipfs.io/ipfs/QmZ3y2P5B5obraaea5GchRXSURdoa1trdwbLf4iWMFZRLm?filename=schema.ttl.txt
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e03cf4cce1388532e6341515c6d401ff3888480
Arg [1] : 000000000000000000000000d18cd5b2f75b2dc1b6a34e09d989e1a39ef4def4
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 000000000000000000000000000000000000000000000000000000000000005b
Arg [4] : 68747470733a2f2f697066732e696f2f697066732f516d5a337932503542356f
Arg [5] : 627261616561354763685258535552646f613174726477624c663469574d465a
Arg [6] : 524c6d3f66696c656e616d653d736368656d612e74746c2e7478740000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.