区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
BSV区块链2 天前
关于BSV区块链覆盖网络的常见问题解答(上篇)
网络·区块链
荔家大少2 天前
区块链媒体推广:15个数字解读未来-华媒舍
大数据·区块链·媒体
0x派大星2 天前
Solidity 存储和内存管理:深入理解与高效优化
web3·区块链·智能合约·solidity
0x派大星3 天前
Solidity智能合约中的事件和日志
web3·区块链·智能合约·solidity
_.Switch3 天前
Python Web WebAssembly 与 Python 的协同工作
前端·python·安全·架构·区块链·智能合约·wasm
CertiK4 天前
CertiK《Hack3d:2024年第三季度安全报告》(附报告全文链接)
安全·web3·区块链
Sui_Network4 天前
Sui主网升级至V1.34.2
运维·服务器·物联网·架构·区块链
杏酸雪菲期权4 天前
期权卖方怎么选择权利金高的品种,期货VIX高低对行情有什么影响
区块链
CertiK5 天前
Techub专访顾荣辉教授:解密CertiK的安全战略路线
安全·区块链·web3.0
苏格拉真没有底5 天前
Web3.0 应用项目
区块链