tyronbrand/flow.net

Add ability to inject imported contract address for transactions

Closed this issue · 2 comments

There should be a way to pass in contract addresses into transactions in order to avoid hard-coding them into the cadence code. Transactions tend to have the following form

import FungibleToken from 0xFungibleToken
transaction(arg1: String, arg2...) {
    prepare(acct: AuthAccount) {
         <some code>
    }
    execute {
        <some code>
    }
}

The value of 0xFungibleToken will change based on which environment the user is using

This should work similarly to the addressMap in flow-js-testing library

I think this is a great feature to add. I shall review your pull request soon.

Pull request has been merged. Thanks for your contribution :)