全部版块 我的主页
论坛 金融投资论坛 六区 金融实务版 比特币、区块链与元宇宙
536 1
2022-11-08

Web3 社区对于非同质化带币(NFT)充满了期待。尽管还没有杀手级应用的出现,但是这项技术已经重塑了数字资产所有权,身份体系,创新范式和社区运作方式。因为 NFT 是可以被买卖交易的数字资产,而 NFT 交易所收集了 NFT 的信息并且撮合了买家和卖家,所以 NFT 交易所是生态中一个必不可少的部分

如果你现在不想部署在测试网或者主网上,那就复制下面的配置文件。我后面将会将这个文件称作“Hardhat Config”,别忘了 export 这个对象(module.exports = {defaultNetwork: {...} } )。这个对象有项目的配置信息,能够定义默认,hardhat 和本地网络。

require("@nomiclabs/hardhat-waffle");require("@nomiclabs/hardhat-etherscan");require("hardhat-deploy");require("solidity-coverage");require("hardhat-contract-sizer");require("dotenv").config();

module.exports = {

  defaultNetwork: "hardhat",

  networks: {

    hardhat: {

      chainId: 31337,

    },

    localhost: {

      chainId: 31337,

    },

  },

  namedAccounts: {

    deployer: {

      default: 0, // here this will by default take the first account as deployer

      1: 0, // similarly on mainnet (network 1) it will take the first//account as deployer. Note though that depending on how hardhat network are //configured, the account 0 on one network can be different than on another

    },

  },

  solidity: {

    compilers: [

      {

        version: "0.8.7",

      },

      {

        version: "0.4.24",

      },

    ],

  },

  mocha: {

    timeout: 200000, // 200 seconds max for running tests

  },};

复制

现在,你的项目会有以下文件夹:

1. Contracts 文件夹,这里有我们 NFT 交易所的逻辑和 NFT 样例合约。

2. deploy 文件夹,这里有 hardhat-deploy plugin 和部署脚本,它们可以编译智能合约并且部署在 Hardhat 提供的本地区块链中。

3. scripts 文件夹,这里有一些脚本文件,用来和部署在本地的 Hardhat 开发环境中的智能合约交互。


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2022-11-29 10:57:43
点个赞感谢分享
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群