【问题标题】:Migrations are not being processed未处理迁移
【发布时间】:2019-02-03 14:43:54
【问题描述】:

我正在尝试迁移选举文件,但没有进行迁移。

我尝试运行 truffle migrate --reset 和重新迁移过程,但没有任何反应。

Elections.sol

pragma solidity ^0.5.0;

contracts Election{
    string public candidate;

    constructor() public{
        candidate="Candidate 1"
    }
}

2_deploy_contracts.js

var Election = artifacts.require("./Election.sol");

module.exports = function(deployer) {
  deployer.deploy(Election);
};

【问题讨论】:

    标签: ethereum solidity


    【解决方案1】:

    你是否已经编译了你的智能合约?

    所以,首先修复语法错误:

    contract Election {
        string public candidate;
    
        constructor() public{
            candidate="Candidate 1";
        }
    }
    

    然后编译你的合约:

    truffle compile
    

    之后,迁移:

    truffle migrate
    

    【讨论】:

      猜你喜欢
      • 2021-05-01
      • 1970-01-01
      • 2021-07-19
      • 2020-04-05
      • 2020-04-02
      • 2013-06-02
      • 2013-06-01
      • 2012-03-08
      • 2021-01-21
      相关资源
      最近更新 更多