Skip to content

Commit dec9b24

Browse files
authored
Rename smart account factory callbacks (#394)
* rename account factory callbacks * docs update * pkg update
1 parent 9e0e825 commit dec9b24

File tree

10 files changed

+103
-103
lines changed

10 files changed

+103
-103
lines changed

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thirdweb-dev/contracts",
33
"description": "Collection of smart contracts deployable via the thirdweb SDK, dashboard and CLI",
4-
"version": "3.5.3",
4+
"version": "3.5.4",
55
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",

contracts/smart-wallet/interfaces/IAccountFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ interface IAccountFactory {
2323
function createAccount(address admin, bytes calldata _data) external returns (address account);
2424

2525
/// @notice Callback function for an Account to register its signers.
26-
function addSigner(address signer) external;
26+
function onSignerAdded(address signer) external;
2727

2828
/// @notice Callback function for an Account to un-register its signers.
29-
function removeSigner(address signer) external;
29+
function onSignerRemoved(address signer) external;
3030

3131
/*///////////////////////////////////////////////////////////////
3232
View Functions

contracts/smart-wallet/non-upgradeable/Account.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ contract Account is
198198
super._setupRole(role, account);
199199

200200
if (role == SIGNER_ROLE && factory.code.length > 0) {
201-
AccountFactory(factory).addSigner(account);
201+
AccountFactory(factory).onSignerAdded(account);
202202
}
203203
}
204204

@@ -207,7 +207,7 @@ contract Account is
207207
super._revokeRole(role, account);
208208

209209
if (role == SIGNER_ROLE && factory.code.length > 0) {
210-
AccountFactory(factory).removeSigner(account);
210+
AccountFactory(factory).onSignerRemoved(account);
211211
}
212212
}
213213

contracts/smart-wallet/utils/AccountExtension.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ contract AccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Hold
126126
super._setupRole(role, account);
127127

128128
if (role == SIGNER_ROLE && factory.code.length > 0) {
129-
IAccountFactory(factory).addSigner(account);
129+
IAccountFactory(factory).onSignerAdded(account);
130130
}
131131
}
132132

@@ -135,7 +135,7 @@ contract AccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Hold
135135
super._revokeRole(role, account);
136136

137137
if (role == SIGNER_ROLE && factory.code.length > 0) {
138-
IAccountFactory(factory).removeSigner(account);
138+
IAccountFactory(factory).onSignerRemoved(account);
139139
}
140140
}
141141
}

contracts/smart-wallet/utils/BaseAccountFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ abstract contract BaseAccountFactory is IAccountFactory, Multicall {
6464
}
6565

6666
/// @notice Callback function for an Account to register its signers.
67-
function addSigner(address _signer) external {
67+
function onSignerAdded(address _signer) external {
6868
address account = msg.sender;
6969

7070
bool isAlreadyAccount = accountsOfSigner[_signer].add(account);
@@ -78,7 +78,7 @@ abstract contract BaseAccountFactory is IAccountFactory, Multicall {
7878
}
7979

8080
/// @notice Callback function for an Account to un-register its signers.
81-
function removeSigner(address _signer) external {
81+
function onSignerRemoved(address _signer) external {
8282
address account = msg.sender;
8383

8484
bool isAccount = accountsOfSigner[_signer].remove(account);

docs/AccountFactory.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ Returns the address of the Account implementation.
2727
|---|---|---|
2828
| _0 | address | undefined |
2929

30-
### addSigner
31-
32-
```solidity
33-
function addSigner(address _signer) external nonpayable
34-
```
35-
36-
Callback function for an Account to register its signers.
37-
38-
39-
40-
#### Parameters
41-
42-
| Name | Type | Description |
43-
|---|---|---|
44-
| _signer | address | undefined |
45-
4630
### createAccount
4731

4832
```solidity
@@ -154,10 +138,26 @@ Receives and executes a batch of function calls on this contract.
154138
|---|---|---|
155139
| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. |
156140

157-
### removeSigner
141+
### onSignerAdded
142+
143+
```solidity
144+
function onSignerAdded(address _signer) external nonpayable
145+
```
146+
147+
Callback function for an Account to register its signers.
148+
149+
150+
151+
#### Parameters
152+
153+
| Name | Type | Description |
154+
|---|---|---|
155+
| _signer | address | undefined |
156+
157+
### onSignerRemoved
158158

159159
```solidity
160-
function removeSigner(address _signer) external nonpayable
160+
function onSignerRemoved(address _signer) external nonpayable
161161
```
162162

163163
Callback function for an Account to un-register its signers.

docs/BaseAccountFactory.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ Returns the address of the Account implementation.
2727
|---|---|---|
2828
| _0 | address | undefined |
2929

30-
### addSigner
31-
32-
```solidity
33-
function addSigner(address _signer) external nonpayable
34-
```
35-
36-
Callback function for an Account to register its signers.
37-
38-
39-
40-
#### Parameters
41-
42-
| Name | Type | Description |
43-
|---|---|---|
44-
| _signer | address | undefined |
45-
4630
### createAccount
4731

4832
```solidity
@@ -154,10 +138,26 @@ Receives and executes a batch of function calls on this contract.
154138
|---|---|---|
155139
| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. |
156140

157-
### removeSigner
141+
### onSignerAdded
142+
143+
```solidity
144+
function onSignerAdded(address _signer) external nonpayable
145+
```
146+
147+
Callback function for an Account to register its signers.
148+
149+
150+
151+
#### Parameters
152+
153+
| Name | Type | Description |
154+
|---|---|---|
155+
| _signer | address | undefined |
156+
157+
### onSignerRemoved
158158

159159
```solidity
160-
function removeSigner(address _signer) external nonpayable
160+
function onSignerRemoved(address _signer) external nonpayable
161161
```
162162

163163
Callback function for an Account to un-register its signers.

docs/DynamicAccountFactory.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ Returns the address of the Account implementation.
2727
|---|---|---|
2828
| _0 | address | undefined |
2929

30-
### addSigner
31-
32-
```solidity
33-
function addSigner(address _signer) external nonpayable
34-
```
35-
36-
Callback function for an Account to register its signers.
37-
38-
39-
40-
#### Parameters
41-
42-
| Name | Type | Description |
43-
|---|---|---|
44-
| _signer | address | undefined |
45-
4630
### createAccount
4731

4832
```solidity
@@ -154,10 +138,26 @@ Receives and executes a batch of function calls on this contract.
154138
|---|---|---|
155139
| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. |
156140

157-
### removeSigner
141+
### onSignerAdded
142+
143+
```solidity
144+
function onSignerAdded(address _signer) external nonpayable
145+
```
146+
147+
Callback function for an Account to register its signers.
148+
149+
150+
151+
#### Parameters
152+
153+
| Name | Type | Description |
154+
|---|---|---|
155+
| _signer | address | undefined |
156+
157+
### onSignerRemoved
158158

159159
```solidity
160-
function removeSigner(address _signer) external nonpayable
160+
function onSignerRemoved(address _signer) external nonpayable
161161
```
162162

163163
Callback function for an Account to un-register its signers.

docs/IAccountFactory.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ Returns the address of the Account implementation.
2727
|---|---|---|
2828
| _0 | address | undefined |
2929

30-
### addSigner
31-
32-
```solidity
33-
function addSigner(address signer) external nonpayable
34-
```
35-
36-
Callback function for an Account to register its signers.
37-
38-
39-
40-
#### Parameters
41-
42-
| Name | Type | Description |
43-
|---|---|---|
44-
| signer | address | undefined |
45-
4630
### createAccount
4731

4832
```solidity
@@ -132,10 +116,26 @@ Returns all signers of an account.
132116
|---|---|---|
133117
| signers | address[] | undefined |
134118

135-
### removeSigner
119+
### onSignerAdded
120+
121+
```solidity
122+
function onSignerAdded(address signer) external nonpayable
123+
```
124+
125+
Callback function for an Account to register its signers.
126+
127+
128+
129+
#### Parameters
130+
131+
| Name | Type | Description |
132+
|---|---|---|
133+
| signer | address | undefined |
134+
135+
### onSignerRemoved
136136

137137
```solidity
138-
function removeSigner(address signer) external nonpayable
138+
function onSignerRemoved(address signer) external nonpayable
139139
```
140140

141141
Callback function for an Account to un-register its signers.

docs/ManagedAccountFactory.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,6 @@ function addExtension(IExtension.Extension _extension) external nonpayable
6060
|---|---|---|
6161
| _extension | IExtension.Extension | undefined |
6262

63-
### addSigner
64-
65-
```solidity
66-
function addSigner(address _signer) external nonpayable
67-
```
68-
69-
Callback function for an Account to register its signers.
70-
71-
72-
73-
#### Parameters
74-
75-
| Name | Type | Description |
76-
|---|---|---|
77-
| _signer | address | undefined |
78-
7963
### createAccount
8064

8165
```solidity
@@ -461,26 +445,26 @@ Receives and executes a batch of function calls on this contract.
461445
|---|---|---|
462446
| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. |
463447

464-
### removeExtension
448+
### onSignerAdded
465449

466450
```solidity
467-
function removeExtension(string _extensionName) external nonpayable
451+
function onSignerAdded(address _signer) external nonpayable
468452
```
469453

454+
Callback function for an Account to register its signers.
470455

471456

472-
*Removes an existing extension from the router.*
473457

474458
#### Parameters
475459

476460
| Name | Type | Description |
477461
|---|---|---|
478-
| _extensionName | string | undefined |
462+
| _signer | address | undefined |
479463

480-
### removeSigner
464+
### onSignerRemoved
481465

482466
```solidity
483-
function removeSigner(address _signer) external nonpayable
467+
function onSignerRemoved(address _signer) external nonpayable
484468
```
485469

486470
Callback function for an Account to un-register its signers.
@@ -493,6 +477,22 @@ Callback function for an Account to un-register its signers.
493477
|---|---|---|
494478
| _signer | address | undefined |
495479

480+
### removeExtension
481+
482+
```solidity
483+
function removeExtension(string _extensionName) external nonpayable
484+
```
485+
486+
487+
488+
*Removes an existing extension from the router.*
489+
490+
#### Parameters
491+
492+
| Name | Type | Description |
493+
|---|---|---|
494+
| _extensionName | string | undefined |
495+
496496
### renounceRole
497497

498498
```solidity

0 commit comments

Comments
 (0)