I am using one more scripts and transactions files. I deployed my app to production i want to use mainnet contract address, or trying to debug i want to use testnet address.
I am changing everytime my contract address. How can i do that with correct way?
Hey there! I think what youโre looking for is using the flow.json aliases + env variables to fill in the correct address/contexts for scripts and transactions on mainnet/testnet. Check out this recent scaffold for an example: https://github.com/chasefleming/fcl-next-scaffold
Yep Andrea.
We used your method.
We changed our token address like this : 0xFungibleToken.
And then we want to change address on replace the our contract address.
Pseudo code:
fcl
.config() // returns the config instance
.put("0xFungibleToken", "0x5644asd54a5s4d5") // configures "0xFungibleToken" to be "0x5644asd54a5s4d5"
.put("0xNonFungibleToken", "0xd54a5sd5445488"); // configures "0xNonFungibleToken" to be "0xd54a5sd5445488"