diff --git a/src/HatsSignerGate.sol b/src/HatsSignerGate.sol index 7a02faa..24bb9de 100644 --- a/src/HatsSignerGate.sol +++ b/src/HatsSignerGate.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CC0 pragma solidity >=0.8.13; -// import { Test, console2 } from "forge-std/Test.sol"; // remove after testing +import { Test, console2 } from "forge-std/Test.sol"; // remove after testing import { HatsSignerGateBase, IGnosisSafe, Enum } from "./HatsSignerGateBase.sol"; import "./HSGLib.sol"; @@ -35,7 +35,8 @@ contract HatsSignerGate is HatsSignerGateBase { /// @dev Reverts if `maxSigners` has been reached, the caller is either invalid or has already claimed. Swaps caller with existing invalid owner if relevant. function claimSigner() public virtual { uint256 maxSigs = maxSigners; // save SLOADs - uint256 currentSignerCount = signerCount; + address[] memory owners = safe.getOwners(); + uint256 currentSignerCount = _countValidSigners(owners); if (currentSignerCount >= maxSigs) { revert MaxSignersReached(); @@ -49,16 +50,14 @@ contract HatsSignerGate is HatsSignerGateBase { revert NotSignerHatWearer(msg.sender); } - /* - We check the safe owner count in case there are existing owners who are no longer valid signers. + /* + We check the safe owner count in case there are existing owners who are no longer valid signers. If we're already at maxSigners, we'll replace one of the invalid owners by swapping the signer. Otherwise, we'll simply add the new signer. */ - address[] memory owners = safe.getOwners(); uint256 ownerCount = owners.length; - if (ownerCount >= maxSigs) { - bool swapped = _swapSigner(owners, ownerCount, maxSigs, currentSignerCount, msg.sender); + bool swapped = _swapSigner(owners, ownerCount, msg.sender); if (!swapped) { // if there are no invalid owners, we can't add a new signer, so we revert revert NoInvalidSignersToReplace(); @@ -73,6 +72,8 @@ contract HatsSignerGate is HatsSignerGateBase { /// @param _account The address to check /// @return valid Whether `_account` is a valid signer function isValidSigner(address _account) public view override returns (bool valid) { + // console2.log("ivs 1"); valid = HATS.isWearerOfHat(_account, signersHatId); + // console2.log("ivs 2"); } } diff --git a/src/HatsSignerGateBase.sol b/src/HatsSignerGateBase.sol index 091637a..ca4d2fe 100644 --- a/src/HatsSignerGateBase.sol +++ b/src/HatsSignerGateBase.sol @@ -23,8 +23,8 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn /// @notice The maximum number of signers allowed for the `safe` uint256 public maxSigners; - /// @notice The current number of signers on the `safe` - uint256 public signerCount; + // /// @notice The current number of signers on the `safe` + // uint256 public signerCount; /// @notice The version of HatsSignerGate used in this contract string public version; @@ -99,7 +99,7 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn if (_targetThreshold != targetThreshold) { _setTargetThreshold(_targetThreshold); - if (signerCount > 1) _setSafeThreshold(_targetThreshold); + if (validSignerCount() > 1) _setSafeThreshold(_targetThreshold); emit HSGLib.TargetThresholdSet(_targetThreshold); } @@ -121,11 +121,11 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn /// @param _threshold The threshold to set on the `safe` function _setSafeThreshold(uint256 _threshold) internal { uint256 newThreshold = _threshold; - uint256 signerCount_ = signerCount; // save an SLOAD + uint256 signerCount = validSignerCount(); // ensure that txs can't execute if fewer signers than target threshold - if (signerCount_ <= _threshold) { - newThreshold = signerCount_; + if (signerCount <= _threshold) { + newThreshold = signerCount; } if (newThreshold != safe.getThreshold()) { bytes memory data = abi.encodeWithSignature("changeThreshold(uint256)", newThreshold); @@ -181,30 +181,26 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn } } - /// @notice Tallies the number of existing `safe` owners that wear a signer hat, sets `signerCount` to that value, and updates the `safe` threshold if necessary + /// @notice Tallies the number of existing `safe` owners that wear a signer hat and updates the `safe` threshold if necessary /// @dev Does NOT remove invalid `safe` owners function reconcileSignerCount() public { - address[] memory owners = safe.getOwners(); - uint256 validSignerCount = _countValidSigners(owners); + uint256 signerCount = validSignerCount(); - if (validSignerCount > maxSigners) { + if (signerCount > maxSigners) { revert MaxSignersReached(); } - // update the signer count accordingly - signerCount = validSignerCount; - uint256 currentThreshold = safe.getThreshold(); uint256 newThreshold; uint256 target = targetThreshold; // save SLOADs - if (validSignerCount <= target && validSignerCount != currentThreshold) { - newThreshold = validSignerCount; - } else if (validSignerCount > target && currentThreshold < target) { + if (signerCount <= target && signerCount != currentThreshold) { + newThreshold = signerCount; + } else if (signerCount > target && currentThreshold < target) { newThreshold = target; } if (newThreshold > 0) { - bytes memory data = abi.encodeWithSignature("changeThreshold(uint256)", validSignerCount); + bytes memory data = abi.encodeWithSignature("changeThreshold(uint256)", signerCount); bool success = safe.execTransactionFromModule( address(safe), // to @@ -219,17 +215,21 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn } } + function validSignerCount() public view returns (uint256 signerCount) { + signerCount = _countValidSigners(safe.getOwners()); + } + /// @notice Internal function to count the number of valid signers in an array of addresses /// @param owners The addresses to check for validity - /// @return validSignerCount The number of valid signers in `owners` - function _countValidSigners(address[] memory owners) internal view returns (uint256 validSignerCount) { + /// @return signerCount The number of valid signers in `owners` + function _countValidSigners(address[] memory owners) internal view returns (uint256 signerCount) { uint256 length = owners.length; // count the existing safe owners that wear the signer hat for (uint256 i; i < length;) { if (isValidSigner(owners[i])) { // shouldn't overflow given reasonable owners array length unchecked { - ++validSignerCount; + ++signerCount; } } // shouldn't overflow given reasonable owners array length @@ -284,9 +284,6 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn addOwnerData = abi.encodeWithSignature("addOwnerWithThreshold(address,uint256)", _signer, newThreshold); } - // increment signer count - signerCount = newSignerCount; - // execute the call bool success = safe.execTransactionFromModule( address(safe), // to @@ -304,17 +301,12 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn /// @dev Unsafe. Does not check if `_signer` is a valid signer. /// @param _owners Array of owners on the `safe` /// @param _ownerCount The number of owners on the `safe` (length of `_owners` array) - /// @param _maxSigners The maximum number of signers allowed - /// @param _currentSignerCount The current number of signers /// @param _signer The address to add as a new `safe` owner /// @return success Whether an invalid signer was found and successfully replaced with `_signer` - function _swapSigner( - address[] memory _owners, - uint256 _ownerCount, - uint256 _maxSigners, - uint256 _currentSignerCount, - address _signer - ) internal returns (bool success) { + function _swapSigner(address[] memory _owners, uint256 _ownerCount, address _signer) + internal + returns (bool success) + { address ownerToCheck; bytes memory data; @@ -342,8 +334,6 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn revert FailedExecRemoveSigner(); } - // increment the signer count if signerCount was correct, ie `reconcileSignerCount` was called prior - if (_currentSignerCount < _maxSigners) ++signerCount; break; } unchecked { @@ -368,10 +358,10 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn function _removeSigner(address _signer) internal { bytes memory removeOwnerData; address[] memory owners = safe.getOwners(); - uint256 currentSignerCount = signerCount; // save an SLOAD - uint256 newSignerCount; + uint256 validSigners = _countValidSigners(owners); + // uint256 newSignerCount; - if (currentSignerCount < 2 && owners.length == 1) { + if (validSigners < 2 && owners.length == 1) { // signerCount could be 0 after reconcileSignerCount // make address(this) the only owner removeOwnerData = abi.encodeWithSignature( @@ -385,17 +375,11 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn } else { uint256 currentThreshold = safe.getThreshold(); uint256 newThreshold = currentThreshold; - uint256 validSignerCount = _countValidSigners(owners); - - if (validSignerCount == currentSignerCount) { - newSignerCount = currentSignerCount; - } else { - newSignerCount = currentSignerCount - 1; - } + // uint256 validSignerCount = _countValidSigners(owners); // ensure that txs can't execute if fewer signers than target threshold - if (newSignerCount <= targetThreshold) { - newThreshold = newSignerCount; + if (validSigners <= targetThreshold) { + newThreshold = validSigners; } removeOwnerData = abi.encodeWithSignature( @@ -403,9 +387,6 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn ); } - // update signerCount - signerCount = newSignerCount; - bool success = safe.execTransactionFromModule( address(safe), // to 0, // value @@ -552,7 +533,7 @@ abstract contract HatsSignerGateBase is BaseGuard, SignatureDecoder, HatsOwnedIn /// @notice Internal function to calculate the threshold that `safe` should have, given the correct `signerCount`, `minThreshold`, and `targetThreshold` /// @return _threshold The correct threshold function _getCorrectThreshold() internal view returns (uint256 _threshold) { - uint256 count = _countValidSigners(safe.getOwners()); + uint256 count = validSignerCount(); uint256 min = minThreshold; uint256 max = targetThreshold; if (count < min) _threshold = min; diff --git a/src/MultiHatsSignerGate.sol b/src/MultiHatsSignerGate.sol index da74536..5fd222b 100644 --- a/src/MultiHatsSignerGate.sol +++ b/src/MultiHatsSignerGate.sol @@ -40,7 +40,8 @@ contract MultiHatsSignerGate is HatsSignerGateBase { /// @param _hatId The hat id to claim signer rights for function claimSigner(uint256 _hatId) public { uint256 maxSigs = maxSigners; // save SLOADs - uint256 currentSignerCount = signerCount; + address[] memory owners = safe.getOwners(); + uint256 currentSignerCount = _countValidSigners(owners); if (currentSignerCount >= maxSigs) { revert MaxSignersReached(); @@ -63,11 +64,10 @@ contract MultiHatsSignerGate is HatsSignerGateBase { If we're already at maxSigners, we'll replace one of the invalid owners by swapping the signer. Otherwise, we'll simply add the new signer. */ - address[] memory owners = safe.getOwners(); uint256 ownerCount = owners.length; if (ownerCount >= maxSigs) { - bool swapped = _swapSigner(owners, ownerCount, maxSigs, currentSignerCount, msg.sender); + bool swapped = _swapSigner(owners, ownerCount, msg.sender); if (!swapped) { // if there are no invalid owners, we can't add a new signer, so we revert revert NoInvalidSignersToReplace(); diff --git a/test/HSGTestSetup.t.sol b/test/HSGTestSetup.t.sol index 692459d..93913b7 100644 --- a/test/HSGTestSetup.t.sol +++ b/test/HSGTestSetup.t.sol @@ -44,6 +44,7 @@ contract HSGTestSetup is HSGFactoryTestSetup, SignatureDecoder { ); (hatsSignerGate, safe) = deployHSGAndSafe(ownerHat, signerHat, minThreshold, targetThreshold, maxSigners); + mockIsWearerCall(address(hatsSignerGate), signerHat, false); } //// HELPER FUNCTIONS //// diff --git a/test/HatsSignerGate.t.sol b/test/HatsSignerGate.t.sol index 9f08cc5..bca3347 100644 --- a/test/HatsSignerGate.t.sol +++ b/test/HatsSignerGate.t.sol @@ -83,6 +83,9 @@ contract HatsSignerGateTest is HSGTestSetup { } function testReconcileSignerCount() public { + mockIsWearerCall(addresses[1], signerHat, false); + mockIsWearerCall(addresses[2], signerHat, false); + mockIsWearerCall(addresses[3], signerHat, false); // add 3 more safe owners the old fashioned way // 1 bytes memory addOwnersData1 = abi.encodeWithSignature("addOwnerWithThreshold(address,uint256)", addresses[1], 1); @@ -123,18 +126,16 @@ contract HatsSignerGateTest is HSGTestSetup { Enum.Operation.Call // operation ); - assertEq(hatsSignerGate.signerCount(), 0); + assertEq(hatsSignerGate.validSignerCount(), 0); // set only two of them as valid signers mockIsWearerCall(address(hatsSignerGate), signerHat, true); mockIsWearerCall(addresses[1], signerHat, true); - mockIsWearerCall(addresses[2], signerHat, false); - mockIsWearerCall(addresses[3], signerHat, false); // do the reconcile hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); assertEq(safe.getThreshold(), 2); // now we can remove both the invalid signers with no changes to hatsSignerCount @@ -143,7 +144,7 @@ contract HatsSignerGateTest is HSGTestSetup { mockIsWearerCall(addresses[3], signerHat, false); hatsSignerGate.removeSigner(addresses[3]); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); assertEq(safe.getThreshold(), 2); } @@ -152,7 +153,7 @@ contract HatsSignerGateTest is HSGTestSetup { assertEq(safe.getOwners().length, 1); - assertEq(hatsSignerGate.signerCount(), 1); + assertEq(hatsSignerGate.validSignerCount(), 1); assertEq(safe.getOwners()[0], addresses[0]); @@ -162,7 +163,7 @@ contract HatsSignerGateTest is HSGTestSetup { function testAddThreeSigners() public { addSigners(3); - assertEq(hatsSignerGate.signerCount(), 3); + assertEq(hatsSignerGate.validSignerCount(), 3); assertEq(safe.getOwners()[0], addresses[2]); assertEq(safe.getOwners()[1], addresses[1]); @@ -182,7 +183,7 @@ contract HatsSignerGateTest is HSGTestSetup { // this call should fail hatsSignerGate.claimSigner(); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); assertEq(safe.getOwners()[0], addresses[4]); assertEq(safe.getOwners()[1], addresses[3]); @@ -213,7 +214,7 @@ contract HatsSignerGateTest is HSGTestSetup { hatsSignerGate.claimSigner(); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); } function testNonHatWearerCannotClaimSigner() public { @@ -234,7 +235,7 @@ contract HatsSignerGateTest is HSGTestSetup { assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], address(hatsSignerGate)); - assertEq(hatsSignerGate.signerCount(), 0); + assertEq(hatsSignerGate.validSignerCount(), 0); assertEq(safe.getThreshold(), 1); } @@ -250,7 +251,7 @@ contract HatsSignerGateTest is HSGTestSetup { assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], addresses[1]); - assertEq(hatsSignerGate.signerCount(), 1); + assertEq(hatsSignerGate.validSignerCount(), 1); assertEq(safe.getThreshold(), 1); } @@ -261,13 +262,13 @@ contract HatsSignerGateTest is HSGTestSetup { mockIsWearerCall(addresses[0], signerHat, false); hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 1); + assertEq(hatsSignerGate.validSignerCount(), 1); hatsSignerGate.removeSigner(addresses[0]); assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], addresses[1]); - assertEq(hatsSignerGate.signerCount(), 1); + assertEq(hatsSignerGate.validSignerCount(), 1); assertEq(safe.getThreshold(), 1); } @@ -278,14 +279,14 @@ contract HatsSignerGateTest is HSGTestSetup { mockIsWearerCall(addresses[0], signerHat, false); hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); hatsSignerGate.removeSigner(addresses[0]); assertEq(safe.getOwners().length, 2); assertEq(safe.getOwners()[0], addresses[2]); assertEq(safe.getOwners()[1], addresses[1]); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); assertEq(safe.getThreshold(), 2); } @@ -301,7 +302,7 @@ contract HatsSignerGateTest is HSGTestSetup { assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], addresses[0]); - assertEq(hatsSignerGate.signerCount(), 1); + assertEq(hatsSignerGate.validSignerCount(), 1); assertEq(safe.getThreshold(), 1); } @@ -735,13 +736,13 @@ contract HatsSignerGateTest is HSGTestSetup { // reconcile is called, so signerCount is updated to 4 hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 4); + assertEq(hatsSignerGate.validSignerCount(), 4); // a new signer claims, so signerCount is updated to 5 mockIsWearerCall(addresses[5], signerHat, true); vm.prank(addresses[5]); hatsSignerGate.claimSigner(); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); // the malicious signer behaves nicely and regains the hat, but they were kicked out by the previous signer claim mockIsWearerCall(addresses[4], signerHat, true); @@ -749,7 +750,7 @@ contract HatsSignerGateTest is HSGTestSetup { // reoncile is called again and signerCount stays at 5 // vm.expectRevert(MaxSignersReached.selector); hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); // // any eligible signer can now claim at will // mockIsWearerCall(addresses[6], signerHat, true); @@ -770,7 +771,7 @@ contract HatsSignerGateTest is HSGTestSetup { // 3) reconcile is called, signerCount=x-3 hatsSignerGate.reconcileSignerCount(); console2.log("A"); - assertEq(hatsSignerGate.signerCount(), 2); + assertEq(hatsSignerGate.validSignerCount(), 2); // 4) 3 more signers can be added with claimSigner() mockIsWearerCall(addresses[5], signerHat, true); @@ -784,7 +785,7 @@ contract HatsSignerGateTest is HSGTestSetup { hatsSignerGate.claimSigner(); console2.log("B"); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); console2.log("C"); assertEq(safe.getOwners().length, 5); @@ -795,14 +796,14 @@ contract HatsSignerGateTest is HSGTestSetup { // but we still only have 5 owners and 5 signers console2.log("D"); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); console2.log("E"); assertEq(safe.getOwners().length, 5); console2.log("F"); hatsSignerGate.reconcileSignerCount(); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 5); // // 6) we now have x+3 signers // hatsSignerGate.reconcileSignerCount(); @@ -911,9 +912,7 @@ contract HatsSignerGateTest is HSGTestSetup { // reconcile is called, so signerCount is updated to 2 hatsSignerGate.reconcileSignerCount(); - console2.log("A"); - assertEq(hatsSignerGate.signerCount(), 2); - console2.log("B"); + assertEq(hatsSignerGate.validSignerCount(), 2); assertEq(safe.getThreshold(), 2); // the 3 owners regain their hats @@ -953,33 +952,65 @@ contract HatsSignerGateTest is HSGTestSetup { } function testCannotClaimSignerIfNoInvalidSigners() public { - console2.log("A"); assertEq(maxSigners, 5); addSigners(5); // one signer loses their hat mockIsWearerCall(addresses[4], signerHat, false); - console2.log("B"); - assertEq(hatsSignerGate.signerCount(), 5); + assertEq(hatsSignerGate.validSignerCount(), 4); // reconcile is called, updating signer count to 4 hatsSignerGate.reconcileSignerCount(); - console2.log("C"); - assertEq(hatsSignerGate.signerCount(), 4); + assertEq(hatsSignerGate.validSignerCount(), 4); // bad signer regains their hat mockIsWearerCall(addresses[4], signerHat, true); - // signer count is still 4 because reoncile hasn't been called again - console2.log("D"); - assertEq(hatsSignerGate.signerCount(), 4); + // signer count returns to 5 + assertEq(hatsSignerGate.validSignerCount(), 5); - // new valid signer tries to claim, but can't because + // new valid signer tries to claim, but can't because we're already at max signers mockIsWearerCall(addresses[5], signerHat, true); vm.prank(addresses[5]); - vm.expectRevert(NoInvalidSignersToReplace.selector); + vm.expectRevert(MaxSignersReached.selector); hatsSignerGate.claimSigner(); } - function testSignersCannotChangeModules() public { - // + function testRemoveSignerCorrectlyUpdates() public { + assertEq(hatsSignerGate.targetThreshold(), 2, "target threshold"); + assertEq(maxSigners, 5, "max signers"); + // start with 5 valid signers + addSigners(5); + + // the last two lose their hats + mockIsWearerCall(addresses[3], signerHat, false); + mockIsWearerCall(addresses[4], signerHat, false); + + // the 4th regains its hat + mockIsWearerCall(addresses[3], signerHat, true); + + // remove the 5th signer + hatsSignerGate.removeSigner(addresses[4]); + + // signer count should be 4 and threshold at target + assertEq(hatsSignerGate.validSignerCount(), 4, "valid signer count"); + assertEq(safe.getThreshold(), hatsSignerGate.targetThreshold(), "ending threshold"); + } + + function testCanClaimToReplaceInvalidSignerAtMaxSigner() public { + assertEq(maxSigners, 5, "max signers"); + // start with 5 valid signers (the max) + addSigners(5); + + // the last one loses their hat + mockIsWearerCall(addresses[4], signerHat, false); + + // a new signer valid tries to claim, and can + mockIsWearerCall(addresses[5], signerHat, true); + vm.prank(addresses[5]); + hatsSignerGate.claimSigner(); + assertEq(hatsSignerGate.validSignerCount(), 5, "valid signer count"); } + + // function testSignersCannotChangeModules() public { + // // + // } } diff --git a/test/MHSGTestSetup.t.sol b/test/MHSGTestSetup.t.sol index 1614dae..7c47b83 100644 --- a/test/MHSGTestSetup.t.sol +++ b/test/MHSGTestSetup.t.sol @@ -39,6 +39,7 @@ contract MHSGTestSetup is HSGTestSetup { ); (multiHatsSignerGate, safe) = deployMHSGAndSafe(ownerHat, signerHats, minThreshold, targetThreshold, maxSigners); + mockIsWearerCall(address(multiHatsSignerGate), signerHat, false); } function addSigners_Multi(uint256 count) internal { diff --git a/test/MultiHatsSignerGate.t.sol b/test/MultiHatsSignerGate.t.sol index 2c3282a..d92a912 100644 --- a/test/MultiHatsSignerGate.t.sol +++ b/test/MultiHatsSignerGate.t.sol @@ -7,7 +7,7 @@ contract MultiHatsSignerGateTest is MHSGTestSetup { function test_Multi_AddSingleSigner() public { addSigners_Multi(1); - assertEq(multiHatsSignerGate.signerCount(), 1); + assertEq(multiHatsSignerGate.validSignerCount(), 1); assertEq(safe.getOwners()[0], addresses[0]); assertEq(safe.getThreshold(), 1); } @@ -15,7 +15,7 @@ contract MultiHatsSignerGateTest is MHSGTestSetup { function test_Multi_AddTwoSigners_DifferentHats() public { addSigners_Multi(2); - assertEq(multiHatsSignerGate.signerCount(), 2); + assertEq(multiHatsSignerGate.validSignerCount(), 2); assertEq(safe.getOwners()[0], addresses[1]); assertEq(safe.getOwners()[1], addresses[0]); assertEq(safe.getThreshold(), 2); @@ -40,7 +40,7 @@ contract MultiHatsSignerGateTest is MHSGTestSetup { assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], address(multiHatsSignerGate)); - assertEq(multiHatsSignerGate.signerCount(), 0); + assertEq(multiHatsSignerGate.validSignerCount(), 0); assertEq(safe.getThreshold(), 1); } @@ -55,7 +55,7 @@ contract MultiHatsSignerGateTest is MHSGTestSetup { assertEq(safe.getOwners().length, 1); assertEq(safe.getOwners()[0], addresses[0]); - assertEq(multiHatsSignerGate.signerCount(), 1); + assertEq(multiHatsSignerGate.validSignerCount(), 1); assertEq(safe.getThreshold(), 1); }