description |
---|
Requires multi-signature |
This extension provides an approval condition to trigger a transaction: each role in the roles argument must call the sign transaction in order to be able to call the signed transaction.
It is very likely that this extension be soon promoted to a native action instruction.
{% code title="signed_by_all.arlx" %}
archetype extension signedbyall (
action[%signedbyall roles%] aTransaction
) = {
asset signer_<%aTransaction> identified by id_<%aTransation> = {
id_<%aTransaction> : address;
}
action sign_<%aTransaction> = {
called by roles (* do not forget this *)
effect {
signer_<%aTransaction>.add { id_<%aTransaction> = caller }
}
}
action aTransaction = {
require {
requires;
<%aTransaction>_signedbyall :
signer_<%aTransaction>.count() = roles.count()
}
}
}
{% endcode %}