Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor formatting #8

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions src/executors/ArbitrumBridgeExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@ import {L2BridgeExecutor} from './L2BridgeExecutor.sol';
* @dev Queuing an ActionsSet into this Executor can only be done by the L2 Address Alias of the L1 EthereumGovernanceExecutor
*/
contract ArbitrumBridgeExecutor is L2BridgeExecutor {
uint160 internal constant OFFSET = uint160(0x1111000000000000000000000000000000001111);
uint160 internal constant OFFSET = uint160(0x1111000000000000000000000000000000001111);

/// @notice Utility function that converts the msg.sender viewed in the L2 to the
/// address in the L1 that submitted a tx to the inbox
/// @param l2Address L2 address as viewed in msg.sender
/// @return l1Address the address in the L1 that triggered the tx to L2
function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {
unchecked {
l1Address = address(uint160(l2Address) - OFFSET);
/// @notice Utility function that converts the msg.sender viewed in the L2 to the
/// address in the L1 that submitted a tx to the inbox
/// @param l2Address L2 address as viewed in msg.sender
/// @return l1Address the address in the L1 that triggered the tx to L2
function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {
unchecked {
l1Address = address(uint160(l2Address) - OFFSET);
}
}
}

/// @inheritdoc L2BridgeExecutor
modifier onlyEthereumGovernanceExecutor() override {
if (undoL1ToL2Alias(msg.sender) != _ethereumGovernanceExecutor)
revert UnauthorizedEthereumExecutor();
_;
}
/// @inheritdoc L2BridgeExecutor
modifier onlyEthereumGovernanceExecutor() override {
if (undoL1ToL2Alias(msg.sender) != _ethereumGovernanceExecutor)
revert UnauthorizedEthereumExecutor();
_;
}

/**
* @dev Constructor
*
* @param ethereumGovernanceExecutor The address of the EthereumGovernanceExecutor
* @param delay The delay before which an actions set can be executed
* @param gracePeriod The time period after a delay during which an actions set can be executed
* @param minimumDelay The minimum bound a delay can be set to
* @param maximumDelay The maximum bound a delay can be set to
* @param guardian The address of the guardian, which can cancel queued proposals (can be zero)
*/
constructor(
address ethereumGovernanceExecutor,
uint256 delay,
uint256 gracePeriod,
uint256 minimumDelay,
uint256 maximumDelay,
address guardian
)
L2BridgeExecutor(
ethereumGovernanceExecutor,
delay,
gracePeriod,
minimumDelay,
maximumDelay,
guardian
/**
* @dev Constructor
*
* @param ethereumGovernanceExecutor The address of the EthereumGovernanceExecutor
* @param delay The delay before which an actions set can be executed
* @param gracePeriod The time period after a delay during which an actions set can be executed
* @param minimumDelay The minimum bound a delay can be set to
* @param maximumDelay The maximum bound a delay can be set to
* @param guardian The address of the guardian, which can cancel queued proposals (can be zero)
*/
constructor(
address ethereumGovernanceExecutor,
uint256 delay,
uint256 gracePeriod,
uint256 minimumDelay,
uint256 maximumDelay,
address guardian
)
{
// Intentionally left blank
}
L2BridgeExecutor(
ethereumGovernanceExecutor,
delay,
gracePeriod,
minimumDelay,
maximumDelay,
guardian
)
{
// Intentionally left blank
}
}
Loading