I'm trying to migrate a test smart contract and when I type the command I'm getting a "ReferenceError: Migrations is not defined" NOTE: The error is for my second file, the first one is migrated without any problem. Here's a screenshot of the full error message:
Files in use:
I'll leave the code of each file below:
Ethswap.sol:
pragma solidity ^0.5.0;
contract EthSwap {
string public name = "EthSwap Instant Exchange";
}
2_deploy_contracts.js:
const EthSwap = artifacts.require("EthSwap");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
1_initial_migration.js:
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
I'd deeply appreciate a solution!
In your 2_deploy_contract.js
, Migration
is not declared.
Instead of
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
Change it to
module.exports = function(deployer) {
deployer.deploy(EthSwap);
};