Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbuild3r committed Aug 21, 2023
1 parent 94e3a6f commit 1416360
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/OpStateBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {ICrossDomainOwnable3} from "./interfaces/ICrossDomainOwnable3.sol";
/// @author Worldcoin
/// @notice Distributes new World ID Identity Manager roots to an OP Stack network
/// @dev This contract lives on Ethereum mainnet and works for Optimism and any OP Stack based chain
/// @dev Ownable2Step allows for transferOwnership to the zero address
contract OpStateBridge is Ownable2Step {
///////////////////////////////////////////////////////////////////
/// STORAGE ///
Expand Down
1 change: 1 addition & 0 deletions src/PolygonStateBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {FxBaseRootTunnel} from "fx-portal/contracts/tunnel/FxBaseRootTunnel.sol"
/// @notice Distributes new World ID Identity Manager roots to World ID supported networks
/// @dev This contract lives on Ethereum mainnet and is called by the World ID Identity Manager contract
/// in the registerIdentities method
/// @dev Ownable2Step allows for transferOwnership to the zero address
contract PolygonStateBridge is FxBaseRootTunnel, Ownable2Step {
///////////////////////////////////////////////////////////////////
/// STORAGE ///
Expand Down
1 change: 1 addition & 0 deletions src/PolygonWorldID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {BytesUtils} from "./utils/BytesUtils.sol";
/// @notice A contract that manages the root history of the WorldID merkle root on Polygon PoS.
/// @dev This contract is deployed on Polygon PoS and is called by the StateBridge contract for each
/// new root insertion.
/// @dev Ownable2Step allows for transferOwnership to the zero address
contract PolygonWorldID is WorldIDBridge, FxBaseChildTunnel, Ownable2Step {
///////////////////////////////////////////////////////////////////
/// STORAGE ///
Expand Down
16 changes: 0 additions & 16 deletions src/test/OpStateBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ contract OpStateBridgeTest is PRBTest, StdCheats {
/// using Ownable2Step transferOwnership
/// @param newOwner the new owner of the contract
function test_owner_transferOwnership_succeeds(address newOwner) public {
vm.assume(newOwner != address(0));

vm.expectEmit(true, true, true, true);

// OpenZeppelin Ownable2Step transferOwnershipStarted event
Expand All @@ -164,8 +162,6 @@ contract OpStateBridgeTest is PRBTest, StdCheats {
/// @param newOwner The new owner of the OPWorldID contract (foundry fuzz)
/// @param isLocal Whether the ownership transfer is local (Optimism EOA/contract) or an Ethereum EOA or contract
function test_owner_transferOwnershipOp_succeeds(address newOwner, bool isLocal) public {
vm.assume(newOwner != address(0));

vm.expectEmit(true, true, true, true);

// CrossDomainOwnable3.sol transferOwnership event
Expand Down Expand Up @@ -256,18 +252,6 @@ contract OpStateBridgeTest is PRBTest, StdCheats {
opStateBridge.transferOwnershipOp(newOwner, isLocal);
}

/// @notice tests that the StateBridge contract's ownership can't be changed by a non-owner
function test_newOwnerZero_transferOwnershipOp_reverts(
bool isLocal
) public {
address newOwner = address(0);

vm.expectRevert("Ownable: new owner is the zero address");

vm.prank(owner);
opStateBridge.transferOwnershipOp(newOwner, isLocal);
}

/// @notice tests whether the StateBridge contract can set root history expiry on Optimism and Polygon
/// @param _rootHistoryExpiry The new root history expiry for OpWorldID and PolygonWorldID
function test_notOwner_SetRootHistoryExpiry_reverts(
Expand Down
2 changes: 1 addition & 1 deletion src/test/OpWorldID.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ contract OpWorldIDTest is Messenger_Initializer {
0,
0,
abi.encodeWithSelector(id.receiveRoot.selector, newRoot)
);
);

// It reverts with CannotOverwriteRoot however because of the bridge simulation
// the L2 cross-domain call doesn't revert, however it does emit a FailedRelayedMessage
Expand Down
2 changes: 0 additions & 2 deletions src/test/PolygonStateBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ contract PolygonStateBridgeTest is PRBTest, StdCheats {
/// using Ownable2Step transferOwnership
/// @param newOwner the new owner of the contract
function test_owner_transferOwnership_succeeds(address newOwner) public {
vm.assume(newOwner != address(0));

vm.expectEmit(true, true, true, true);

// OpenZeppelin Ownable2Step transferOwnershipStarted event
Expand Down
2 changes: 0 additions & 2 deletions src/test/PolygonWorldID.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ contract PolygonWorldIDTest is PRBTest, StdCheats {
/// using Ownable2Step transferOwnership
/// @param newOwner the new owner of the contract
function test_owner_transferOwnership_succeeds(address newOwner) public {
vm.assume(newOwner != address(0));

vm.prank(owner);
id.transferOwnership(newOwner);

Expand Down

0 comments on commit 1416360

Please sign in to comment.