POL Price: $0.332767 (+1.99%)
Gas: 49.9 GWei
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x7FaBc0a3...115A8ba60
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AttestationsRegistry

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 14 : AttestationsRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

import {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';
import {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';
import {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';
import {Range, RangeUtils} from './libs/utils/RangeLib.sol';
import {Attestation, AttestationData} from './libs/Structs.sol';
import {IBadges} from './interfaces/IBadges.sol';

/**
 * @title Attestations Registry
 * @author Sismo
 * @notice Main contract of Sismo, stores all recorded attestations in attestations collections
 * Only authorized attestations issuers can record attestation in the registry
 * Attesters that expect to record in the Attestations Registry must be authorized issuers
 * For more information: https://attestations-registry.docs.sismo.io

 * For each attestation recorded, a badge is received by the user
 * The badge is the Non transferrable NFT representation of an attestation 
 * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values
 * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts
 * It enables off-chain apps such as opensea to catch the "shadow mint" of the badge
 **/
contract AttestationsRegistry is
  AttestationsRegistryState,
  IAttestationsRegistry,
  AttestationsRegistryConfigLogic
{
  uint8 public constant IMPLEMENTATION_VERSION = 3;
  IBadges immutable BADGES;

  /**
   * @dev Constructor.
   * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers
   * @param badgesAddress Stateless ERC1155 Badges contract
   */
  constructor(address owner, address badgesAddress) {
    BADGES = IBadges(badgesAddress);
    initialize(owner);
  }

  /**
   * @dev Initialize function, to be called by the proxy delegating calls to this implementation
   * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers
   * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.
   */
  function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {
    // if proxy did not setup owner yet or if called by constructor (for implem setup)
    if (owner() == address(0) || address(this).code.length == 0) {
      _transferOwnership(ownerAddress);
    }
  }

  /**
   * @dev Main function to be called by authorized issuers
   * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)
   */
  function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {
    address issuer = _msgSender();
    for (uint256 i = 0; i < attestations.length; i++) {
      if (!_isAuthorized(issuer, attestations[i].collectionId))
        revert IssuerNotAuthorized(issuer, attestations[i].collectionId);

      uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][
        attestations[i].owner
      ].value;

      _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(
        attestations[i].issuer,
        attestations[i].value,
        attestations[i].timestamp,
        attestations[i].extraData
      );

      _triggerBadgeTransferEvent(
        attestations[i].collectionId,
        attestations[i].owner,
        previousAttestationValue,
        attestations[i].value
      );
      emit AttestationRecorded(attestations[i]);
    }
  }

  /**
   * @dev Delete function to be called by authorized issuers
   * @param owners The owners of the attestations to be deleted
   * @param collectionIds The collection ids of the attestations to be deleted
   */
  function deleteAttestations(
    address[] calldata owners,
    uint256[] calldata collectionIds
  ) external override whenNotPaused {
    if (owners.length != collectionIds.length)
      revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);

    address issuer = _msgSender();
    for (uint256 i = 0; i < owners.length; i++) {
      AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];

      if (!_isAuthorized(issuer, collectionIds[i]))
        revert IssuerNotAuthorized(issuer, collectionIds[i]);
      delete _attestationsData[collectionIds[i]][owners[i]];

      _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);

      emit AttestationDeleted(
        Attestation(
          collectionIds[i],
          owners[i],
          attestationData.issuer,
          attestationData.value,
          attestationData.timestamp,
          attestationData.extraData
        )
      );
    }
  }

  /**
   * @dev Returns whether a user has an attestation from a collection
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function hasAttestation(
    uint256 collectionId,
    address owner
  ) external view override returns (bool) {
    return _getAttestationValue(collectionId, owner) != 0;
  }

  /**
   * @dev Getter of the data of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationData(
    uint256 collectionId,
    address owner
  ) external view override returns (AttestationData memory) {
    return _getAttestationData(collectionId, owner);
  }

  /**
   * @dev Getter of the value of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationValue(
    uint256 collectionId,
    address owner
  ) external view override returns (uint256) {
    return _getAttestationValue(collectionId, owner);
  }

  /**
   * @dev Getter of the data of a specific attestation as tuple
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationDataTuple(
    uint256 collectionId,
    address owner
  ) external view override returns (address, uint256, uint32, bytes memory) {
    AttestationData memory attestationData = _attestationsData[collectionId][owner];
    return (
      attestationData.issuer,
      attestationData.value,
      attestationData.timestamp,
      attestationData.extraData
    );
  }

  /**
   * @dev Getter of the extraData of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationExtraData(
    uint256 collectionId,
    address owner
  ) external view override returns (bytes memory) {
    return _attestationsData[collectionId][owner].extraData;
  }

  /**
   * @dev Getter of the issuer of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationIssuer(
    uint256 collectionId,
    address owner
  ) external view override returns (address) {
    return _attestationsData[collectionId][owner].issuer;
  }

  /**
   * @dev Getter of the timestamp of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationTimestamp(
    uint256 collectionId,
    address owner
  ) external view override returns (uint32) {
    return _attestationsData[collectionId][owner].timestamp;
  }

  /**
   * @dev Getter of the data of specific attestations
   * @param collectionIds Collection identifiers of the targeted attestations
   * @param owners Owners of the targeted attestations
   */
  function getAttestationDataBatch(
    uint256[] memory collectionIds,
    address[] memory owners
  ) external view override returns (AttestationData[] memory) {
    AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);
    for (uint256 i = 0; i < collectionIds.length; i++) {
      attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);
    }
    return attestationsDataArray;
  }

  /**
   * @dev Getter of the values of specific attestations
   * @param collectionIds Collection identifiers of the targeted attestations
   * @param owners Owners of the targeted attestations
   */
  function getAttestationValueBatch(
    uint256[] memory collectionIds,
    address[] memory owners
  ) external view override returns (uint256[] memory) {
    uint256[] memory attestationsValues = new uint256[](collectionIds.length);
    for (uint256 i = 0; i < collectionIds.length; i++) {
      attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);
    }
    return attestationsValues;
  }

  /**
   * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract
   * It enables off-chain apps such as opensea to catch the "shadow mints/burns" of badges
   */
  function _triggerBadgeTransferEvent(
    uint256 badgeTokenId,
    address owner,
    uint256 previousValue,
    uint256 newValue
  ) internal {
    bool isGreaterValue = newValue > previousValue;
    address operator = address(this);
    address from = isGreaterValue ? address(0) : owner;
    address to = isGreaterValue ? owner : address(0);
    uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;

    // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.
    BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);
  }

  function _getAttestationData(
    uint256 collectionId,
    address owner
  ) internal view returns (AttestationData memory) {
    return (_attestationsData[collectionId][owner]);
  }

  function _getAttestationValue(
    uint256 collectionId,
    address owner
  ) internal view returns (uint256) {
    return _attestationsData[collectionId][owner].value;
  }
}

