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

[SC-380] Improve Coverage + Slight Refactoring #14

Merged
merged 13 commits into from
May 20, 2024
3 changes: 3 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
src = "src"
out = "out"
libs = ["lib"]
solc_version = '0.8.25'
optimizer = true
optimizer_runs = 200
2 changes: 1 addition & 1 deletion src/executors/AuthBridgeExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.10;

import { AccessControl } from 'lib/openzeppelin-contracts/contracts/access/AccessControl.sol';

import { IAuthBridgeExecutor } from '../interfaces/IAuthBridgeExecutor.sol';
import { IAuthBridgeExecutor } from 'src/interfaces/IAuthBridgeExecutor.sol';
import { BridgeExecutorBase } from './BridgeExecutorBase.sol';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/executors/BridgeExecutorBase.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.10;

import { IExecutorBase } from '../interfaces/IExecutorBase.sol';
import { IExecutorBase } from 'src/interfaces/IExecutorBase.sol';

/**
* @title BridgeExecutorBase
Expand Down
4 changes: 2 additions & 2 deletions src/receivers/BridgeExecutorReceiverArbitrum.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import { ArbitrumReceiver } from 'xchain-helpers/ArbitrumReceiver.sol';

import { IAuthBridgeExecutor } from '../interfaces/IAuthBridgeExecutor.sol';
import { IAuthBridgeExecutor } from 'src/interfaces/IAuthBridgeExecutor.sol';

contract BridgeExecutorReceiverArbitrum is ArbitrumReceiver {

Expand Down
4 changes: 2 additions & 2 deletions src/receivers/BridgeExecutorReceiverGnosis.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import { GnosisReceiver } from 'xchain-helpers/GnosisReceiver.sol';

import { IAuthBridgeExecutor } from '../interfaces/IAuthBridgeExecutor.sol';
import { IAuthBridgeExecutor } from 'src/interfaces/IAuthBridgeExecutor.sol';

contract BridgeExecutorReceiverGnosis is GnosisReceiver {

Expand Down
4 changes: 2 additions & 2 deletions src/receivers/BridgeExecutorReceiverOptimism.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import { OptimismReceiver } from 'xchain-helpers/OptimismReceiver.sol';

import { IAuthBridgeExecutor } from '../interfaces/IAuthBridgeExecutor.sol';
import { IAuthBridgeExecutor } from 'src/interfaces/IAuthBridgeExecutor.sol';

contract BridgeExecutorReceiverOptimism is OptimismReceiver {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import 'forge-std/Test.sol';

import { Domain, ArbitrumDomain } from 'xchain-helpers/testing/ArbitrumDomain.sol';
import { XChainForwarders } from 'xchain-helpers/XChainForwarders.sol';

import { AuthBridgeExecutor } from '../src/executors/AuthBridgeExecutor.sol';
import { BridgeExecutorReceiverArbitrum } from '../src/receivers/BridgeExecutorReceiverArbitrum.sol';
import { AuthBridgeExecutor } from 'src/executors/AuthBridgeExecutor.sol';
import { BridgeExecutorReceiverArbitrum } from 'src/receivers/BridgeExecutorReceiverArbitrum.sol';

import { IPayload } from './interfaces/IPayload.sol';

import { CrosschainPayload, CrosschainTestBase } from './CrosschainTestBase.sol';

contract ArbitrumCrosschainPayload is CrosschainPayload {
contract ArbitrumOneCrosschainPayload is CrosschainPayload {

constructor(IPayload _targetPayload, address _bridgeReceiver)
CrosschainPayload(_targetPayload, _bridgeReceiver) {}
Expand All @@ -30,12 +30,12 @@ contract ArbitrumCrosschainPayload is CrosschainPayload {

}

contract ArbitrumCrosschainTest is CrosschainTestBase {
contract ArbitrumOneCrosschainTest is CrosschainTestBase {

function deployCrosschainPayload(IPayload targetPayload, address bridgeReceiver)
public override returns (IPayload)
{
return IPayload(new ArbitrumCrosschainPayload(targetPayload, bridgeReceiver));
return IPayload(new ArbitrumOneCrosschainPayload(targetPayload, bridgeReceiver));
}

function setUp() public {
Expand All @@ -60,4 +60,14 @@ contract ArbitrumCrosschainTest is CrosschainTestBase {
vm.deal(L1_EXECUTOR, 0.01 ether);
}

function test_constructor_receiver() public {
BridgeExecutorReceiverArbitrum receiver = new BridgeExecutorReceiverArbitrum(
defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor,
bridgeExecutor
);

assertEq(receiver.l1Authority(), defaultL2BridgeExecutorArgs.ethereumGovernanceExecutor);
assertEq(address(receiver.executor()), address(bridgeExecutor));
}

}
Loading
Loading