区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
zhang_xiaoyu581 天前
第十届99全球链商节重点项目“全球纸基生态战略联盟”正式签约
区块链
文火冰糖的硅基工坊1 天前
《投资-54》数字资产的形式有哪些?
人工智能·区块链
凡哥btczf6662 天前
Antminer S19 Pro 92T矿机详细参数解析与挖矿能力分析
区块链
qq_508823403 天前
金融数据---股票筹码数据
金融·区块链
致***锌3 天前
50期权日内交易技巧
区块链
CodingBrother3 天前
ABI解析智能合约
区块链·智能合约
.刻舟求剑.3 天前
solidity得高级语法3
区块链·solidity·语法笔记
致***锌3 天前
期货盘后空开是认购期权行权?
区块链
LHminer 凡3 天前
蚂蚁K7 60.5T矿机参数详解:Eaglesong算法,CKB挖矿专用
区块链
许强0xq3 天前
Ethernaut Level 1: Fallback - 回退函数权限提升攻击
区块链·solidity·foundry·ethernaut