区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
知识分享小能手2 小时前
Ubuntu入门学习教程,从入门到精通,Ubuntu 22.04 中的区块链 —— 知识点详解 (23)
学习·ubuntu·区块链
电报号dapp11914 小时前
钱包开发:在虚无中为数字自我筑巢
游戏·去中心化·区块链·智能合约
数据大魔方20 小时前
【期货量化入门】期权交易入门:从零开始学期权量化(TqSdk完整教程)
数据库·python·mysql·算法·区块链·程序员创富
期货资管源码20 小时前
期货资管分仓软件开发/平台搭建经验分享
经验分享·算法·eclipse·区块链
数据皮皮侠AI1 天前
上市公司股票名称相似度(1990-2025)
大数据·人工智能·笔记·区块链·能源·1024程序员节
LYFlied1 天前
WebGPU与浏览器边缘智能:开启去中心化AI新纪元
前端·人工智能·大模型·去中心化·区块链
电报号dapp1192 天前
DApp开发:从数字工具到自治理社会系统的构建之路
web3·去中心化·区块链·智能合约
MQLYES2 天前
02-BTC-密码学原理
区块链·密码学·哈希算法
电报号dapp1192 天前
公链开发:在数字丛林中构建文明
web3·去中心化·区块链·智能合约
Cvmax2 天前
Hyperliquid:革命性的去中心化交易平台
去中心化·区块链