Skip to content

Commit

Permalink
using v5 of oz contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
dan13ram committed Oct 1, 2024
1 parent 3a7fe18 commit 3d9809e
Show file tree
Hide file tree
Showing 19 changed files with 127 additions and 54 deletions.
11 changes: 9 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
url = https://github.com/foundry-rs/forge-std
[submodule "lib/LayerZero-v2"]
path = lib/LayerZero-v2
url = https://github.com/JorgeAtPaladin/LayerZero-v2
branch = lz-upgrade
url = https://github.com/dan13ram/layerzero-v2-upgradeable
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/surl"]
path = lib/surl
url = https://github.com/memester-xyz/surl
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
branch = release-v5.0
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = release-v5.0
2 changes: 1 addition & 1 deletion lib/LayerZero-v2
Submodule LayerZero-v2 updated 41 files
+1 −1 messagelib/contracts/Executor.sol
+1 −1 messagelib/contracts/ExecutorFeeLib.sol
+1 −1 messagelib/contracts/PriceFeed.sol
+2 −0 messagelib/contracts/Treasury.sol
+5 −5 messagelib/contracts/Worker.sol
+1 −1 messagelib/contracts/uln/LzExecutor.sol
+1 −1 messagelib/contracts/uln/dvn/DVNFeeLib.sol
+1 −1 messagelib/contracts/uln/dvn/MultiSig.sol
+1 −1 messagelib/contracts/uln/dvn/adapters/CCIP/CCIPDVNAdapterFeeLib.sol
+1 −1 messagelib/contracts/uln/dvn/adapters/axelar/AxelarDVNAdapterFeeLib.sol
+3 −1 messagelib/contracts/uln/uln301/ReceiveLibBaseE1.sol
+3 −0 messagelib/contracts/uln/uln301/SendUln301.sol
+3 −1 messagelib/contracts/uln/uln302/ReceiveUln302.sol
+3 −1 messagelib/contracts/uln/uln302/SendUln302.sol
+5 −5 messagelib/contracts/upgradeable/WorkerUpgradeable.sol
+0 −96 messagelib/contracts/upgradeable/proxy/ProxyAdmin.sol
+0 −131 messagelib/contracts/upgradeable/proxy/TransparentUpgradeableProxy.sol
+2 −2 messagelib/package.json
+3 −0 messagelib/test/AddressSizeConfig.t.sol
+8 −46 messagelib/test/DVN.t.sol
+4 −1 messagelib/test/LzExecutor.t.sol
+4 −0 messagelib/test/ReceiveUlnBase.t.sol
+3 −1 messagelib/test/SendLibBase.t.sol
+3 −1 messagelib/test/SendLibBaseE1.t.sol
+3 −1 messagelib/test/SendLibBaseE2.t.sol
+3 −1 messagelib/test/SendUlnBase.t.sol
+3 −1 messagelib/test/UlnBase.t.sol
+1 −1 messagelib/test/mocks/EndpointV1.sol
+1 −2 oapp/contracts/oapp/examples/OmniCounterPreCrimeUpgradeable.sol
+1 −2 oapp/contracts/oapp/examples/OmniCounterUpgradeable.sol
+2 −2 oapp/package.json
+1 −2 oapp/test/mocks/OFTAdapterUpgradeableMock.sol
+1 −2 oapp/test/mocks/OFTUpgradeableMock.sol
+1 −2 oapp/test/mocks/PreCrimeV2SimulatorUpgradeableMock.sol
+1 −2 oapp/test/mocks/PreCrimeV2UpgradeableMock.sol
+2 −2 protocol/contracts/EndpointV2.sol
+1 −1 protocol/contracts/messagelib/SimpleMessageLib.sol
+2 −2 protocol/package.json
+10 −4 protocol/test/MessageLibManager.t.sol
+2 −0 protocol/test/mocks/TreasuryMock.sol
+16 −14 yarn.lock
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at dbb610
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"@layerzerolabs/lz-evm-oapp-v2": "^2.1.18",
"@layerzerolabs/lz-evm-protocol-v2": "^2.1.27",
"@layerzerolabs/lz-evm-v1-0.7": "^2.3.40",
"@openzeppelin/contracts": "4.9.2",
"@openzeppelin/contracts-upgradeable": "4.9.2",
"hardhat-deploy": "^0.12.4",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
Expand Down
6 changes: 4 additions & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@layerzerolabs/lz-evm-oapp-v2/contracts/=node_modules/@layerzerolabs/lz-evm-oapp-v2/contracts/
@layerzerolabs/lz-evm-v1-0.7/=node_modules/@layerzerolabs/lz-evm-v1-0.7/
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/

