Skip to content

Commit

Permalink
remove bridge role (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexonaut authored Jun 11, 2024
1 parent 25ddc69 commit 2fb0afc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/executors/AuthBridgeExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { BridgeExecutorBase } from './BridgeExecutorBase.sol';
* @notice Queue up proposals from an authorized bridge.
*/
contract AuthBridgeExecutor is IAuthBridgeExecutor, AccessControl, BridgeExecutorBase {

bytes32 public constant AUTHORIZED_BRIDGE_ROLE = keccak256('AUTHORIZED_BRIDGE_ROLE');

/**
* @dev Constructor
Expand All @@ -33,7 +31,6 @@ contract AuthBridgeExecutor is IAuthBridgeExecutor, AccessControl, BridgeExecuto
)
{
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setRoleAdmin(AUTHORIZED_BRIDGE_ROLE, DEFAULT_ADMIN_ROLE);
}

/// @inheritdoc IAuthBridgeExecutor
Expand All @@ -43,7 +40,7 @@ contract AuthBridgeExecutor is IAuthBridgeExecutor, AccessControl, BridgeExecuto
string[] memory signatures,
bytes[] memory calldatas,
bool[] memory withDelegatecalls
) external onlyRole(AUTHORIZED_BRIDGE_ROLE) {
) external onlyRole(DEFAULT_ADMIN_ROLE) {
_queue(targets, values, signatures, calldatas, withDelegatecalls);
}

Expand Down
2 changes: 1 addition & 1 deletion test/ArbitrumOneCrosschainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract ArbitrumOneCrosschainTest is CrosschainTestBase {
defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor,
bridgeExecutor
));
bridgeExecutor.grantRole(bridgeExecutor.AUTHORIZED_BRIDGE_ROLE(), bridgeReceiver);
bridgeExecutor.grantRole(bridgeExecutor.DEFAULT_ADMIN_ROLE(), bridgeReceiver);

hostDomain.selectFork();
vm.deal(L1_EXECUTOR, 0.01 ether);
Expand Down
10 changes: 4 additions & 6 deletions test/AuthBridgeExecutor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ contract AuthBridgeExecutorTestBase is Test {
gracePeriod: GRACE_PERIOD,
guardian: guardian
});
executor.grantRole(executor.AUTHORIZED_BRIDGE_ROLE(), bridge);
executor.grantRole(executor.DEFAULT_ADMIN_ROLE(), bridge);
executor.revokeRole(executor.DEFAULT_ADMIN_ROLE(), address(this));
executor.grantRole(executor.DEFAULT_ADMIN_ROLE(), bridge);
executor.revokeRole(executor.DEFAULT_ADMIN_ROLE(), address(this));
}

/******************************************************************************************************************/
Expand Down Expand Up @@ -186,15 +185,14 @@ contract AuthBridgeExecutorConstructorTests is AuthBridgeExecutorTestBase {
assertEq(executor.getGuardian(), guardian);

assertEq(executor.hasRole(executor.DEFAULT_ADMIN_ROLE(), address(this)), true);
assertEq(executor.getRoleAdmin(executor.AUTHORIZED_BRIDGE_ROLE()), executor.DEFAULT_ADMIN_ROLE());
}

}

contract AuthBridgeExecutorQueueTests is AuthBridgeExecutorTestBase {

function test_queue_onlyBridge() public {
vm.expectRevert(abi.encodeWithSignature("AccessControlUnauthorizedAccount(address,bytes32)", address(this), executor.AUTHORIZED_BRIDGE_ROLE()));
function test_queue_onlyDefaultAdmin() public {
vm.expectRevert(abi.encodeWithSignature("AccessControlUnauthorizedAccount(address,bytes32)", address(this), executor.DEFAULT_ADMIN_ROLE()));
executor.queue(new address[](0), new uint256[](0), new string[](0), new bytes[](0), new bool[](0));
}

Expand Down
2 changes: 1 addition & 1 deletion test/BaseChainCrosschainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract BaseChainCrosschainTest is CrosschainTestBase {
defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor,
bridgeExecutor
));
bridgeExecutor.grantRole(bridgeExecutor.AUTHORIZED_BRIDGE_ROLE(), bridgeReceiver);
bridgeExecutor.grantRole(bridgeExecutor.DEFAULT_ADMIN_ROLE(), bridgeReceiver);

hostDomain.selectFork();
}
Expand Down
2 changes: 1 addition & 1 deletion test/GnosisCrosschainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract GnosisCrosschainTest is CrosschainTestBase {
defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor,
bridgeExecutor
));
bridgeExecutor.grantRole(bridgeExecutor.AUTHORIZED_BRIDGE_ROLE(), bridgeReceiver);
bridgeExecutor.grantRole(bridgeExecutor.DEFAULT_ADMIN_ROLE(), bridgeReceiver);

hostDomain.selectFork();
}
Expand Down
2 changes: 1 addition & 1 deletion test/OptimismCrosschainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract OptimismCrosschainTest is CrosschainTestBase {
defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor,
bridgeExecutor
));
bridgeExecutor.grantRole(bridgeExecutor.AUTHORIZED_BRIDGE_ROLE(), bridgeReceiver);
bridgeExecutor.grantRole(bridgeExecutor.DEFAULT_ADMIN_ROLE(), bridgeReceiver);

hostDomain.selectFork();
}
Expand Down

0 comments on commit 2fb0afc

Please sign in to comment.