I get the following error when trying to deploy my contract
Error: Migrations has not been deployed to detected network (network/artifact mismatch) at /Users/rohank2/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack:
I used truffle init to create my own truffle project. I initialized a smart contract called Migrations.
here is the code for that smart contract:
pragma solidity ^0.4.23;
contract Migrations{
address public admin;
struct Bank{
string bankname;
string PWCcode;
}
struct graybarbranch{
string branchname ;
uint currentapr;
uint currentdebt;
uint amtreturned;
uint totalborrowed;
string bankborrowedfrom;
}
mapping(address=>Bank) public Banks;
event graybar(address accountaddress,string branchname,uint totalamt);
mapping(address=>graybarbranch) public graybarbranches;
constructor() public {
admin =msg.sender;
}
function borrow(address from, address to,uint currentapr,uint currentamt) public {
graybarbranches[to].bankborrowedfrom=Banks[from].bankname;
graybarbranches[to].currentapr=currentapr;
graybarbranches[to].totalborrowed+=currentamt;
graybarbranches[to].currentdebt=graybarbranches[to].totalborrowed-graybarbranches[to].amtreturned;
}
function ret(address to,uint amt) public {
graybarbranches[to].amtreturned+=amt;
graybarbranches[to].currentdebt=graybarbranches[to].totalborrowed-graybarbranches[to].amtreturned;
}
function initializebank(string bankname,string PWCcode,address ad)public{
Banks[ad].bankname=bankname;
Banks[ad].PWCcode = PWCcode;
}
function initializegraybar(address ad,string branchname) public {
graybarbranches[ad].branchname=branchname;
graybarbranches[ad].currentapr=0;
graybarbranches[ad].currentdebt=0;
graybarbranches[ad].totalborrowed=0;
graybarbranches[ad].amtreturned=0;
}
function display(address ad) public{
emit graybar(ad,graybarbranches[ad].branchname,graybarbranches[ad].totalborrowed);
}
}
and here are the migration files:
var Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
and finally this is my truffle.js file :
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*"
}
}
};
No idea how to interact with the contract.