Skip to Content

Nibiru

Integrating with Humanode Biomapper on Nibiru network.

Getting Started

First familiarize yourself with core concepts like Generations and General Information about the integrations.

Then, all you need to do is

  • write your smart contract that integrated with Bridged Biomapper on Nibiru network, and
  • add the link to Biomapper UI on your frontend to let your users obtain the biomapping.

Development

Smart Contract

Use Biomapper SDK  to get the APIs for smart contracts.

You can use MockBridgedBiomapper contract for local development, and testnet deployment of the BridgedBiomapper to real-world testing.

See technical details at the Biomapper SDK Docs .

Frontend

Integrating on the frontend is as simple as adding a link to the Biomapper App.

Ignoring generations could lead to Sybil attacks.

Here is an example of how to check if a wallet is biomapped in the last generation known to Biomapper on Nibiru.

Get contract ABI

The proper way is to create ABI from IBridgedBiomapperRead interface in @biomapper-sdk/core.

Alternatively you can use these 2 functions:

const biomapperAbi = parseAbi([ "function generationsHead() external view returns (uint256)", "function lookupBiomappingPtr(address account, uint256 generationPtr) external view returns (uint256)", ]);

Get contract address

Look up the contract addresses page for full contract addresses info.

For the Biomapper on Nibiru Mainnet:

const biomapperContractAddress = '0x541D5d8162cda504a26084330EBcf9404039e4c1';

For the Biomapper on Nibiru Testnet Testnet-2:

const biomapperContractAddress = '0x16F2a7AC67B6aC1E57dD5528A24b1fC689902Be2';

Get current biomapping generation

See more about readContract function on https://viem.sh/docs/contract/readContract .

const lastKnownGeneration = await publicClient.readContract({ address: biomapperContractAddress, abi: biomapperAbi, functionName: "generationsHead", });

Get biomapping status in the last known generation

To get biomapping status for some address addressToCheck in the last known generation

const biomappingPtrInLastKnownGeneration = await publicClient.readContract({ address: biomapperContractAddress, abi: biomapperAbi, functionName: "lookupBiomappingPtr", args: [addressToCheck, lastKnownGeneration], });

biomappingPtrInLastKnownGeneration is the block number on Humanode Mainnet or Humanode Testnet 5 of biomapping tx in the last known generation for specified address, or zero if such address is not biomapped.

const biomappingStatus = biomappingPtrInLastKnownGeneration !== 0n;

Rollout

When you are ready, deploy your smart contract to Nibiru and connect it to the Humanode Bridged Biomapper on Nibiru Cataclysm-1 (see contract addresses).

Don’t forget to update the link to Biomapper App your the frontend to mainnet Biomapper App.

After Rollout

If you’d like your app to be listed in the Biomapper App talk to us.

Last updated on