File 2 of 14 : IAttestationsRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

import {Attestation, AttestationData} from '../libs/Structs.sol';
import {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';

/**
 * @title IAttestationsRegistry
 * @author Sismo
 * @notice This is the interface of the AttestationRegistry
 */
interface IAttestationsRegistry is IAttestationsRegistryConfigLogic {
  error IssuerNotAuthorized(address issuer, uint256 collectionId);
  error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);
  event AttestationRecorded(Attestation attestation);
  event AttestationDeleted(Attestation attestation);

  /**
   * @dev Main function to be called by authorized issuers
   * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)
   */
  function recordAttestations(Attestation[] calldata attestations) external;

  /**
   * @dev Delete function to be called by authorized issuers
   * @param owners The owners of the attestations to be deleted
   * @param collectionIds The collection ids of the attestations to be deleted
   */
  function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;

  /**
   * @dev Returns whether a user has an attestation from a collection
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function hasAttestation(uint256 collectionId, address owner) external returns (bool);

  /**
   * @dev Getter of the data of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationData(
    uint256 collectionId,
    address owner
  ) external view returns (AttestationData memory);

  /**
   * @dev Getter of the value of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);

  /**
   * @dev Getter of the data of a specific attestation as tuple
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationDataTuple(
    uint256 collectionId,
    address owner
  ) external view returns (address, uint256, uint32, bytes memory);

  /**
   * @dev Getter of the extraData of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationExtraData(
    uint256 collectionId,
    address owner
  ) external view returns (bytes memory);

  /**
   * @dev Getter of the issuer of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationIssuer(
    uint256 collectionId,
    address owner
  ) external view returns (address);

  /**
   * @dev Getter of the timestamp of a specific attestation
   * @param collectionId Collection identifier of the targeted attestation
   * @param owner Owner of the targeted attestation
   */
  function getAttestationTimestamp(
    uint256 collectionId,
    address owner
  ) external view returns (uint32);

  /**
   * @dev Getter of the data of specific attestations
   * @param collectionIds Collection identifiers of the targeted attestations
   * @param owners Owners of the targeted attestations
   */
  function getAttestationDataBatch(
    uint256[] memory collectionIds,
    address[] memory owners
  ) external view returns (AttestationData[] memory);

  /**
   * @dev Getter of the values of specific attestations
   * @param collectionIds Collection identifiers of the targeted attestations
   * @param owners Owners of the targeted attestations
   */
  function getAttestationValueBatch(
    uint256[] memory collectionIds,
    address[] memory owners
  ) external view returns (uint256[] memory);
}

File 3 of 14 : IAttestationsRegistryConfigLogic.sol
// SPDX-License-Identifier: MIT
// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.14;

import {Range, RangeUtils} from '../libs/utils/RangeLib.sol';

interface IAttestationsRegistryConfigLogic {
  error AttesterNotFound(address issuer);
  error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);
  error IdsMismatch(
    address issuer,
    uint256 rangeIndex,
    uint256 expectedFirstId,
    uint256 expectedLastId,
    uint256 FirstId,
    uint256 lastCollectionId
  );
  error AttributeDoesNotExist(uint8 attributeIndex);
  error AttributeAlreadyExists(uint8 attributeIndex);
  error ArgsLengthDoesNotMatch();

  event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);
  event AttributeNameUpdated(
    uint8 attributeIndex,
    bytes32 newAttributeName,
    bytes32 previousAttributeName
  );
  event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);

  event AttestationsCollectionAttributeSet(
    uint256 collectionId,
    uint8 attributeIndex,
    uint8 attributeValue
  );

  event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);
  event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);

  /**
   * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param index Index of the attribute. Can go from 0 to 63.
   */
  function attestationsCollectionHasAttribute(
    uint256 collectionId,
    uint8 index
  ) external view returns (bool);

  function attestationsCollectionHasAttributes(
    uint256 collectionId,
    uint8[] memory indices
  ) external view returns (bool);

  /**
   * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param attributeIndex Index of the attribute. Can go from 0 to 63.
   */
  function getAttributeValueForAttestationsCollection(
    uint256 collectionId,
    uint8 attributeIndex
  ) external view returns (uint8);

  function getAttributesValuesForAttestationsCollection(
    uint256 collectionId,
    uint8[] memory indices
  ) external view returns (uint8[] memory);

  /**
   * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param index Index of the attribute (must be between 0 and 63)
   * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15
   */
  function setAttributeValueForAttestationsCollection(
    uint256 collectionId,
    uint8 index,
    uint8 value
  ) external;

  function setAttributesValuesForAttestationsCollections(
    uint256[] memory collectionIds,
    uint8[] memory indices,
    uint8[] memory values
  ) external;

  /**
   * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection
   * @param collectionId Collection Id of the targeted attestationsCollection
   */
  function getAttributesNamesAndValuesForAttestationsCollection(
    uint256 collectionId
  ) external view returns (bytes32[] memory, uint8[] memory);

  /**
   * @dev Authorize an issuer for a specific range
   * @param issuer Issuer that will be authorized
   * @param firstCollectionId First collection Id of the range for which the issuer will be authorized
   * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized
   */
  function authorizeRange(
    address issuer,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) external;

  /**
   * @dev Unauthorize an issuer for a specific range
   * @param issuer Issuer that will be unauthorized
   * @param rangeIndex Index of the range to be unauthorized
   * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized
   * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized
   */
  function unauthorizeRange(
    address issuer,
    uint256 rangeIndex,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) external;

  /**
   * @dev Authorize an issuer for specific ranges
   * @param issuer Issuer that will be authorized
   * @param ranges Ranges for which the issuer will be authorized
   */
  function authorizeRanges(address issuer, Range[] memory ranges) external;

  /**
   * @dev Unauthorize an issuer for specific ranges
   * @param issuer Issuer that will be unauthorized
   * @param ranges Ranges for which the issuer will be unauthorized
   */
  function unauthorizeRanges(
    address issuer,
    Range[] memory ranges,
    uint256[] memory rangeIndexes
  ) external;

  /**
   * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection
   * @param issuer Issuer to be checked
   * @param collectionId Collection Id for which the issuer will be checked
   */
  function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);

  /**
   * @dev Pauses the registry. Issuers can no longer record or delete attestations
   */
  function pause() external;

  /**
   * @dev Unpauses the registry
   */
  function unpause() external;

  /**
   * @dev Create a new attribute.
   * @param index Index of the attribute. Can go from 0 to 63.
   * @param name Name in bytes32 of the attribute
   */
  function createNewAttribute(uint8 index, bytes32 name) external;

  function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;

  /**
   * @dev Update the name of an existing attribute
   * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist
   * @param newName new name in bytes32 of the attribute
   */
  function updateAttributeName(uint8 index, bytes32 newName) external;

  function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;

  /**
   * @dev Delete an existing attribute
   * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist
   */
  function deleteAttribute(uint8 index) external;

  function deleteAttributes(uint8[] memory indices) external;
}

