1
1
Table of Contents
2
+
2
3
- [ Overview] ( #overview )
3
4
- [ Use Cases] ( #use-cases )
4
5
- [ Core Functionality] ( #core-functionality )
5
6
- [ ` constructor() ` ] ( #constructor )
6
7
- [ ` execute_transaction() ` ] ( #execute_transaction )
7
8
- [ ` set_threshold() ` ] ( #set_threshold )
8
9
- [ ` set_weight() ` ] ( #set_weight )
9
- - [ ` transfer() ` ] ( #transfer )
10
10
- [ State Checks] ( #state-checks )
11
11
- [ ` approval_weight() ` ] ( #approval_weight )
12
12
- [ ` balance() ` ] ( #balance )
13
13
- [ ` nonce() ` ] ( #nonce )
14
14
- [ ` threshold() ` ] ( #threshold )
15
15
- [ Utilities] ( #utilities )
16
- - [ ` transaction_hash() ` ] ( #transaction_hash )
17
- - [ ` threshold_hash() ` ] ( #threshold_hash )
18
- - [ ` weight_hash() ` ] ( #weight_hash )
16
+ - [ ` compute_hash() ` ] ( #compute_hash )
19
17
- [ Sequence Diagram] ( #sequence-diagram )
20
18
21
19
# Overview
@@ -43,16 +41,15 @@ If you are interested in a functional overview then this is the section for you.
43
41
44
42
### ` execute_transaction() `
45
43
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] .
56
53
57
54
### ` set_threshold() `
58
55
@@ -74,20 +71,6 @@ If you are interested in a functional overview then this is the section for you.
74
71
3 . The number of approvals does not meet the threshold.
75
72
4 . The new total weighting is less than the threshold.
76
73
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
-
91
74
## State Checks
92
75
93
76
### ` approval_weight() `
@@ -109,21 +92,9 @@ If you are interested in a functional overview then this is the section for you.
109
92
110
93
## Utilities
111
94
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() `
125
96
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 .
127
98
128
99
## Sequence Diagram
129
100
0 commit comments