Use NFTHashi as middleware

You can integrate NFTHashi smart contracts into your contracts.

Overview

You can integrate the NFTHashi contract using the following interface and deployed contract addresses.

Interface

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IHashi721Bridge {
  function xCall(
    uint32 destination,
    uint256 relayerFee,
    address asset,
    address to,
    uint256 tokenId,
    bool isTokenURIIgnored
  ) external payable returns (bytes32);
}

Deployments

Mainnet

TBD

Testnet

Smart Contract Example

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IHashi721Bridge {
  function xCall(
    uint32 destination,
    uint256 relayerFee,
    address asset,
    address to,
    uint256 tokenId,
    bool isTokenURIIgnored
  ) external payable returns (bytes32);
}

contract SampleXApp {
    address nftHashiBridgeContract;
    
    constructor(address _nftHashiBridgeContract) {
        nftHashiBridgeContract = _nftHashiBridgeContract;
    }
    
    function sampleXCall(    
        uint32 destination,         // domain ID from above list
        uint256 relayerFee,         // check Connext document
        address asset,              // NFT contract address
        address to,                 // NFT receiver in destination chain
        uint256 tokenId,            // NFT token ID
        bool isTokenURIIgnored   // if token URI is not required, set true
    ) public {
        // specific logic for your dApp
        IHashi721Bridge(nftHashiBridgeContract).xCall(destination, relayerFee, asset, to, tokenId, isTokenURIIgnored);
    }
}

Interact from frontend

The user must approve the NFTHashi bridge contract to transfer NFT before calling.

Last updated