Creating a Social Club Badge

Anyone with a Lens profile can create a badge and manage their own onchain loyalty system.

The core badge contract MadSBT lives on Polygon, with the option for deployment on other chains. Send us an email at if you want a specific chain supported.

⚠️ NOTE: On launch, we'll have this functionality gated to creators that either hold the MadFi Badge NFT or were invited by lens/@madfinance. This is to maintain a tight first cohort of creators / social clubs.

Creating a badge on MadFi

On launch - anyone that meets the gating requirement can create their Social Club Badge from their page at{lenshandle}.

That will take you to a page where you can create your badge simply by

  • Entering a prompt to generate the images for your Badge

  • or using the MadFI default images

  • or uploading your own images

As badge holders accrue points, their NFT metadata changes to reflect the image set for that level.

Once you hit "Create Badge" to send the transaction on Polygon, your badge collection will be set onchain and ready for mints (explained below).

Creating a badge on the MadSBT contract

Anyone with a Lens profile can call the contract function onchain

Contract Address (Polygon) | 0x22209D6eAe6cEBA2d059ebfE67b67837BCC1b428

Function Interface

function createCollection(
    address creator,
    uint256 profileId,
    bytes calldata data // (uint256 supply, string memory _uri, address referrer) = abi.decode(data, (uint256, string, address))
) external returns (uint256) {

How to mint badges

Badges can be minted in one of three ways

  • the creator can call the function themselves to mint it for a given address

  • a permissioned contract can call it as the result of something (ex: Subscriptions, Smart Posts)

  • the contract owner (MadFi) can airdrop it to a given address

Calling the mint function as the creator

The creator of a given collectionId can call this function onchain to mint a badge for the given account.

function mint(address account, uint256 collectionId) external returns (uint256)

For subscribers

By default, anyone that subscribes to a creator on MadFi will get their badge NFT (if any).

More on this in the Subscriptions page.

Via Smart Posts (Promote Social Club)

👍This is the most recommended way of getting your badge minted early on

You can have limited drops of your badge NFT per Lens post. It can be free/paid, timed, and for followers only. It's up to you how you want to monetize + distribute your badge NFT!

More on this can be found in the Promote Social Club page.

Last updated