Encryption Examples
Token Gated (token-gated
)
Must own at least 1 AZUKI
NFT on Ethereum Mainnet
{
"type": "token-gated",
"chain": "ethereum",
"contractType": "ERC721",
"contractAddress": "0xed5af388653567af2f388e6224dc7c4b3241c544",
"minTokenBalance": "1"
}
Must own at least 100 USDC
on Polygon Mainnet
{
"type": "token-gated",
"chain": "polygon",
"contractType": "ERC20",
"contractAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"minTokenBalance": "100000000" // equals 100 USD (100 * 10^6)
}
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.
{
"type": "token-gated",
"chain": "polygon",
"contractType": "ERC1155",
"contractAddress": "0xba6666b118f8303f990f3519df07e160227cce87",
"tokenId": "14",
"minTokenBalance": "1" // equals 100 USD (100 * 10^6)
}
Must own some USDC
on Solana
{
"type": "token-gated",
"chain": "solana",
"contractType": "SolanaContract",
"contractAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"minTokenBalance": "1"
}
Custom (custom
)
Must own at least 0.00001 ETH
on Ethereum mainnet
{
"type": "custom",
"accessControlConditions": [
{
"contractAddress": "",
"standardContractType": "",
"chain": "ethereum",
"method": "eth_getBalance",
"parameters": [
":userAddress",
"latest"
],
"returnValueTest": {
"comparator": ">=",
"value": "10000000000000"
}
}
]
}
After a specific date
This example allows you to use a UNIX timestamp (seconds
) after which the content should be made available to anyone.
{
"type": "custom",
"accessControlConditions": [
{
"contractAddress": "",
"standardContractType": "timestamp",
"chain": "ethereum",
"method": "eth_getBlockByNumber",
"parameters": ["latest"],
"returnValueTest": {
"comparator": ">=",
"value": "1651276942"
}
}
]
}
Must own at least 0.1 SOL
on Solana Mainnet
{
"type": "custom",
"accessControlConditions": [
{
"method": "getBalance",
"params": [":userAddress"],
"pdaParams": [],
"pdaInterface": { offset: 0, fields: {} },
"pdaKey": "",
"chain": "solana",
"returnValueTest": {
"key": "",
"comparator": ">=",
"value": "100000000", // equals 0.1 SOL
},
}
]
}
Must own at least 1 ETH
and either (10 USDC
or 1 SOL
)
{
"type": "custom",
"accessControlConditions": [
{
"contractAddress": "",
"standardContractType": "",
"chain": "ethereum",
"method": "eth_getBalance",
"parameters": [
":userAddress",
"latest"
],
"returnValueTest": {
"comparator": ">=",
"value": "1000000000000000000" // equals 1 ETH
}
}
{
"operator": "and"
},
[
{
"contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"standardContractType": "ERC20",
"chain": "ethereum",
"method": "balanceOf",
"parameters": [
":userAddress"
],
"returnValueTest": {
"comparator": ">=",
"value": "10000000" // Equals 10 USDC
}
},
{
"operator": "or"
},
{
"method": "getBalance",
"params": [":userAddress"],
"pdaParams": [],
"pdaInterface": { offset: 0, fields: {} },
"pdaKey": "",
"chain": "solana",
"returnValueTest": {
"key": "",
"comparator": ">=",
"value": "1000000000", // equals 1 SOL
},
}
]
]
}
Additional Custom Examples
Additional examples and all rules are available in Lit Protocol's Documentation (opens in a new tab).