Sophon Testnet

Contract

0x42eDF86D4353985a733d7686DEF682077C05d4c8

Overview

SOPH Balance

Sophon Sepolia  LogoSophon Sepolia  LogoSophon Sepolia  Logo0 SOPH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Register6964522025-03-10 13:53:3347 hrs ago1741614813IN
0x42eDF86D...77C05d4c8
0 SOPH1.2160510,000

Latest 13 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
7077352025-03-12 10:30:132 hrs ago1741775413
0x42eDF86D...77C05d4c8
0 SOPH
7077352025-03-12 10:30:132 hrs ago1741775413
0x42eDF86D...77C05d4c8
0 SOPH
7077352025-03-12 10:30:132 hrs ago1741775413
0x42eDF86D...77C05d4c8
0 SOPH
6969432025-03-10 15:51:0745 hrs ago1741621867
0x42eDF86D...77C05d4c8
0 SOPH
6969432025-03-10 15:51:0745 hrs ago1741621867
0x42eDF86D...77C05d4c8
0 SOPH
6969432025-03-10 15:51:0745 hrs ago1741621867
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6964522025-03-10 13:53:3347 hrs ago1741614813
0x42eDF86D...77C05d4c8
0 SOPH
6958062025-03-10 11:40:072 days ago1741606807  Contract Creation0 SOPH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SchemaRegistry

Compiler Version
v0.8.27+commit.40a35a09

ZkSolc Version
v1.5.7

Optimization Enabled:
Yes with Mode 3

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : SchemaRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.27;

import { ISchemaResolver } from "./resolver/ISchemaResolver.sol";

import { EMPTY_UID } from "./Common.sol";
import { Semver } from "./Semver.sol";
import { ISchemaRegistry, SchemaRecord } from "./ISchemaRegistry.sol";

/// @title SchemaRegistry
/// @notice The global schema registry.
contract SchemaRegistry is ISchemaRegistry, Semver {
    error AlreadyExists();

    // The global mapping between schema records and their IDs.
    mapping(bytes32 uid => SchemaRecord schemaRecord) private _registry;

    /// @dev Creates a new SchemaRegistry instance.
    constructor() Semver(1, 3, 0) {}

    /// @inheritdoc ISchemaRegistry
    function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) {
        SchemaRecord memory schemaRecord = SchemaRecord({
            uid: EMPTY_UID,
            schema: schema,
            resolver: resolver,
            revocable: revocable
        });

        bytes32 uid = _getUID(schemaRecord);
        if (_registry[uid].uid != EMPTY_UID) {
            revert AlreadyExists();
        }

        schemaRecord.uid = uid;
        _registry[uid] = schemaRecord;

        emit Registered(uid, msg.sender, schemaRecord);

        return uid;
    }

    /// @inheritdoc ISchemaRegistry
    function getSchema(bytes32 uid) external view returns (SchemaRecord memory) {
        return _registry[uid];
    }

    /// @dev Calculates a UID for a given schema.
    /// @param schemaRecord The input schema.
    /// @return schema UID.
    function _getUID(SchemaRecord memory schemaRecord) private pure returns (bytes32) {
        return keccak256(abi.encodePacked(schemaRecord.schema, schemaRecord.resolver, schemaRecord.revocable));
    }
}

File 2 of 9 : ISchemaResolver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { Attestation } from "./../Common.sol";
import { ISemver } from "./../ISemver.sol";

/// @title ISchemaResolver
/// @notice The interface of an optional schema resolver.
interface ISchemaResolver is ISemver {
    /// @notice Checks if the resolver can be sent ETH.
    /// @return Whether the resolver supports ETH transfers.
    function isPayable() external pure returns (bool);

    /// @notice Processes an attestation and verifies whether it's valid.
    /// @param attestation The new attestation.
    /// @return Whether the attestation is valid.
    function attest(Attestation calldata attestation) external payable returns (bool);

