The SimpleGAMultiSig contract can be used to convert a regular, plain-old account (POA) into a MultiSig account using the Generalized Account feature of aeternity.
By performing a GaAttachTx you can convert your POA into a GA by deploying the MultiSig contract that contains a special authorize
function. This authorize
function will then always be called by the protocol to authorize future transactions of this account.
- Provide a set of signers
- minimum 2
- Provide the amount of confirmations need for a tx to be authorized
- minimum 2
- must not exceed amount of signers
- It's only possible to propose one tx at the same time & in order to be able to propose a new tx the current tx needs to be:
- authorized (executed)
- expired
- revoked
- Signers & amount of required confirmations cannot be changed after attaching the GA MultiSig
- Currently the contract needs to handle fee protection to prevent malicious behavior of miners
- reasonable default values have been defined by default
- the values can be changed by any signer
- it's expected that a future hardfork introduces handling the fee protection on protocol level
- to prepare for this the fee protection handling on contract level can be disabled later on
init(int, Set.set)
- params
int
is the amount of confirmations required for a tx to be authorizedSet.set
a set of signers which will be authorized to propose and confirm transactions
- can be used to initialize the GA
- params
authorize(int)
- params
int
the nonce to be used for authorizing the tx
- can only be called in the
Auth
-Context in a GaMetaTx - can only be executed if there is a tx proposed and confirmed by the required amount of signers
- params
propose(hash, Chain.ttl)
- params
hash
the tx-hash of the meta transaction that should be authorizedChain.ttl
the ttl that indicates when the tx-proposal expire
- can be called to propose a new tx
- params
confirm(hash)
- params
hash
the tx-hash of the meta transaction that should be authorized
- can be called to confirm the currently proposed tx
- params
refuse(hash)
- params
hash
the tx-hash of the meta transaction that should be authorized
- can be called by co-signers to refuse the currently proposed tx
- once enough signers refused, the tx will automatically be revoked
- params
revoke(hash)
- params
hash
the tx-hash of the meta transaction that should be authorized
- can be called by the proposer only to explicitely revoke the currently proposed tx
- params
update_fee_protection(fee_protection)
- params
fee_protection
object withint
-attributesmax_fee
andmax_gasprice
- can be called by any signer in order to change the fee protection settings
- params
disable_fee_protection()
- can be called by any signer in order to disable handling the fee protection in the contract
- Note:
- we expect fee protection to be handled by the æternity protocol introduced in a future hardfork
- can only be called once
These entrypoints are mainly for information purposes and required to build a meaningsful management UI that can handle MultiSig transactions.
get_version()
- returns the version of the GA MultiSig contract
is_fee_protection_enabled()
- returns if the fee protection on contract-level is enabled
get_fee_protection()
- returns the values
max_fee
andmax_gasprice
which are used to protect from malicious miners
- returns the values
get_signers()
- returns the list of all signers
get_nonce()
- returns the required nonce to authorize the tx
get_consensus_info()
- returns a record with all information needed for users and interfaces to manage the GA that contains following properties:
ga_tx_hash
the (optional) hash of the proposed meta-transaction to be authorizedconfirmations_required
the amount of confirmations required to authorize a txconfirmed_by
a list of all signers that confirmed the proposed txrefused_by
a list of all signers that refused the proposed txhas_consensus
bool that indicates if the proposed tx was confirmed by a sufficient amount of signersexpiration_height
the block height where the proposed tx expiresexpired
bool that indicates if the proposed tx is expiredproposed_by
refers to the address of the individual who initiated the proposal
- returns a record with all information needed for users and interfaces to manage the GA that contains following properties:
Following events are emitted if users perform certain actions on the contract of the GA:
TxProposed(hash, address, int)
if one of the signers proposes a new transactionhash
the tx-hash of the meta transaction that should be authorizedaddress
the address of the co-signer that proposed the txint
the height where the tx will expire
TxConfirmed(hash, address)
hash
the tx-hash of the meta transaction that should be authorizedaddress
the address of the co-signer that proposed the tx
TxRefused(hash, address)
hash
the tx-hash of the meta transaction that should be authorizedaddress
the address of the co-signer that refused the tx
TxConsensusReached(hash)
hash
the tx-hash of the meta transaction that reached consensus (as soon as this event is emitted the tx can be authorized)
TxConsensusLost(hash)
hash
the tx-hash of the meta transaction that lost consensus, e.g. if a signer refuses a previously confirmed tx
TxRevoked(hash, address)
hash
the tx-hash of the meta transaction that has been revokedaddress
the address of the co-signer that revoked the tx
TxAuthorized(hash)
hash
the tx-hash of the meta transaction that has been authorized
FeeProtectionDisabled(address)
address
the signer that disabled the fee protection
This smart contract has not been security audited yet.
Use it at your own risk!