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

Address some code cleanup and refactoring issues #48

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:

# `forge coverage` doesn't have an `exclude-path` flag.
# See open issue: https://github.com/foundry-rs/foundry/issues/2988
# We manually exclude output for the src/test directory, as well as
# the 'Total' row which would be askew with out the full data set.
# We manually exclude output for the test/ directory, as well as
# the 'Total' row which would be askew without the full data set.
- name: Run Forge coverage
run: |
forge coverage --report summary | grep -v "test/" | grep -v "| Total" > ./coverage.out
Expand Down
2 changes: 1 addition & 1 deletion script/DeployRootContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {RootAxelarBridgeAdaptor} from "../src/root/RootAxelarBridgeAdaptor.sol";
import {ChildERC20Bridge} from "../src/child/ChildERC20Bridge.sol";
import {ChildAxelarBridgeAdaptor} from "../src/child/ChildAxelarBridgeAdaptor.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {WETH} from "../src/test/root/WETH.sol";
import {WETH} from "../src/lib/WETH.sol";

// TODO update private key usage to be more secure: https://book.getfoundry.sh/reference/forge/forge-script#wallet-options---raw

Expand Down
6 changes: 5 additions & 1 deletion src/child/ChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br
}

/**
* @notice Fallback function on receiving native IMX from WIMX contract.
* @notice Method to receive IMX back from the WIMX contract when it is unwrapped
* @dev When a user deposits wIMX, it must first be unwrapped.
* This allows the bridge to store the underlying native IMX, rather than the wrapped version.
* The unwrapping is done through the WIMX contract's `withdraw()` function, which sends the native IMX to this bridge contract.
* The only reason this `receive()` function is needed is for this process, hence the validation ensures that the sender is the WIMX contract.
*/
receive() external payable whenNotPaused {
// Revert if sender is not the WIMX token address
Expand Down
3 changes: 3 additions & 0 deletions src/common/AdaptorRoles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ abstract contract AdaptorRoles is AccessControlUpgradeable {
function revokeTargetMangaerRole(address account) external onlyRole(DEFAULT_ADMIN_ROLE) {
revokeRole(TARGET_MANAGER_ROLE, account);
}

// slither-disable-next-line unused-state,naming-convention
uint256[50] private __gapAdaptorRoles;
}
3 changes: 3 additions & 0 deletions src/common/BridgeRoles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,7 @@ abstract contract BridgeRoles is AccessControlUpgradeable, PausableUpgradeable {
function unpause() external onlyRole(UNPAUSER_ROLE) {
_unpause();
}

// slither-disable-next-line unused-state,naming-convention
uint256[50] private __gapBridgeRoles;
}
2 changes: 1 addition & 1 deletion src/test/root/WETH.sol → src/lib/WETH.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.19;

import {IWETH} from "../../interfaces/root/IWETH.sol";
import {IWETH} from "../interfaces/root/IWETH.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

/**
Expand Down
7 changes: 5 additions & 2 deletions src/root/RootERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ contract RootERC20Bridge is BridgeRoles, IRootERC20Bridge, IRootERC20BridgeEvent
}

/**
* @notice method to receive the ETH back from the WETH contract when it is unwrapped
* @notice Method to receive ETH back from the WETH contract when it is unwrapped
* @dev When a user deposits wETH, it must first be unwrapped.
* This allows the bridge to store the underlying native ETH, rather than the wrapped version.
* The unwrapping is done through the WETH contract's `withdraw()` function, which sends the native ETH to this bridge contract.
* The only reason this `receive()` function is needed is for this process, hence the validation ensures that the sender is the WETH contract.
*/
receive() external payable whenNotPaused {
// Revert if sender is not the WETH token address
Expand Down Expand Up @@ -504,7 +508,6 @@ contract RootERC20Bridge is BridgeRoles, IRootERC20Bridge, IRootERC20BridgeEvent
IERC20Metadata(rootToken).safeTransfer(receiver, amount);
emit RootChainERC20Withdraw(rootToken, childToken, withdrawer, receiver, amount);
}
// slither-disable-next-line reentrancy-events
}

// slither-disable-next-line unused-state,naming-convention
Expand Down
2 changes: 1 addition & 1 deletion src/root/flowrate/FlowRateDetection.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright Immutable Pty Ltd 2018 - 2023
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: Apache 2.0
pragma solidity 0.8.19;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/root/flowrate/FlowRateWithdrawalQueue.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright Immutable Pty Ltd 2018 - 2023
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: Apache 2.0
pragma solidity 0.8.19;

import {
Expand Down
6 changes: 3 additions & 3 deletions test/integration/child/ChildAxelarBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
IChildERC20BridgeErrors
} from "../../../src/child/ChildERC20Bridge.sol";
import {IChildERC20, ChildERC20} from "../../../src/child/ChildERC20.sol";
import {MockChildAxelarGateway} from "../../../src/test/child/MockChildAxelarGateway.sol";
import {MockChildAxelarGasService} from "../../../src/test/child/MockChildAxelarGasService.sol";
import {MockChildAxelarGateway} from "../../mocks/child/MockChildAxelarGateway.sol";
import {MockChildAxelarGasService} from "../../mocks/child/MockChildAxelarGasService.sol";
import {Utils} from "../../utils.t.sol";

