Otterspace Docs
  • Overview
    • 🦦Intro to Otterspace
    • 🔑Key Concepts
      • 🔥Burning and revocation
      • ⏳Expiration
      • 🤓Metadata schemas
    • ❓F.A.Q
  • Documentation
    • 🔌API
      • 🔐Authentication
    • 🐙Subgraph
    • 🛠️Contracts
      • 🎨Create a Badge Spec
      • 🪂Airdrop a Badge
      • ✅Adding to allowlist
      • 🤝Minting allowlisted Badges
      • ➕Add/Remove Admins
  • Guides
    • 🔏Token-gating using badges
  • Integrations
    • Using badges with Snapshot
    • Guild.xyz for token gating
    • Using with Gnosis Safe
    • On OpenSea, Metamask etc
  • Get Help
    • 🕺Discord/Twitter
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. Contracts

Add/Remove Admins

The Super Admin is the holder of the Raft Token and has full control over Badge Spec creation, airdrops, allowlisting, and badge revocation. Other users or addresses can be granted admin rights, including the ability to create and issue Badges, thus enabling a more flexible system with distributed administrative privileges. However, it's important to note that only Super Admins have the authority to add or remove other admins.

On the Raft contract you can call setAdmins(uint256 tokenId, address[] memory admins, bool[] memory isActive

The purpose of this function is to modify the isAdmin value of a list of administrators. It provides the ability to add or remove multiple administrators at once or perform a combination of both actions.

import { Contract, Signer } from 'ethers'
import Raft from '@otterspace-xyz/contracts/out/Raft.sol/Raft.json' assert { type: 'json' }

const RAFT_CONTRACT_ADDRESS = '0xBb8997048e5F0bFe6C9D6BEe63Ede53BD0236Bb2'

const mintBadge = async (
    raftReceiver: Signer,
		raftTokenId: string,
    adminList: string[],
    isActiveList: string[]
): Promise<ContractCallResult> => {
    const contract = new Contract(RAFT_CONTRACT_ADDRESS, Raft.abi, raftReceiver)
    const callSetAdmins = contract['setAdmins']
    return await callSetAdmins(raftTokenId, adminList, isActiveList)
}
PreviousMinting allowlisted BadgesNextToken-gating using badges

Last updated 1 year ago

Was this helpful?

🛠️
➕