As far as I know Flow will allows for multiple contracts to be deployed on the same account.
Currently in the Go SDK, flow.Account
has a field to access the contract code, Code
. At the same time there’s also Contracts
which is always nil
for now. Will Code
be deprecated in favor of Contracts
when multiple contracts per-account comes?
1 Like
Hi yondercode.
Thats correct. After multiple contracts per accounts feature is deployed the Code field will always be nil and the Contracts field will be the one to use if you want to know what is deployed.
Some extra info:
- currently you can deploy exactly one contract definition and multiple contract interface definitions under code.
- after the change you will be able to deploy only one contract definition or contract interface definition under the code for one Contract. The Contract name (as in the parameters of
acct.contracts.add(name: name, code: code)
) needs to be the same as the contract (interface) definition name in the actual code (this is checked and the TX will fail if it is not).
All currently deployed code will be migrated, so if you have a contract definition named TestContract
and an contract interface definition TestInterface
deployed, you will be able to see their code under Contracts["TestContract"]
and Contracts["TestInterface"]
.
2 Likes