Metis
Integrating with Humanode Biomapper on Metis 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 Metis 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 Metis.
Get contract ABI
The proper way is to create ABI from IBridgedBiomapperRead
interface in @biomapper-sdk/core
.
Alternatively you can use these 2 functions:
Ethers v6
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 Metis Mainnet:
const biomapperContractAddress = '0x7Bc956A55ec813447142E1183974bE2e496Ee444';
For the Biomapper on Metis Testnet (Sepolia):
const biomapperContractAddress = '0x16F2a7AC67B6aC1E57dD5528A24b1fC689902Be2';
Get current biomapping generation
Ethers 6
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
Ethers 6
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 Metis and connect it to the Humanode Bridged Biomapper on Metis Andromeda Mainnet (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.