Skip to content

Commit a8124d8

Browse files
committed
Add test for zero address owner in zone constructor
1 parent 61a9f5f commit a8124d8

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

test/trading/seaport16/zones/immutable-signed-zone/v3/ImmutableSignedZoneV3.t.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ contract ImmutableSignedZoneV3Test is
6262
assertTrue(ownerHasAdminRole);
6363
}
6464

65+
function test_contructor_revertsIfOwnerIsTheZeroAddress() public {
66+
vm.expectRevert("ZoneAccessControl: owner is the zero address");
67+
new ImmutableSignedZoneV3(
68+
"MyZoneName", SEAPORT, "https://www.immutable.com", "https://www.immutable.com/docs", address(0)
69+
);
70+
}
71+
6572
function test_contructor_emitsSeaportCompatibleContractDeployedEvent() public {
6673
vm.expectEmit();
6774
emit SeaportCompatibleContractDeployed();

test/trading/seaport16/zones/immutable-signed-zone/v3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Constructor tests:
77
| Test name | Description | Happy Case | Implemented |
88
| ------------------------------------------------------------- | ------------------------------------------------------------- | ---------- | ----------- |
99
| `test_contructor_grantsAdminRoleToOwner` | Check `DEFAULT_ADMIN_ROLE` is granted to the specified owner. | Yes | Yes |
10+
| `test_contructor_revertsIfOwnerIsTheZeroAddress` | Check specified owner is not the zero address. | No | Yes |
1011
| `test_contructor_emitsSeaportCompatibleContractDeployedEvent` | Emits `SeaportCompatibleContractDeployed` event. | Yes | Yes |
1112

1213
Control function tests:

0 commit comments

Comments
 (0)