File 4 of 14 : IBadges.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

/**
 * @title Interface for Badges contract
 * @author Sismo
 * @notice Stateless ERC1155 contract. Reads balance from the values of attestations
 * The associated attestations registry triggers TransferSingle events from this contract
 * It allows badge "shadow mints and burns" to be caught by off-chain platforms
 */
interface IBadges {
  error BadgesNonTransferrable();

  /**
   * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation
   * @param uri Uri for the metadata of badges
   * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry
   * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.
   */
  function initialize(string memory uri, address owner) external;

  /**
   * @dev Main function of the ERC1155 badge
   * The balance of a user is equal to the value of the underlying attestation.
   * attestationCollectionId == badgeId
   * @param account Address to check badge balance (= value of attestation)
   * @param id Badge Id to check (= attestationCollectionId)
   */
  function balanceOf(address account, uint256 id) external view returns (uint256);

  /**
   * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning
   * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)
   * @param operator who is calling the TransferEvent
   * @param from address(0) if minting, address of the badge holder if burning
   * @param to address of the badge holder is minting, address(0) if burning
   * @param id badgeId for which to trigger the event
   * @param value minted/burned balance
   */
  function triggerTransferEvent(
    address operator,
    address from,
    address to,
    uint256 id,
    uint256 value
  ) external;

  /**
   * @dev Set the attestations registry address. Can only be called by owner (default admin)
   * @param attestationsRegistry new attestations registry address
   */
  function setAttestationsRegistry(address attestationsRegistry) external;

  /**
   * @dev Set the URI. Can only be called by owner (default admin)
   * @param uri new attestations registry address
   */
  function setUri(string memory uri) external;

  /**
   * @dev Getter of the attestations registry
   */
  function getAttestationsRegistry() external view returns (address);

  /**
   * @dev Getter of the badge issuer
   * @param account Address that holds the badge
   * @param id Badge Id to check (= attestationCollectionId)
   */
  function getBadgeIssuer(address account, uint256 id) external view returns (address);

  /**
   * @dev Getter of the badge timestamp
   * @param account Address that holds the badge
   * @param id Badge Id to check (= attestationCollectionId)
   */
  function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);

  /**
   * @dev Getter of the badge extra data (it can store nullifier and burnCount)
   * @param account Address that holds the badge
   * @param id Badge Id to check (= attestationCollectionId)
   */
  function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);

  /**
   * @dev Getter of the value of a specific badge attribute
   * @param id Badge Id to check (= attestationCollectionId)
   * @param index Index of the attribute
   */
  function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);

  /**
   * @dev Getter of all badge attributes and their values for a specific badge
   * @param id Badge Id to check (= attestationCollectionId)
   */
  function getAttributesNamesAndValuesForBadge(
    uint256 id
  ) external view returns (bytes32[] memory, uint8[] memory);
}

File 5 of 14 : Structs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

/**
 * @title  Attestations Registry State
 * @author Sismo
 * @notice This contract holds all of the storage variables and data
 *         structures used by the AttestationsRegistry and parent
 *         contracts.
 */

// User Attestation Request, can be made by any user
// The context of an Attestation Request is a specific attester contract
// Each attester has groups of accounts in its available data
// eg: for a specific attester:
//     group 1 <=> accounts that sent txs on mainnet
//     group 2 <=> accounts that sent txs on polygon
// eg: for another attester:
//     group 1 <=> accounts that sent eth txs in 2022
//     group 2 <=> accounts sent eth txs in 2021
struct Request {
  // implicit address attester;
  // implicit uint256 chainId;
  Claim[] claims;
  address destination; // destination that will receive the end attestation
}

struct Claim {
  uint256 groupId; // user claims to have an account in this group
  uint256 claimedValue; // user claims this value for its account in the group
  bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation
}

/**
 * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.
 * @param collectionId Attestation collection
 * @param owner Attestation collection
 * @param issuer Attestation collection
 * @param value Attestation collection
 * @param timestamp Attestation collection
 * @param extraData Attestation collection
 */
struct Attestation {
  // implicit uint256 chainId;
  uint256 collectionId; // Id of the attestation collection (in the registry)
  address owner; // Owner of the attestation
  address issuer; // Contract that created or last updated the record.
  uint256 value; // Value of the attestation
  uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation
  // it is different from the recording timestamp (date when the attestation was recorded)
  // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.
  bytes extraData; // arbitrary data that can be added by the attester
}

// Attestation Data, stored in the registry
// The context is a specific owner of a specific collection
struct AttestationData {
  // implicit uint256 chainId
  // implicit uint256 collectionId - from context
  // implicit owner
  address issuer; // Address of the contract that recorded the attestation
  uint256 value; // Value of the attestation
  uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)
  bytes extraData; // arbitrary data that can be added by the attester
}

