Skip to content

Commit

Permalink
Allow self as owner.
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Oct 10, 2024
1 parent 95c0ce1 commit a2c8f99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions contracts/base/OwnerManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ abstract contract OwnerManager is SelfAuthorized, IOwnerManager {
for (uint256 i = 0; i < _owners.length; i++) {
// Owner address cannot be null.
address owner = _owners[i];
if (owner == address(0) || owner == SENTINEL_OWNERS || owner == address(this) || currentOwner == owner)
revertWithError("GS203");
if (owner == address(0) || owner == SENTINEL_OWNERS || currentOwner == owner) revertWithError("GS203");
// No duplicate owners allowed.
if (owners[owner] != address(0)) revertWithError("GS204");
owners[currentOwner] = owner;
Expand Down
4 changes: 1 addition & 3 deletions test/core/Safe.Setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ describe("Safe", () => {
signers: [, user2],
} = await setupTests();
const templateAddress = await template.getAddress();
await expect(
template.setup([user2.address, templateAddress], 2, AddressZero, "0x", AddressZero, AddressZero, 0, AddressZero),
).to.be.revertedWith("GS203");
expect(await template.setup([user2.address, templateAddress], 2, AddressZero, "0x", AddressZero, AddressZero, 0, AddressZero));
});

it("should revert if sentinel is used as an owner", async () => {
Expand Down

0 comments on commit a2c8f99

Please sign in to comment.