1

I deployed two identical contracts on the same blockchain.

contract V1 address:0x48A2a37fF1Cff6eB1984aCA7fCA4cAa25B1C9287

contract V2 address:0xdfaDE9c110eBD5C00243Ca0b3AdCf5B73A8f0e42

However I would like to interact with the contract V1 where I already had some data mapped, yet, when using commands in the truffle console terminal it defaults to contacting the contract V2

let smartContract = await contract.deployed()

contract.address always returns 0xdfaDE9c110eBD5C00243Ca0b3AdCf5B73A8f0e42 an address of contract V2

Does anyone here know truffle commands to interact with the contract directly by its address instead of by its deployed name? So I might connect to contract V1 .

1

You can use this command line :

let smartContract = await contract.at("0x48A2a37fF1Cff6eB1984aCA7fCA4cAa25B1C9287")

smartContract will then refer to contract V1.

1
  • Thanks, man. I will test this out. If it works I will name this as solved.
    – Sky
    May 29 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.