I have a simple question.
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?
Does the SDK support this?
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
p.s. pro tip for local dev: we recently launched Flow CLI super commands which allows address-less imports and auto-deployment of contracts: Using Super Commands with the Flow CLI | Flow Blockchain
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.
.config() // returns the config instance
.put("0xFungibleToken", "0x5644asd54a5s4d5") // configures "0xFungibleToken" to be "0x5644asd54a5s4d5"
.put("0xNonFungibleToken", "0xd54a5sd5445488"); // configures "0xNonFungibleToken" to be "0xd54a5sd5445488"