Publish with contract references
Users can now publish their contracts with contract references in deploy params.
What this means is, if there are address params in your contract's constructor, you can provide a reference to another published contract for those params. These reference contracts will then be deterministically deployed before deploying your contract.
You can specify these references in publish form as shown below:
For e.g., _owner
param is of type address
and allows publisher to specify a contract reference. You can do this by selecting Dynamic Input
and providing details of the published contract. Please note that the contract being set as reference should be a published contract with default values pre-filled.
You can also setup a chain of such references, i.e. a referenced contract has another reference contract in its deploy params, and so on.
In addition to the address
type, you can also provide dynamic inputs for bytes
params. For e.g., if the bytes param is composed of address
, uint256
, and bool
, you can specify these values instead of giving an encoded bytes value. These will be encoded during deployment. The address param within this bytes param can again be a dynamic reference. See below:
This feature works for address[]
and bytes[]
params too.