@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/

solidity-bytes-utils/=node_modules/solidity-bytes-utils/
hardhat-deploy/=node_modules/hardhat-deploy/
Expand All @@ -17,3 +18,4 @@ forge-std/=lib/forge-std/src/
solmate/=lib/solmate/src/
surl/=lib/surl/src/
solidity-stringutils/=lib/surl/lib/solidity-stringutils/src/

1 change: 0 additions & 1 deletion script/BaseScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {BaseData} from "./BaseData.s.sol";
import {L1YnOFTAdapterUpgradeable} from "@/L1YnOFTAdapterUpgradeable.sol";
import {ImmutableMultiChainDeployer} from "@/factory/ImmutableMultiChainDeployer.sol";
import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";
import {EndpointV2} from "@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2.sol";
import {TransparentUpgradeableProxy} from
"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

Expand Down
9 changes: 7 additions & 2 deletions script/DeployL1OFTAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
pragma solidity ^0.8.24;

import {BaseScript} from "./BaseScript.s.sol";
import {Utils} from "./Utils.sol";

import {L1YnOFTAdapterUpgradeable} from "@/L1YnOFTAdapterUpgradeable.sol";
import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";
import {
ITransparentUpgradeableProxy,
ProxyAdmin,
TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {console} from "forge-std/console.sol";
Expand All @@ -17,7 +19,7 @@ import {console} from "forge-std/console.sol";
// --account ${deployerAccountName} --sender ${deployer} \
// --broadcast --etherscan-api-key ${api} --verify

contract DeployL1OFTAdapter is BaseScript {
contract DeployL1OFTAdapter is BaseScript, Utils {
L1YnOFTAdapterUpgradeable public l1OFTAdapter;

function run(string calldata _jsonPath) public {
Expand Down Expand Up @@ -48,8 +50,11 @@ contract DeployL1OFTAdapter is BaseScript {
)
);

ProxyAdmin proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l1OFTAdapter)));

vm.broadcast();
ITransparentUpgradeableProxy(address(l1OFTAdapter)).changeAdmin(getData(block.chainid).PROXY_ADMIN);
proxyAdmin.transferOwnership(getData(block.chainid).PROXY_ADMIN);

console.log("Deployed L1OFTAdapter at: %s", address(l1OFTAdapter));
} else {
l1OFTAdapter = L1YnOFTAdapterUpgradeable(currentDeployment.oftAdapter);
Expand Down
12 changes: 9 additions & 3 deletions script/DeployL2OFTAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pragma solidity ^0.8.24;

import {BaseScript} from "./BaseScript.s.sol";
import {Utils} from "./Utils.sol";

import {L2YnERC20Upgradeable} from "@/L2YnERC20Upgradeable.sol";
import {L2YnOFTAdapterUpgradeable} from "@/L2YnOFTAdapterUpgradeable.sol";
Expand All @@ -11,6 +12,7 @@ import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/Ra

import {
ITransparentUpgradeableProxy,
ProxyAdmin,
TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {console} from "forge-std/console.sol";
Expand All @@ -20,7 +22,7 @@ import {console} from "forge-std/console.sol";
// --account ${deployerAccountName} --sender ${deployer} \
// --broadcast --etherscan-api-key ${api} --verify

contract DeployL2OFTAdapter is BaseScript {
contract DeployL2OFTAdapter is BaseScript, Utils {
ImmutableMultiChainDeployer public multiChainDeployer;
L2YnOFTAdapterUpgradeable public l2OFTAdapter;
L2YnERC20Upgradeable public l2ERC20;
Expand Down Expand Up @@ -68,8 +70,10 @@ contract DeployL2OFTAdapter is BaseScript {
)
);

ProxyAdmin proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l2ERC20)));

