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

Minting allowlisted Badges

Claim and mint the Badge using the signature

PreviousAdding to allowlistNextAdd/Remove Admins

Last updated 1 year ago

Was this helpful?

Call take(address _from, string calldata _uri, bytes calldata _signature) on the Badges

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)
}
🛠️
🤝
contract