Otterspace Docs

Minting allowlisted Badges

Claim and mint the Badge using the signature
Call take(address _from, string calldata _uri, bytes calldata _signature) on the Badges contract
import { Contract, Signer } from 'ethers'
import Badges from '@otterspace-xyz/contracts/out/Badges.sol/Badges.json' assert { type: 'json' }
const BADGES_CONTRACT_ADDRESS = '0x7F9279B24D1c36Fa3E517041fdb4E8788dc63D25'
const mintBadge = async (
badgeReceiver: Signer,
fromAddress: string,
badgeSpecURI: string,
compactSignature: string
): Promise<ContractCallResult> => {
const contract = new Contract(BADGES_CONTRACT_ADDRESS, Badges.abi, badgeReceiver)
const doTake = contract['take']
return await doTake(fromAddress, badgeSpecURI, compactSignature)