Access Gating Examples
Orbis SDK expects accessRules to be an array (wrapped in []).
Below examples assume you already initialized an empty array and are ready to copy/pasted.
Tokens
Must own at least 10 USDC on Polygon
The user must own 10 USDC on Polygon Mainnet.
USDC has 6 decimals, so the desired minBalance (10) must be multiplied by 10^6 (10000000).
{
"type": "token",
"requiredToken": {
"chain": "polygon",
"symbol": "USDC",
"address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"decimals": 6,
"minBalance": "10000000", // 10 * 10 ^ 6
"contract_type": "erc20",
"attributes_required": [] // ignored for ERC20
}
}Must own at least 1 BAYC (ERC721) on Ethereum
The user must own 1 BAYC NFT on Ethereum mainnet.
Decimals are null as they do not apply to ERC721.
{
"type": "token",
"requiredToken": {
"chain": "mainnet",
"symbol": "BAYC",
"address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"decimals": null,
"minBalance": "1",
"contract_type": "erc721",
"attributes_required": []
}
}Must own at least 1 Azuki (ERC721) with specific metadata
The user must own 1 Azuki NFT on Ethereum mainnet.
The NFT must also have type: human and eyes: concerned metadata properties.
Decimals are null as they do not apply to ERC721.
{
"type": "token",
"requiredToken": {
"chain": "mainnet",
"symbol": "AZUKI",
"address": "0xed5af388653567af2f388e6224dc7c4b3241c544",
"decimals": null,
"minBalance": "1",
"contract_type": "erc721",
"attributes_required": [
{
"key": "type",
"value": "human"
},
{
"key": "eyes",
"value": "concerned"
}
]
}
}Must own at least 10 PIX-A #14 (ERC1155) on Polygon
The user must own 10 PIX-A (#14) Legendary Bio-M0Ds on Polygon Mainnet.
Bio-M0D is defined as Token 14 in the ERC1155 contract.
Decimals are null as they do not apply to ERC1155.
{
"type": "token",
"requiredToken": {
"chain": "polygon",
"symbol": "PIX-A",
"address": "0xba6666b118f8303f990f3519df07e160227cce87",
"decimals": null,
"token_id": "14",
"minBalance": "10",
"contract_type": "erc1155",
"attributes_required": []
}
}DIDs
Only specified DIDs
{
"type": "did",
"authorizedUsers": [
{
"did": "did:pkh:eip155:1:0x83593d13fec30806c989410f9325fd18245b246b"
},
{
"did": "did:pkh:eip155:1:0x0c8feeda30aeb92f62edfcff08c9bda9733b50fe"
}
]
}Credentials
You can find the list of available Credentials and their identifiers here.
Must have transactions on Ethereum Mainnet
{
"type": "credential",
"requiredCredentials": [
{
"identifier": "orbis-active-wallet-mainnet",
}
]
}Must have at least 10 swaps using Uniswap v3 and 100 votes on Snapshot
{
"type": "credential",
"requiredCredentials": [
{
"identifier": "orbis-uniswap-swap-count-10",
},
{
"identifier": "orbis-snapshot-votes-count-100",
}
]
}POAP
Must have a POAP from ETHBerlin 2018
ETHBerlin 2018's (opens in a new tab) event ID is 9.
{
"type": "poap",
"requiredPoap": {
"event_id": "9"
}
}Combined Rules
Must own at least 10 USDC on Polygon, 1 BAYC on Ethereum and have transactions on Arbitrum
{
"type": "token",
"requiredToken": {
"chain": "polygon",
"symbol": "USDC",
"address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"decimals": 6,
"minBalance": "10000000", // 10 * 10 ^ 6
"contract_type": "erc20",
"attributes_required": [] // ignored for ERC20
}
},
{
"operator": "or"
},
{
"type": "token",
"requiredToken": {
"chain": "mainnet",
"symbol": "BAYC",
"address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"decimals": null,
"minBalance": "1",
"contract_type": "erc721",
"attributes_required": []
}
},
{
"operator": "or"
},
{
"type": "credential",
"requiredCredentials": [
{
"identifier": "orbis-active-wallet-arbitrum"
}
]
}