Developers
Gate an action on a Solidus credential without ever seeing the data behind it. The gate answers with a reason, so you can tell a holder what to fix rather than only that they failed.
On chain
import {SolidusGate} from "./SolidusGate.sol"; // github.com/solidusnetwork/bridge-contracts, src/lib/SolidusGate.sol
// Reverts with the REASON, not just a refusal, so you can tell the holder what to fix.
SolidusGate.requireCredential(
mirror, // SolidusRegistry.mirrorOf(domain)
SolidusGate.holderOf(msg.sender),
keccak256("KycL2"),
issuerDidHash,
1 days // how stale a heartbeat may be
);In a frontend
import { checkGate, credentialTypeHash, gateReasonName, holderFromEvmAddress } from '@solidus-network/bridge'
const result = await checkGate({
client: publicClient,
mirror: mirrorAddress,
holder: holderFromEvmAddress(account.address),
credentialTypeHash: credentialTypeHash('KycL2'),
issuerDidHash,
maxAge: 86_400n,
})
if (!result.ok) show(`cannot proceed: ${gateReasonName(result.reason)}`)You supply the client. This package ships no RPC URL of its own.
Addresses
| Chain | Registry | Mirror |
|---|---|---|
| Ethereum Sepolia | 0x19aF92b387200827E0540f516FEd1468B09806A5 | 0x0a5a0d19206f436d67B7b87BF4c889d5b769517A |
| Avalanche Fuji | 0x19aF92b387200827E0540f516FEd1468B09806A5 | 0x0a5a0d19206f436d67B7b87BF4c889d5b769517A |
| Arc testnet | 0x19aF92b387200827E0540f516FEd1468B09806A5 | 0x0a5a0d19206f436d67B7b87BF4c889d5b769517A |
| Solana devnet | not deployed | 2MWe3EHixse6MGx5gBjqdY54Xn3SZ2bmkaSXnXp6tg7u |