小编Ara*_*aki的帖子

如何将库和合同链接到一个文件中?

我正在用安全帽编写智能合约,并面临类似的错误missing links for the following libraries

我想我应该做点什么sample-nft-test.js,但我不知道该怎么做。

有谁知道如何解决这个问题?

% bin/npm-install
% bin/test
Run Code Online (Sandbox Code Playgroud)
  SampleNft
    1) "before each" hook for "should be able to return token name by token id"


  0 passing (2s)
  1 failing

  1) SampleNft
       "before each" hook for "should be able to return token name by token id":
     NomicLabsHardhatPluginError: The contract SampleNft is missing links for the following libraries:
* contracts/SampleNft.sol:TokenTrait

Learn more about linking contracts at https://hardhat.org/plugins/nomiclabs-hardhat-ethers.html#library-linking

      at collectLibrariesAndLink (node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:258:11)
      at getContractFactoryFromArtifact (node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:149:32)
      at …
Run Code Online (Sandbox Code Playgroud)

solidity

2
推荐指数
2
解决办法
5134
查看次数

标签 统计

solidity ×1