Skip to content

Commit 2d93a61

Browse files
authored
AA zero address check (#151)
1 parent 22b7bfd commit 2d93a61

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

contracts/account-abstraction/AAccountRecovery.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ abstract contract AAccountRecovery is IAccountRecovery {
106106
address provider_,
107107
bytes memory proof_
108108
) internal virtual {
109+
if (newOwner_ == address(0)) revert ZeroAddress();
110+
109111
AAccountRecoveryStorage storage $ = _getAAccountRecoveryStorage();
110112

111113
if (!$.recoveryProviders.contains(provider_)) revert ProviderNotRegistered(provider_);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solarity/solidity-lib",
3-
"version": "3.1.3",
3+
"version": "3.1.4",
44
"license": "MIT",
55
"author": "Distributed Lab",
66
"readme": "README.md",

test/account-abstraction/AccountRecovery.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ describe("AccountRecovery", () => {
102102
.to.be.revertedWithCustomError(accountRecovery, "ProviderNotRegistered")
103103
.withArgs(provider2);
104104
});
105+
106+
it("should revert if a new owner is zero address", async () => {
107+
await expect(
108+
accountRecovery.validateRecovery(ethers.ZeroAddress, provider1, RECOVERY_DATA),
109+
).to.be.revertedWithCustomError(accountRecovery, "ZeroAddress");
110+
});
105111
});
106112

107113
describe("recoveryProviderAdded", () => {

0 commit comments

Comments
 (0)