区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
ZDGJ609916 小时前
新手小白了解国际期货先了解哪一步
区块链
重明链迹实验室2 天前
重明链迹丨每周区块链安全要闻(0921-0927)
安全·web3·区块链
AIFQuant9 天前
ETF行情API接入踩坑记:从报错到跑通的七个问题
python·金融·区块链·etf·基金
磐链科技10 天前
DApp 前端开发指南:钱包连接与链上数据交互实践
区块链·智能合约
磐链科技10 天前
DApp 智能合约开发详解:Solidity 编写、测试与部署全流程
区块链
ACME204410 天前
江浙沪商铺投资胜负手
区块链
baopixiaoz10 天前
BeeQuant × BeeAgent:用AI加速策略验证
大数据·人工智能·python·区块链
磐链科技11 天前
区块链开发公司发展趋势分析:智能合约、DApp与行业数字化应用探索
区块链·智能合约