4.6 Bridge Developer Guide

Lock assets on one chain and mint on another using the Neural Bridge.

๐Ÿ”ง Deploy Contracts

const Lock = await ethers.getContractFactory("LockContract");
const lock = await Lock.deploy(tokenAddress, targetChainId);

const Mint = await ethers.getContractFactory("MintContract");
const mint = await Mint.deploy(bridgedTokenAddress);

๐Ÿ”Œ Relay Config

{
  "sourceRpc": "https://rpc.avilom.net",
  "destRpc": "https://bsc.rpc.avilom.net",
  "lockContract": "0xLockAddr",
  "mintContract": "0xMintAddr",
  "modelPath": "bridge_model.onnx",
  "privateKey": "0xYOUR_KEY"
}

React UI Snippet

await lock.lockTokens({ value: ethers.utils.parseEther(amount) });
// Listen for event, then submit proof to mint

Last updated