forked from sphinx-labs/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ct): Prevent owner from being set to the zero address
- Loading branch information
Showing
5 changed files
with
140 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sphinx-labs/contracts': patch | ||
--- | ||
|
||
Prevent owner from being set to the zero address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../contracts/forge-std/src/Test.sol"; | ||
import { SphinxUtils } from "../../contracts/foundry/SphinxUtils.sol"; | ||
import { SphinxConfig } from "../../contracts/foundry/Sphinx.sol"; | ||
|
||
contract CHU572_test is Test, SphinxUtils { | ||
SphinxConfig public config; | ||
|
||
function test_valid_fails_address_zero_owner() external { | ||
config.projectName = "CHU-572"; | ||
config.owners = [address(0)]; | ||
config.threshold = 1; | ||
config.orgId = "test-org-id"; | ||
vm.expectRevert( | ||
"Sphinx: Detected owner that is, address(0). Gnosis Safe prevents you from using this address as an owner." | ||
); | ||
validate(config); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../contracts/forge-std/src/Test.sol"; | ||
import { Sphinx } from "../../contracts/foundry/Sphinx.sol"; | ||
|
||
contract CHU663_test is Test, Sphinx { | ||
address public safe; | ||
|
||
function configureSphinx() public override { | ||
sphinxConfig.projectName = "CHU-663"; | ||
sphinxConfig.owners = [0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266]; | ||
sphinxConfig.threshold = 1; | ||
sphinxConfig.orgId = "test-org-id"; | ||
safe = safeAddress(); | ||
} | ||
|
||
function test_configureSphinx_success_calls_safeAddress() external { | ||
configureSphinx(); | ||
assertNotEq(safe, address(0)); | ||
} | ||
} |