我正在用安全帽编写智能合约,并面临类似的错误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 ×1