I'm trying to call a contract I've created.
I've set up my truffle deployment script like so:
var SafeYieldAggregator = artifacts.require("SafeYieldAggregator")
module.exports = function(deployer) {
deployer.deploy(SafeYieldAggregator);
};
I've Run:
truffle compile truffle migrate
Which returns the output:
Compiling your contracts... =========================== √ Fetching solc version list from solc-bin. Attempt #1 Everything is up to date, there is nothing to compile.
Inside my app I attach my truffle contract $.getJSON('SafeYieldAggregator.json', function(data) { // Get the necessary contract artifact file and instantiate it with @truffle/contract var safeYieldArtifact = data; App.contracts.SafeYieldAggregator = TruffleContract(safeYieldArtifact);
// Set the provider for our contract
App.contracts.SafeYieldAggregator.setProvider(App.web3Provider);
});
And then I try to call my contract:
App.contracts.SafeYieldAggregator.deployed().then(function(instance) {
yieldAggregatorInstance = instance;
// Execute adopt as a transaction by sending account
return yieldAggregatorInstance.supply(1, {from: account});
})
I get an error:
Contract has not been deployed to detected network (network/artifact mismatch)
My best guess is that truffle thinks this has been deployed appropriately. My config is setup like:
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
},
develop: {
port: 8545
}
}
and I'm running the ganache-cli on the same port forking the main net