vm.broadcast();
ITransparentUpgradeableProxy(address(l2ERC20)).changeAdmin(getData(block.chainid).PROXY_ADMIN);
proxyAdmin.transferOwnership(getData(block.chainid).PROXY_ADMIN);

console.log("Deployed L2ERC20 at: %s", address(l2ERC20));
} else {
Expand Down Expand Up @@ -99,8 +103,10 @@ contract DeployL2OFTAdapter is BaseScript {
)
);

ProxyAdmin proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l2OFTAdapter)));

vm.broadcast();
ITransparentUpgradeableProxy(address(l2OFTAdapter)).changeAdmin(getData(block.chainid).PROXY_ADMIN);
proxyAdmin.transferOwnership(getData(block.chainid).PROXY_ADMIN);

console.log("Deployed L2OFTAdapter at: %s", address(l2OFTAdapter));
} else {
Expand Down
67 changes: 67 additions & 0 deletions script/Utils.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: BSD 3-Clause License
pragma solidity ^0.8.24;

import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Vm} from "forge-std/Vm.sol";

contract Utils {
/**
* @dev Returns the admin address of a TransparentUpgradeableProxy contract.
* @param proxy The address of the TransparentUpgradeableProxy.
* @return The admin address of the proxy contract.
*/
function getTransparentUpgradeableProxyAdminAddress(address proxy) public view returns (address) {
address CHEATCODE_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D;
Vm vm = Vm(CHEATCODE_ADDRESS);

bytes32 adminSlot = vm.load(proxy, ERC1967Utils.ADMIN_SLOT);
return address(uint160(uint256(adminSlot)));
}

/**
* @dev Returns the implementation address of a TransparentUpgradeableProxy contract.
* @param proxy The address of the TransparentUpgradeableProxy.
* @return The implementation address of the proxy contract.
*/
function getTransparentUpgradeableProxyImplementationAddress(address proxy) public view returns (address) {
address CHEATCODE_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D;
Vm vm = Vm(CHEATCODE_ADDRESS);

bytes32 implementationSlot = vm.load(proxy, ERC1967Utils.IMPLEMENTATION_SLOT);
return address(uint160(uint256(implementationSlot)));
}

/**
* @dev Compares two uint256 values and checks if their difference is within a specified threshold.
* @param value1 The first uint256 value.
* @param value2 The second uint256 value.
* @param threshold The threshold for the difference between value1 and value2.
* @return bool Returns true if the difference between value1 and value2 is less than or equal to the
* threshold.
*/
function compareWithThreshold(uint256 value1, uint256 value2, uint256 threshold) public pure returns (bool) {
if (value1 > value2) {
return (value1 - value2) <= threshold;
} else {
return (value2 - value1) <= threshold;
}
}

/**
* @dev Compares two uint256 values (representing rebasing token balances) and checks if their difference is
* within an implicit threshold of 1-2 wei, allowing for a slight decrease only.
* @param value1 The first uint256 value, typically the lower or equal value in the context of rebasing tokens.
* @param value2 The second uint256 value, typically the higher or equal value in the context of rebasing
* tokens.
* @return bool Returns true if value1 is less than or equal to value2 and the difference between value2 and
* value1 is 1 or 2 wei.
*/
function compareRebasingTokenBalances(uint256 value1, uint256 value2) public pure returns (bool) {
if (value1 > value2) {
return false; // value1 should not be greater than value2
} else {
uint256 difference = value2 - value1;
return difference <= 2; // Allow for a 1-2 wei difference only
}
}
}
8 changes: 5 additions & 3 deletions script/VerifyL1OFTAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ pragma solidity ^0.8.24;

import {BaseScript, PeerConfig} from "./BaseScript.s.sol";
import {BatchScript} from "./BatchScript.s.sol";
import {Utils} from "./Utils.sol";

import {L1YnOFTAdapterUpgradeable} from "@/L1YnOFTAdapterUpgradeable.sol";

