Skip to main content

UniqueIdentity

UniqueIdentity

Deployment on Ethereum mainnet:

https://etherscan.io/address/0xba0439088dc1e75F58e0A7C107627942C15cbb41

UniqueIdentity is an ERC1155-compliant contract for representing the identity verification status of addresses.

SIGNER_ROLE

bytes32 SIGNER_ROLE

ID_TYPE_0

uint256 ID_TYPE_0

ID_TYPE_1

uint256 ID_TYPE_1

ID_TYPE_2

uint256 ID_TYPE_2

ID_TYPE_3

uint256 ID_TYPE_3

ID_TYPE_4

uint256 ID_TYPE_4

ID_TYPE_5

uint256 ID_TYPE_5

ID_TYPE_6

uint256 ID_TYPE_6

ID_TYPE_7

uint256 ID_TYPE_7

ID_TYPE_8

uint256 ID_TYPE_8

ID_TYPE_9

uint256 ID_TYPE_9

ID_TYPE_10

uint256 ID_TYPE_10

MINT_COST_PER_TOKEN

uint256 MINT_COST_PER_TOKEN

nonces

mapping(address => uint256) nonces

We include a nonce in every hashed message, and increment the nonce as part of a state-changing operation, so as to prevent replay attacks, i.e. the reuse of a signature.

supportedUIDTypes

mapping(uint256 => bool) supportedUIDTypes

initialize

function initialize(address owner, string uri) public

__UniqueIdentity_init

function __UniqueIdentity_init(address owner) internal

__UniqueIdentity_init_unchained

function __UniqueIdentity_init_unchained(address owner) internal

setSupportedUIDTypes

function setSupportedUIDTypes(uint256[] ids, bool[] values) public

name

function name() public pure returns (string)

Gets the token name.

Return Values

NameTypeDescription
[0]stringstring representing the token name

symbol

function symbol() public pure returns (string)

Gets the token symbol.

Return Values

NameTypeDescription
[0]stringstring representing the token symbol

mint

function mint(uint256 id, uint256 expiresAt, bytes signature) public payable

Mint a new UniqueIdentity token to the msgSender

Parameters

NameTypeDescription
iduint256The id representing the KYC type of the UniqueIdentity
expiresAtuint256The expiration time of the signature
signaturebytesAn EIP-191 signature of the corresponding mint params: account, id, expiresAt, address(this), nonces[account], block.chainid from an address with the SIGNER_ROLE.

mintTo

function mintTo(address recipient, uint256 id, uint256 expiresAt, bytes signature) public payable

Mint a new UniqueIdentity token to the recipient

Parameters

NameTypeDescription
recipientaddressThe recipient address to be minted to.
iduint256The id representing the KYC type of the UniqueIdentity
expiresAtuint256The expiration time of the signature
signaturebytesAn EIP-191 signature of the corresponding mintTo params: (account, recipient, id, expiresAt, address(this), nonces[account], block.chainid) from an address with the SIGNER_ROLE.

_mintTo

function _mintTo(address mintToAddress, uint256 id) private

burn

function burn(address account, uint256 id, uint256 expiresAt, bytes signature) public

Burn a UniqueIdentity token of id from the account

Parameters

NameTypeDescription
accountaddressThe account which currently owns the UID
iduint256The id representing the KYC type of the UniqueIdentity
expiresAtuint256The expiration time of the signature
signaturebytesAn EIP-191 signature of the corresponding burn params: (account, id, expiresAt, address(this), nonces[account], block.chainid) from an address with the SIGNER_ROLE.

_beforeTokenTransfer

function _beforeTokenTransfer(address operator, address from, address to, uint256[] ids, uint256[] amounts, bytes data) internal

_See {ERC1155-_beforeTokenTransfer}.

Requirements:

  • the contract must not be paused._

onlySigner

modifier onlySigner(address account, uint256 id, uint256 expiresAt, bytes signature)

onlySignerMintTo

modifier onlySignerMintTo(address mintToAddress, uint256 id, uint256 expiresAt, bytes signature)

incrementNonce

modifier incrementNonce(address account)