Source Code
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RubyScoreBadge
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <=0.8.26;
import "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import "./extensions/ScrollBadgeAccessControl.sol";
import "./extensions/ScrollBadgeSingleton.sol";
import "./interfaces/IRubyscore_Achievement.sol";
import "./extensions/ScrollBadgeDefaultURI.sol";
/// @title ScrollBadgeSimple
/// @notice A simple badge that has the same static metadata for each token.
contract RubyScoreBadge is ScrollBadgeAccessControl, ScrollBadgeSingleton, ScrollBadgeDefaultURI {
address public RubyscoreAchievement;
constructor(address resolver_, address achievement_, string memory defaultUri_) ScrollBadgeDefaultURI(defaultUri_) ScrollBadge(resolver_) Ownable(msg.sender) {
RubyscoreAchievement = achievement_;
}
/// @inheritdoc ScrollBadge
function onIssueBadge(Attestation calldata attestation)
internal
override (ScrollBadgeAccessControl, ScrollBadgeSingleton, ScrollBadge)
returns (bool)
{
if (!super.onIssueBadge(attestation)) {
return false;
}
if (IRubyscore_Achievement(RubyscoreAchievement).getUserNonce(attestation.recipient) == 0) {
revert Unauthorized();
}
return true;
}
/// @inheritdoc ScrollBadge
function onRevokeBadge(Attestation calldata attestation)
internal
override (ScrollBadgeAccessControl, ScrollBadgeSingleton, ScrollBadge)
returns (bool)
{
return super.onRevokeBadge(attestation);
}
/// @inheritdoc ScrollBadgeDefaultURI
function getBadgeTokenURI(bytes32 uid) internal view override returns (string memory) {
return string(abi.encodePacked(defaultBadgeURI, "0x", _toHexString(uid)));
}
function setDefaultBadgeURI(string memory defaultURI) external virtual onlyOwner {
defaultBadgeURI = defaultURI;
}
function _toHexString(bytes32 value) internal pure returns (string memory) {
bytes memory alphabet = "0123456789abcdef";
bytes memory buffer = new bytes(64);
for (uint256 i = 0; i < 32; i++) {
buffer[i * 2] = alphabet[uint8(value[i]) >> 4];
buffer[i * 2 + 1] = alphabet[uint8(value[i]) & 0x0f];
}
return string(buffer);
}
}// 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;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ISchemaRegistry } from "./ISchemaRegistry.sol";
import { ISemver } from "./ISemver.sol";
import { Attestation, Signature } from "./Common.sol";
/// @notice A struct representing the arguments of the attestation request.
struct AttestationRequestData {
address recipient; // The recipient of the attestation.
uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
bool revocable; // Whether the attestation is revocable.
bytes32 refUID; // The UID of the related attestation.
bytes data; // Custom attestation data.
uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user errors.
}
/// @notice A struct representing the full arguments of the attestation request.
struct AttestationRequest {
bytes32 schema; // The unique identifier of the schema.
AttestationRequestData data; // The arguments of the attestation request.
}
/// @notice A struct representing the full arguments of the full delegated attestation request.
struct DelegatedAttestationRequest {
bytes32 schema; // The unique identifier of the schema.
AttestationRequestData data; // The arguments of the attestation request.
Signature signature; // The ECDSA signature data.
address attester; // The attesting account.
uint64 deadline; // The deadline of the signature/request.
}
/// @notice A struct representing the full arguments of the multi attestation request.
struct MultiAttestationRequest {
bytes32 schema; // The unique identifier of the schema.
AttestationRequestData[] data; // The arguments of the attestation request.
}
/// @notice A struct representing the full arguments of the delegated multi attestation request.
struct MultiDelegatedAttestationRequest {
bytes32 schema; // The unique identifier of the schema.
AttestationRequestData[] data; // The arguments of the attestation requests.
Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with increasing nonces.
address attester; // The attesting account.
uint64 deadline; // The deadline of the signature/request.
}
/// @notice A struct representing the arguments of the revocation request.
struct RevocationRequestData {
bytes32 uid; // The UID of the attestation to revoke.
uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user errors.
}
/// @notice A struct representing the full arguments of the revocation request.
struct RevocationRequest {
bytes32 schema; // The unique identifier of the schema.
RevocationRequestData data; // The arguments of the revocation request.
}
/// @notice A struct representing the arguments of the full delegated revocation request.
struct DelegatedRevocationRequest {
bytes32 schema; // The unique identifier of the schema.
RevocationRequestData data; // The arguments of the revocation request.
Signature signature; // The ECDSA signature data.
address revoker; // The revoking account.
uint64 deadline; // The deadline of the signature/request.
}
/// @notice A struct representing the full arguments of the multi revocation request.
struct MultiRevocationRequest {
bytes32 schema; // The unique identifier of the schema.
RevocationRequestData[] data; // The arguments of the revocation request.
}
/// @notice A struct representing the full arguments of the delegated multi revocation request.
struct MultiDelegatedRevocationRequest {
bytes32 schema; // The unique identifier of the schema.
RevocationRequestData[] data; // The arguments of the revocation requests.
Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with increasing nonces.
address revoker; // The revoking account.
uint64 deadline; // The deadline of the signature/request.
}
/// @title IEAS
/// @notice EAS - Ethereum Attestation Service interface.
interface IEAS is ISemver {
/// @notice Emitted when an attestation has been made.
/// @param recipient The recipient of the attestation.
/// @param attester The attesting account.
/// @param uid The UID of the new attestation.
/// @param schemaUID The UID of the schema.
event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID);
/// @notice Emitted when an attestation has been revoked.
/// @param recipient The recipient of the attestation.
/// @param attester The attesting account.
/// @param schemaUID The UID of the schema.
/// @param uid The UID the revoked attestation.
event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID);
/// @notice Emitted when a data has been timestamped.
/// @param data The data.
/// @param timestamp The timestamp.
event Timestamped(bytes32 indexed data, uint64 indexed timestamp);
/// @notice Emitted when a data has been revoked.
/// @param revoker The address of the revoker.
/// @param data The data.
/// @param timestamp The timestamp.
event RevokedOffchain(address indexed revoker, bytes32 indexed data, uint64 indexed timestamp);
/// @notice Returns the address of the global schema registry.
/// @return The address of the global schema registry.
function getSchemaRegistry() external view returns (ISchemaRegistry);
/// @notice Attests to a specific schema.
/// @param request The arguments of the attestation request.
/// @return The UID of the new attestation.
///
/// Example:
/// attest({
/// schema: "0facc36681cbe2456019c1b0d1e7bedd6d1d40f6f324bf3dd3a4cef2999200a0",
/// data: {
/// recipient: "0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf",
/// expirationTime: 0,
/// revocable: true,
/// refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
/// data: "0xF00D",
/// value: 0
/// }
/// })
function attest(AttestationRequest calldata request) external payable returns (bytes32);
/// @notice Attests to a specific schema via the provided ECDSA signature.
/// @param delegatedRequest The arguments of the delegated attestation request.
/// @return The UID of the new attestation.
///
/// Example:
/// attestByDelegation({
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: {
/// recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
/// expirationTime: 1673891048,
/// revocable: true,
/// refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
/// data: '0x1234',
/// value: 0
/// },
/// signature: {
/// v: 28,
/// r: '0x148c...b25b',
/// s: '0x5a72...be22'
/// },
/// attester: '0xc5E8740aD971409492b1A63Db8d83025e0Fc427e',
/// deadline: 1673891048
/// })
function attestByDelegation(
DelegatedAttestationRequest calldata delegatedRequest
) external payable returns (bytes32);
/// @notice Attests to multiple schemas.
/// @param multiRequests The arguments of the multi attestation requests. The requests should be grouped by distinct
/// schema ids to benefit from the best batching optimization.
/// @return The UIDs of the new attestations.
///
/// Example:
/// multiAttest([{
/// schema: '0x33e9094830a5cba5554d1954310e4fbed2ef5f859ec1404619adea4207f391fd',
/// data: [{
/// recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
/// expirationTime: 1673891048,
/// revocable: true,
/// refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
/// data: '0x1234',
/// value: 1000
/// },
/// {
/// recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
/// expirationTime: 0,
/// revocable: false,
/// refUID: '0x480df4a039efc31b11bfdf491b383ca138b6bde160988222a2a3509c02cee174',
/// data: '0x00',
/// value: 0
/// }],
/// },
/// {
/// schema: '0x5ac273ce41e3c8bfa383efe7c03e54c5f0bff29c9f11ef6ffa930fc84ca32425',
/// data: [{
/// recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
/// expirationTime: 0,
/// revocable: true,
/// refUID: '0x75bf2ed8dca25a8190c50c52db136664de25b2449535839008ccfdab469b214f',
/// data: '0x12345678',
/// value: 0
/// },
/// }])
function multiAttest(MultiAttestationRequest[] calldata multiRequests) external payable returns (bytes32[] memory);
/// @notice Attests to multiple schemas using via provided ECDSA signatures.
/// @param multiDelegatedRequests The arguments of the delegated multi attestation requests. The requests should be
/// grouped by distinct schema ids to benefit from the best batching optimization.
/// @return The UIDs of the new attestations.
///
/// Example:
/// multiAttestByDelegation([{
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: [{
/// recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
/// expirationTime: 1673891048,
/// revocable: true,
/// refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
/// data: '0x1234',
/// value: 0
/// },
/// {
/// recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
/// expirationTime: 0,
/// revocable: false,
/// refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
/// data: '0x00',
/// value: 0
/// }],
/// signatures: [{
/// v: 28,
/// r: '0x148c...b25b',
/// s: '0x5a72...be22'
/// },
/// {
/// v: 28,
/// r: '0x487s...67bb',
/// s: '0x12ad...2366'
/// }],
/// attester: '0x1D86495b2A7B524D747d2839b3C645Bed32e8CF4',
/// deadline: 1673891048
/// }])
function multiAttestByDelegation(
MultiDelegatedAttestationRequest[] calldata multiDelegatedRequests
) external payable returns (bytes32[] memory);
/// @notice Revokes an existing attestation to a specific schema.
/// @param request The arguments of the revocation request.
///
/// Example:
/// revoke({
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: {
/// uid: '0x101032e487642ee04ee17049f99a70590c735b8614079fc9275f9dd57c00966d',
/// value: 0
/// }
/// })
function revoke(RevocationRequest calldata request) external payable;
/// @notice Revokes an existing attestation to a specific schema via the provided ECDSA signature.
/// @param delegatedRequest The arguments of the delegated revocation request.
///
/// Example:
/// revokeByDelegation({
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: {
/// uid: '0xcbbc12102578c642a0f7b34fe7111e41afa25683b6cd7b5a14caf90fa14d24ba',
/// value: 0
/// },
/// signature: {
/// v: 27,
/// r: '0xb593...7142',
/// s: '0x0f5b...2cce'
/// },
/// revoker: '0x244934dd3e31bE2c81f84ECf0b3E6329F5381992',
/// deadline: 1673891048
/// })
function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest) external payable;
/// @notice Revokes existing attestations to multiple schemas.
/// @param multiRequests The arguments of the multi revocation requests. The requests should be grouped by distinct
/// schema ids to benefit from the best batching optimization.
///
/// Example:
/// multiRevoke([{
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: [{
/// uid: '0x211296a1ca0d7f9f2cfebf0daaa575bea9b20e968d81aef4e743d699c6ac4b25',
/// value: 1000
/// },
/// {
/// uid: '0xe160ac1bd3606a287b4d53d5d1d6da5895f65b4b4bab6d93aaf5046e48167ade',
/// value: 0
/// }],
/// },
/// {
/// schema: '0x5ac273ce41e3c8bfa383efe7c03e54c5f0bff29c9f11ef6ffa930fc84ca32425',
/// data: [{
/// uid: '0x053d42abce1fd7c8fcddfae21845ad34dae287b2c326220b03ba241bc5a8f019',
/// value: 0
/// },
/// }])
function multiRevoke(MultiRevocationRequest[] calldata multiRequests) external payable;
/// @notice Revokes existing attestations to multiple schemas via provided ECDSA signatures.
/// @param multiDelegatedRequests The arguments of the delegated multi revocation attestation requests. The requests
/// should be grouped by distinct schema ids to benefit from the best batching optimization.
///
/// Example:
/// multiRevokeByDelegation([{
/// schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
/// data: [{
/// uid: '0x211296a1ca0d7f9f2cfebf0daaa575bea9b20e968d81aef4e743d699c6ac4b25',
/// value: 1000
/// },
/// {
/// uid: '0xe160ac1bd3606a287b4d53d5d1d6da5895f65b4b4bab6d93aaf5046e48167ade',
/// value: 0
/// }],
/// signatures: [{
/// v: 28,
/// r: '0x148c...b25b',
/// s: '0x5a72...be22'
/// },
/// {
/// v: 28,
/// r: '0x487s...67bb',
/// s: '0x12ad...2366'
/// }],
/// revoker: '0x244934dd3e31bE2c81f84ECf0b3E6329F5381992',
/// deadline: 1673891048
/// }])
function multiRevokeByDelegation(
MultiDelegatedRevocationRequest[] calldata multiDelegatedRequests
) external payable;
/// @notice Timestamps the specified bytes32 data.
/// @param data The data to timestamp.
/// @return The timestamp the data was timestamped with.
function timestamp(bytes32 data) external returns (uint64);
/// @notice Timestamps the specified multiple bytes32 data.
/// @param data The data to timestamp.
/// @return The timestamp the data was timestamped with.
function multiTimestamp(bytes32[] calldata data) external returns (uint64);
/// @notice Revokes the specified bytes32 data.
/// @param data The data to timestamp.
/// @return The timestamp the data was revoked with.
function revokeOffchain(bytes32 data) external returns (uint64);
/// @notice Revokes the specified multiple bytes32 data.
/// @param data The data to timestamp.
/// @return The timestamp the data was revoked with.
function multiRevokeOffchain(bytes32[] calldata data) external returns (uint64);
/// @notice Returns an existing attestation by UID.
/// @param uid The UID of the attestation to retrieve.
/// @return The attestation data members.
function getAttestation(bytes32 uid) external view returns (Attestation memory);
/// @notice Checks whether an attestation exists.
/// @param uid The UID of the attestation to retrieve.
/// @return Whether an attestation exists.
function isAttestationValid(bytes32 uid) external view returns (bool);
/// @notice Returns the timestamp that the specified data was timestamped with.
/// @param data The data to query.
/// @return The timestamp the data was timestamped with.
function getTimestamp(bytes32 data) external view returns (uint64);
/// @notice Returns the timestamp that the specified data was timestamped with.
/// @param data The data to query.
/// @return The timestamp the data was timestamped with.
function getRevokeOffchain(address revoker, bytes32 data) external view returns (uint64);
}// 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);
}// 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);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ISemver } from "../ISemver.sol";
import { Attestation } from "../Common.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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the value of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ScrollBadge} from "../ScrollBadge.sol";
import "../lib/Errors.sol";
/// @title ScrollBadgeAccessControl
/// @notice This contract adds access control to ScrollBadge.
/// @dev In EAS, only the original attester can revoke an attestation. If the original
// attester was removed and a new was added in this contract, it will not be able
// to revoke previous attestations.
abstract contract ScrollBadgeAccessControl is Ownable, ScrollBadge {
// Authorized badge issuer and revoker accounts.
mapping(address => bool) public isAttester;
/// @notice Enables or disables a given attester.
/// @param attester The attester address.
/// @param enable True if enable, false if disable.
function toggleAttester(address attester, bool enable) external onlyOwner {
isAttester[attester] = enable;
}
/// @inheritdoc ScrollBadge
function onIssueBadge(Attestation calldata attestation) internal virtual override returns (bool) {
if (!super.onIssueBadge(attestation)) {
return false;
}
// only allow authorized issuers
if (!isAttester[attestation.attester]) {
revert Unauthorized();
}
return true;
}
/// @inheritdoc ScrollBadge
function onRevokeBadge(Attestation calldata attestation) internal virtual override returns (bool) {
if (!super.onRevokeBadge(attestation)) {
return false;
}
// only allow authorized revokers
if (!isAttester[attestation.attester]) {
revert Unauthorized();
}
return true;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {ScrollBadge} from "../ScrollBadge.sol";
/// @title ScrollBadgeDefaultURI
/// @notice This contract sets a default badge URI.
abstract contract ScrollBadgeDefaultURI is ScrollBadge {
string public defaultBadgeURI;
constructor(string memory _defaultBadgeURI) {
defaultBadgeURI = _defaultBadgeURI;
}
/// @inheritdoc ScrollBadge
function badgeTokenURI(bytes32 uid) public view override returns (string memory) {
return getBadgeTokenURI(uid);
}
/// @notice Returns the token URI corresponding to a certain badge UID.
/// @param uid The badge UID.
/// @return The badge token URI (same format as ERC721).
function getBadgeTokenURI(bytes32 uid) internal view virtual returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <=0.8.26;
import "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import {ScrollBadge} from "../ScrollBadge.sol";
import "../lib/Errors.sol";
/// @title ScrollBadgeSingleton
/// @notice This contract only allows one active badge per wallet.
abstract contract ScrollBadgeSingleton is ScrollBadge {
/// @inheritdoc ScrollBadge
function onIssueBadge(Attestation calldata attestation) internal virtual override returns (bool) {
if (!super.onIssueBadge(attestation)) {
return false;
}
if (hasBadge(attestation.recipient)) {
revert SingletonBadge();
}
return true;
}
/// @inheritdoc ScrollBadge
function onRevokeBadge(Attestation calldata attestation) internal virtual override returns (bool) {
return super.onRevokeBadge(attestation);
}
}// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.20;
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
/**
* @title IRubyscore_Achievement
* @dev IRubyscore_Achievement is an interface for Rubyscore_Achievement contract
*/
interface IRubyscore_Achievement is IERC1155 {
struct MintParams {
address userAddress; // Address of the buyer.
uint256 userNonce; // Nonce associated with the user's address for preventing replay attacks.
uint256[] nftIds; // ids of NFTs to mint
}
/**
* @notice Emitted when the base URI for token metadata is updated.
* @param newBaseURI The new base URI that will be used to construct token metadata URIs.
* @dev This event is triggered when the contract operator updates the base URI
* for retrieving metadata associated with tokens. The 'newBaseURI' parameter represents
* the updated base URI.
*/
event BaseURISet(string indexed newBaseURI);
/**
* @notice Emitted when NFTs are minted for a user.
* @param userAddress The address of the user receiving the NFTs.
* @param userNonce The user's nonce used to prevent replay attacks.
* @param nftIds An array of NFT IDs that were minted.
* @dev This event is emitted when new NFTs are created and assigned to a user.
* @dev It includes the user's address, nonce, and the IDs of the minted NFTs for transparency.
*/
event Minted(address indexed userAddress, uint256 indexed userNonce, uint256[] nftIds);
/**
* @notice Emitted when the URI for a specific token is updated.
* @param tokenId The ID of the token for which the URI is updated.
* @param newTokenURI The new URI assigned to the token.
* @dev This event is emitted when the URI for a token is modified, providing transparency
* when metadata URIs are changed for specific tokens.
*/
event TokenURISet(uint256 indexed tokenId, string indexed newTokenURI);
/**
* @notice Emitted when the transfer lock status for a token is updated.
* @param tokenId The ID of the token for which the transfer lock status changes.
* @param lock The new transfer lock status (true for locked, false for unlocked).
* @dev This event is emitted when the transfer lock status of a specific token is modified.
* @dev It provides transparency regarding whether a token can be transferred or not.
*/
event TokenUnlockSet(uint256 indexed tokenId, bool indexed lock);
/**
* @notice Emitted when the price for a token mint is updated.
* @param newPrice The new price for mint.
* @dev This event is emitted when the price for mint a token is modified.
*/
event PriceUpdated(uint256 newPrice);
/**
* @notice Get token name.
* @return Token name.
*/
function name() external view returns (string memory);
/**
* @notice Get token symbol.
* @return Token symbol.
*/
function symbol() external view returns (string memory);
/**
* @notice Get the URI of a token.
* @param tokenId The ID of the token.
* @return The URI of the token.
*/
function uri(uint256 tokenId) external view returns (string memory);
/**
* @notice Get the transfer status of a token.
* @param tokenId The ID of the token.
* @return Whether the token's transfer is unlocked (true) or restricted (false).
*/
function getTransferStatus(uint256 tokenId) external view returns (bool);
/**
* @notice Get the user's nonce associated with their address.
* @param userAddress The address of the user.
* @return The user's nonce.
*/
function getUserNonce(address userAddress) external view returns (uint256);
/**
* @notice Get the token URI for a given tokenId.
* @param tokenId The ID of the token.
* @return The URI of the token.
* @dev Diblicate for uri() method
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
/**
* @notice Set the URI for a token.
* @param tokenId The ID of the token.
* @param newTokenURI The new URI to set for the token.
* @dev Requires the MINTER_ROLE.
*/
function setTokenURI(uint256 tokenId, string memory newTokenURI) external;
/**
* @notice Set the URIs for multiple tokens in a batch.
* @param tokenIds An array of token IDs to set URIs for.
* @param newTokenURIs An array of new URIs to set for the tokens.
* @dev Requires the MINTER_ROLE.
* @dev Requires that the tokenIds and newTokenURIs arrays have the same length.
*/
function setBatchTokenURI(uint256[] calldata tokenIds, string[] calldata newTokenURIs) external;
/**
* @notice Set the base URI for all tokens.
* @param newBaseURI The new base URI to set.
* @dev Requires the OPERATOR_ROLE.
*/
function setBaseURI(string memory newBaseURI) external;
/**
* @notice Safely mints NFTs for a user based on provided parameters and a valid minter signature.
* @param mintParams The struct containing user address, user nonce, and NFT IDs to mint.
* @param operatorSignature The ECDSA signature of the data, validating the operator's role.
* @dev This function safely mints NFTs for a user while ensuring the validity of the operator's signature.
* @dev It requires that the provided NFT IDs are valid and that the operator has the MINTER_ROLE.
* @dev User nonces are used to prevent replay attacks.
* @dev Multiple NFTs can be minted in a batch or a single NFT can be minted based on the number of NFT IDs provided.
* @dev Emits the 'Minted' event to indicate the successful minting of NFTs.
*/
function safeMint(MintParams memory mintParams, bytes calldata operatorSignature) external payable;
event Withdrawed(uint256 amount);
/**
* @notice Sets the transfer lock status for a specific token ID.
* @param tokenId The ID of the token to set the transfer lock status for.
* @param lock The boolean value to determine whether transfers of this token are locked or unlocked.
* @dev This function can only be called by an operator with the OPERATOR_ROLE.
* @dev It allows operators to control the transferability of specific tokens.
* @dev Emits the 'tokenUnlockSet' event to indicate the change in transfer lock status.
*/
function setTransferUnlock(uint256 tokenId, bool lock) external;
/**
* @notice Check if a given interface is supported by this contract.
* @param interfaceId The interface identifier to check for support.
* @return Whether the contract supports the specified interface.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
function withdraw() external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import "@ethereum-attestation-service/eas-contracts/contracts/Common.sol";
interface IScrollBadge {
event IssueBadge(bytes32 indexed uid);
event RevokeBadge(bytes32 indexed uid);
/// @notice A resolver callback invoked in the `issueBadge` function in the parent contract.
/// @param attestation The new attestation.
/// @return Whether the attestation is valid.
function issueBadge(Attestation calldata attestation) external returns (bool);
/// @notice A resolver callback invoked in the `revokeBadge` function in the parent contract.
/// @param attestation The new attestation.
/// @return Whether the attestation can be revoked.
function revokeBadge(Attestation calldata attestation) external returns (bool);
/// @notice Validate and return a Scroll badge attestation.
/// @param uid The attestation UID.
/// @return The attestation.
function getAndValidateBadge(bytes32 uid) external view returns (Attestation memory);
/// @notice Returns the token URI corresponding to a certain badge UID, or the default
/// badge token URI if the pass UID is 0x0.
/// @param uid The badge UID, or 0x0.
/// @return The badge token URI (same format as ERC721).
function badgeTokenURI(bytes32 uid) external view returns (string memory);
/// @notice Returns true if the user has one or more of this badge.
/// @param user The user's wallet address.
/// @return True if the user has one or more of this badge.
function hasBadge(address user) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import "@ethereum-attestation-service/eas-contracts/contracts/Common.sol";
interface IScrollBadgeResolver {
/**
*
* Events *
*
*/
/// @dev Emitted when a new badge is issued.
/// @param uid The UID of the new badge attestation.
event IssueBadge(bytes32 indexed uid);
/// @dev Emitted when a badge is revoked.
/// @param uid The UID of the revoked badge attestation.
event RevokeBadge(bytes32 indexed uid);
/// @dev Emitted when the auto-attach status of a badge is updated.
/// @param badge The address of the badge contract.
/// @param enable Auto-attach was enabled if true, disabled if false.
event UpdateAutoAttachWhitelist(address indexed badge, bool indexed enable);
/**
*
* Public View Functions *
*
*/
/// @notice Return the Scroll badge attestation schema.
/// @return The GUID of the Scroll badge attestation schema.
function schema() external returns (bytes32);
/// @notice The profile registry contract.
/// @return The address of the profile registry.
function registry() external returns (address);
/// @notice The global EAS contract.
/// @return The address of the global EAS contract.
function eas() external returns (address);
/// @notice Validate and return a Scroll badge attestation.
/// @param uid The attestation UID.
/// @return The attestation.
function getAndValidateBadge(bytes32 uid) external view returns (Attestation memory);
}// SPDX-License-Identifier: MIT pragma solidity 0.8.20; error Unauthorized(); error CannotUpgrade(bytes32 uid); // attestation errors // note: these don't include the uid since it is not known prior to the attestation. error BadgeNotAllowed(address badge); error BadgeNotFound(address badge); error ExpirationDisabled(); error MissingPayload(); error ResolverPaymentsDisabled(); error RevocationDisabled(); error SingletonBadge(); error UnknownSchema(); // query errors error AttestationBadgeMismatch(bytes32 uid); error AttestationExpired(bytes32 uid); error AttestationNotFound(bytes32 uid); error AttestationOwnerMismatch(bytes32 uid); error AttestationRevoked(bytes32 uid); error AttestationSchemaMismatch(bytes32 uid); // profile errors error BadgeCountReached(); error LengthMismatch(); error TokenNotOwnedByUser(address token, uint256 tokenId); // profile registry errors error CallerIsNotUserProfile(); error DuplicatedUsername(); error ExpiredSignature(); error ImplementationNotContract(); error InvalidReferrer(); error InvalidSignature(); error InvalidUsername(); error MsgValueMismatchWithMintFee(); error ProfileAlreadyMinted();
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {IScrollBadge} from "./interfaces/IScrollBadge.sol";
import {IScrollBadgeResolver} from "./interfaces/IScrollBadgeResolver.sol";
import "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import "./lib/Errors.sol";
/// @title ScrollBadge
/// @notice This contract implements the basic functionalities of a Scroll badge.
/// It serves as the base contract for more complex badge functionalities.
abstract contract ScrollBadge is IScrollBadge {
// The global Scroll badge resolver contract.
address public immutable resolver;
// wallet address => badge count
mapping(address => uint256) private _userBadgeCount;
/// @dev Creates a new ScrollBadge instance.
/// @param resolver_ The address of the global Scroll badge resolver contract.
constructor(address resolver_) {
resolver = resolver_;
}
function decodeBadgeData(bytes memory data) internal pure returns (address, bytes memory) {
return abi.decode(data, (address, bytes));
}
/// @inheritdoc IScrollBadge
function issueBadge(Attestation calldata attestation) public returns (bool) {
// only callable from resolver
if (msg.sender != address(resolver)) {
revert Unauthorized();
}
// delegate logic to subcontract
if (!onIssueBadge(attestation)) {
return false;
}
_userBadgeCount[attestation.recipient] += 1;
emit IssueBadge(attestation.uid);
return true;
}
/// @inheritdoc IScrollBadge
function revokeBadge(Attestation calldata attestation) public returns (bool) {
// only callable from resolver
if (msg.sender != address(resolver)) {
revert Unauthorized();
}
// delegate logic to subcontract
if (!onRevokeBadge(attestation)) {
return false;
}
_userBadgeCount[attestation.recipient] -= 1;
emit RevokeBadge(attestation.uid);
return true;
}
/// @notice A resolver callback that should be implemented by child contracts.
/// @param {attestation} The new attestation.
/// @return Whether the attestation is valid.
function onIssueBadge(Attestation calldata /*attestation*/ ) internal virtual returns (bool) {
return true;
}
/// @notice A resolver callback that should be implemented by child contracts.
/// @param {attestation} The existing attestation to be revoked.
/// @return Whether the attestation can be revoked.
function onRevokeBadge(Attestation calldata /*attestation*/ ) internal virtual returns (bool) {
return true;
}
/// @inheritdoc IScrollBadge
function getAndValidateBadge(bytes32 uid) public view returns (Attestation memory) {
Attestation memory attestation = IScrollBadgeResolver(resolver).getAndValidateBadge(uid);
(address badge,) = decodeBadgeData(attestation.data);
if (badge != address(this)) {
revert AttestationBadgeMismatch(uid);
}
return attestation;
}
/// @inheritdoc IScrollBadge
function badgeTokenURI(bytes32 uid) public view virtual returns (string memory);
/// @inheritdoc IScrollBadge
function hasBadge(address user) public view virtual returns (bool) {
return _userBadgeCount[user] > 0;
}
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"resolver_","type":"address"},{"internalType":"address","name":"achievement_","type":"address"},{"internalType":"string","name":"defaultUri_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"uid","type":"bytes32"}],"name":"AttestationBadgeMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"SingletonBadge","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"uid","type":"bytes32"}],"name":"IssueBadge","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":"bytes32","name":"uid","type":"bytes32"}],"name":"RevokeBadge","type":"event"},{"inputs":[],"name":"RubyscoreAchievement","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"uid","type":"bytes32"}],"name":"badgeTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultBadgeURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"uid","type":"bytes32"}],"name":"getAndValidateBadge","outputs":[{"components":[{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"bytes32","name":"schema","type":"bytes32"},{"internalType":"uint64","name":"time","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint64","name":"revocationTime","type":"uint64"},{"internalType":"bytes32","name":"refUID","type":"bytes32"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"attester","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Attestation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"hasBadge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAttester","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"bytes32","name":"schema","type":"bytes32"},{"internalType":"uint64","name":"time","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint64","name":"revocationTime","type":"uint64"},{"internalType":"bytes32","name":"refUID","type":"bytes32"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"attester","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Attestation","name":"attestation","type":"tuple"}],"name":"issueBadge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resolver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"bytes32","name":"schema","type":"bytes32"},{"internalType":"uint64","name":"time","type":"uint64"},{"internalType":"uint64","name":"expirationTime","type":"uint64"},{"internalType":"uint64","name":"revocationTime","type":"uint64"},{"internalType":"bytes32","name":"refUID","type":"bytes32"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"attester","type":"address"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Attestation","name":"attestation","type":"tuple"}],"name":"revokeBadge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"defaultURI","type":"string"}],"name":"setDefaultBadgeURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"attester","type":"address"},{"internalType":"bool","name":"enable","type":"bool"}],"name":"toggleAttester","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b50604051620027e4380380620027e483398181016040528101906200003791906200040f565b808333600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000af5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000a691906200049b565b60405180910390fd5b620000c0816200015360201b60201c565b508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505050806003908162000107919062000703565b505081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050620007ea565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000258826200022b565b9050919050565b6200026a816200024b565b81146200027657600080fd5b50565b6000815190506200028a816200025f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620002e5826200029a565b810181811067ffffffffffffffff82111715620003075762000306620002ab565b5b80604052505050565b60006200031c62000217565b90506200032a8282620002da565b919050565b600067ffffffffffffffff8211156200034d576200034c620002ab565b5b62000358826200029a565b9050602081019050919050565b60005b838110156200038557808201518184015260208101905062000368565b60008484015250505050565b6000620003a8620003a2846200032f565b62000310565b905082815260208101848484011115620003c757620003c662000295565b5b620003d484828562000365565b509392505050565b600082601f830112620003f457620003f362000290565b5b81516200040684826020860162000391565b91505092915050565b6000806000606084860312156200042b576200042a62000221565b5b60006200043b8682870162000279565b93505060206200044e8682870162000279565b925050604084015167ffffffffffffffff81111562000472576200047162000226565b5b6200048086828701620003dc565b9150509250925092565b62000495816200024b565b82525050565b6000602082019050620004b260008301846200048a565b92915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200050b57607f821691505b602082108103620005215762000520620004c3565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200058b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200054c565b6200059786836200054c565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620005e4620005de620005d884620005af565b620005b9565b620005af565b9050919050565b6000819050919050565b6200060083620005c3565b620006186200060f82620005eb565b84845462000559565b825550505050565b600090565b6200062f62000620565b6200063c818484620005f5565b505050565b5b8181101562000664576200065860008262000625565b60018101905062000642565b5050565b601f821115620006b3576200067d8162000527565b62000688846200053c565b8101602085101562000698578190505b620006b0620006a7856200053c565b83018262000641565b50505b505050565b600082821c905092915050565b6000620006d860001984600802620006b8565b1980831691505092915050565b6000620006f38383620006c5565b9150826002028217905092915050565b6200070e82620004b8565b67ffffffffffffffff8111156200072a5762000729620002ab565b5b620007368254620004f2565b6200074382828562000668565b600060209050601f8311600181146200077b576000841562000766578287015190505b620007728582620006e5565b865550620007e2565b601f1984166200078b8662000527565b60005b82811015620007b5578489015182556001820191506020850194506020810190506200078e565b86831015620007d55784890151620007d1601f891682620006c5565b8355505b6001600288020188555050505b505050505050565b608051611fc96200081b600039600081816102e7015281816103e10152818161052901526107710152611fc96000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063b1a3a35f11610066578063b1a3a35f1461024b578063b6ebe53914610269578063d753a63d14610299578063f2fde38b146102c9576100ea565b80638da5cb5b146101f3578063a8a54e0f14610211578063abe7f0951461022f576100ea565b80635e50864f116100c85780635e50864f14610159578063715018a6146101895780638298b030146101935780638c6f12f0146101c3576100ea565b806304f3bcec146100ef5780630ee489481461010d5780632483056314610129575b600080fd5b6100f76102e5565b60405161010491906110c7565b60405180910390f35b6101276004803603810190610122919061115a565b610309565b005b610143600480360381019061013e91906111d0565b61036c565b604051610150919061128d565b60405180910390f35b610173600480360381019061016e91906112af565b61037e565b60405161018091906112eb565b60405180910390f35b6101916103c9565b005b6101ad60048036038101906101a8919061132b565b6103dd565b6040516101ba91906112eb565b60405180910390f35b6101dd60048036038101906101d891906111d0565b61051d565b6040516101ea91906114f3565b60405180910390f35b6101fb610655565b60405161020891906110c7565b60405180910390f35b61021961067e565b60405161022691906110c7565b60405180910390f35b6102496004803603810190610244919061164a565b6106a4565b005b6102536106bf565b604051610260919061128d565b60405180910390f35b610283600480360381019061027e91906112af565b61074d565b60405161029091906112eb565b60405180910390f35b6102b360048036038101906102ae919061132b565b61076d565b6040516102c091906112eb565b60405180910390f35b6102e360048036038101906102de91906112af565b6108ad565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b610311610933565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6060610377826109ba565b9050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b6103d1610933565b6103db60006109ee565b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610464576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61046d82610ab2565b61047a5760009050610518565b60018060008460c001602081019061049291906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546104db91906116cc565b9250508190555081600001357f504e4727721de18c6bf7f66448a6ff6da00aa4b1f00b6034e71723ae7ce6373a60405160405180910390a2600190505b919050565b610525610fde565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16638c6f12f0846040518263ffffffff1660e01b8152600401610580919061170f565b600060405180830381865afa15801561059d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105c69190611952565b905060006105d8826101200151610ac4565b5090503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461064b57836040517fb923d261000000000000000000000000000000000000000000000000000000008152600401610642919061170f565b60405180910390fd5b8192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106ac610933565b80600390816106bb9190611ba7565b5050565b600380546106cc906119ca565b80601f01602080910402602001604051908101604052809291908181526020018280546106f8906119ca565b80156107455780601f1061071a57610100808354040283529160200191610745565b820191906000526020600020905b81548152906001019060200180831161072857829003601f168201915b505050505081565b60026020528060005260406000206000915054906101000a900460ff1681565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107fd82610ae5565b61080a57600090506108a8565b60018060008460c001602081019061082291906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461086b9190611c79565b9250508190555081600001357fa0785ec0b9bf31a5475d33c716fb9f500f0ea0bb9e4bc10ec39d5db763c1da1560405160405180910390a2600190505b919050565b6108b5610933565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109275760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161091e91906110c7565b60405180910390fd5b610930816109ee565b50565b61093b610bee565b73ffffffffffffffffffffffffffffffffffffffff16610959610655565b73ffffffffffffffffffffffffffffffffffffffff16146109b85761097c610bee565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016109af91906110c7565b60405180910390fd5b565b606060036109c783610bf6565b6040516020016109d8929190611db8565b6040516020818303038152906040529050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000610abd82610dd4565b9050919050565b6000606082806020019051810190610adc9190611e25565b91509150915091565b6000610af082610de6565b610afd5760009050610be9565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636834e3a88460c0016020810190610b5091906112af565b6040518263ffffffff1660e01b8152600401610b6c91906110c7565b602060405180830381865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190611ead565b03610be4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b600033905090565b606060006040518060400160405280601081526020017f303132333435363738396162636465660000000000000000000000000000000081525090506000604067ffffffffffffffff811115610c4f57610c4e61151f565b5b6040519080825280601f01601f191660200182016040528015610c815781602001600182028036833780820191505090505b50905060005b6020811015610dc957826004868360208110610ca657610ca5611eda565b5b1a60f81b60f81c60ff16901c60ff1681518110610cc657610cc5611eda565b5b602001015160f81c60f81b82600283610cdf9190611f09565b81518110610cf057610cef611eda565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082600f868360208110610d3557610d34611eda565b5b1a60f81b60f81c1660ff1681518110610d5157610d50611eda565b5b602001015160f81c60f81b826001600284610d6c9190611f09565b610d769190611c79565b81518110610d8757610d86611eda565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610dc190611f4b565b915050610c87565b508092505050919050565b6000610ddf82610e5a565b9050919050565b6000610df182610f11565b610dfe5760009050610e55565b610e198260c0016020810190610e1491906112af565b61037e565b15610e50576040517f18b2623200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b6000610e6582610fc8565b610e725760009050610f0c565b600260008360e0016020810190610e8991906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f07576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b6000610f1c82610fd3565b610f295760009050610fc3565b600260008360e0016020810190610f4091906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610fbe576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b600060019050919050565b600060019050919050565b6040518061014001604052806000801916815260200160008019168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff16815260200160008019168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001606081525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110b182611086565b9050919050565b6110c1816110a6565b82525050565b60006020820190506110dc60008301846110b8565b92915050565b6000604051905090565b600080fd5b600080fd5b6110ff816110a6565b811461110a57600080fd5b50565b60008135905061111c816110f6565b92915050565b60008115159050919050565b61113781611122565b811461114257600080fd5b50565b6000813590506111548161112e565b92915050565b60008060408385031215611171576111706110ec565b5b600061117f8582860161110d565b925050602061119085828601611145565b9150509250929050565b6000819050919050565b6111ad8161119a565b81146111b857600080fd5b50565b6000813590506111ca816111a4565b92915050565b6000602082840312156111e6576111e56110ec565b5b60006111f4848285016111bb565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561123757808201518184015260208101905061121c565b60008484015250505050565b6000601f19601f8301169050919050565b600061125f826111fd565b6112698185611208565b9350611279818560208601611219565b61128281611243565b840191505092915050565b600060208201905081810360008301526112a78184611254565b905092915050565b6000602082840312156112c5576112c46110ec565b5b60006112d38482850161110d565b91505092915050565b6112e581611122565b82525050565b600060208201905061130060008301846112dc565b92915050565b600080fd5b6000610140828403121561132257611321611306565b5b81905092915050565b600060208284031215611341576113406110ec565b5b600082013567ffffffffffffffff81111561135f5761135e6110f1565b5b61136b8482850161130b565b91505092915050565b61137d8161119a565b82525050565b600067ffffffffffffffff82169050919050565b6113a081611383565b82525050565b6113af816110a6565b82525050565b6113be81611122565b82525050565b600081519050919050565b600082825260208201905092915050565b60006113eb826113c4565b6113f581856113cf565b9350611405818560208601611219565b61140e81611243565b840191505092915050565b6000610140830160008301516114326000860182611374565b5060208301516114456020860182611374565b5060408301516114586040860182611397565b50606083015161146b6060860182611397565b50608083015161147e6080860182611397565b5060a083015161149160a0860182611374565b5060c08301516114a460c08601826113a6565b5060e08301516114b760e08601826113a6565b506101008301516114cc6101008601826113b5565b506101208301518482036101208601526114e682826113e0565b9150508091505092915050565b6000602082019050818103600083015261150d8184611419565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61155782611243565b810181811067ffffffffffffffff821117156115765761157561151f565b5b80604052505050565b60006115896110e2565b9050611595828261154e565b919050565b600067ffffffffffffffff8211156115b5576115b461151f565b5b6115be82611243565b9050602081019050919050565b82818337600083830152505050565b60006115ed6115e88461159a565b61157f565b9050828152602081018484840111156116095761160861151a565b5b6116148482856115cb565b509392505050565b600082601f83011261163157611630611515565b5b81356116418482602086016115da565b91505092915050565b6000602082840312156116605761165f6110ec565b5b600082013567ffffffffffffffff81111561167e5761167d6110f1565b5b61168a8482850161161c565b91505092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116d782611693565b91506116e283611693565b92508282039050818111156116fa576116f961169d565b5b92915050565b6117098161119a565b82525050565b60006020820190506117246000830184611700565b92915050565b600080fd5b600080fd5b600081519050611743816111a4565b92915050565b61175281611383565b811461175d57600080fd5b50565b60008151905061176f81611749565b92915050565b600081519050611784816110f6565b92915050565b6000815190506117998161112e565b92915050565b600067ffffffffffffffff8211156117ba576117b961151f565b5b6117c382611243565b9050602081019050919050565b60006117e36117de8461179f565b61157f565b9050828152602081018484840111156117ff576117fe61151a565b5b61180a848285611219565b509392505050565b600082601f83011261182757611826611515565b5b81516118378482602086016117d0565b91505092915050565b600061014082840312156118575761185661172a565b5b61186261014061157f565b9050600061187284828501611734565b600083015250602061188684828501611734565b602083015250604061189a84828501611760565b60408301525060606118ae84828501611760565b60608301525060806118c284828501611760565b60808301525060a06118d684828501611734565b60a08301525060c06118ea84828501611775565b60c08301525060e06118fe84828501611775565b60e0830152506101006119138482850161178a565b6101008301525061012082015167ffffffffffffffff8111156119395761193861172f565b5b61194584828501611812565b6101208301525092915050565b600060208284031215611968576119676110ec565b5b600082015167ffffffffffffffff811115611986576119856110f1565b5b61199284828501611840565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806119e257607f821691505b6020821081036119f5576119f461199b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302611a5d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611a20565b611a678683611a20565b95508019841693508086168417925050509392505050565b6000819050919050565b6000611aa4611a9f611a9a84611693565b611a7f565b611693565b9050919050565b6000819050919050565b611abe83611a89565b611ad2611aca82611aab565b848454611a2d565b825550505050565b600090565b611ae7611ada565b611af2818484611ab5565b505050565b5b81811015611b1657611b0b600082611adf565b600181019050611af8565b5050565b601f821115611b5b57611b2c816119fb565b611b3584611a10565b81016020851015611b44578190505b611b58611b5085611a10565b830182611af7565b50505b505050565b600082821c905092915050565b6000611b7e60001984600802611b60565b1980831691505092915050565b6000611b978383611b6d565b9150826002028217905092915050565b611bb0826111fd565b67ffffffffffffffff811115611bc957611bc861151f565b5b611bd382546119ca565b611bde828285611b1a565b600060209050601f831160018114611c115760008415611bff578287015190505b611c098582611b8b565b865550611c71565b601f198416611c1f866119fb565b60005b82811015611c4757848901518255600182019150602085019450602081019050611c22565b86831015611c645784890151611c60601f891682611b6d565b8355505b6001600288020188555050505b505050505050565b6000611c8482611693565b9150611c8f83611693565b9250828201905080821115611ca757611ca661169d565b5b92915050565b600081905092915050565b60008154611cc5816119ca565b611ccf8186611cad565b94506001821660008114611cea5760018114611cff57611d32565b60ff1983168652811515820286019350611d32565b611d08856119fb565b60005b83811015611d2a57815481890152600182019150602081019050611d0b565b838801955050505b50505092915050565b7f3078000000000000000000000000000000000000000000000000000000000000600082015250565b6000611d71600283611cad565b9150611d7c82611d3b565b600282019050919050565b6000611d92826111fd565b611d9c8185611cad565b9350611dac818560208601611219565b80840191505092915050565b6000611dc48285611cb8565b9150611dcf82611d64565b9150611ddb8284611d87565b91508190509392505050565b6000611df282611086565b9050919050565b611e0281611de7565b8114611e0d57600080fd5b50565b600081519050611e1f81611df9565b92915050565b60008060408385031215611e3c57611e3b6110ec565b5b6000611e4a85828601611e10565b925050602083015167ffffffffffffffff811115611e6b57611e6a6110f1565b5b611e7785828601611812565b9150509250929050565b611e8a81611693565b8114611e9557600080fd5b50565b600081519050611ea781611e81565b92915050565b600060208284031215611ec357611ec26110ec565b5b6000611ed184828501611e98565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611f1482611693565b9150611f1f83611693565b9250828202611f2d81611693565b91508282048414831517611f4457611f4361169d565b5b5092915050565b6000611f5682611693565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f8857611f8761169d565b5b60018201905091905056fea26469706673582212205517301113be93b296807966f8f2ac5958a9a6442475fe407f7c547d48b7820164736f6c634300081400330000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec0113000000000000000000000000dc3d8318fbaec2de49281843f5bba22e783381460000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f7275627973636f72652e696f2f6170692f7363726f6c6c2d62616467652f62616467652f0000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063b1a3a35f11610066578063b1a3a35f1461024b578063b6ebe53914610269578063d753a63d14610299578063f2fde38b146102c9576100ea565b80638da5cb5b146101f3578063a8a54e0f14610211578063abe7f0951461022f576100ea565b80635e50864f116100c85780635e50864f14610159578063715018a6146101895780638298b030146101935780638c6f12f0146101c3576100ea565b806304f3bcec146100ef5780630ee489481461010d5780632483056314610129575b600080fd5b6100f76102e5565b60405161010491906110c7565b60405180910390f35b6101276004803603810190610122919061115a565b610309565b005b610143600480360381019061013e91906111d0565b61036c565b604051610150919061128d565b60405180910390f35b610173600480360381019061016e91906112af565b61037e565b60405161018091906112eb565b60405180910390f35b6101916103c9565b005b6101ad60048036038101906101a8919061132b565b6103dd565b6040516101ba91906112eb565b60405180910390f35b6101dd60048036038101906101d891906111d0565b61051d565b6040516101ea91906114f3565b60405180910390f35b6101fb610655565b60405161020891906110c7565b60405180910390f35b61021961067e565b60405161022691906110c7565b60405180910390f35b6102496004803603810190610244919061164a565b6106a4565b005b6102536106bf565b604051610260919061128d565b60405180910390f35b610283600480360381019061027e91906112af565b61074d565b60405161029091906112eb565b60405180910390f35b6102b360048036038101906102ae919061132b565b61076d565b6040516102c091906112eb565b60405180910390f35b6102e360048036038101906102de91906112af565b6108ad565b005b7f0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec011381565b610311610933565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6060610377826109ba565b9050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b6103d1610933565b6103db60006109ee565b565b60007f0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec011373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610464576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61046d82610ab2565b61047a5760009050610518565b60018060008460c001602081019061049291906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546104db91906116cc565b9250508190555081600001357f504e4727721de18c6bf7f66448a6ff6da00aa4b1f00b6034e71723ae7ce6373a60405160405180910390a2600190505b919050565b610525610fde565b60007f0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec011373ffffffffffffffffffffffffffffffffffffffff16638c6f12f0846040518263ffffffff1660e01b8152600401610580919061170f565b600060405180830381865afa15801561059d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105c69190611952565b905060006105d8826101200151610ac4565b5090503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461064b57836040517fb923d261000000000000000000000000000000000000000000000000000000008152600401610642919061170f565b60405180910390fd5b8192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106ac610933565b80600390816106bb9190611ba7565b5050565b600380546106cc906119ca565b80601f01602080910402602001604051908101604052809291908181526020018280546106f8906119ca565b80156107455780601f1061071a57610100808354040283529160200191610745565b820191906000526020600020905b81548152906001019060200180831161072857829003601f168201915b505050505081565b60026020528060005260406000206000915054906101000a900460ff1681565b60007f0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec011373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107fd82610ae5565b61080a57600090506108a8565b60018060008460c001602081019061082291906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461086b9190611c79565b9250508190555081600001357fa0785ec0b9bf31a5475d33c716fb9f500f0ea0bb9e4bc10ec39d5db763c1da1560405160405180910390a2600190505b919050565b6108b5610933565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109275760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161091e91906110c7565b60405180910390fd5b610930816109ee565b50565b61093b610bee565b73ffffffffffffffffffffffffffffffffffffffff16610959610655565b73ffffffffffffffffffffffffffffffffffffffff16146109b85761097c610bee565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016109af91906110c7565b60405180910390fd5b565b606060036109c783610bf6565b6040516020016109d8929190611db8565b6040516020818303038152906040529050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000610abd82610dd4565b9050919050565b6000606082806020019051810190610adc9190611e25565b91509150915091565b6000610af082610de6565b610afd5760009050610be9565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636834e3a88460c0016020810190610b5091906112af565b6040518263ffffffff1660e01b8152600401610b6c91906110c7565b602060405180830381865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190611ead565b03610be4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b600033905090565b606060006040518060400160405280601081526020017f303132333435363738396162636465660000000000000000000000000000000081525090506000604067ffffffffffffffff811115610c4f57610c4e61151f565b5b6040519080825280601f01601f191660200182016040528015610c815781602001600182028036833780820191505090505b50905060005b6020811015610dc957826004868360208110610ca657610ca5611eda565b5b1a60f81b60f81c60ff16901c60ff1681518110610cc657610cc5611eda565b5b602001015160f81c60f81b82600283610cdf9190611f09565b81518110610cf057610cef611eda565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082600f868360208110610d3557610d34611eda565b5b1a60f81b60f81c1660ff1681518110610d5157610d50611eda565b5b602001015160f81c60f81b826001600284610d6c9190611f09565b610d769190611c79565b81518110610d8757610d86611eda565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610dc190611f4b565b915050610c87565b508092505050919050565b6000610ddf82610e5a565b9050919050565b6000610df182610f11565b610dfe5760009050610e55565b610e198260c0016020810190610e1491906112af565b61037e565b15610e50576040517f18b2623200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b6000610e6582610fc8565b610e725760009050610f0c565b600260008360e0016020810190610e8991906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f07576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b6000610f1c82610fd3565b610f295760009050610fc3565b600260008360e0016020810190610f4091906112af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610fbe576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600190505b919050565b600060019050919050565b600060019050919050565b6040518061014001604052806000801916815260200160008019168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff16815260200160008019168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001606081525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110b182611086565b9050919050565b6110c1816110a6565b82525050565b60006020820190506110dc60008301846110b8565b92915050565b6000604051905090565b600080fd5b600080fd5b6110ff816110a6565b811461110a57600080fd5b50565b60008135905061111c816110f6565b92915050565b60008115159050919050565b61113781611122565b811461114257600080fd5b50565b6000813590506111548161112e565b92915050565b60008060408385031215611171576111706110ec565b5b600061117f8582860161110d565b925050602061119085828601611145565b9150509250929050565b6000819050919050565b6111ad8161119a565b81146111b857600080fd5b50565b6000813590506111ca816111a4565b92915050565b6000602082840312156111e6576111e56110ec565b5b60006111f4848285016111bb565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561123757808201518184015260208101905061121c565b60008484015250505050565b6000601f19601f8301169050919050565b600061125f826111fd565b6112698185611208565b9350611279818560208601611219565b61128281611243565b840191505092915050565b600060208201905081810360008301526112a78184611254565b905092915050565b6000602082840312156112c5576112c46110ec565b5b60006112d38482850161110d565b91505092915050565b6112e581611122565b82525050565b600060208201905061130060008301846112dc565b92915050565b600080fd5b6000610140828403121561132257611321611306565b5b81905092915050565b600060208284031215611341576113406110ec565b5b600082013567ffffffffffffffff81111561135f5761135e6110f1565b5b61136b8482850161130b565b91505092915050565b61137d8161119a565b82525050565b600067ffffffffffffffff82169050919050565b6113a081611383565b82525050565b6113af816110a6565b82525050565b6113be81611122565b82525050565b600081519050919050565b600082825260208201905092915050565b60006113eb826113c4565b6113f581856113cf565b9350611405818560208601611219565b61140e81611243565b840191505092915050565b6000610140830160008301516114326000860182611374565b5060208301516114456020860182611374565b5060408301516114586040860182611397565b50606083015161146b6060860182611397565b50608083015161147e6080860182611397565b5060a083015161149160a0860182611374565b5060c08301516114a460c08601826113a6565b5060e08301516114b760e08601826113a6565b506101008301516114cc6101008601826113b5565b506101208301518482036101208601526114e682826113e0565b9150508091505092915050565b6000602082019050818103600083015261150d8184611419565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61155782611243565b810181811067ffffffffffffffff821117156115765761157561151f565b5b80604052505050565b60006115896110e2565b9050611595828261154e565b919050565b600067ffffffffffffffff8211156115b5576115b461151f565b5b6115be82611243565b9050602081019050919050565b82818337600083830152505050565b60006115ed6115e88461159a565b61157f565b9050828152602081018484840111156116095761160861151a565b5b6116148482856115cb565b509392505050565b600082601f83011261163157611630611515565b5b81356116418482602086016115da565b91505092915050565b6000602082840312156116605761165f6110ec565b5b600082013567ffffffffffffffff81111561167e5761167d6110f1565b5b61168a8482850161161c565b91505092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116d782611693565b91506116e283611693565b92508282039050818111156116fa576116f961169d565b5b92915050565b6117098161119a565b82525050565b60006020820190506117246000830184611700565b92915050565b600080fd5b600080fd5b600081519050611743816111a4565b92915050565b61175281611383565b811461175d57600080fd5b50565b60008151905061176f81611749565b92915050565b600081519050611784816110f6565b92915050565b6000815190506117998161112e565b92915050565b600067ffffffffffffffff8211156117ba576117b961151f565b5b6117c382611243565b9050602081019050919050565b60006117e36117de8461179f565b61157f565b9050828152602081018484840111156117ff576117fe61151a565b5b61180a848285611219565b509392505050565b600082601f83011261182757611826611515565b5b81516118378482602086016117d0565b91505092915050565b600061014082840312156118575761185661172a565b5b61186261014061157f565b9050600061187284828501611734565b600083015250602061188684828501611734565b602083015250604061189a84828501611760565b60408301525060606118ae84828501611760565b60608301525060806118c284828501611760565b60808301525060a06118d684828501611734565b60a08301525060c06118ea84828501611775565b60c08301525060e06118fe84828501611775565b60e0830152506101006119138482850161178a565b6101008301525061012082015167ffffffffffffffff8111156119395761193861172f565b5b61194584828501611812565b6101208301525092915050565b600060208284031215611968576119676110ec565b5b600082015167ffffffffffffffff811115611986576119856110f1565b5b61199284828501611840565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806119e257607f821691505b6020821081036119f5576119f461199b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302611a5d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611a20565b611a678683611a20565b95508019841693508086168417925050509392505050565b6000819050919050565b6000611aa4611a9f611a9a84611693565b611a7f565b611693565b9050919050565b6000819050919050565b611abe83611a89565b611ad2611aca82611aab565b848454611a2d565b825550505050565b600090565b611ae7611ada565b611af2818484611ab5565b505050565b5b81811015611b1657611b0b600082611adf565b600181019050611af8565b5050565b601f821115611b5b57611b2c816119fb565b611b3584611a10565b81016020851015611b44578190505b611b58611b5085611a10565b830182611af7565b50505b505050565b600082821c905092915050565b6000611b7e60001984600802611b60565b1980831691505092915050565b6000611b978383611b6d565b9150826002028217905092915050565b611bb0826111fd565b67ffffffffffffffff811115611bc957611bc861151f565b5b611bd382546119ca565b611bde828285611b1a565b600060209050601f831160018114611c115760008415611bff578287015190505b611c098582611b8b565b865550611c71565b601f198416611c1f866119fb565b60005b82811015611c4757848901518255600182019150602085019450602081019050611c22565b86831015611c645784890151611c60601f891682611b6d565b8355505b6001600288020188555050505b505050505050565b6000611c8482611693565b9150611c8f83611693565b9250828201905080821115611ca757611ca661169d565b5b92915050565b600081905092915050565b60008154611cc5816119ca565b611ccf8186611cad565b94506001821660008114611cea5760018114611cff57611d32565b60ff1983168652811515820286019350611d32565b611d08856119fb565b60005b83811015611d2a57815481890152600182019150602081019050611d0b565b838801955050505b50505092915050565b7f3078000000000000000000000000000000000000000000000000000000000000600082015250565b6000611d71600283611cad565b9150611d7c82611d3b565b600282019050919050565b6000611d92826111fd565b611d9c8185611cad565b9350611dac818560208601611219565b80840191505092915050565b6000611dc48285611cb8565b9150611dcf82611d64565b9150611ddb8284611d87565b91508190509392505050565b6000611df282611086565b9050919050565b611e0281611de7565b8114611e0d57600080fd5b50565b600081519050611e1f81611df9565b92915050565b60008060408385031215611e3c57611e3b6110ec565b5b6000611e4a85828601611e10565b925050602083015167ffffffffffffffff811115611e6b57611e6a6110f1565b5b611e7785828601611812565b9150509250929050565b611e8a81611693565b8114611e9557600080fd5b50565b600081519050611ea781611e81565b92915050565b600060208284031215611ec357611ec26110ec565b5b6000611ed184828501611e98565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611f1482611693565b9150611f1f83611693565b9250828202611f2d81611693565b91508282048414831517611f4457611f4361169d565b5b5092915050565b6000611f5682611693565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f8857611f8761169d565b5b60018201905091905056fea26469706673582212205517301113be93b296807966f8f2ac5958a9a6442475fe407f7c547d48b7820164736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec0113000000000000000000000000dc3d8318fbaec2de49281843f5bba22e783381460000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f7275627973636f72652e696f2f6170692f7363726f6c6c2d62616467652f62616467652f0000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : resolver_ (address): 0x4560FECd62B14A463bE44D40fE5Cfd595eEc0113
Arg [1] : achievement_ (address): 0xDC3D8318Fbaec2de49281843f5bba22e78338146
Arg [2] : defaultUri_ (string): https://rubyscore.io/api/scroll-badge/badge/
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000004560fecd62b14a463be44d40fe5cfd595eec0113
Arg [1] : 000000000000000000000000dc3d8318fbaec2de49281843f5bba22e78338146
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 000000000000000000000000000000000000000000000000000000000000002c
Arg [4] : 68747470733a2f2f7275627973636f72652e696f2f6170692f7363726f6c6c2d
Arg [5] : 62616467652f62616467652f0000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$156.31
Net Worth in ETH
Token Allocations
ETH
99.99%
BNB
0.01%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.