区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
薛定e的猫咪7 小时前
区块链、NFT、DeFi深度拆解:从零搭建Web3知识体系
web3·区块链
北冥you鱼12 小时前
深入解析 DEX 项目池流动性设计原理:从恒定乘积到集中流动性
人工智能·区块链
普通网友1 天前
共识算法实现:从工作量证明到权益证明的演进
算法·区块链·共识算法
ZDGJ60991 天前
国际期货开通需要满足哪些条件 ?流程复杂吗?
区块链
ZDGJ60992 天前
外盘期货与内盘期货交易规则差异
区块链
IvorySQL4 天前
PG 日报|优化缓冲区批量扫描,降低多套接字并发竞争
数据库·人工智能·postgresql·开源·区块链
mrbande4 天前
Vatee万腾:把信息透明度做扎实,更谨慎的使用者更容易感受到的清单
区块链
Web3李李4 天前
Web3 创业最大误区:DApp 能跑≠能上线!无数项目死在这个
金融·web3·区块链·智能合约·软件开发·dapp开发·defi开发
ithadoop4 天前
CLOB-FIRST:当永续合约把“订单簿“重新变成主角
区块链·clob·amm·永续合约·hyperliquid·dydx v4·gmx v2
ZDGJ60995 天前
外盘期货与内盘期货交易时间核心区别
区块链