File 6 of 14 : AttestationsRegistryConfigLogic.sol
// SPDX-License-Identifier: MIT
// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.14;

import './OwnableLogic.sol';
import './PausableLogic.sol';
import './InitializableLogic.sol';
import './AttestationsRegistryState.sol';
import {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';
import {Range, RangeUtils} from '../utils/RangeLib.sol';
import {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';

/**
 * @title Attestations Registry Config Logic contract
 * @author Sismo
 * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry
 **/
contract AttestationsRegistryConfigLogic is
  AttestationsRegistryState,
  IAttestationsRegistryConfigLogic,
  OwnableLogic,
  PausableLogic,
  InitializableLogic
{
  using RangeUtils for Range[];
  using Bitmap256Bit for uint256;
  using Bitmap256Bit for uint8;

  /******************************************
   *
   *    ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)
   *
   *****************************************/

  /**
   * @dev Pauses the registry. Issuers can no longer record or delete attestations
   */
  function pause() external override onlyOwner {
    _pause();
  }

  /**
   * @dev Unpauses the registry
   */
  function unpause() external override onlyOwner {
    _unpause();
  }

  /**
   * @dev Authorize an issuer for a specific range
   * @param issuer Issuer that will be authorized
   * @param firstCollectionId First collection Id of the range for which the issuer will be authorized
   * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized
   */
  function authorizeRange(
    address issuer,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) external override onlyOwner {
    _authorizeRange(issuer, firstCollectionId, lastCollectionId);
  }

  /**
   * @dev Unauthorize an issuer for a specific range
   * @param issuer Issuer that will be unauthorized
   * @param rangeIndex Index of the range to be unauthorized
   * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized
   * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized
   */
  function unauthorizeRange(
    address issuer,
    uint256 rangeIndex,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) external override onlyOwner {
    _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);
  }

  /**
   * @dev Authorize an issuer for specific ranges
   * @param issuer Issuer that will be authorized
   * @param ranges Ranges for which the issuer will be authorized
   */
  function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {
    for (uint256 i = 0; i < ranges.length; i++) {
      _authorizeRange(issuer, ranges[i].min, ranges[i].max);
    }
  }

  /**
   * @dev Unauthorize an issuer for specific ranges
   * @param issuer Issuer that will be unauthorized
   * @param ranges Ranges for which the issuer will be unauthorized
   */
  function unauthorizeRanges(
    address issuer,
    Range[] memory ranges,
    uint256[] memory rangeIndexes
  ) external override onlyOwner {
    for (uint256 i = 0; i < rangeIndexes.length; i++) {
      _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);
    }
  }

  /**
   * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection
   * @param issuer Issuer to be checked
   * @param collectionId Collection Id for which the issuer will be checked
   */
  function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {
    return _isAuthorized(issuer, collectionId);
  }

  /******************************************
   *
   *    ATTRIBUTES CONFIG LOGIC
   *
   *****************************************/

  /**
   * @dev Create a new attribute.
   * @param index Index of the attribute. Can go from 0 to 63.
   * @param name Name in bytes32 of the attribute
   */
  function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {
    index._checkIndexIsValid();
    if (_isAttributeCreated(index)) {
      revert AttributeAlreadyExists(index);
    }
    _createNewAttribute(index, name);
  }

  function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {
    if (indices.length != names.length) {
      revert ArgsLengthDoesNotMatch();
    }

    for (uint256 i = 0; i < indices.length; i++) {
      createNewAttribute(indices[i], names[i]);
    }
  }

  /**
   * @dev Update the name of an existing attribute
   * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist
   * @param newName new name in bytes32 of the attribute
   */
  function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {
    index._checkIndexIsValid();
    if (!_isAttributeCreated(index)) {
      revert AttributeDoesNotExist(index);
    }
    _updateAttributeName(index, newName);
  }

  function updateAttributesName(
    uint8[] memory indices,
    bytes32[] memory newNames
  ) external onlyOwner {
    if (indices.length != newNames.length) {
      revert ArgsLengthDoesNotMatch();
    }

    for (uint256 i = 0; i < indices.length; i++) {
      updateAttributeName(indices[i], newNames[i]);
    }
  }

  /**
   * @dev Delete an existing attribute
   * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist
   */
  function deleteAttribute(uint8 index) public onlyOwner {
    index._checkIndexIsValid();
    if (!_isAttributeCreated(index)) {
      revert AttributeDoesNotExist(index);
    }
    _deleteAttribute(index);
  }

  function deleteAttributes(uint8[] memory indices) external onlyOwner {
    for (uint256 i = 0; i < indices.length; i++) {
      deleteAttribute(indices[i]);
    }
  }

  /**
   * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param index Index of the attribute (must be between 0 and 63)
   * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15
   */
  function setAttributeValueForAttestationsCollection(
    uint256 collectionId,
    uint8 index,
    uint8 value
  ) public onlyOwner {
    index._checkIndexIsValid();

    if (!_isAttributeCreated(index)) {
      revert AttributeDoesNotExist(index);
    }

    _setAttributeForAttestationsCollection(collectionId, index, value);
  }

  function setAttributesValuesForAttestationsCollections(
    uint256[] memory collectionIds,
    uint8[] memory indices,
    uint8[] memory values
  ) external onlyOwner {
    if (collectionIds.length != indices.length || collectionIds.length != values.length) {
      revert ArgsLengthDoesNotMatch();
    }
    for (uint256 i = 0; i < collectionIds.length; i++) {
      setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);
    }
  }

  /**
   * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param index Index of the attribute. Can go from 0 to 63.
   */
  function getAttributeValueForAttestationsCollection(
    uint256 collectionId,
    uint8 index
  ) public view returns (uint8) {
    uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(
      collectionId
    );
    return currentAttributesValues._get(index);
  }

  function getAttributesValuesForAttestationsCollection(
    uint256 collectionId,
    uint8[] memory indices
  ) external view returns (uint8[] memory) {
    uint8[] memory attributesValues = new uint8[](indices.length);
    for (uint256 i = 0; i < indices.length; i++) {
      attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);
    }
    return attributesValues;
  }

  /**
   * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index
   * @param collectionId Collection Id of the targeted attestationsCollection
   * @param index Index of the attribute. Can go from 0 to 63.
   */
  function attestationsCollectionHasAttribute(
    uint256 collectionId,
    uint8 index
  ) public view returns (bool) {
    uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(
      collectionId
    );
    return currentAttributeValues._get(index) > 0;
  }

  function attestationsCollectionHasAttributes(
    uint256 collectionId,
    uint8[] memory indices
  ) external view returns (bool) {
    for (uint256 i = 0; i < indices.length; i++) {
      if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {
        return false;
      }
    }
    return true;
  }

  /**
   * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection
   * @param collectionId Collection Id of the targeted attestationsCollection
   */
  function getAttributesNamesAndValuesForAttestationsCollection(
    uint256 collectionId
  ) public view returns (bytes32[] memory, uint8[] memory) {
    uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(
      collectionId
    );

    (
      uint8[] memory indices,
      uint8[] memory values,
      uint8 nbOfNonZeroValues
    ) = currentAttributesValues._getAllNonZeroValues();

    bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);
    uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);
    for (uint8 i = 0; i < nbOfNonZeroValues; i++) {
      attributesNames[i] = _attributesNames[indices[i]];
      attributesValues[i] = values[i];
    }

    return (attributesNames, attributesValues);
  }

  /*****************************
   *
   *      INTERNAL FUNCTIONS
   *
   *****************************/

  function _authorizeRange(
    address issuer,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) internal {
    Range memory newRange = Range(firstCollectionId, lastCollectionId);
    _authorizedRanges[issuer].push(newRange);
    emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);
  }

  function _unauthorizeRange(
    address issuer,
    uint256 rangeIndex,
    uint256 firstCollectionId,
    uint256 lastCollectionId
  ) internal onlyOwner {
    if (rangeIndex >= _authorizedRanges[issuer].length)
      revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);

    uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;
    uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;
    if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)
      revert IdsMismatch(
        issuer,
        rangeIndex,
        expectedFirstId,
        expectedLastId,
        firstCollectionId,
        lastCollectionId
      );

    _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][
      _authorizedRanges[issuer].length - 1
    ];
    _authorizedRanges[issuer].pop();
    emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);
  }

  function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {
    return _authorizedRanges[issuer]._includes(collectionId);
  }

  function _setAttributeForAttestationsCollection(
    uint256 collectionId,
    uint8 index,
    uint8 value
  ) internal {
    uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);

    _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(
      index,
      value
    );

    emit AttestationsCollectionAttributeSet(collectionId, index, value);
  }

  function _createNewAttribute(uint8 index, bytes32 name) internal {
    _attributesNames[index] = name;

    emit NewAttributeCreated(index, name);
  }

  function _updateAttributeName(uint8 index, bytes32 newName) internal {
    bytes32 previousName = _attributesNames[index];

    _attributesNames[index] = newName;

    emit AttributeNameUpdated(index, newName, previousName);
  }

  function _deleteAttribute(uint8 index) internal {
    bytes32 deletedName = _attributesNames[index];

    delete _attributesNames[index];

    emit AttributeDeleted(index, deletedName);
  }

  function _getAttributesValuesBitmapForAttestationsCollection(
    uint256 collectionId
  ) internal view returns (uint256) {
    return _attestationsCollectionAttributesValuesBitmap[collectionId];
  }

  function _isAttributeCreated(uint8 index) internal view returns (bool) {
    if (_attributesNames[index] == 0) {
      return false;
    }
    return true;
  }
}

