Factory allows admin to create set of templates that can be then used by anyone to originate any kind of contracts. Factory records any metadata after each contract creation. This can be used to keep tracking contract versions after template update. All this Factory mechanics is experiment that allow to create contracts that follow strictly defined properties (for example: admin can't change splits of the collab contract after it was created). Factory allows to have some records
to be set to allow more variety in lambda execution (but this variety can be achieved by updating template lambdas).
- Expects record with
templateName
which isstring
andparams
which is packedbytes
- Expects packed parameters
- Expects no attached amount
- Originates collab contract using given template and parameters
- Adds originated contract address to the
originatedContracts
ledger withmetadata
returned from template execution - Anyone can call this entrypoint
This entrypoint allows anyone to originate new collab contract using one of the templates provided by factory administrator. To create collab user should provide templateName
, currently in mainnet only one template is supported which is hic_collab
used to interact with h=n and Teia contracts. Calling this entrypoint runs template origination lambda that expecting some packed params
to be executed. This params may vary for different templates. This params should be packed before passing to create_proxy
entrypoint. See MichelsonType.pack method to pack params using PyTezos. See MichelCodePacker.packData method to pack params using taquito.
- Expects record with
name
which isstring
andoriginateFunc
which is(recordsType * bytes) -> originationResult
. AndoriginationResult
is record with originationoperation
, new contractaddress
andmetadata
which is anybytes
that will be written inoriginatedContracts
ledger (it is easier to just read the code I suppose) - Updates given template in
templates
ledger if it was existed under thisname
or adds new template if it wasn't - Expects no attached amount
- Only admin can call this entrypoint
This entrypoint allows to add new templates to the Factory, as well as update existing templates.
- Expects
string
withname
of template that should be removed - Removes template from
templates
ledger disallowing to create new contracts using this template - Expects no attached amount
- Only admin can call this entrypoint
- Expects record with
name
which isstring
with name of added/updated record andvalue
which isbytes
value of this record - Updates given record in
records
ledger if it was existed under thisname
or adds new record if it wasn't - Expects no attached amount
- Only admin can call this entrypoint
This entrypoint allows to add/update record that can be used in templates.
- Expects
string
withname
of record that should be removed - Removes record from
records
ledger - Expects no attached amount
- Only admin can call this entrypoint
- Expects
address
of proposed administrator - Expects no attached amount
- Changes storage
proposedAdministrator
to proposed administrator - Only admin can call this entrypoint
This entrypoint allows to transfer ownership. Proposed administrator should call accept_ownership
to finish ownership transfer.
- Expects
unit
as parameter - Expects no attached amount
- Changes storage
administator
to proposed administrator - Only proposed administrator can call this entrypoint
This entrypoint allows to finish ownership transfer.
- Expects record with
contractAddress
which used to request andcallback
with typecontract(bool)
- Emits transaction with
bool
answer whether this contract address was created by this Factory or it is not - Expects no attached amount
- Anyone can call this entrypoint
This is callback view that can be used to request if given contract address was created by this factory.
AMNT_FRBD
: error raised if entrypoint is not expecting to receive any amount but gets someNOT_ADM
: error raised if entrypoint is expected to be called by admin only and called by anyone elseTEMPLATE_NF
: error raised if trying tocreate_proxy
with template name that not existedNOT_PROPOSED
: error raised if someone tries toaccept_ownership
but his address was not proposedRECORD_NF
: error raised if template during execution tries to read record that not existed
UNPK_FAIL
: error raised if providedparams
can not be unpacked to be used in origination templateEXCEED_MAX_SHARES
: error raised if trying to create collab contract with more shares that it was tested forEXCEED_MAX_PARTICIPANTS
: error raised if trying to create collab with too much participants