For the complete documentation index, see llms.txt. This page is also available as Markdown.

Register

Registering NFTs allow them to be used as reactions in the RARA protocol.

L1 registrations use the RootRegistrar ABI, L2 registrations use the MakerRegistar ABI

{
    nftContractAddress: Address, // The Address of the NFT you want to Register
    nftId: Uint256, // Token ID of the NFT you want to Register
    creatorAddress: Address, // The Address receiving a cut of Maker rewards
    creatorSaleBasisPoints: Uint256 // The basis points set aside for the Maker
    optionBits: Uint256, // Parameter version of the Reaction you're using
    ipfsMetadataHash: String // Additional metadata saved with registration
}

Maker Registrar Contract Addresses

// Polygon Mainnet
0x47CD3266FA94E40613B37a88D98196325Cd28412

// Polygon Mumbai
0x06493B0362b3892EEc7C63023e8bC0C0c64646eb

Maker Registrar Contract ABI

Maker Registrar Contract ABI
{
  address: "0x06493B0362b3892EEc7C63023e8bC0C0c64646eb", // Mumbai Address
  abi:[{
    name: 'registerNft',
    stateMutability: 'nonpayable',
    type: 'function',
    inputs: [{
        internalType: 'address',
        name: 'nftContractAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'nftId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'creatorAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'creatorSaleBasisPoints',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'optionBits',
        type: 'uint256',
      },
      {
        internalType: 'string',
        name: 'ipfsMetadataHash',
        type: 'string',
      },
    ],
    outputs: [],
  }]
}

Root Registrar Contract Addresses

Root Registrar Contract ABI

Register a Reaction with ethers.js and ipfs-http-client

See MakerRegistar ABI or RootRegistrar ABI tab for contract definitions

[Optional] Save Registration Metadata to IPFS

If you'd like to include a Reaction Name or Tags with your Reaction, you'll need to save that information to IPFS first. If you just want to register a Reaction you can skip this step.

Register an NFT for use as a Reaction

To register a Reaction for use in the protocol, you'll use the registerNft function of either the RootRegistrar (a bridge for L1 NFTs) or the MakerRegistrar (for L2 NFTs). All parameters are required (see the Parameters section for more details).

This example uses the MakerRegistrar to register an L2 NFT. If you'd like to register an L1 NFT, simply switch out the MakerRegistrar for the RootRegistrar.

Parameters

All parameters are required

nftContractAddress

Contract Address of the NFT receiving reactions

nftTokenId

Token ID of the NFT receiving reactions

creatorAddress

The address of the creator of this NFT. If a creatorAddress is set, they will receive a portion of the Maker Rewards generated each time this Reaction is spent based on the following creatorSaleBasisPoints parameter. Use addressZero to leave the creatorAddress parameter unset.

creatorSaleBasisPoints

Basis points allocated to the creator as a portion of the MakerRewards generated during a reaction sale. Use 0 if no basis points should be allocated to the creator.

optionBits

This parameter can be used to create different versions of the reaction NFT. Use 0 if optionBits are not set.

IPFSMetadataHash

This parameter can be used to embed additional data about the user interaction. Use maxInt256 if ipfsMetadataHash is not set.

Source Code

View the protocol on Github.

Last updated