File 7 of 14 : AttestationsRegistryState.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

import {Range} from '../utils/RangeLib.sol';
import {Attestation, AttestationData} from '../Structs.sol';

contract AttestationsRegistryState {
  /*******************************************************
    Storage layout:
    19 slots for config
      4 currently used for _initialized, _initializing, _paused, _owner
      15 place holders
    16 slots for logic
      3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames
      13 place holders
    1 slot for _attestationsData 
  *******************************************************/

  // main config
  // changed `_initialized` from bool to uint8
  // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)
  // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)
  // PR: https://github.com/sismo-core/sismo-protocol/pull/41
  uint8 internal _initialized;
  bool internal _initializing;
  bool internal _paused;
  address internal _owner;
  // keeping some space for future
  uint256[15] private _placeHoldersAdmin;

  // storing the authorized ranges for each attesters
  mapping(address => Range[]) internal _authorizedRanges;
  // Storing the attributes values used for each attestations collection
  // Each attribute value is an hexadecimal
  mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;
  // Storing the attribute name for each attributes index
  mapping(uint8 => bytes32) internal _attributesNames;
  // keeping some space for future
  uint256[13] private _placeHoldersConfig;
  // storing the data of attestations
  // =collectionId=> =owner=> attestationData
  mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;
}

File 8 of 14 : InitializableLogic.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)
// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.14;

import '../utils/Address.sol';
import './AttestationsRegistryState.sol';

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract InitializableLogic is AttestationsRegistryState {
  // only diff with oz
  // /**
  //  * @dev Indicates that the contract has been initialized.
  //  */
  // bool private _initialized;

  // /**
  //  * @dev Indicates that the contract is in the process of being initialized.
  //  */
  // bool private _initializing;

  /**
   * @dev Triggered when the contract has been initialized or reinitialized.
   */
  event Initialized(uint8 version);

  /**
   * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
   * `onlyInitializing` functions can be used to initialize parent contracts.
   *
   * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
   * constructor.
   *
   * Emits an {Initialized} event.
   */
  modifier initializer() {
    bool isTopLevelCall = !_initializing;
    require(
      (isTopLevelCall && _initialized < 1) ||
        (!Address.isContract(address(this)) && _initialized == 1),
      'Initializable: contract is already initialized'
    );
    _initialized = 1;
    if (isTopLevelCall) {
      _initializing = true;
    }
    _;
    if (isTopLevelCall) {
      _initializing = false;
      emit Initialized(1);
    }
  }

  /**
   * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
   * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
   * used to initialize parent contracts.
   *
   * A reinitializer may be used after the original initialization step. This is essential to configure modules that
   * are added through upgrades and that require initialization.
   *
   * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
   * cannot be nested. If one is invoked in the context of another, execution will revert.
   *
   * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
   * a contract, executing them in the right order is up to the developer or operator.
   *
   * WARNING: setting the version to 255 will prevent any future reinitialization.
   *
   * Emits an {Initialized} event.
   */
  modifier reinitializer(uint8 version) {
    require(
      !_initializing && _initialized < version,
      'Initializable: contract is already initialized'
    );
    _initialized = version;
    _initializing = true;
    _;
    _initializing = false;
    emit Initialized(version);
  }

  /**
   * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
   * {initializer} and {reinitializer} modifiers, directly or indirectly.
   */
  modifier onlyInitializing() {
    require(_initializing, 'Initializable: contract is not initializing');
    _;
  }

  /**
   * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
   * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
   * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
   * through proxies.
   *
   * Emits an {Initialized} event the first time it is successfully executed.
   */
  function _disableInitializers() internal virtual {
    require(!_initializing, 'Initializable: contract is initializing');
    if (_initialized < type(uint8).max) {
      _initialized = type(uint8).max;
      emit Initialized(type(uint8).max);
    }
  }

  /**
   * @dev Internal function that returns the initialized version. Returns `_initialized`
   */
  function _getInitializedVersion() internal view returns (uint8) {
    return _initialized;
  }

  /**
   * @dev Internal function that returns the initialized version. Returns `_initializing`
   */
  function _isInitializing() internal view returns (bool) {
    return _initializing;
  }
}

