Bitgert Blockchain Documentation
  • BRISE Chain Documentation
    • Getting Started
    • Become a validator
    • Contributing
    • BRISE Chain Explorers
    • Genesis File
    • Consensus
    • Introduction
  • Wallets
  • For Developers
    • Network Status Monitoring Guideline
    • Proxy Contract
    • Local Brise Chain Network
    • Deploy NFT
    • RPC
    • BRISE Chain Relayer
    • BRISE Chain Full Node Documentation
    • Wallet Providers
    • Verify Proxy Contract
    • Hardhat Verify
    • Truffle Verify
    • Deploy on Truffle
    • Deploy on Remix IDE
    • Smart Contract Tools
    • Create Wallet
Powered by GitBook
On this page
  • Verify Your Contract on Brisescan
  • Truffle
  1. For Developers

Truffle Verify

PreviousHardhat VerifyNextDeploy on Truffle

Last updated 1 year ago

Verify Your Contract on Brisescan

The recommended way to verify a smart contract is using plugin. It is easier to read, imports are maintained, licenses are maintained.

Verified using Truffle

Example:

GitHub Project:

Truffle

Truffle has an BscScan plugin:

You need to deploy with Truffle to verify with the Truffle verify plugin.

Get API key: https://brisescan.com/myapikey

  • Install the plugin

npm install -D truffle-plugin-verify
  • Configure the plugin in truffle-config.js

const HDWalletProvider = require("@truffle/hdwallet-provider");

// const infuraKey = "fj4jll3k.....";
//
const { mnemonic, NCSCANAPIKEY} = require('./env.json');

module.exports = {

  plugins: [
    'truffle-plugin-verify'
  ],
  api_keys: {
    bscscan: NCSCANAPIKEY
  },
  networks: {

    testnet: {
        provider: () => new HDWalletProvider(mnemonic, `https://testnet-rpc.brisescan.com`),
        network_id: 97,
        timeoutBlocks: 200,
        confirmations: 5,
        production: true    // Treats this network as if it was a public net. (default: false)
    }
  },

  // Set default mocha options here, use special reporters etc.
  mocha: {
    timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
       version: "0.5.16",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
      settings: {          // See the solidity docs for advice about optimization and evmVersion
       optimizer: {
         enabled: false,
         runs: 200
       },
       evmVersion: "byzantium"
      }
    },
  },
};
  • Verify

    truffle run verify BRC20Token@{contract-address} --network testnet

    You should see the following output:

Verifying BRC20Token@0x68D2E27940CA48109Fa3DaD0D2C8B27E64a0c6cf
Pass - Verified: https://testnet-explorer.brisescan.com/address/0x68D2E27940CA48109Fa3DaD0D2C8B27E64a0c6cf#contracts
Successfully verified 1 contract(s).

https://testnet.brisescan.com/token/0x68D2E27940CA48109Fa3DaD0D2C8B27E64a0c6cf
https://github.com/huangsuyu/verify-example
truffle-plugin-verify