I have several contrats to deploy on different chains. Normally, when I just deploy the contract with truffle-v5 it creates/updates json object of artifacts by the path ./build/contracts/MyContract.json
for each chain id.
So if I do in 1_MyContract.js
const GnosisSafe = artifacts.require("GnosisSafe");
await deployer.deploy(SafeProxy, DEPLOYED.GNOSIS_SAFE_MASTERCOPY);
safeProxyInstance = await SafeProxy.deployed();
I can use this contracts in the next migrator script, 2_MySecondContract.js just like this:
const GnosisSafe = artifacts.require("GnosisSafe");
safeProxyInstance = await SafeProxy.deployed();
it's already knows chain, address etc because first script saved that info into json object.
If I don't want to deploy new instance of the contract during migration I can use via at() function:
safeProxyInstance = await SafeProxy.at(DEPLOYED.MULTISIG);
but when I do the line above - it doesn't update json artifact object.
The question
What can I do to update json artifact object for the existing instance of the contact for particular chain?