Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 937 Bytes

signed-by-all.md

File metadata and controls

40 lines (30 loc) · 937 Bytes
description
Requires multi-signature

Signed by all

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 %}