我在 Solidity 0.6.6 中编写了一个简单的智能合约,并尝试将其部署到 BSC 测试网。
这就是我的 truffle-config.js 文件中的内容(privateKeys 是一个包含 ['0x + privatekey'] 单个条目的数组:
networks: {
bscTestnet: {
provider: () => new HDWalletProvider(
privateKeys,
'https://data-seed-prebsc-1-s1.binance.org:8545/'
),
network_id: 97,
skipDryRun: true
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行命令“truffle migrate --reset --network bscTestnet”时,出现以下错误:
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'bscTestnet'
> Network id: 97
> Block gas limit: 30000000 (0x1c9c380)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" …Run Code Online (Sandbox Code Playgroud)