contract ChildERC20BridgeIntegrationTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils {
Expand Down Expand Up @@ -317,7 +317,7 @@ contract ChildERC20BridgeIntegrationTest is Test, IChildERC20BridgeEvents, IChil
address rootAddress = address(0x123);
{
// Found by running `forge inspect src/child/ChildERC20Bridge.sol:ChildERC20Bridge storageLayout | grep -B3 -A5 -i "rootTokenToChildToken"`
uint256 rootTokenToChildTokenMappingSlot = 201;
uint256 rootTokenToChildTokenMappingSlot = 251;
address childAddress = address(444444);
bytes32 slot = getMappingStorageSlotFor(rootAddress, rootTokenToChildTokenMappingSlot);
bytes32 data = bytes32(uint256(uint160(childAddress)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity 0.8.19;

import {Test} from "forge-std/Test.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ import {Test, console2} from "forge-std/Test.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
IChildAxelarBridgeAdaptorEvents,
IChildAxelarBridgeAdaptorErrors
} from "../../../../src/child/ChildAxelarBridgeAdaptor.sol";
import {Utils} from "../../../utils.t.sol";
import {WETH} from "../../../../src/test/root/WETH.sol";
import {WIMX} from "../../../../src/child/WIMX.sol";
import {ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ import {Test, console2} from "forge-std/Test.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
IChildAxelarBridgeAdaptorEvents,
IChildAxelarBridgeAdaptorErrors
} from "../../../../src/child/ChildAxelarBridgeAdaptor.sol";
import {Utils} from "../../../utils.t.sol";
import {WETH} from "../../../../src/test/root/WETH.sol";
import {WIMX} from "../../../../src/child/WIMX.sol";
import {ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity 0.8.19;

import {Test} from "forge-std/Test.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity 0.8.19;

import {Test} from "forge-std/Test.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity 0.8.19;
import {Test} from "forge-std/Test.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.19;

import {Test} from "forge-std/Test.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ import {Test} from "forge-std/Test.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {ChildERC20Bridge, IChildERC20BridgeEvents} from "../../../../src/child/ChildERC20Bridge.sol";
import {
ChildAxelarBridgeAdaptor,
IChildAxelarBridgeAdaptorEvents,
IChildAxelarBridgeAdaptorErrors
} from "../../../../src/child/ChildAxelarBridgeAdaptor.sol";
import {Utils} from "../../../utils.t.sol";
import {WETH} from "../../../../src/test/root/WETH.sol";
import {WIMX} from "../../../../src/child/WIMX.sol";
import {ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
Expand Down
5 changes: 2 additions & 3 deletions test/integration/root/RootERC20BridgeFlowRate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import {Test, console2} from "forge-std/Test.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../mocks/root/MockAxelarGasService.sol";
import {RootERC20Bridge, IRootERC20BridgeEvents, IERC20Metadata} from "../../../src/root/RootERC20Bridge.sol";
import {RootERC20BridgeFlowRate} from "../../../src/root/flowrate/RootERC20BridgeFlowRate.sol";
import {RootAxelarBridgeAdaptor, IRootAxelarBridgeAdaptorEvents} from "../../../src/root/RootAxelarBridgeAdaptor.sol";
import {Utils} from "../../utils.t.sol";
import {WETH} from "../../../src/test/root/WETH.sol";

contract RootERC20BridgeFlowRateIntegrationTest is
Test,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {Test, console2} from "forge-std/Test.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MockAxelarGateway} from "../../../../src/test/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../../src/test/root/MockAxelarGasService.sol";
import {MockAxelarGateway} from "../../../mocks/root/MockAxelarGateway.sol";
import {MockAxelarGasService} from "../../../mocks/root/MockAxelarGasService.sol";
import {
RootERC20Bridge,
IRootERC20BridgeEvents,
Expand All @@ -19,7 +19,6 @@ import {
RootAxelarBridgeAdaptor, IRootAxelarBridgeAdaptorEvents
} from "../../../../src/root/RootAxelarBridgeAdaptor.sol";
import {Utils} from "../../../utils.t.sol";
import {WETH} from "../../../../src/test/root/WETH.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

contract RootERC20BridgeFlowRateWithdrawIntegrationTest is
Expand Down Expand Up @@ -52,8 +51,6 @@ contract RootERC20BridgeFlowRateWithdrawIntegrationTest is
function setUp() public {
console2.log("root withdraw setUp");

deployCodeTo("WETH.sol", abi.encode("Wrapped ETH", "WETH"), WRAPPED_ETH);

RootIntegration memory integration = rootIntegrationSetup(
CHILD_BRIDGE,
CHILD_BRIDGE_ADAPTOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Adapted from OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity 0.8.19;

import "../../child/ChildERC20.sol";

import "../../../src/child/ChildERC20.sol";
/**
* @title ChildERC20FailOnBurn
* @author Immutable (@Benjimmutable)
* @notice ChildERC20 contract, except burn always returns false. Used for testing.
* @dev USED FOR TESTING
*/
// solhint-disable reason-string

contract ChildERC20FailOnBurn is ChildERC20 {
function burn(address, /*account*/ uint256 /*amount*/ ) public virtual override returns (bool) {
return false;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions test/unit/child/ChildAxelarBridgeAdaptor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {Test} from "forge-std/Test.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {ERC20PresetMinterPauser} from "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
import {ChildAxelarBridgeAdaptor} from "../../../src/child/ChildAxelarBridgeAdaptor.sol";
import {MockChildERC20Bridge} from "../../../src/test/child/MockChildERC20Bridge.sol";
import {MockChildAxelarGateway} from "../../../src/test/child/MockChildAxelarGateway.sol";
import {MockChildAxelarGasService} from "../../../src/test/child/MockChildAxelarGasService.sol";
import {MockChildERC20Bridge} from "../../mocks/child/MockChildERC20Bridge.sol";
import {MockChildAxelarGateway} from "../../mocks/child/MockChildAxelarGateway.sol";
import {MockChildAxelarGasService} from "../../mocks/child/MockChildAxelarGasService.sol";
import {
IChildAxelarBridgeAdaptorErrors,
IChildAxelarBridgeAdaptorEvents,
Expand Down
4 changes: 2 additions & 2 deletions test/unit/child/ChildERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B
address caller = address(0x123a);
payable(caller).transfer(2 ether);
// forge inspect src/child/ChildERC20Bridge.sol:ChildERC20Bridge storageLayout | grep -B3 -A5 -i "wIMXToken"
uint256 wIMXStorageSlot = 208;
uint256 wIMXStorageSlot = 258;
vm.store(address(childBridge), bytes32(wIMXStorageSlot), bytes32(uint256(uint160(caller))));

vm.startPrank(caller);
Expand Down Expand Up @@ -664,7 +664,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B
address rootAddress = address(0x123);
{
// Found by running `forge inspect src/child/ChildERC20Bridge.sol:ChildERC20Bridge storageLayout | grep -B3 -A5 -i "rootTokenToChildToken"`
uint256 rootTokenToChildTokenMappingSlot = 201;
uint256 rootTokenToChildTokenMappingSlot = 251;
address childAddress = address(444444);
bytes32 slot = getMappingStorageSlotFor(rootAddress, rootTokenToChildTokenMappingSlot);
bytes32 data = bytes32(uint256(uint160(childAddress)));
Expand Down
4 changes: 2 additions & 2 deletions test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IChildERC20BridgeErrors
} from "../../../../src/child/ChildERC20Bridge.sol";
import {IChildERC20, ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {MockAdaptor} from "../../../../src/test/root/MockAdaptor.sol";
import {MockAdaptor} from "../../../mocks/root/MockAdaptor.sol";
import {Utils, IPausable} from "../../../utils.t.sol";

contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils {
Expand Down Expand Up @@ -114,7 +114,7 @@ contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChi

// Slot is 2 because of the Ownable, Initializable contracts coming first.
// Found by running `forge inspect src/child/ChildERC20Bridge.sol:ChildERC20Bridge storageLayout | grep -B3 -A5 -i "rootTokenToChildToken"`
uint256 rootTokenToChildTokenMappingSlot = 201;
uint256 rootTokenToChildTokenMappingSlot = 251;
bytes32 slot = getMappingStorageSlotFor(address(0), rootTokenToChildTokenMappingSlot);
bytes32 data = bytes32(uint256(uint160(address(childToken))));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "../../../../src/child/ChildERC20Bridge.sol";
import {IChildERC20} from "../../../../src/interfaces/child/IChildERC20.sol";
import {ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {MockAdaptor} from "../../../../src/test/root/MockAdaptor.sol";
import {MockAdaptor} from "../../../mocks/root/MockAdaptor.sol";
import {Utils, IPausable} from "../../../utils.t.sol";

contract ChildERC20BridgeWithdrawETHUnitTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "../../../../src/child/ChildERC20Bridge.sol";
import {IChildERC20} from "../../../../src/interfaces/child/IChildERC20.sol";
import {ChildERC20} from "../../../../src/child/ChildERC20.sol";
import {MockAdaptor} from "../../../../src/test/root/MockAdaptor.sol";
import {MockAdaptor} from "../../../mocks/root/MockAdaptor.sol";
import {Utils, IPausable} from "../../../utils.t.sol";

contract ChildERC20BridgeWithdrawETHToUnitTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils {
Expand Down
Loading
Loading