Constants
Protocol constants exported from the SDK.
import {
ADMIN_ROLE,
HOST_ROLE,
DOOR_ROLE,
MINTER_ROLE,
PROTOCOL_FEE_BPS,
} from '@sceneinfrastructure/sdk'Role Constants
Bitmap-based role values for access control on Gatekeeper1155 contracts.
ADMIN_ROLE
const ADMIN_ROLE = 1n // 1 << 0Full contract control:
- Setup new tiers
- Mint tickets
- Stub tickets (check-in)
- Void tickets
- Update token metadata
- Grant and revoke roles
- Call gatekeeper contract
HOST_ROLE
const HOST_ROLE = 2n // 1 << 1Event management capabilities:
- Mint tickets
- Stub tickets (check-in)
- Void tickets
DOOR_ROLE
const DOOR_ROLE = 4n // 1 << 2Check-in only:
- Stub tickets (convert to used state)
MINTER_ROLE
const MINTER_ROLE = 8n // 1 << 3Issuance permissions:
- Mint tickets
- Void tickets
- Required by Gatekeeper contract for purchases
Combining Roles
Roles can be combined with bitwise OR when granting multiple roles to staff:
import { HOST_ROLE, DOOR_ROLE } from '@sceneinfrastructure/sdk'
// Grant HOST + DOOR to event staff
const staffRoles = HOST_ROLE | DOOR_ROLE // 6nProtocol Constants
PROTOCOL_FEE_BPS
const PROTOCOL_FEE_BPS = 100 // 1%The protocol fee in basis points (1/100th of a percent).
- 100 BPS = 1% fee on all sales
- Fee is collected by the protocol on each purchase
Indexer Endpoints
Docs-only placeholders for Ponder SQL endpoints:
const PONDER_ENDPOINTS = {
dev: 'https://ponder-dev.example.com/sql',
prod: 'https://ponder.example.com/sql',
} as constRole Values Reference
| Constant | Value | Binary | Hex |
|---|---|---|---|
ADMIN_ROLE | 1n | 0001 | 0x1 |
HOST_ROLE | 2n | 0010 | 0x2 |
DOOR_ROLE | 4n | 0100 | 0x4 |
MINTER_ROLE | 8n | 1000 | 0x8 |
Usage Example
import {
Gatekeeper1155,
Factory,
MINTER_ROLE,
HOST_ROLE,
DOOR_ROLE,
gatekeeperAddress,
} from '@sceneinfrastructure/sdk'
const chainId = 8453 // Base
// Grant MINTER to Gatekeeper for sales
const grantMinter = Factory.encodeGrantRoles({
user: gatekeeperAddress[chainId],
roles: MINTER_ROLE,
})
// Grant HOST + DOOR to staff
const grantStaff = Factory.encodeGrantRoles({
user: '0x2345678901234567890123456789012345678901',
roles: HOST_ROLE | DOOR_ROLE,
})