    /// @notice Processes multiple attestations and verifies whether they are valid.
    /// @param attestations The new attestations.
    /// @param values Explicit ETH amounts which were sent with each attestation.
    /// @return Whether all the attestations are valid.
    function multiAttest(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable returns (bool);

    /// @notice Processes an attestation revocation and verifies if it can be revoked.
    /// @param attestation The existing attestation to be revoked.
    /// @return Whether the attestation can be revoked.
    function revoke(Attestation calldata attestation) external payable returns (bool);

    /// @notice Processes revocation of multiple attestation and verifies they can be revoked.
    /// @param attestations The existing attestations to be revoked.
    /// @param values Explicit ETH amounts which were sent with each revocation.
    /// @return Whether the attestations can be revoked.
    function multiRevoke(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable returns (bool);
}

File 3 of 9 : Common.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// A representation of an empty/uninitialized UID.
bytes32 constant EMPTY_UID = 0;

// A zero expiration represents an non-expiring attestation.
uint64 constant NO_EXPIRATION_TIME = 0;

error AccessDenied();
error DeadlineExpired();
error InvalidEAS();
error InvalidLength();
error InvalidSignature();
error NotFound();

/// @notice A struct representing ECDSA signature data.
struct Signature {
    uint8 v; // The recovery ID.
    bytes32 r; // The x-coordinate of the nonce R.
    bytes32 s; // The signature data.
}

/// @notice A struct representing a single attestation.
struct Attestation {
    bytes32 uid; // A unique identifier of the attestation.
    bytes32 schema; // The unique identifier of the schema.
    uint64 time; // The time when the attestation was created (Unix timestamp).
    uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
    uint64 revocationTime; // The time when the attestation was revoked (Unix timestamp).
    bytes32 refUID; // The UID of the related attestation.
    address recipient; // The recipient of the attestation.
    address attester; // The attester/sender of the attestation.
    bool revocable; // Whether the attestation is revocable.
    bytes data; // Custom attestation data.
}

/// @notice A helper function to work with unchecked iterators in loops.
function uncheckedInc(uint256 i) pure returns (uint256 j) {
    unchecked {
        j = i + 1;
    }
}

File 4 of 9 : Semver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";

import { ISemver } from "./ISemver.sol";

/// @title Semver
/// @notice A simple contract for managing contract versions.
contract Semver is ISemver {
    // Contract's major version number.
    uint256 private immutable _major;

    // Contract's minor version number.
    uint256 private immutable _minor;

    // Contract's patch version number.
    uint256 private immutable _patch;

    /// @dev Create a new Semver instance.
    /// @param major Major version number.
    /// @param minor Minor version number.
    /// @param patch Patch version number.
    constructor(uint256 major, uint256 minor, uint256 patch) {
        _major = major;
        _minor = minor;
        _patch = patch;
    }

    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function version() external view returns (string memory) {
        return
            string(
                abi.encodePacked(Strings.toString(_major), ".", Strings.toString(_minor), ".", Strings.toString(_patch))
            );
    }
}

File 5 of 9 : ISchemaRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { ISemver } from "./ISemver.sol";

import { ISchemaResolver } from "./resolver/ISchemaResolver.sol";

/// @notice A struct representing a record for a submitted schema.
struct SchemaRecord {
    bytes32 uid; // The unique identifier of the schema.
    ISchemaResolver resolver; // Optional schema resolver.
    bool revocable; // Whether the schema allows revocations explicitly.
    string schema; // Custom specification of the schema (e.g., an ABI).
}

/// @title ISchemaRegistry
/// @notice The interface of global attestation schemas for the Ethereum Attestation Service protocol.
interface ISchemaRegistry is ISemver {
    /// @notice Emitted when a new schema has been registered
    /// @param uid The schema UID.
    /// @param registerer The address of the account used to register the schema.
    /// @param schema The schema data.
    event Registered(bytes32 indexed uid, address indexed registerer, SchemaRecord schema);

    /// @notice Submits and reserves a new schema
    /// @param schema The schema data schema.
    /// @param resolver An optional schema resolver.
    /// @param revocable Whether the schema allows revocations explicitly.
    /// @return The UID of the new schema.
    function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32);

    /// @notice Returns an existing schema by UID
    /// @param uid The UID of the schema to retrieve.
    /// @return The schema data members.
    function getSchema(bytes32 uid) external view returns (SchemaRecord memory);
}

File 6 of 9 : ISemver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title ISemver
/// @notice A semver interface.
interface ISemver {
    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function version() external view returns (string memory);
}

File 7 of 9 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @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), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 8 of 9 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 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.

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 9 of 9 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "viaIR": false,
  "codegen": "yul",
  "remappings": [
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@erc721a/=deps/erc721a/contracts/",
    "forge-std/=lib/forge-std/src/",
    "@ethereum-attestation-service/=node_modules/@ethereum-attestation-service/"
  ],
  "evmVersion": "cancun",
  "outputSelection": {
    "*": {
      "*": [
        "abi",
        "metadata"
      ],
      "": [
        "ast"
      ]
    }
  },
  "optimizer": {
    "enabled": true,
    "mode": "3",
    "fallback_to_optimizing_for_size": false,
    "disable_system_request_memoization": true
  },
  "metadata": {},
  "libraries": {},
  "detectMissingLibraries": false,
  "enableEraVMExtensions": false,
  "forceEVMLA": false
}

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExists","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"uid","type":"bytes32"},{"indexed":true,"internalType":"address","name":"registerer","type":"address"},{"components":[{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"contract ISchemaResolver","name":"resolver","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"string","name":"schema","type":"string"}],"indexed":false,"internalType":"struct SchemaRecord","name":"schema","type":"tuple"}],"name":"Registered","type":"event"},{"inputs":[{"internalType":"bytes32","name":"uid","type":"bytes32"}],"name":"getSchema","outputs":[{"components":[{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"contract ISchemaResolver","name":"resolver","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"string","name":"schema","type":"string"}],"internalType":"struct SchemaRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schema","type":"string"},{"internalType":"contract ISchemaResolver","name":"resolver","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"}],"name":"register","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

