Otterspace Docs
Ask or search…
K

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