import {IOAppCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol";
import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";
import {
ITransparentUpgradeableProxy,
ProxyAdmin,
TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {console} from "forge-std/console.sol";
Expand All @@ -19,7 +21,7 @@ import {console} from "forge-std/console.sol";
// --rpc-url ${rpc} --sig "run(string calldata)" ${path} \
// --account ${deployerAccountName} --sender ${deployer}

contract VerifyL1OFTAdapter is BaseScript, BatchScript {
contract VerifyL1OFTAdapter is BaseScript, BatchScript, Utils {
L1YnOFTAdapterUpgradeable public l1OFTAdapter;

RateLimiter.RateLimitConfig[] public newRateLimitConfigs;
Expand All @@ -42,8 +44,8 @@ contract VerifyL1OFTAdapter is BaseScript, BatchScript {
revert("L1 OFT Adapter ownership not transferred");
}

vm.prank(getData(block.chainid).PROXY_ADMIN);
if (ITransparentUpgradeableProxy(address(l1OFTAdapter)).admin() != getData(block.chainid).PROXY_ADMIN) {
ProxyAdmin proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l1OFTAdapter)));
if (proxyAdmin.owner() != getData(block.chainid).PROXY_ADMIN) {
revert("L1 OFT Adapter proxy admin not set");
}

Expand Down
12 changes: 7 additions & 5 deletions script/VerifyL2OFTAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity ^0.8.24;

import {BaseScript, PeerConfig} from "./BaseScript.s.sol";
import {BatchScript} from "./BatchScript.s.sol";
import {Utils} from "./Utils.sol";

import {L2YnERC20Upgradeable} from "@/L2YnERC20Upgradeable.sol";
import {L2YnOFTAdapterUpgradeable} from "@/L2YnOFTAdapterUpgradeable.sol";
Expand All @@ -13,6 +14,7 @@ import {IOAppCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces
import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";
import {
ITransparentUpgradeableProxy,
ProxyAdmin,
TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {console} from "forge-std/console.sol";
Expand All @@ -21,7 +23,7 @@ import {console} from "forge-std/console.sol";
// --rpc-url ${rpc} --sig "run(string calldata)" ${path} \
// --account ${deployerAccountName} --sender ${deployer}

contract VerifyL2OFTAdapter is BaseScript, BatchScript {
contract VerifyL2OFTAdapter is BaseScript, BatchScript, Utils {
ImmutableMultiChainDeployer public multiChainDeployer;
L2YnOFTAdapterUpgradeable public l2OFTAdapter;
L2YnERC20Upgradeable public l2ERC20;
Expand Down Expand Up @@ -66,8 +68,8 @@ contract VerifyL2OFTAdapter is BaseScript, BatchScript {
revert("L2 OFT Adapter ownership not transferred");
}

vm.prank(getData(block.chainid).PROXY_ADMIN);
if (ITransparentUpgradeableProxy(address(l2OFTAdapter)).admin() != getData(block.chainid).PROXY_ADMIN) {
ProxyAdmin proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l2OFTAdapter)));
if (proxyAdmin.owner() != getData(block.chainid).PROXY_ADMIN) {
revert("L2 OFT Adapter proxy admin not set");
}

Expand All @@ -82,8 +84,8 @@ contract VerifyL2OFTAdapter is BaseScript, BatchScript {
revert("Token Admin Role not set");
}

vm.prank(getData(block.chainid).PROXY_ADMIN);
if (ITransparentUpgradeableProxy(address(l2ERC20)).admin() != getData(block.chainid).PROXY_ADMIN) {
proxyAdmin = ProxyAdmin(getTransparentUpgradeableProxyAdminAddress(address(l2ERC20)));
if (proxyAdmin.owner() != getData(block.chainid).PROXY_ADMIN) {
revert("L2 ERC20 proxy admin not set");
}

Expand Down
3 changes: 1 addition & 2 deletions src/L1YnOFTAdapterUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ contract L1YnOFTAdapterUpgradeable is OFTAdapterUpgradeable, RateLimiter {
*/
function initialize(address _owner) external virtual initializer {
__OFTAdapter_init(_owner);
__Ownable_init();
_transferOwnership(_owner);
__Ownable_init(_owner);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/L2YnOFTAdapterUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ contract L2YnOFTAdapterUpgradeable is OFTAdapterUpgradeable, RateLimiter {
*/
function initialize(address _owner) external virtual initializer {
__OFTAdapter_init(_owner);
__Ownable_init();
_transferOwnership(_owner);
__Ownable_init(_owner);
}

/**
Expand Down
12 changes: 8 additions & 4 deletions test/CrossChainBaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {ImmutableMultiChainDeployer} from "@/factory/ImmutableMultiChainDeployer
import {IMintableBurnableERC20} from "@/interfaces/IMintableBurnableERC20.sol";
import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";
import {ERC20Mock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/ERC20Mock.sol";
import {EndpointV2} from "@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2.sol";
import {ILayerZeroEndpointV2} from
"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import {TransparentUpgradeableProxy} from
"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {Test} from "forge-std/Test.sol";
Expand All @@ -29,9 +30,12 @@ contract CrossChainBaseTest is Test {
address public _owner = makeAddr("owner");
address public _controller = makeAddr("controller");

EndpointV2 public arbitrumLzEndpoint = EndpointV2(0x1a44076050125825900e736c501f859c50fE728c);
EndpointV2 public optimismLzEndpoint = EndpointV2(0x1a44076050125825900e736c501f859c50fE728c);
EndpointV2 public mainnetLzEndpoint = EndpointV2(0x1a44076050125825900e736c501f859c50fE728c);
ILayerZeroEndpointV2 public arbitrumLzEndpoint =
ILayerZeroEndpointV2(0x1a44076050125825900e736c501f859c50fE728c);
ILayerZeroEndpointV2 public optimismLzEndpoint =
ILayerZeroEndpointV2(0x1a44076050125825900e736c501f859c50fE728c);
ILayerZeroEndpointV2 public mainnetLzEndpoint =
ILayerZeroEndpointV2(0x1a44076050125825900e736c501f859c50fE728c);

ERC20Mock public mainnetERC20;
L2YnERC20Upgradeable public optimismERC20;
Expand Down
15 changes: 4 additions & 11 deletions test/OFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ pragma solidity ^0.8.24;

import {OptionsBuilder} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/libs/OptionsBuilder.sol";

import {
EnforcedOptionParam,
IOAppOptionsType3
} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/libs/OAppOptionsType3Upgradeable.sol";
import {
MessagingFee,
MessagingReceipt
} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oft/OFTCoreUpgradeable.sol";
} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oft/interfaces/IOFT.sol";
import {ERC20Mock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/ERC20Mock.sol";
import {OFTAdapterUpgradeableMock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/OFTAdapterUpgradeableMock.sol";
import {OFTComposerMock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/OFTComposerMock.sol";
import {IOAppMsgInspector, OFTInspectorMock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/OFTInspectorMock.sol";
import {OFTUpgradeableMock} from "@layerzerolabs/lz-evm-oapp-v2/test/mocks/OFTUpgradeableMock.sol";

import {OFTComposeMsgCodec} from
"@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oft/libs/OFTComposeMsgCodec.sol";
import {OFTMsgCodec} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oft/libs/OFTMsgCodec.sol";

import {
IOFT,
Expand All @@ -31,13 +23,15 @@ import {IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metad

import {L1OFTAdapterMock} from "./mocks/L1OFTAdapterMock.sol";
import {L2OFTAdapterMock} from "./mocks/L2OFTAdapterMock.sol";
import {Initializable, TestHelper} from "@layerzerolabs/lz-evm-oapp-v2/test/TestHelper.sol";

import {console} from "forge-std/console.sol";

import {L2YnERC20Upgradeable as L2YnERC20} from "@/L2YnERC20Upgradeable.sol";

import {RateLimiter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol";

import {TestHelper} from "@layerzerolabs/lz-evm-oapp-v2/test/TestHelper.sol";

contract OFTTest is TestHelper {
using OptionsBuilder for bytes;

Expand All @@ -62,7 +56,6 @@ contract OFTTest is TestHelper {
vm.deal(userB, 1000 ether);
vm.deal(userC, 1000 ether);

super.setUp();
setUpEndpoints(3, LibraryType.UltraLightNode);
RateLimiter.RateLimitConfig[] memory _rateLimitConfigs = new RateLimiter.RateLimitConfig[](3);
_rateLimitConfigs[0] = RateLimiter.RateLimitConfig({dstEid: 1, limit: 10 ether, window: 1 days});
Expand Down
Loading

0 comments on commit 3d9809e

Please sign in to comment.