Is it possible to call functions from contracts within a migration on Truffle?

394 Views Asked by At

Is it possible to call functions from contracts within a migration? I try to interact with a contract that has already been deployed by another migration, but truffle doesn't recognize that this function exists within the contract! If migrations can't call contract functions, how do I interact with the contract without using truffle develop?

My migration: enter image description here

Truffle:

enter image description here

1

There are 1 best solutions below

0
On

Try This:

let myNewContract = await MyNewContract.at((await MyOldContract.deployed()).address);

That will create an object using your new logic contract that is located at the address of your proxy (the permanent address).