{"id":20185140,"url":"https://github.com/aeternity/ga-multisig-contract","last_synced_at":"2025-04-10T06:11:33.781Z","repository":{"id":38833976,"uuid":"449653012","full_name":"aeternity/ga-multisig-contract","owner":"aeternity","description":"This contract can be used to convert a regular, plain-old account (POA) into a MultiSig account using the Generalized Account feature of æternity.","archived":false,"fork":false,"pushed_at":"2023-05-17T07:22:23.000Z","size":414,"stargazers_count":3,"open_issues_count":3,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T07:21:46.710Z","etag":null,"topics":["aelabs","generalized-account","multisig","smart-contract"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeternity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-19T10:52:00.000Z","updated_at":"2024-03-13T01:42:00.000Z","dependencies_parsed_at":"2024-11-14T03:11:43.336Z","dependency_job_id":null,"html_url":"https://github.com/aeternity/ga-multisig-contract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeternity%2Fga-multisig-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeternity%2Fga-multisig-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeternity%2Fga-multisig-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeternity%2Fga-multisig-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeternity","download_url":"https://codeload.github.com/aeternity/ga-multisig-contract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aelabs","generalized-account","multisig","smart-contract"],"created_at":"2024-11-14T03:11:39.346Z","updated_at":"2025-04-10T06:11:33.745Z","avatar_url":"https://github.com/aeternity.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple MultiSig contract as Generalized Account\nThe [SimpleGAMultiSig](./contracts/SimpleGAMultiSig.aes) contract can be used to convert a regular, plain-old account (POA) into a MultiSig account using the [Generalized Account](https://aeternity.com/protocol/generalized_accounts/ga_explained.html) feature of [aeternity](https://aeternity.com).\n\nBy performing a [GaAttachTx](https://aeternity.com/protocol/generalized_accounts/index.html#ga_attach_tx) 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.\n\n## Features \u0026 limitations\n\n- Provide a set of signers\n    - minimum 2\n- Provide the amount of confirmations need for a tx to be authorized\n    - minimum 2\n    - must not exceed amount of signers\n- It's only possible to propose one tx at the same time \u0026 in order to be able to propose a new tx the current tx needs to be:\n    - authorized (executed)\n    - expired\n    - revoked\n- Signers \u0026 amount of required confirmations cannot be changed after attaching the GA MultiSig\n- Currently the contract needs to handle fee protection to prevent malicious behavior of miners\n    - reasonable default values have been defined by default\n    - the values can be changed by any signer\n    - it's expected that a future hardfork introduces handling the fee protection on protocol level\n        - to prepare for this the fee protection handling on contract level can be disabled later on\n\n## Contract entrypoints\n\n### Stateful\n- `init(int, Set.set)`\n    - params\n        - `int` is the amount of confirmations required for a tx to be authorized\n        - `Set.set` a set of signers which will be authorized to propose and confirm transactions\n    - can be used to initialize the GA\n- `authorize(int)`\n    - params\n        - `int` the nonce to be used for authorizing the tx\n    - can only be called in the `Auth`-Context in a [GaMetaTx](https://aeternity.com/protocol/generalized_accounts/index.html#meta_tx)\n    - can only be executed if there is a tx proposed and confirmed by the required amount of signers\n- `propose(hash, Chain.ttl)`\n    - params\n        - `hash` the tx-hash of the meta transaction that should be authorized\n        - `Chain.ttl` the ttl that indicates when the tx-proposal expire\n    - can be called to propose a new tx\n- `confirm(hash)`\n    - params\n        - `hash` the tx-hash of the meta transaction that should be authorized\n    - can be called to confirm the currently proposed tx\n- `refuse(hash)`\n    - params\n        - `hash` the tx-hash of the meta transaction that should be authorized\n    - can be called by co-signers to refuse the currently proposed tx\n        - once enough signers refused, the tx will automatically be revoked\n- `revoke(hash)`\n    - params\n        - `hash` the tx-hash of the meta transaction that should be authorized\n    - can be called by the proposer only to explicitely revoke the currently proposed tx\n- `update_fee_protection(fee_protection)`\n    - params\n        - `fee_protection` object with `int`-attributes `max_fee` and `max_gasprice`\n    - can be called by any signer in order to change the fee protection settings\n- `disable_fee_protection()`\n    - can be called by any signer in order to disable handling the fee protection in the contract\n    - Note:\n        - we expect fee protection to be handled by the æternity protocol introduced in a future hardfork\n        - can only be called once\n\n### Read only\nThese entrypoints are mainly for information purposes and required to build a meaningsful management UI that can handle MultiSig transactions.\n\n- `get_version()`\n    - returns the version of the GA MultiSig contract\n- `is_fee_protection_enabled()`\n    - returns if the fee protection on contract-level is enabled\n- `get_fee_protection()`\n    - returns the values `max_fee` and `max_gasprice` which are used to protect from malicious miners\n- `get_signers()`\n    - returns the list of all signers\n- `get_nonce()`\n    - returns the required nonce to authorize the tx\n- `get_consensus_info()`\n    - returns a record with all information needed for users and interfaces to manage the GA that contains following properties:\n        - `ga_tx_hash` the (optional) hash of the proposed meta-transaction to be authorized\n        - `confirmations_required` the amount of confirmations required to authorize a tx\n        - `confirmed_by` a list of all signers that confirmed the proposed tx\n        - `refused_by` a list of all signers that refused the proposed tx\n        - `has_consensus` bool that indicates if the proposed tx was confirmed by a sufficient amount of signers\n        - `expiration_height` the block height where the proposed tx expires\n        - `expired` bool that indicates if the proposed tx is expired\n        - `proposed_by` refers to the address of the individual who initiated the proposal\n\n## Events\nFollowing events are emitted if users perform certain actions on the contract of the GA:\n\n- `TxProposed(hash, address, int)` if one of the signers proposes a new transaction\n    - `hash` the tx-hash of the meta transaction that should be authorized\n    - `address` the address of the co-signer that proposed the tx\n    - `int` the height where the tx will expire\n- `TxConfirmed(hash, address)`\n    - `hash` the tx-hash of the meta transaction that should be authorized\n    - `address` the address of the co-signer that proposed the tx\n- `TxRefused(hash, address)`\n    - `hash` the tx-hash of the meta transaction that should be authorized\n    - `address` the address of the co-signer that refused the tx\n- `TxConsensusReached(hash)`\n    - `hash` the tx-hash of the meta transaction that reached consensus (as soon as this event is emitted the tx can be authorized)\n- `TxConsensusLost(hash)`\n    - `hash` the tx-hash of the meta transaction that lost consensus, e.g. if a signer refuses a previously confirmed tx\n- `TxRevoked(hash, address)`\n    - `hash` the tx-hash of the meta transaction that has been revoked\n    - `address` the address of the co-signer that revoked the tx\n- `TxAuthorized(hash)`\n    - `hash` the tx-hash of the meta transaction that has been authorized\n- `FeeProtectionDisabled(address)`\n    - `address` the signer that disabled the fee protection\n\n## Disclaimer\nThis smart contract has not been security audited yet.\n\nUse it at your own risk!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeternity%2Fga-multisig-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeternity%2Fga-multisig-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeternity%2Fga-multisig-contract/lists"}