区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
kida_yuan3 天前
【以太来袭】4. Geth 原理与解析
区块链
blockcoach5 天前
刘教链|金融市场中的物理学规律:平方根定律
区块链
碳链价值5 天前
吴忌寒清仓比特币背后
区块链
blockcoach5 天前
刘教链|BTC的时光机
区块链
lsrsyx5 天前
TEBBIT:以安全、创新与服务,重塑您的数字资产交易体验
安全·区块链
lsrsyx5 天前
Icoin:当市场归于理性,强者浮出水面
区块链
反向跟单策略6 天前
期货反向跟单-2025年回顾及2026年展望
大数据·人工智能·学习·数据分析·区块链
kida_yuan6 天前
【以太来袭】3. Geth 知识点归纳
区块链
OneBlock Community6 天前
Polkadot Hub 已实现 2 秒出块,下一步 0.5 秒!
区块链