区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
东南门吹雪4 小时前
PostgreSQL与MySQL的锁与隔离级别
mysql·postgresql·区块链
5***790010 小时前
Rust在区块链智能合约中的安全实践
rust·区块链·智能合约
MicroTech202511 小时前
微算法科技(NASDAQ :MLGO)基于区块链的混合数据驱动认知算法:开启智能安全新范式
科技·安全·区块链
wangchenggong198819 小时前
Foundry初始化、编译、测试、部署智能合约全流程介绍
区块链·智能合约
矶鹬笛手20 小时前
(2.2) 新一代信息技术及应用
大数据·云计算·区块链·时序数据库
u***09641 天前
Web3去中心化身份
web3·去中心化·区块链
1***Q7842 天前
Web3去中心化存储
web3·去中心化·区块链
p***43482 天前
Web3在社交网络中的去中心化
web3·去中心化·区块链
OpenBuild.xyz3 天前
加密三重演进:Balaji 眼中的 “去中心化 - 可编程 - 隐私化” 完整链路
去中心化·区块链
掘金安东尼3 天前
Solana 链条:为什么这个“最快的区块链”
区块链