Skip to content

Commit fd42a55

Browse files
committed
Updated specification
1 parent 93e8b59 commit fd42a55

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed
0 Bytes
Loading

multisig-wallet/.docs/sequence-diagram.drawio

Lines changed: 0 additions & 1 deletion
This file was deleted.

multisig-wallet/project/SPECIFICATION.md

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
Table of Contents
2+
23
- [Overview](#overview)
34
- [Use Cases](#use-cases)
45
- [Core Functionality](#core-functionality)
56
- [`constructor()`](#constructor)
67
- [`execute_transaction()`](#execute_transaction)
78
- [`set_threshold()`](#set_threshold)
89
- [`set_weight()`](#set_weight)
9-
- [`transfer()`](#transfer)
1010
- [State Checks](#state-checks)
1111
- [`approval_weight()`](#approval_weight)
1212
- [`balance()`](#balance)
1313
- [`nonce()`](#nonce)
1414
- [`threshold()`](#threshold)
1515
- [Utilities](#utilities)
16-
- [`transaction_hash()`](#transaction_hash)
17-
- [`threshold_hash()`](#threshold_hash)
18-
- [`weight_hash()`](#weight_hash)
16+
- [`compute_hash()`](#compute_hash)
1917
- [Sequence Diagram](#sequence-diagram)
2018

2119
# Overview
@@ -43,16 +41,15 @@ If you are interested in a functional overview then this is the section for you.
4341

4442
### `execute_transaction()`
4543

46-
1. Execute a transaction, formed from the parameters.
47-
> **NOTE** This functionality is not yet fully implemented.
48-
1. If the constructor has been called.
49-
2. If signature recovery is successful.
50-
3. If the recovered addresses are in ascending order.
51-
4. If the number of approvals, from the owners whose addresses were recovered, meets the threshold.
52-
5. Requires `data`; the data field of the transaction to be executed.
53-
6. Requires `signatures`; The information for each of the signatures submitted to approve a specific transaction.
54-
7. Requires `to`; The recipient of the transaction to be executed.
55-
8. Requires `value`; The value sent in the transaction to be executed.
44+
1. Execute either a transfer or a contract call.
45+
2. Reverts when:
46+
1. The constructor has not been called to initialize the contract.
47+
2. Attempting to transfer with `transfer_params.value` as [Option::None].
48+
3. The amount of the asset being sent is greater than the balance in the contract.
49+
4. The public key cannot be recovered from a signature.
50+
5. The recovered addresses in `count_approvals `are not in ascending order (0x1 < 0x2 < 0x3...) [b256].
51+
6. The total approval count is less than the required threshold for execution.
52+
7. Attempting to call when `target` is not a [Identity::ContractId].
5653

5754
### `set_threshold()`
5855

@@ -74,20 +71,6 @@ If you are interested in a functional overview then this is the section for you.
7471
3. The number of approvals does not meet the threshold.
7572
4. The new total weighting is less than the threshold.
7673

77-
### `transfer()`
78-
79-
1. Transfers assets, via a transaction formed from the parameters.
80-
1. If the constructor has been called.
81-
2. If signature recovery is successful.
82-
3. If the recovered addresses are in ascending order.
83-
4. If the number of approvals, from the owners whose addresses were recovered, meets the threshold.
84-
5. Requires `asset_id`: the contract ID of the asset to be transferred.
85-
6. Requires `data`; the data field of the transaction.
86-
7. Requires `signatures`; The information for each of the signatures submitted to approve a specific transaction.
87-
8. Requires `to`; The recipient of the transaction.
88-
9. Requires `value`; The value sent in the transaction.
89-
1. If the contract owns enough of the asset to be transferred.
90-
9174
## State Checks
9275

9376
### `approval_weight()`
@@ -109,21 +92,9 @@ If you are interested in a functional overview then this is the section for you.
10992

11093
## Utilities
11194

112-
### `transaction_hash()`
113-
114-
1. Returns the hash of a transaction, comprised of the parameters. This is a utility for getting a transaction hash to sign over.
115-
1. Requires `data`; The data field of the transaction.
116-
2. Requires `nonce`; The nonce field of the transaction.
117-
3. Requires `to`; The recipient of the transaction.
118-
4. Requires `value`; The value sent in the transaction.
119-
120-
### `threshold_hash()`
121-
122-
1. Returns the hash of a transaction used to change the threshold for execution.
123-
124-
### `weight_hash()`
95+
### `compute_hash()`
12596

126-
1. Returns the hash of a transaction used to change the weight of a user.
97+
1. Takes a struct comprised of transaction data and hashes it.
12798

12899
## Sequence Diagram
129100

0 commit comments

Comments
 (0)