区块链使用记录

区块链使用记录

  • 参考资料
  • 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"
      }
    }
  },
相关推荐
0136 小时前
013的加密世界权威指南_第一部分
区块链·虚拟币
CryptoRzz3 天前
越南k线历史数据、IPO新股股票数据接口文档
java·数据库·后端·python·区块链
CryptoPP3 天前
获取越南股票市场列表(包含VN30成分股)实战指南
大数据·服务器·数据库·区块链
链上日记3 天前
OKZOO亮相欧洲区块链大会:HealthFi全球化进程加速
区块链
本郡主是喵4 天前
用 TypeScript 进行 Truffle 测试
学习·区块链
YSGZJJ4 天前
股指期货套期保值的风险有哪些?
区块链
落雪财神意4 天前
股指10月想法
大数据·人工智能·金融·区块链·期股
leijiwen4 天前
农业与供应链类 RWA 落地研究报告
区块链
数据与人工智能律师4 天前
解码Web3:DeFi、GameFi、SocialFi的法律风险警示与合规路径
大数据·网络·人工智能·云计算·区块链
CryptoRzz4 天前
欧美(美股、加拿大股票、墨西哥股票)股票数据接口文档
java·服务器·开发语言·数据库·区块链