Creation and Initialization
Create a Routines Contract
Hosts use the deploy
function to have the Factory clone the model (which, as mentioned, contains the standard logic):
When the Factory does this, it calls the init
function for the Routines contract, passing the encoded data
as a data
parameter.
The init
function works as follow:
_extension
-> theaddress
of the deployed extension to be linked to the contract. If it passed asaddress(0)
, a new Extension is cloned and deployed.extensionInitData
-> the encoded initialize extension data (available if aninit
extension function is provided). The default extension's init data contains the host address.newEntry
-> theFixedInflationEntry
of the contract.newOperations
-> theFixedInflationOperation[]
of the contract.
As noted above, the deployed extension doesn't need to have been initialized before this (and thus an init
function is not provided), but can be done directly through the contract's init
function, passing the extensionInitData
in the payload
.
If the FixedInflationEntry
and FixedInflationOperation[]
parameter was passed in init
function, also the passed Operations are created.
Otherwise, Operations can be created directly using the setEntry
function.
Last updated