File 9 of 14 : OwnableLogic.sol
// SPDX-License-Identifier: MIT
// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.14;

import '../utils/Context.sol';
import './AttestationsRegistryState.sol';

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableLogic is Context, AttestationsRegistryState {
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  // This is the only diff with OZ contract
  // address private _owner;

  /**
   * @dev Initializes the contract setting the deployer as the initial owner.
   */
  constructor() {
    _transferOwnership(_msgSender());
  }

  /**
   * @dev Returns the address of the current owner.
   */
  function owner() public view virtual returns (address) {
    return _owner;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(owner() == _msgSender(), 'Ownable: caller is not the owner');
    _;
  }

  /**
   * @dev Leaves the contract without owner. It will not be possible to call
   * `onlyOwner` functions anymore. Can only be called by the current owner.
   *
   * NOTE: Renouncing ownership will leave the contract without an owner,
   * thereby removing any functionality that is only available to the owner.
   */
  function renounceOwnership() public virtual onlyOwner {
    _transferOwnership(address(0));
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Can only be called by the current owner.
   */
  function transferOwnership(address newOwner) public virtual onlyOwner {
    require(newOwner != address(0), 'Ownable: new owner is the zero address');
    _transferOwnership(newOwner);
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Internal function without access restriction.
   */
  function _transferOwnership(address newOwner) internal virtual {
    address oldOwner = _owner;
    _owner = newOwner;
    emit OwnershipTransferred(oldOwner, newOwner);
  }
}

File 10 of 14 : PausableLogic.sol
// SPDX-License-Identifier: MIT
// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.14;

import '../utils/Context.sol';
import './AttestationsRegistryState.sol';

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableLogic is Context, AttestationsRegistryState {
  /**
   * @dev Emitted when the pause is triggered by `account`.
   */
  event Paused(address account);

  /**
   * @dev Emitted when the pause is lifted by `account`.
   */
  event Unpaused(address account);

  // this is the only diff with OZ contract
  // bool private _paused;

  /**
   * @dev Initializes the contract in unpaused state.
   */
  constructor() {
    _paused = false;
  }

  /**
   * @dev Returns true if the contract is paused, and false otherwise.
   */
  function paused() public view virtual returns (bool) {
    return _paused;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   *
   * Requirements:
   *
   * - The contract must not be paused.
   */
  modifier whenNotPaused() {
    require(!paused(), 'Pausable: paused');
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   *
   * Requirements:
   *
   * - The contract must be paused.
   */
  modifier whenPaused() {
    require(paused(), 'Pausable: not paused');
    _;
  }

  /**
   * @dev Triggers stopped state.
   *
   * Requirements:
   *
   * - The contract must not be paused.
   */
  function _pause() internal virtual whenNotPaused {
    _paused = true;
    emit Paused(_msgSender());
  }

  /**
   * @dev Returns to normal state.
   *
   * Requirements:
   *
   * - The contract must be paused.
   */
  function _unpause() internal virtual whenPaused {
    _paused = false;
    emit Unpaused(_msgSender());
  }
}

File 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
  /**
   * @dev Returns true if `account` is a contract.
   *
   * [IMPORTANT]
   * ====
   * It is unsafe to assume that an address for which this function returns
   * false is an externally-owned account (EOA) and not a contract.
   *
   * Among others, `isContract` will return false for the following
   * types of addresses:
   *
   *  - an externally-owned account
   *  - a contract in construction
   *  - an address where a contract will be created
   *  - an address where a contract lived, but was destroyed
   * ====
   *
   * [IMPORTANT]
   * ====
   * You shouldn't rely on `isContract` to protect against flash loan attacks!
   *
   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
   * constructor.
   * ====
   */
  function isContract(address account) internal view returns (bool) {
    // This method relies on extcodesize/address.code.length, which returns 0
    // for contracts in construction, since the code is only stored at the end
    // of the constructor execution.

    return account.code.length > 0;
  }

  /**
   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
   * `recipient`, forwarding all available gas and reverting on errors.
   *
   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
   * of certain opcodes, possibly making contracts go over the 2300 gas limit
   * imposed by `transfer`, making them unable to receive funds via
   * `transfer`. {sendValue} removes this limitation.
   *
   * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
   *
   * IMPORTANT: because control is transferred to `recipient`, care must be
   * taken to not create reentrancy vulnerabilities. Consider using
   * {ReentrancyGuard} or the
   * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
   */
  function sendValue(address payable recipient, uint256 amount) internal {
    require(address(this).balance >= amount, 'Address: insufficient balance');

    (bool success, ) = recipient.call{value: amount}('');
    require(success, 'Address: unable to send value, recipient may have reverted');
  }

  /**
   * @dev Performs a Solidity function call using a low level `call`. A
   * plain `call` is an unsafe replacement for a function call: use this
   * function instead.
   *
   * If `target` reverts with a revert reason, it is bubbled up by this
   * function (like regular Solidity function calls).
   *
   * Returns the raw returned data. To convert to the expected return value,
   * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
   *
   * Requirements:
   *
   * - `target` must be a contract.
   * - calling `target` with `data` must not revert.
   *
   * _Available since v3.1._
   */
  function functionCall(address target, bytes memory data) internal returns (bytes memory) {
    return functionCall(target, data, 'Address: low-level call failed');
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
   * `errorMessage` as a fallback revert reason when `target` reverts.
   *
   * _Available since v3.1._
   */
  function functionCall(
    address target,
    bytes memory data,
    string memory errorMessage
  ) internal returns (bytes memory) {
    return functionCallWithValue(target, data, 0, errorMessage);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but also transferring `value` wei to `target`.
   *
   * Requirements:
   *
   * - the calling contract must have an ETH balance of at least `value`.
   * - the called Solidity function must be `payable`.
   *
   * _Available since v3.1._
   */
  function functionCallWithValue(
    address target,
    bytes memory data,
    uint256 value
  ) internal returns (bytes memory) {
    return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');
  }

  /**
   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
   * with `errorMessage` as a fallback revert reason when `target` reverts.
   *
   * _Available since v3.1._
   */
  function functionCallWithValue(
    address target,
    bytes memory data,
    uint256 value,
    string memory errorMessage
  ) internal returns (bytes memory) {
    require(address(this).balance >= value, 'Address: insufficient balance for call');
    require(isContract(target), 'Address: call to non-contract');

    (bool success, bytes memory returndata) = target.call{value: value}(data);
    return verifyCallResult(success, returndata, errorMessage);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a static call.
   *
   * _Available since v3.3._
   */
  function functionStaticCall(
    address target,
    bytes memory data
  ) internal view returns (bytes memory) {
    return functionStaticCall(target, data, 'Address: low-level static call failed');
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
   * but performing a static call.
   *
   * _Available since v3.3._
   */
  function functionStaticCall(
    address target,
    bytes memory data,
    string memory errorMessage
  ) internal view returns (bytes memory) {
    require(isContract(target), 'Address: static call to non-contract');

    (bool success, bytes memory returndata) = target.staticcall(data);
    return verifyCallResult(success, returndata, errorMessage);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a delegate call.
   *
   * _Available since v3.4._
   */
  function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
    return functionDelegateCall(target, data, 'Address: low-level delegate call failed');
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
   * but performing a delegate call.
   *
   * _Available since v3.4._
   */
  function functionDelegateCall(
    address target,
    bytes memory data,
    string memory errorMessage
  ) internal returns (bytes memory) {
    require(isContract(target), 'Address: delegate call to non-contract');

    (bool success, bytes memory returndata) = target.delegatecall(data);
    return verifyCallResult(success, returndata, errorMessage);
  }

  /**
   * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
   * revert reason using the provided one.
   *
   * _Available since v4.3._
   */
  function verifyCallResult(
    bool success,
    bytes memory returndata,
    string memory errorMessage
  ) internal pure returns (bytes memory) {
    if (success) {
      return returndata;
    } else {
      // Look for revert reason and bubble it up if present
      if (returndata.length > 0) {
        // The easiest way to bubble the revert reason is using memory via assembly

        assembly {
          let returndata_size := mload(returndata)
          revert(add(32, returndata), returndata_size)
        }
      } else {
        revert(errorMessage);
      }
    }
  }
}

File 12 of 14 : Bitmap256Bit.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

/*
 * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.
 * The 4 bits can encode any value from 0 to 15.

    chunck63            chunck2      chunck1      chunck0
    bits                bits         bits         bits 
   ┌────────────┐      ┌────────────┬────────────┬────────────┐
   │ 1  1  1  1 │ .... │ 1  0  1  1 │ 0  0  0  0 │ 0  0  0  1 │
   └────────────┘      └────────────┴────────────┴────────────┘
      value 15            value 11     value 0      value 1

  * A chunck index must be between 0 and 63.
  * A value must be between 0 and 15.
 **/

library Bitmap256Bit {
  uint256 constant MAX_INT = 2 ** 256 - 1;

  error IndexOutOfBounds(uint8 index);
  error ValueOutOfBounds(uint8 value);

  /**
   * @dev Return the value at a given index of a 256-bit bitmap
   * @param index index where the value can be found. Can be between 0 and 63
   */
  function _get(uint256 self, uint8 index) internal pure returns (uint8) {
    uint256 currentValues = self;
    // Get the encoded 4-bit value by right shifting to the `index` position
    uint256 shifted = currentValues >> (4 * index);
    // Get the value by only masking the last 4 bits with an AND operator
    return uint8(shifted & (2 ** 4 - 1));
  }

  /**
   * @dev Set a value at a chosen index in a 256-bit bitmap
   * @param index index where the value will be stored. Can be between 0 and 63
   * @param value value to store. Can be between 0 and 15
   */
  function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {
    _checkIndexIsValid(index);
    _checkValueIsValid(value);

    uint256 currentValues = self;
    // 1. first we need to remove the current value for the inputed `index`
    // Left Shift 4 bits mask (1111 mask) to the `index` position
    uint256 mask = (2 ** 4 - 1) << (4 * index);
    // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove
    uint256 negativeMask = MAX_INT ^ mask;
    // Apply a AND operation between the current values and the negative mask to remove the wanted bits
    uint256 newValues = currentValues & negativeMask;

    // 2. We set the new value wanted at the `index` position
    // Create the 4 bits encoding the new value and left shift them to the `index` position
    uint256 newValueMask = uint256(value) << (4 * index);
    // Apply an OR operation between the current values and the newValueMask to reference new value
    return newValues | newValueMask;
  }

  /**
   * @dev Get all the non-zero values in a 256-bit bitmap
   * @param self a 256-bit bitmap
   */
  function _getAllNonZeroValues(
    uint256 self
  ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {
    uint8[] memory indices = new uint8[](64);
    uint8[] memory values = new uint8[](64);
    uint8 nbOfNonZeroValues = 0;
    for (uint8 i = 0; i < 63; i++) {
      uint8 value = _get(self, i);
      if (value > 0) {
        indices[nbOfNonZeroValues] = i;
        values[nbOfNonZeroValues] = value;
        nbOfNonZeroValues++;
      }
    }
    return (indices, values, nbOfNonZeroValues);
  }

  /**
   * @dev Check if the index is valid (is between 0 and 63)
   * @param index index of a chunck
   */
  function _checkIndexIsValid(uint8 index) internal pure {
    if (index > 63) {
      revert IndexOutOfBounds(index);
    }
  }

  /**
   * @dev Check if the value is valid (is between 0 and 15)
   * @param value value to encode in a chunck
   */
  function _checkValueIsValid(uint8 value) internal pure {
    if (value > 15) {
      revert ValueOutOfBounds(value);
    }
  }
}

File 13 of 14 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.14;

/**
 * @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;
  }
}

File 14 of 14 : RangeLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

struct Range {
  uint256 min;
  uint256 max;
}

// Range [0;3] includees 0 and 3
library RangeUtils {
  function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {
    for (uint256 i = 0; i < ranges.length; i++) {
      if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {
        return true;
      }
    }
    return false;
  }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"badgesAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArgsLengthDoesNotMatch","type":"error"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"}],"name":"AttesterNotFound","type":"error"},{"inputs":[{"internalType":"uint8","name":"attributeIndex","type":"uint8"}],"name":"AttributeAlreadyExists","type":"error"},{"inputs":[{"internalType":"uint8","name":"attributeIndex","type":"uint8"}],"name":"AttributeDoesNotExist","type":"error"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"rangeIndex","type":"uint256"},{"internalType":"uint256","name":"expectedFirstId","type":"uint256"},{"internalType":"uint256","name":"expectedLastId","type":"uint256"},{"internalType":"uint256","name":"FirstId","type":"uint256"},{"internalType":"uint256","name":"lastCollectionId","type":"uint256"}],"name":"IdsMismatch","type":"error"},{"inputs":[{"internalType":"uint8","name":"index","type":"uint8"}],"name":"IndexOutOfBounds","type":"error"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"IssuerNotAuthorized","type":"error"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"collectionIds","type":"uint256[]"}],"name":"OwnersAndCollectionIdsLengthMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"expectedArrayLength","type":"uint256"},{"internalType":"uint256","name":"rangeIndex","type":"uint256"}],"name":"RangeIndexOutOfBounds","type":"error"},{"inputs":[{"internalType":"uint8","name":"value","type":"uint8"}],"name":"ValueOutOfBounds","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"indexed":false,"internalType":"struct Attestation","name":"attestation","type":"tuple"}],"name":"AttestationDeleted","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"indexed":false,"internalType":"struct Attestation","name":"attestation","type":"tuple"}],"name":"AttestationRecorded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"collectionId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"attributeIndex","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"attributeValue","type":"uint8"}],"name":"AttestationsCollectionAttributeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"attributeIndex","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"deletedAttributeName","type":"bytes32"}],"name":"AttributeDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"attributeIndex","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"newAttributeName","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"previousAttributeName","type":"bytes32"}],"name":"AttributeNameUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"issuer","type":"address"},{"indexed":false,"internalType":"uint256","name":"firstCollectionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastCollectionId","type":"uint256"}],"name":"IssuerAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"issuer","type":"address"},{"indexed":false,"internalType":"uint256","name":"firstCollectionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastCollectionId","type":"uint256"}],"name":"IssuerUnauthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"attributeIndex","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"attributeName","type":"bytes32"}],"name":"NewAttributeCreated","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"IMPLEMENTATION_VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8","name":"index","type":"uint8"}],"name":"attestationsCollectionHasAttribute","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8[]","name":"indices","type":"uint8[]"}],"name":"attestationsCollectionHasAttributes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"firstCollectionId","type":"uint256"},{"internalType":"uint256","name":"lastCollectionId","type":"uint256"}],"name":"authorizeRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"components":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"internalType":"struct Range[]","name":"ranges","type":"tuple[]"}],"name":"authorizeRanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"createNewAttribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"indices","type":"uint8[]"},{"internalType":"bytes32[]","name":"names","type":"bytes32[]"}],"name":"createNewAttributes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"collectionIds","type":"uint256[]"}],"name":"deleteAttestations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"index","type":"uint8"}],"name":"deleteAttribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"indices","type":"uint8[]"}],"name":"deleteAttributes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationData","outputs":[{"components":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct AttestationData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"collectionIds","type":"uint256[]"},{"internalType":"address[]","name":"owners","type":"address[]"}],"name":"getAttestationDataBatch","outputs":[{"components":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct AttestationData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationDataTuple","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationExtraData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationIssuer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getAttestationValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"collectionIds","type":"uint256[]"},{"internalType":"address[]","name":"owners","type":"address[]"}],"name":"getAttestationValueBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8","name":"index","type":"uint8"}],"name":"getAttributeValueForAttestationsCollection","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"getAttributesNamesAndValuesForAttestationsCollection","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"},{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8[]","name":"indices","type":"uint8[]"}],"name":"getAttributesValuesForAttestationsCollection","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"hasAttestation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"isAuthorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"timestamp","type":"uint32"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct Attestation[]","name":"attestations","type":"tuple[]"}],"name":"recordAttestations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint8","name":"value","type":"uint8"}],"name":"setAttributeValueForAttestationsCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"collectionIds","type":"uint256[]"},{"internalType":"uint8[]","name":"indices","type":"uint8[]"},{"internalType":"uint8[]","name":"values","type":"uint8[]"}],"name":"setAttributesValuesForAttestationsCollections","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"rangeIndex","type":"uint256"},{"internalType":"uint256","name":"firstCollectionId","type":"uint256"},{"internalType":"uint256","name":"lastCollectionId","type":"uint256"}],"name":"unauthorizeRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"components":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"internalType":"struct Range[]","name":"ranges","type":"tuple[]"},{"internalType":"uint256[]","name":"rangeIndexes","type":"uint256[]"}],"name":"unauthorizeRanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"bytes32","name":"newName","type":"bytes32"}],"name":"updateAttributeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"indices","type":"uint8[]"},{"internalType":"bytes32[]","name":"newNames","type":"bytes32[]"}],"name":"updateAttributesName","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f000000000000000000000000f12494e3545d49616d9dfb78e5907e9078618a349091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033

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

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.