区块链使用记录
- 参考资料
- FAQ
-
- [部署智能合约遇到Network up to date.错误](#部署智能合约遇到Network up to date.错误)
- [hit an invalid opcode while deploying. Try:](#hit an invalid opcode while deploying. Try:)
参考资料
FAQ
部署智能合约遇到Network up to date.错误
参考 部署智能合约遇到Network up to date.错误 truffle migrate
查找是以数字开头的 js
文件
通过命令方式创建
sh
truffle create migration deploy_demo
hit an invalid opcode while deploying. Try:
sh
"Ballot" hit an invalid opcode while deploying. Try:
* Verifying that your constructor params satisfy all assert conditions.
* Verifying your constructor code doesn't access an array out of bounds.
* Adding reason strings to your assert statements.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: *** Deployment Failed ***
"Ballot" hit an invalid opcode while deploying. Try:
* Verifying that your constructor params satisfy all assert conditions.
* Verifying your constructor code doesn't access an array out of bounds.
* Adding reason strings to your assert statements.
参考truffle初始化的项目在部署(migrate)的时候出现invalid opcode的异常
对 truffle-config.js
使用下面这个
js
compilers: {
solc: {
version: "0.8.21", // Fetch exact version from solc-bin (default: truffle's version)
docker: false, // 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"
}
}
},