9c4d535b0000000000000000000000000000000000000000000000000000000000000000010001296477b3ab1f242e20095608c7a87158dd877ad2978da50ef17604e38800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x0002000000000002000c00000000000200010000000103550000006003100270000001020030019d0000000100200190000000480000c13d00000102033001970000008002000039000000400020043f000000040030008c0000030a0000413d000000000201043b000000e002200270000001040020009c0000005e0000613d000001050020009c000000800000613d000001060020009c0000030a0000c13d0000000001000416000000000001004b0000030a0000c13d0000000001000412000c00000001001d000b00000000003d00000000010004150000000c0110008a0000000501100210040203e50000040f040203980000040f0000000002000412000a00000002001d000900200000003d000500000001001d00000000010004150000000a0110008a0000000501100210040203e50000040f040203980000040f0000000002000412000800000002001d000700400000003d000600000001001d0000000001000415000000080110008a0000000501100210040203e50000040f040203980000040f0000000503000029000000004303043400000119073001970000001f0530018f000000400d00043d0000002006d00039000000000064004b000000e40000813d000000000007004b000000450000613d00000000095400190000000008560019000000200880008a000000200990008a000000000a780019000000000b790019000000000b0b04330000000000ba0435000000200770008c0000003f0000c13d000000000005004b000000f00000c13d000000fa0000013d000000e001000039000000400010043f0000000001000416000000000001004b0000030a0000c13d0000000101000039000000800010043f0000000302000039000000a00020043f000000c00000043f0000014000000443000001600010044300000020010000390000018000100443000001a0002004430000004003000039000001c000300443000001e000000443000001000010044300000120002004430000010301000041000004030001042e000000240030008c0000030a0000413d0000000002000416000000000002004b0000030a0000c13d0000010002000039000000400020043f000000800000043f000000a00000043f000000c00000043f0000006002000039000000e00020043f0000000401100370000000000101043b000000000010043f000000200000043f0000000001000414000001020010009c0000010201008041000000c00110021000000107011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d000000400500043d000001080050009c000001760000a13d0000011601000041000000000010043f0000004101000039000000040010043f00000117010000410000040400010430000000640030008c0000030a0000413d0000000002000416000000000002004b0000030a0000c13d0000000402100370000000000502043b0000010c0050009c0000030a0000213d0000002302500039000000000032004b0000030a0000813d0000000404500039000000000241034f000000000202043b0000010c0020009c0000030a0000213d00000000052500190000002405500039000000000035004b0000030a0000213d0000002403100370000000000303043b000001090030009c0000030a0000213d0000004405100370000000000505043b000000000005004b0000000006000039000000010600c039000000000065004b0000030a0000c13d00000109063001970000010003000039000000400030043f000000800000043f000000a00060043f000000c00050043f0000001f0520003900000119055001970000003f0550003900000119055001970000010d0050009c0000007a0000813d0000010005500039000000400050043f0000002004400039000000000441034f000001000020043f00000119052001980000001f0620018f0000012001500039000000bb0000613d0000012007000039000000000804034f000000008908043c0000000007970436000000000017004b000000b70000c13d000000000006004b000000c80000613d000000000454034f0000000305600210000000000601043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f000000000041043500000120012000390000000000010435000000e00030043f000000c00400043d000000a00500043d000001000300043d00000119073001970000001f0630018f000000400100043d0000002002100039000001210020008c000001c80000413d000000000007004b000000df0000613d000000000962001900000100086001bf000000200990008a000000000a790019000000000b780019000000000b0b04330000000000ba0435000000200770008c000000d90000c13d000000000006004b000001de0000613d00000120070000390000000008020019000001d40000013d0000000008760019000000000007004b000000ec0000613d0000000009040019000000009a0904340000000006a60436000000000086004b000000e80000c13d000000000005004b000000fa0000613d000000000474001900000000060800190000000305500210000000000706043300000000075701cf000000000757022f00000000040404330000010005500089000000000454022f00000000045401cf000000000474019f00000000004604350000000003d300190000002004300039000001180500004100000000005404350000000605000029000000000405043300000119084001970000001f0740018f00000021063000390000002005500039000000000065004b000001150000813d000000000008004b000001120000613d000000000a7500190000000009760019000000200990008a000000200aa0008a000000000b890019000000000c8a0019000000000c0c04330000000000cb0435000000200880008c0000010c0000c13d000000000007004b000001210000c13d0000012b0000013d0000000009860019000000000008004b0000011d0000613d000000000a05001900000000ab0a04340000000006b60436000000000096004b000001190000c13d000000000007004b0000012b0000613d000000000585001900000000060900190000000307700210000000000806043300000000087801cf000000000878022f00000000050504330000010007700089000000000575022f00000000057501cf000000000585019f000000000056043500000000073400190000002103700039000001180400004100000000004304350000002003700039000000000401043300000119064001970000001f0540018f00000022027000390000002001100039000000000021004b000001460000813d000000000006004b000001430000613d00000000085100190000000007520019000000200770008a000000200880008a0000000009670019000000000a680019000000000a0a04330000000000a90435000000200660008c0000013d0000c13d000000000005004b000001520000c13d0000015c0000013d0000000007620019000000000006004b0000014e0000613d000000000801001900000000890804340000000002920436000000000072004b0000014a0000c13d000000000005004b0000015c0000613d000000000161001900000000020700190000000305500210000000000602043300000000065601cf000000000656022f00000000010104330000010005500089000000000151022f00000000015101cf000000000161019f00000000001204350000000001430019000000020210003900000000000204350000000001d100490000001e0210008a00000000002d0435000000020210003900000000010d001900060000000d001d040203860000040f0000002001000039000000400200043d000500000002001d000000000212043600000006010000290402030c0000040f00000005020000290000000001210049000001020010009c00000102010080410000006001100210000001020020009c00000102020080410000004002200210000000000121019f000004030001042e000000000101043b0000008002500039000000400020043f000000000201041a00000000022504360000000103100039000000000303041a0000010904300197000000000042043500000040025000390000010a003001980000000003000039000000010300c03900000000003204350000000201100039000000000201041a000000010320019000000001062002700000007f0660618f0000001f0060008c00000000040000390000000104002039000000000442013f0000000100400190000001950000613d0000011601000041000000000010043f0000002201000039000000040010043f00000117010000410000040400010430000500000005001d000000400500043d0000000004650436000000000003004b000600000005001d000001b70000613d000300000004001d000400000006001d000000000010043f0000000001000414000001020010009c0000010201008041000000c0011002100000010b011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d0000000406000029000000000006004b000000000200001900000006050000290000000307000029000001bc0000613d000000000101043b00000000020000190000000003270019000000000401041a000000000043043500000001011000390000002002200039000000000062004b000001af0000413d000001bc0000013d0000011a012001970000000000140435000000000006004b0000002002000039000000000200603900000020022000390000000001050019040203860000040f0000000502000029000000600120003900000006030000290000000000310435000000400100043d000600000001001d0402033e0000040f00000006020000290000016d0000013d0000000008720019000000000007004b000001d10000613d0000012009000039000000000a020019000000009b090434000000000aba043600000000008a004b000001cd0000c13d000000000006004b000001de0000613d00000120077000390000000306600210000000000908043300000000096901cf000000000969022f00000000070704330000010006600089000000000767022f00000000066701cf000000000696019f000000000068043500000060055002100000000006130019000000200760003900000000005704350000003405600039000000000004004b0000010e040000410000000004006019000000000045043500000015043000390000000000410435000000540330003900000119043001970000000003140019000000000043004b000000000400003900000001040040390000010c0030009c0000007a0000213d00000001004001900000007a0000c13d000000400030043f000001020020009c000001020200804100000040022002100000000001010433000001020010009c00000102010080410000006001100210000000000121019f0000000002000414000001020020009c0000010202008041000000c002200210000000000112019f0000010f011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d000000000101043b000600000001001d000000000010043f000000200000043f0000000001000414000001020010009c0000010201008041000000c00110021000000107011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d000000000101043b000000000101041a000000000001004b000002790000c13d0000000601000029000000800010043f000000000010043f000000200000043f0000000001000414000001020010009c0000010201008041000000c00110021000000107011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d000000000101043b000000800200043d000000000021041b000000a00200043d00000109022001970000000103100039000000000403041a0000011204400197000000000224019f000000c00400043d000000000004004b00000113040000410000000004006019000000000242019f000000000023041b000000e00200043d000400000002001d0000000032020434000300000003001d000500000002001d0000010c0020009c0000007a0000213d0000000201100039000200000001001d000000000101041a000000010210019000000001011002700000007f0110618f000100000001001d0000001f0010008c00000000010000390000000101002039000000000012004b0000018f0000c13d0000000101000029000000200010008c000002650000413d0000000201000029000000000010043f0000000001000414000001020010009c0000010201008041000000c0011002100000010b011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d00000005030000290000001f023000390000000502200270000000200030008c0000000002004019000000000301043b00000001010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b000002650000813d000000000002041b0000000102200039000000000012004b000002610000413d00000005010000290000001f0010008c0000027d0000a13d0000000201000029000000000010043f0000000001000414000001020010009c0000010201008041000000c0011002100000010b011001c70000801002000039040203fd0000040f00000001002001900000030a0000613d000000200200008a0000000502200180000000000101043b0000028a0000c13d0000002003000039000002970000013d0000011001000041000000000010043f00000111010000410000040400010430000000050000006b0000000001000019000002820000613d00000003010000290000000001010433000000050400002900000003024002100000011b0220027f0000011b02200167000000000121016f0000000102400210000000000121019f000002a50000013d000000010320008a0000000503300270000000000431001900000020030000390000000104400039000000040600002900000000056300190000000005050433000000000051041b00000020033000390000000101100039000000000041004b000002900000c13d000000050020006c000002a20000813d00000005020000290000000302200210000000f80220018f0000011b0220027f0000011b0220016700000004033000290000000003030433000000000223016f000000000021041b0000000501000029000000010110021000000001011001bf0000000202000029000000000012041b0000002002000039000000400100043d0000000002210436000000800300043d0000000000320435000000a00200043d000001090220019700000040031000390000000000230435000000c00200043d000000000002004b0000000002000039000000010200c039000000600310003900000000002304350000008002100039000000e00300043d00000080040000390000000000420435000000a00510003900000000420304340000000000250435000000000600041100000119072001970000001f0520018f000000c003100039000000000034004b000002d30000813d000000000007004b000002cf0000613d00000000095400190000000008530019000000200880008a000000200990008a000000000a780019000000000b790019000000000b0b04330000000000ba0435000000200770008c000002c90000c13d000000000005004b000002e90000613d0000000008030019000002df0000013d0000000008730019000000000007004b000002dc0000613d0000000009040019000000000a030019000000009b090434000000000aba043600000000008a004b000002d80000c13d000000000005004b000002e90000613d00000000047400190000000305500210000000000708043300000000075701cf000000000757022f00000000040404330000010005500089000000000454022f00000000045401cf000000000474019f00000000004804350000001f04200039000001190440019700000000023200190000000000020435000000c002400039000001020020009c00000102020080410000006002200210000001020010009c00000102010080410000004001100210000000000112019f0000000002000414000001020020009c0000010202008041000000c002200210000000000121019f0000010f011001c70000800d02000039000000030300003900000114040000410000000605000029040203f80000040f00000001002001900000030a0000613d000000400100043d00000006020000290000000000210435000001020010009c0000010201008041000000400110021000000115011001c7000004030001042e000000000100001900000404000104300000000043010434000000000132043600000119063001970000001f0530018f000000000014004b000003220000813d000000000006004b0000031e0000613d00000000085400190000000007510019000000200770008a000000200880008a0000000009670019000000000a680019000000000a0a04330000000000a90435000000200660008c000003180000c13d000000000005004b000003380000613d00000000070100190000032e0000013d0000000007610019000000000006004b0000032b0000613d00000000080400190000000009010019000000008a0804340000000009a90436000000000079004b000003270000c13d000000000005004b000003380000613d00000000046400190000000305500210000000000607043300000000065601cf000000000656022f00000000040404330000010005500089000000000454022f00000000045401cf000000000464019f0000000000470435000000000431001900000000000404350000001f0330003900000119023001970000000001210019000000000001042d0000002003000039000000000331043600000000540204340000000000430435000000000305043300000109033001970000004004100039000000000034043500000040032000390000000003030433000000000003004b0000000003000039000000010300c0390000006004100039000000000034043500000060022000390000000002020433000000800310003900000080040000390000000000430435000000a0031000390000000042020434000000000023043500000119062001970000001f0520018f000000c001100039000000000014004b0000036a0000813d000000000006004b000003660000613d00000000085400190000000007510019000000200770008a000000200880008a0000000009670019000000000a680019000000000a0a04330000000000a90435000000200660008c000003600000c13d000000000005004b000003800000613d0000000007010019000003760000013d0000000007610019000000000006004b000003730000613d00000000080400190000000009010019000000008a0804340000000009a90436000000000079004b0000036f0000c13d000000000005004b000003800000613d00000000046400190000000305500210000000000607043300000000065601cf000000000656022f00000000040404330000010005500089000000000454022f00000000045401cf000000000464019f0000000000470435000000000412001900000000000404350000001f0220003900000119022001970000000001120019000000000001042d0000001f0220003900000119022001970000000001120019000000000021004b000000000200003900000001020040390000010c0010009c000003920000213d0000000100200190000003920000c13d000000400010043f000000000001042d0000011601000041000000000010043f0000004101000039000000040010043f000001170100004100000404000104300000011c0010009c0000039d0000413d00000040030000390000011c0210012a000003a60000013d0000011e0010009c00000000020100190000011d0220212a000000000300003900000020030020390000011f0020009c00000010033081bf00000120022081970000011f0220812a000001210020009c00000008033080390000010c02208197000001210220812a000027100020008c00000004033080390000010202208197000027100220811a000000640020008c00000002033080390000ffff0220818f000000640220811a000000090020008c000000010330203900000119063001970000005f026000390000011907200197000000400200043d0000000004270019000000000074004b000000000700003900000001070040390000010c0040009c000003de0000213d0000000100700190000003de0000c13d000000400040043f00000001043000390000000004420436000000200760003900000119067001980000001f0570018f000003ce0000613d000000000664001900000000070000310000000107700367000000007807043c0000000004840436000000000064004b000003ca0000c13d000000000005004b00000000033200190000002103300039000000090010008c0000000a4110011a0000000304400210000000010330008a00000000050304330000012205500197000001230440021f0000012404400197000000000445019f0000000000430435000003d10000213d0000000001020019000000000001042d0000011601000041000000000010043f0000004101000039000000040010043f00000117010000410000040400010430000000000001042f00000125020000410000000000200443000000050110027000000000020100310000000400200443000000010101003100000024001004430000000001000414000001020010009c0000010201008041000000c00110021000000126011001c70000800502000039040203fd0000040f0000000100200190000003f70000613d000000000101043b000000000001042d000000000001042f000003fb002104210000000102000039000000000001042d0000000002000019000000000001042d00000400002104230000000102000039000000000001042d0000000002000019000000000001042d0000040200000432000004030001042e000004040001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000010000000100000000000000000000000000000000000000000000000000000000000000000000000000a2ea7c6e0000000000000000000000000000000000000000000000000000000060d7a2780000000000000000000000000000000000000000000000000000000054fd4d500200000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000ff00000000000000000000000000000000000000000200000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffff000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000023369fa6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000ffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000d0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e00000000000000000000000000000000000000200000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000000000000000000000000000000000000000004ee2d6d415b85acef810000000000000000000000000000000000000000000004ee2d6d415b85acef80ffffffff000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000005f5e10000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff30313233343536373839616263646566000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000310ab089e4439a4c15d089f94afb7896ff553aecb10793d0ab882de59d99a32e0200000200000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045200fd4baf737f5d8094b867021c0366b242aa0563ca439fb08f5b6588be3d5

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.