Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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 << 0

Full 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 << 1

Event management capabilities:

  • Mint tickets
  • Stub tickets (check-in)
  • Void tickets

DOOR_ROLE

const DOOR_ROLE = 4n // 1 << 2

Check-in only:

  • Stub tickets (convert to used state)

MINTER_ROLE

const MINTER_ROLE = 8n // 1 << 3

Issuance 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 // 6n

Protocol 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 const

Role Values Reference

ConstantValueBinaryHex
ADMIN_ROLE1n00010x1
HOST_ROLE2n00100x2
DOOR_ROLE4n01000x4
MINTER_ROLE8n10000x8

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,
})