Skip to content

Commit

Permalink
check for set controller zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
nginnever committed May 24, 2022
1 parent c56fd79 commit 613a106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contracts/GnomadModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ contract GnomadModule is Module {
public
onlyOwner
{
require(_controller != address(0), "Controller can not be zero address");
require(_controllerDomain != 0, "Controller Domain can not be zero");
require(
!isController(_controller, _controllerDomain),
"controller already set to this"
Expand Down
3 changes: 2 additions & 1 deletion test/GnomadModule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe("GnomadModule", async () => {
const { module, controller } = await setupTestWithTestAvatar();
const avatarTx = await module.populateTransaction.setController(
user2.address,
0
42
);
const tx = {
to: module.address,
Expand All @@ -269,6 +269,7 @@ describe("GnomadModule", async () => {
await module.handle(controllerDomain, 0, bytes32controller, encoded);

expect(await module.controller()).to.be.equals(user2.address);
expect(await module.controllerDomain()).to.be.equals(42);
});
});
});

0 comments on commit 613a106

Please sign in to comment.