区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
大今野1 天前
人工智能与区块链核心考点全解析
人工智能·区块链·uml·专转本
莫叫石榴姐1 天前
现货黄金技术分析:3427破而复收之后,关键价位与下周情景推演
区块链·可信计算技术
OxYGC1 天前
[Web3] 钱包业务第十五篇: Bitcoin 链调研与钱包开发
web3·区块链·以太坊·比特币
OxYGC2 天前
[Web3] 钱包业务第十三篇: Ethereum 钱包链调研实战
web3·区块链·以太坊·比特币
大今野3 天前
2026 专转本计算机|区块链典型框架:以太坊与超级账本 Fabric 考点全解(附例题)
运维·区块链·fabric·专转本
OxYGC8 天前
[Web3] 智能合约 19: NFT 知识与 Web3 求职指南
区块链·智能合约·求职招聘·nft
OxYGC9 天前
[Web3] 智能合约 00: 系列总览与目录
web3·区块链·智能合约·solidity
Bczheng111 天前
五十六.网络(6)--广播tx测试
区块链
笑容掩饰我的失落16 天前
区块链从小白到精通(十):合约安全与上线——重入攻击、Gas 优化与最佳实践
安全·区块链
OxYGC17 天前
[Web3] 智能合约 04: 高级开发实战与 OpenZeppelin
web3·区块链·智能合约