From 8b92a02b4684aa3160abcaacbb73724102f4a273 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Sat, 5 Oct 2024 14:59:32 -0500 Subject: [PATCH 01/13] importing legacy native minting contracts --- contracts/EtherfiL1SyncPoolETH.sol | 205 -------- contracts/L1BaseSyncPoolUpgradeable.sol | 328 ------------ contracts/MintableOFTUpgradeable.sol | 2 +- contracts/NativeMinting/BucketRateLimiter.sol | 80 +++ .../NativeMinting/DummyTokenUpgradeable.sol | 68 +++ .../EtherfiL2ExchangeRateProvider.sol | 39 ++ .../L1BaseReceiverUpgradeable.sol | 108 ++++ .../L2BaseSyncPoolUpgradeable.sol | 478 ++++++++++++++++++ .../L2ExchangeRateProviderUpgradeable.sol | 161 ++++++ .../EtherfiL2ModeSyncPoolETH.sol | 25 + .../L2ModeSyncPoolETHUpgradeable.sol | 110 ++++ .../L1ScrollReceiverETHUpgradeable.sol | 46 ++ interfaces/IAggregatorV3.sol | 20 + interfaces/ICrossDomainMessenger.sol | 28 + interfaces/IL1Receiver.sol | 6 + interfaces/IL1ScrollMessenger.sol | 79 +++ interfaces/IL2ExchangeRateProvider.sol | 21 + interfaces/IL2SyncPool.sol | 17 + interfaces/IRateLimiter.sol | 7 + interfaces/IScrollMessenger.sol | 77 +++ scripts/NativeMintingDeployment/L1.s.sol | 39 ++ utils/BaseMessengerUpgradeable.sol | 63 +++ utils/BaseReceiverUpgradeable.sol | 62 +++ utils/BucketLimiter.sol | 155 ++++++ utils/Constants.sol | 2 +- 25 files changed, 1691 insertions(+), 535 deletions(-) delete mode 100644 contracts/EtherfiL1SyncPoolETH.sol delete mode 100644 contracts/L1BaseSyncPoolUpgradeable.sol create mode 100644 contracts/NativeMinting/BucketRateLimiter.sol create mode 100644 contracts/NativeMinting/DummyTokenUpgradeable.sol create mode 100644 contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol create mode 100644 contracts/NativeMinting/L1BaseReceiverUpgradeable.sol create mode 100644 contracts/NativeMinting/L2BaseSyncPoolUpgradeable.sol create mode 100644 contracts/NativeMinting/L2ExchangeRateProviderUpgradeable.sol create mode 100644 contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol create mode 100644 contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol create mode 100644 contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol create mode 100644 interfaces/IAggregatorV3.sol create mode 100644 interfaces/ICrossDomainMessenger.sol create mode 100644 interfaces/IL1Receiver.sol create mode 100644 interfaces/IL1ScrollMessenger.sol create mode 100644 interfaces/IL2ExchangeRateProvider.sol create mode 100644 interfaces/IL2SyncPool.sol create mode 100644 interfaces/IRateLimiter.sol create mode 100644 interfaces/IScrollMessenger.sol create mode 100644 scripts/NativeMintingDeployment/L1.s.sol create mode 100644 utils/BaseMessengerUpgradeable.sol create mode 100644 utils/BaseReceiverUpgradeable.sol create mode 100644 utils/BucketLimiter.sol diff --git a/contracts/EtherfiL1SyncPoolETH.sol b/contracts/EtherfiL1SyncPoolETH.sol deleted file mode 100644 index 922c818..0000000 --- a/contracts/EtherfiL1SyncPoolETH.sol +++ /dev/null @@ -1,205 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -import {IDummyToken} from "../interfaces/IDummyToken.sol"; -import {L1BaseSyncPoolUpgradeable, Constants} from "./L1BaseSyncPoolUpgradeable.sol"; -import {ILiquifier} from "../interfaces/ILiquifier.sol"; -import {IWeEth} from "../interfaces/IWeEth.sol"; - -contract EtherfiL1SyncPoolETH is L1BaseSyncPoolUpgradeable { - error EtherfiL1SyncPoolETH__OnlyETH(); - error EtherfiL1SyncPoolETH__InvalidAmountIn(); - error EtherfiL1SyncPoolETH__UnsetDummyToken(); - - ILiquifier private _liquifier; - IERC20 private _eEth; - - mapping(uint32 => IDummyToken) private _dummyTokens; - - event LiquifierSet(address liquifier); - event EEthSet(address eEth); - event DummyTokenSet(uint32 originEid, address dummyToken); - - /** - * @dev Constructor for Etherfi L1 Sync Pool ETH - * @param endpoint Address of the LayerZero endpoint - */ - constructor(address endpoint) L1BaseSyncPoolUpgradeable(endpoint) {} - - /** - * @dev Initialize the contract - * @param liquifier Address of the liquifier - * @param eEth Address of the eEth - * @param tokenOut Address of the main token - * @param lockBox Address of the lock box - * @param owner Address of the owner - */ - function initialize(address liquifier, address eEth, address tokenOut, address lockBox, address owner) - external - initializer - { - __L1BaseSyncPool_init(tokenOut, lockBox, owner); - __Ownable_init(owner); - - _setLiquifier(liquifier); - _setEEth(eEth); - } - - /** - * @dev Get the liquifier address - * @return The liquifier address - */ - function getLiquifier() public view returns (address) { - return address(_liquifier); - } - - /** - * @dev Get the eEth address - * @return The eEth address - */ - function getEEth() public view returns (address) { - return address(_eEth); - } - - /** - * @dev Get the dummy token address for a given origin EID - * @param originEid Origin EID - * @return The dummy token address - */ - function getDummyToken(uint32 originEid) public view virtual returns (address) { - return address(_dummyTokens[originEid]); - } - - /** - * @dev Set the liquifier address - * @param liquifier The liquifier address - */ - function setLiquifier(address liquifier) public onlyOwner { - _setLiquifier(liquifier); - } - - /** - * @dev Set the eEth address - * @param eEth The eEth address - */ - function setEEth(address eEth) public onlyOwner { - _setEEth(eEth); - } - - /** - * @dev Set the dummy token address for a given origin EID - * @param originEid Origin EID - * @param dummyToken The dummy token address - */ - function setDummyToken(uint32 originEid, address dummyToken) public onlyOwner { - _setDummyToken(originEid, dummyToken); - } - - /** - * @dev Internal function to set the liquifier address - * @param liquifier The liquifier address - */ - function _setLiquifier(address liquifier) internal { - _liquifier = ILiquifier(liquifier); - - emit LiquifierSet(liquifier); - } - - /** - * @dev Internal function to set the eEth address - * @param eEth The eEth address - */ - function _setEEth(address eEth) internal { - _eEth = IERC20(eEth); - - emit EEthSet(eEth); - } - - /** - * @dev Internal function to set the dummy token address for a given origin EID - * @param originEid Origin EID - * @param dummyToken The dummy token address - */ - function _setDummyToken(uint32 originEid, address dummyToken) internal { - _dummyTokens[originEid] = IDummyToken(dummyToken); - - emit DummyTokenSet(originEid, dummyToken); - } - - /** - * @dev Internal function to anticipate a deposit - * Will mint the dummy tokens and deposit them to the L1 deposit pool - * Will revert if: - * - The token in is not ETH - * - The dummy token is not set - * @param originEid Origin EID - * @param tokenIn Address of the token in - * @param amountIn Amount in - * @return actualAmountOut The actual amount of token received - */ - function _anticipatedDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256) - internal - virtual - override - returns (uint256 actualAmountOut) - { - if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH(); - - IERC20 tokenOut = IERC20(getTokenOut()); - - ILiquifier liquifier = _liquifier; - IDummyToken dummyToken = _dummyTokens[originEid]; - - if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken(); - - uint256 balanceBefore = tokenOut.balanceOf(address(this)); - - dummyToken.mint(address(this), amountIn); - dummyToken.approve(address(liquifier), amountIn); - - liquifier.depositWithERC20(address(dummyToken), amountIn, address(0)); - - uint256 eEthBalance = _eEth.balanceOf(address(this)); - - _eEth.approve(address(tokenOut), eEthBalance); - IWeEth(address(tokenOut)).wrap(eEthBalance); - - return tokenOut.balanceOf(address(this)) - balanceBefore; - } - - /** - * @dev Internal function to finalize a deposit - * Will swap the dummy tokens for the actual ETH - * Will revert if: - * - The token in is not ETH - * - The amount in is not equal to the value - * - The dummy token is not set - * @param originEid Origin EID - * @param tokenIn Address of the token in - * @param amountIn Amount in - */ - function _finalizeDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256) - internal - virtual - override - { - if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH(); - if (amountIn != msg.value) revert EtherfiL1SyncPoolETH__InvalidAmountIn(); - - ILiquifier liquifier = _liquifier; - IDummyToken dummyToken = _dummyTokens[originEid]; - - if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken(); - - uint256 dummyBalance = dummyToken.balanceOf(address(liquifier)); - uint256 ethBalance = address(this).balance; - - uint256 swapAmount = ethBalance > dummyBalance ? dummyBalance : ethBalance; - - liquifier.unwrapL2Eth{value: swapAmount}(address(dummyToken)); - - dummyToken.burn(swapAmount); - } -} diff --git a/contracts/L1BaseSyncPoolUpgradeable.sol b/contracts/L1BaseSyncPoolUpgradeable.sol deleted file mode 100644 index ed74769..0000000 --- a/contracts/L1BaseSyncPoolUpgradeable.sol +++ /dev/null @@ -1,328 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; -import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import { - OAppReceiverUpgradeable, - OAppCoreUpgradeable -} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/OAppReceiverUpgradeable.sol"; -import {Origin} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; - -import {IL1SyncPool} from "../interfaces/IL1SyncPool.sol"; -import {Constants} from "../libraries/Constants.sol"; - -/** - * @title L1 Base Sync Pool - * @dev Base contract for L1 Sync Pools - * A sync pool is an OApp that allows users to deposit tokens on Layer 2, and then sync them to Layer 1 - * using the LayerZero messaging protocol. - * The L1 sync pool takes care of the actual syncing process, it receives different messages from L2s - * and handles the anticipated deposits and the actual deposits. - * The L1 sync pool is responsible for managing the lock box making sure it is backed by the correct amount of tokens. - * Fast messages are used to anticipate the deposit, and slow messages are used to finalize the deposit. - * For example, a user can deposit 100 ETH on L2, the L2 sync pool will send a fast message to the L1 sync pool - * anticipating the actual 100 ETH deposit (as it takes ~7 days to finalize the deposit), and finalize the deposit - * when the 100 ETH is actually received from the L2. - */ -abstract contract L1BaseSyncPoolUpgradeable is OAppReceiverUpgradeable, ReentrancyGuardUpgradeable, IL1SyncPool { - struct L1BaseSyncPoolStorage { - IERC20 tokenOut; - address lockBox; - uint256 totalUnbackedTokens; - mapping(uint32 => address) receivers; - } - - // keccak256(abi.encode(uint256(keccak256(syncpools.storage.l1basesyncpool)) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant L1BaseSyncPoolStorageLocation = - 0xd96cd964f71a052084af61290ff53294a8f76de4d8f66ba7682fe6598635ef00; - - function _getL1BaseSyncPoolStorage() internal pure returns (L1BaseSyncPoolStorage storage $) { - assembly { - $.slot := L1BaseSyncPoolStorageLocation - } - } - - error L1BaseSyncPool__UnauthorizedCaller(); - error L1BaseSyncPool__NativeTransferFailed(); - - event ReceiverSet(uint32 indexed originEid, address receiver); - event TokenOutSet(address tokenOut); - event LockBoxSet(address lockBox); - event InsufficientDeposit( - uint32 indexed originEid, - bytes32 guid, - uint256 actualAmountOut, - uint256 expectedAmountOut, - uint256 unbackedTokens - ); - event Fee(uint32 indexed originEid, bytes32 guid, uint256 actualAmountOut, uint256 expectedAmountOut, uint256 fee); - event Sweep(address token, address receiver, uint256 amount); - - /** - * @dev Constructor for L1 Base Sync Pool - * @param endpoint Address of the LayerZero endpoint - */ - constructor(address endpoint) OAppCoreUpgradeable(endpoint) {} - - function __L1BaseSyncPool_init(address tokenOut, address lockBox, address delegate) internal onlyInitializing { - __ReentrancyGuard_init(); - __OAppCore_init(delegate); - __L1BaseSyncPool_init_unchained(tokenOut, lockBox); - } - - function __L1BaseSyncPool_init_unchained(address tokenOut, address lockBox) internal onlyInitializing { - _setTokenOut(tokenOut); - _setLockBox(lockBox); - } - - /** - * @dev Get the main token address - * @return The main token address - */ - function getTokenOut() public view virtual returns (address) { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - return address($.tokenOut); - } - - /** - * @dev Get the lock box address - * @return The lock box address - */ - function getLockBox() public view virtual returns (address) { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - return $.lockBox; - } - - /** - * @dev Get the receiver address for a specific origin EID - * @param originEid Origin EID - * @return The receiver address - */ - function getReceiver(uint32 originEid) public view virtual returns (address) { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - return $.receivers[originEid]; - } - - /** - * @dev Get the total unbacked tokens - * @return The total unbacked tokens - */ - function getTotalUnbackedTokens() public view virtual returns (uint256) { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - return $.totalUnbackedTokens; - } - - /** - * @dev Receive a message from an L2 - * Will revert if: - * - The caller is not the receiver - * @param originEid Origin EID - * @param guid Message GUID - * @param tokenIn Token address - * @param amountIn Amount in - * @param amountOut Amount out - */ - function onMessageReceived(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) - public - payable - override - nonReentrant - { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - - if (msg.sender != $.receivers[originEid]) revert L1BaseSyncPool__UnauthorizedCaller(); - - _finalizeDeposit(originEid, guid, tokenIn, amountIn, amountOut); - } - - /** - * @dev Receive a message from LayerZero - * Overriden to add reentrancy guard - * @param origin Origin - * @param guid Message GUID - * @param message Message - * @param executor Executor - * @param extraData Extra data - */ - function lzReceive( - Origin calldata origin, - bytes32 guid, - bytes calldata message, - address executor, - bytes calldata extraData - ) public payable virtual override nonReentrant { - super.lzReceive(origin, guid, message, executor, extraData); - } - - /** - * @dev Set the main token address - * @param tokenOut Address of the main token - */ - function setTokenOut(address tokenOut) public virtual onlyOwner { - _setTokenOut(tokenOut); - } - - /** - * @dev Set the lock box address - * @param lockBox Address of the lock box - */ - function setLockBox(address lockBox) public virtual onlyOwner { - _setLockBox(lockBox); - } - - /** - * @dev Set the receiver address for a specific origin EID - * @param originEid Origin EID - * @param receiver Receiver address - */ - function setReceiver(uint32 originEid, address receiver) public virtual onlyOwner { - _setReceiver(originEid, receiver); - } - - /** - * @dev Sweep tokens from the contract - * @param token Token address - * @param receiver Receiver address - * @param amount Amount to sweep - */ - function sweep(address token, address receiver, uint256 amount) public virtual onlyOwner { - if (token == Constants.ETH_ADDRESS) { - (bool success,) = receiver.call{value: amount}(""); - if (!success) revert L1BaseSyncPool__NativeTransferFailed(); - } else { - SafeERC20.safeTransfer(IERC20(token), receiver, amount); - } - - emit Sweep(token, receiver, amount); - } - - /** - * @dev Internal function called when a LZ message is received - * @param origin Origin - * @param guid Message GUID - * @param message Message - */ - function _lzReceive(Origin calldata origin, bytes32 guid, bytes calldata message, address, bytes calldata) - internal - virtual - override - { - (address tokenIn, uint256 amountIn, uint256 amountOut) = abi.decode(message, (address, uint256, uint256)); - - uint256 actualAmountOut = _anticipatedDeposit(origin.srcEid, guid, tokenIn, amountIn, amountOut); - - _handleAnticipatedDeposit(origin.srcEid, guid, actualAmountOut, amountOut); - } - - /** - * @dev Internal function to set the main token address - * @param tokenOut Address of the main token - */ - function _setTokenOut(address tokenOut) internal virtual { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - $.tokenOut = IERC20(tokenOut); - - emit TokenOutSet(tokenOut); - } - - /** - * @dev Internal function to set the receiver address for a specific origin EID - * @param originEid Origin EID - * @param receiver Receiver address - */ - function _setReceiver(uint32 originEid, address receiver) internal virtual { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - $.receivers[originEid] = receiver; - - emit ReceiverSet(originEid, receiver); - } - - /** - * @dev Internal function to set the lock box address - * @param lockBox Address of the lock box - */ - function _setLockBox(address lockBox) internal virtual { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - $.lockBox = lockBox; - - emit LockBoxSet(lockBox); - } - - /** - * @dev Internal function to handle an anticipated deposit - * Will emit an InsufficientDeposit event if the actual amount out is less than the expected amount out - * Will emit a Fee event if the actual amount out is equal or greater than the expected amount out - * The fee kept in this contract will be used to back any future insufficient deposits - * When the fee is used, the total unbacked tokens will be lower than the actual missing amount - * Any time the InsufficientDeposit event is emitted, necessary actions should be taken to back the lock box - * such as using POL, increasing the deposit fee on the faulty L2, etc. - * @param originEid Origin EID - * @param guid Message GUID - * @param actualAmountOut Actual amount out - * @param expectedAmountOut Expected amount out - */ - function _handleAnticipatedDeposit( - uint32 originEid, - bytes32 guid, - uint256 actualAmountOut, - uint256 expectedAmountOut - ) internal virtual { - L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); - - IERC20 tokenOut = $.tokenOut; - - uint256 totalUnbackedTokens = $.totalUnbackedTokens; - uint256 balance = tokenOut.balanceOf(address(this)); - - uint256 totalAmountOut = expectedAmountOut + totalUnbackedTokens; - uint256 amountToSend; - - if (balance < totalAmountOut) { - amountToSend = balance; - - $.totalUnbackedTokens = totalAmountOut - balance; - } else { - amountToSend = totalAmountOut; - - if (totalUnbackedTokens > 0) $.totalUnbackedTokens = 0; - } - - if (actualAmountOut < expectedAmountOut) { - uint256 unbackedTokens = expectedAmountOut - actualAmountOut; - emit InsufficientDeposit(originEid, guid, actualAmountOut, expectedAmountOut, unbackedTokens); - } else { - uint256 fee = actualAmountOut - expectedAmountOut; - emit Fee(originEid, guid, actualAmountOut, expectedAmountOut, fee); - } - - SafeERC20.safeTransfer(tokenOut, $.lockBox, amountToSend); - } - - /** - * @dev Internal function to anticipate a deposit - * @param originEid Origin EID - * @param guid Message GUID - * @param tokenIn Token address - * @param amountIn Amount in - * @param amountOut Amount out - * @return actualAmountOut Actual amount out - */ - function _anticipatedDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) - internal - virtual - returns (uint256 actualAmountOut); - - /** - * @dev Internal function to finalize a deposit - * @param originEid Origin EID - * @param guid Message GUID (will match the one used in the anticipated deposit) - * @param tokenIn Token address - * @param amountIn Amount in - * @param amountOut Amount out - */ - function _finalizeDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) - internal - virtual; -} diff --git a/contracts/MintableOFTUpgradeable.sol b/contracts/MintableOFTUpgradeable.sol index 81a082d..da6437c 100644 --- a/contracts/MintableOFTUpgradeable.sol +++ b/contracts/MintableOFTUpgradeable.sol @@ -72,4 +72,4 @@ contract MintableOFTUpgradeable is RateLimiter, OFTUpgradeable, AccessControlUpg $.slot := ERC20StorageLocation } } -} \ No newline at end of file +} diff --git a/contracts/NativeMinting/BucketRateLimiter.sol b/contracts/NativeMinting/BucketRateLimiter.sol new file mode 100644 index 0000000..e1a962e --- /dev/null +++ b/contracts/NativeMinting/BucketRateLimiter.sol @@ -0,0 +1,80 @@ +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/utils/math/SafeCast.sol"; +import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "../../interfaces/IRateLimiter.sol"; +import "../../utils/BucketLimiter.sol"; + +contract BucketRateLimiter is IRateLimiter, Initializable, PausableUpgradeable, OwnableUpgradeable, UUPSUpgradeable { + + BucketLimiter.Limit public limit; + address public consumer; + + mapping(address => bool) public admins; + mapping(address => bool) public pausers; + + event UpdatedAdmin(address indexed admin, bool status); + event UpdatedPauser(address indexed pauser, bool status); + + constructor() { + _disableInitializers(); + } + + function initialize(address owner) external initializer { + __Pausable_init(); + __Ownable_init(owner); + __UUPSUpgradeable_init(); + + limit = BucketLimiter.create(0, 0); + } + + function updateRateLimit(address sender, address tokenIn, uint256 amountIn, uint256 amountOut) external whenNotPaused { + require(msg.sender == consumer, "NOT_CONSUMER"); + // Count both 'amountIn' and 'amountOut' as rate limit consumption + uint64 consumedAmount = SafeCast.toUint64((amountIn + amountOut + 1e12 - 1) / 1e12); + require(BucketLimiter.consume(limit, consumedAmount), "BucketRateLimiter: rate limit exceeded"); + } + + function setCapacity(uint256 capacity) external onlyOwner { + // max capacity = max(uint64) * 1e12 ~= 16 * 1e18 * 1e12 = 16 * 1e12 ether, which is practically enough + uint64 capacity64 = SafeCast.toUint64(capacity / 1e12); + BucketLimiter.setCapacity(limit, capacity64); + } + + function setRefillRatePerSecond(uint256 refillRate) external onlyOwner { + // max refillRate = max(uint64) * 1e12 ~= 16 * 1e18 * 1e12 = 16 * 1e12 ether per second, which is practically enough + uint64 refillRate64 = SafeCast.toUint64(refillRate / 1e12); + BucketLimiter.setRefillRate(limit, refillRate64); + } + + function updateConsumer(address _consumer) external onlyOwner { + consumer = _consumer; + } + + function updateAdmin(address admin, bool status) external onlyOwner { + admins[admin] = status; + emit UpdatedAdmin(admin, status); + } + + function updatePauser(address pauser, bool status) external onlyOwner { + pausers[pauser] = status; + emit UpdatedPauser(pauser, status); + } + + function pauseContract() external { + require(pausers[msg.sender] || admins[msg.sender] || msg.sender == owner(), "NOT_PAUSER"); + _pause(); + } + + function unPauseContract() external { + require(admins[msg.sender] || msg.sender == owner(), "NOT_ADMIN"); + _unpause(); + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} + +} diff --git a/contracts/NativeMinting/DummyTokenUpgradeable.sol b/contracts/NativeMinting/DummyTokenUpgradeable.sol new file mode 100644 index 0000000..e3f1e58 --- /dev/null +++ b/contracts/NativeMinting/DummyTokenUpgradeable.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; + +import {IDummyToken} from "../../interfaces/IDummyToken.sol"; + +/** + * @title Dummy Token + * @dev ERC20 token with mint and burn functions. + * This token is expected to be used as an accounting token for anticipated deposits. + * For example, when a user deposit ETH on an L2, it needs ~7 days to be sent back to the L1, + * using a faster bridge such as LayerZero allows to deposit a dummy ETH token on the L1 + * to keep track of the actual ETH amount deposited on the L1 and L2, without any delay. + * The dummy token will then be exchanged against the actual ETH when the ETH withdrawal is completed. + */ +contract DummyTokenUpgradeable is ERC20Upgradeable, AccessControlUpgradeable, IDummyToken { + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + uint8 private immutable _decimals; + + /** + * @dev Constructor for DummyToken + * @param decimals_ The number of decimals the token uses + */ + constructor(uint8 decimals_) { + _decimals = decimals_; + _disableInitializers(); + } + + /** + * @dev Initializes the contract + * @param name The name of the token + * @param symbol The symbol of the token + * @param owner The owner of the token + */ + function initialize(string memory name, string memory symbol, address owner) external initializer { + __ERC20_init(name, symbol); + + _grantRole(DEFAULT_ADMIN_ROLE, owner); + } + + /** + * @dev Get the number of decimals the token uses + * @return The number of decimals the token uses + */ + function decimals() public view override returns (uint8) { + return _decimals; + } + + /** + * @dev Mint function that can only be called by a minter + * @param to The account to mint the tokens to + * @param amount The amount of tokens to mint + */ + function mint(address to, uint256 amount) external virtual override onlyRole(MINTER_ROLE) { + _mint(to, amount); + } + + /** + * @dev Burn function that can be called by anyone + * @param amount The amount of tokens to burn + */ + function burn(uint256 amount) external virtual override { + _burn(msg.sender, amount); + } +} diff --git a/contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol b/contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol new file mode 100644 index 0000000..a4cd1c6 --- /dev/null +++ b/contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {L2ExchangeRateProviderUpgradeable} from "./L2ExchangeRateProviderUpgradeable.sol"; +import {IAggregatorV3} from "../../interfaces/IAggregatorV3.sol"; + +contract EtherfiL2ExchangeRateProvider is L2ExchangeRateProviderUpgradeable { + error EtherfiL2ExchangeRateProvider__InvalidRate(); + + constructor() { + _disableInitializers(); + } + + function initialize(address owner) external initializer { + __Ownable_init(owner); + } + + /** + * @dev Internal function to get rate and last updated time from a rate oracle + * @param rateOracle Rate oracle contract + * @return rate The exchange rate in 1e18 precision + * @return lastUpdated Last updated time + */ + function _getRateAndLastUpdated(address rateOracle, address) + internal + view + override + returns (uint256 rate, uint256 lastUpdated) + { + (, int256 answer,, uint256 updatedAt,) = IAggregatorV3(rateOracle).latestRoundData(); + + if (answer <= 0) revert EtherfiL2ExchangeRateProvider__InvalidRate(); + + // adjust 'answer' based on Oracle feed's precision to have 1e18 precision + // rate * 1e18 / 10**oracle.decimals() + uint8 oracleDecimals = IAggregatorV3(rateOracle).decimals(); + return (uint256(uint256(answer) * 1e18 / 10**oracleDecimals), updatedAt); + } +} diff --git a/contracts/NativeMinting/L1BaseReceiverUpgradeable.sol b/contracts/NativeMinting/L1BaseReceiverUpgradeable.sol new file mode 100644 index 0000000..5c56ee7 --- /dev/null +++ b/contracts/NativeMinting/L1BaseReceiverUpgradeable.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +import {BaseMessengerUpgradeable} from "../../utils/BaseMessengerUpgradeable.sol"; +import {IL1SyncPool} from "../../interfaces/IL1SyncPool.sol"; +import {IL1Receiver} from "../../interfaces/IL1Receiver.sol"; + +/** + * @title L1 Base Receiver + * @notice Base contract for L1 receivers + * This contract is intended to receive messages from the native L2 bridge, decode the message + * and then forward it to the L1 sync pool. + */ +abstract contract L1BaseReceiverUpgradeable is OwnableUpgradeable, BaseMessengerUpgradeable, IL1Receiver { + struct L1BaseReceiverStorage { + IL1SyncPool l1SyncPool; + } + + // keccak256(abi.encode(uint256(keccak256(l1basereceiver.storage.l1syncpool)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant L1BaseReceiverStorageLocation = + 0xec90cfc37697dc33dbcf188d524bdc2a41f251df5a390991a45d6388ac04b500; + + function _getL1BaseReceiverStorage() internal pure returns (L1BaseReceiverStorage storage $) { + assembly { + $.slot := L1BaseReceiverStorageLocation + } + } + + error L1BaseReceiver__UnauthorizedCaller(); + error L1BaseReceiver__UnauthorizedL2Sender(); + + event L1SyncPoolSet(address l1SyncPool); + + function __L1BaseReceiver_init(address l1SyncPool, address messenger) internal onlyInitializing { + __BaseMessenger_init(messenger); + __L1BaseReceiver_init_unchained(l1SyncPool); + } + + function __L1BaseReceiver_init_unchained(address l1SyncPool) internal onlyInitializing { + _setL1SyncPool(l1SyncPool); + } + + /** + * @dev Get the L1 sync pool address + * @return The L1 sync pool address + */ + function getL1SyncPool() public view virtual returns (address) { + L1BaseReceiverStorage storage $ = _getL1BaseReceiverStorage(); + return address($.l1SyncPool); + } + + /** + * @dev Set the L1 sync pool address + * @param l1SyncPool The L1 sync pool address + */ + function setL1SyncPool(address l1SyncPool) public virtual onlyOwner { + _setL1SyncPool(l1SyncPool); + } + + /** + * @dev Internal function to set the L1 sync pool address + * @param l1SyncPool The L1 sync pool address + */ + function _setL1SyncPool(address l1SyncPool) internal virtual { + L1BaseReceiverStorage storage $ = _getL1BaseReceiverStorage(); + $.l1SyncPool = IL1SyncPool(l1SyncPool); + + emit L1SyncPoolSet(l1SyncPool); + } + + /** + * @dev Internal function to forward the message to the L1 sync pool + * @param originEid Origin endpoint ID + * @param sender Sender address + * @param guid Message GUID + * @param tokenIn Token address + * @param amountIn Amount of tokens + * @param amountOut Amount of tokens + * @param valueToL1SyncPool Value to send to the L1 sync pool + */ + function _forwardToL1SyncPool( + uint32 originEid, + bytes32 sender, + bytes32 guid, + address tokenIn, + uint256 amountIn, + uint256 amountOut, + uint256 valueToL1SyncPool + ) internal virtual { + if (msg.sender != getMessenger()) revert L1BaseReceiver__UnauthorizedCaller(); + if (_getAuthorizedL2Address(originEid) != sender) revert L1BaseReceiver__UnauthorizedL2Sender(); + + L1BaseReceiverStorage storage $ = _getL1BaseReceiverStorage(); + $.l1SyncPool.onMessageReceived{value: valueToL1SyncPool}(originEid, guid, tokenIn, amountIn, amountOut); + } + + /** + * @dev Internal function to get the authorized L2 address + * @param originEid Origin endpoint ID + * @return The authorized L2 address + */ + function _getAuthorizedL2Address(uint32 originEid) internal view virtual returns (bytes32) { + L1BaseReceiverStorage storage $ = _getL1BaseReceiverStorage(); + return $.l1SyncPool.peers(originEid); + } +} diff --git a/contracts/NativeMinting/L2BaseSyncPoolUpgradeable.sol b/contracts/NativeMinting/L2BaseSyncPoolUpgradeable.sol new file mode 100644 index 0000000..09cf462 --- /dev/null +++ b/contracts/NativeMinting/L2BaseSyncPoolUpgradeable.sol @@ -0,0 +1,478 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; +import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { + OAppSenderUpgradeable, + OAppCoreUpgradeable +} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/OAppSenderUpgradeable.sol"; +import {OAppOptionsType3Upgradeable} from + "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/libs/OAppOptionsType3Upgradeable.sol"; +import { + MessagingFee, + MessagingReceipt +} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; + +import {IL2ExchangeRateProvider} from "../../interfaces/IL2ExchangeRateProvider.sol"; +import {IL2SyncPool} from "../../interfaces/IL2SyncPool.sol"; +import {IMintableERC20} from "../../interfaces/IMintableERC20.sol"; +import {IRateLimiter} from "../../interfaces/IRateLimiter.sol"; +import {Constants} from "../../libraries/Constants.sol"; + +/** + * @title L2 Base Sync Pool + * @dev Base contract for Layer 2 sync pools + * A sync pool is an OApp that allows users to deposit tokens on Layer 2, and then sync them to Layer 1 + * using the LayerZero messaging protocol. + * The L2 sync pool takes care of deposits on the L2 and syncing to the L1 using the L1 sync pool. + * Once enough tokens have been deposited, anyone can trigger a sync to Layer 1. + */ +abstract contract L2BaseSyncPoolUpgradeable is + OAppSenderUpgradeable, + OAppOptionsType3Upgradeable, + ReentrancyGuardUpgradeable, + IL2SyncPool +{ + struct L2BaseSyncPoolStorage { + IL2ExchangeRateProvider l2ExchangeRateProvider; + IRateLimiter rateLimiter; + address tokenOut; + uint32 dstEid; + mapping(address => Token) tokens; + } + + /** + * @dev Token data + * @param unsyncedAmountIn Amount of tokens deposited on Layer 2 + * @param unsyncedAmountOut Amount of tokens minted on Layer 2 + * @param minSyncAmount Minimum amount of tokens required to sync + * @param l1Address Address of the token on Layer 1, address(0) is unauthorized + */ + struct Token { + uint256 unsyncedAmountIn; + uint256 unsyncedAmountOut; + uint256 minSyncAmount; + address l1Address; + } + + // keccak256(abi.encode(uint256(keccak256(syncpools.storage.l2basesyncpool)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant L2BaseSyncPoolStorageLocation = + 0x4b36603b35af025fe7f5b305ecc1a13c2c1ca8257f1efc0a04a9ab3253595100; + + function _getL2BaseSyncPoolStorage() internal pure returns (L2BaseSyncPoolStorage storage $) { + assembly { + $.slot := L2BaseSyncPoolStorageLocation + } + } + + error L2BaseSyncPool__ZeroAmount(); + error L2BaseSyncPool__InsufficientAmountOut(); + error L2BaseSyncPool__InsufficientAmountToSync(); + error L2BaseSyncPool__UnauthorizedToken(); + error L2BaseSyncPool__InvalidAmountIn(); + + event L2ExchangeRateProviderSet(address l2ExchangeRateProvider); + event RateLimiterSet(address rateLimiter); + event TokenOutSet(address tokenOut); + event DstEidSet(uint32 dstEid); + event MinSyncAmountSet(address tokenIn, uint256 minSyncAmount); + event L1TokenInSet(address tokenIn, address l1TokenIn); + event Deposit(address indexed tokenIn, uint256 amountIn, uint256 amountOut); + event Sync(uint32 dstEid, address indexed tokenIn, uint256 amountIn, uint256 amountOut); + + /** + * @dev Constructor for L2 Base Sync Pool + * @param endpoint Address of the LayerZero endpoint + */ + constructor(address endpoint) OAppCoreUpgradeable(endpoint) {} + + /** + * @dev Initialize the L2 Base Sync Pool + * @param l2ExchangeRateProvider Address of the exchange rate provider + * @param rateLimiter Address of the rate limiter + * @param tokenOut Address of the token to mint on Layer 2 + * @param dstEid Destination endpoint ID (most of the time, the Layer 1 endpoint ID) + * @param delegate Address of the delegate + */ + function __L2BaseSyncPool_init( + address l2ExchangeRateProvider, + address rateLimiter, + address tokenOut, + uint32 dstEid, + address delegate + ) internal onlyInitializing { + __ReentrancyGuard_init(); + __OAppCore_init(delegate); + __L2BaseSyncPool_init_unchained(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid); + } + + function __L2BaseSyncPool_init_unchained( + address l2ExchangeRateProvider, + address rateLimiter, + address tokenOut, + uint32 dstEid + ) internal onlyInitializing { + _setL2ExchangeRateProvider(l2ExchangeRateProvider); + _setRateLimiter(rateLimiter); + _setTokenOut(tokenOut); + _setDstEid(dstEid); + } + + /** + * @dev Get the exchange rate provider + * @return l2ExchangeRateProvider Address of the exchange rate provider + */ + function getL2ExchangeRateProvider() public view virtual returns (address) { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + return address($.l2ExchangeRateProvider); + } + + /** + * @dev Get the rate limiter + * @return rateLimiter Address of the rate limiter + */ + function getRateLimiter() public view virtual returns (address) { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + return address($.rateLimiter); + } + + /** + * @dev Get the token to mint on Layer 2 + * @return tokenOut Address of the token to mint on Layer 2 + */ + function getTokenOut() public view virtual returns (address) { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + return address($.tokenOut); + } + + /** + * @dev Get the destination endpoint ID, most of the time the Layer 1 endpoint ID + * @return dstEid Destination endpoint ID + */ + function getDstEid() public view virtual returns (uint32) { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + return $.dstEid; + } + + /** + * @dev Get token data + * If the l1Address is address(0), the token is unauthorized + * @param tokenIn Address of the token + * @return token Token data + */ + function getTokenData(address tokenIn) public view virtual returns (Token memory) { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + return $.tokens[tokenIn]; + } + + /** + * @dev Quote the messaging fee for a sync + * @param tokenIn Address of the token + * @param extraOptions Extra options for the messaging protocol + * @param payInLzToken Whether to pay the fee in LZ token + * @return msgFee Messaging fee + */ + function quoteSync(address tokenIn, bytes calldata extraOptions, bool payInLzToken) + public + view + virtual + returns (MessagingFee memory msgFee) + { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + + Token storage token = $.tokens[tokenIn]; + uint32 dstEid = $.dstEid; + + (bytes memory message, bytes memory options) = + _buildMessageAndOptions(dstEid, tokenIn, token.unsyncedAmountIn, token.unsyncedAmountOut, extraOptions); + + return _quote(dstEid, message, options, payInLzToken); + } + + /** + * @dev Deposit tokens on Layer 2 + * This will mint tokenOut on Layer 2 using the exchange rate for tokenIn to tokenOut. + * The amount deposited and minted will be stored in the token data which can be synced to Layer 1. + * Will revert if: + * - The amountIn is zero + * - The token is unauthorized (that is, the l1Address is address(0)) + * - The amountOut is less than the minAmountOut + * @param tokenIn Address of the token + * @param amountIn Amount of tokens to deposit + * @param minAmountOut Minimum amount of tokens to mint on Layer 2 + * @return amountOut Amount of tokens minted on Layer 2 + */ + function deposit(address tokenIn, uint256 amountIn, uint256 minAmountOut) + public + payable + virtual + override + nonReentrant + returns (uint256 amountOut) + { + if (amountIn == 0) revert L2BaseSyncPool__ZeroAmount(); + + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + + Token storage token = $.tokens[tokenIn]; + if (token.l1Address == address(0)) revert L2BaseSyncPool__UnauthorizedToken(); + + emit Deposit(tokenIn, amountIn, minAmountOut); + + _receiveTokenIn(tokenIn, amountIn); + + amountOut = $.l2ExchangeRateProvider.getConversionAmount(tokenIn, amountIn); + if (amountOut < minAmountOut) revert L2BaseSyncPool__InsufficientAmountOut(); + + token.unsyncedAmountIn += amountIn; + token.unsyncedAmountOut += amountOut; + + IRateLimiter rateLimiter = $.rateLimiter; + if (address(rateLimiter) != address(0)) rateLimiter.updateRateLimit(msg.sender, tokenIn, amountIn, amountOut); + + _sendTokenOut(msg.sender, amountOut); + + return amountOut; + } + + /** + * @dev Sync tokens to Layer 1 + * This will send a message to the destination endpoint with the token data to + * sync the tokens minted on Layer 2 to Layer 1. + * Will revert if: + * - The token is unauthorized (that is, the l1Address is address(0)) + * - The amount to sync is zero or less than the minSyncAmount + * @dev It is very important to listen for the Sync event to know when and how much tokens were synced + * especially if an action is required on another chain (for example, executing the message). If an action + * was required but was not executed, the tokens won't be sent to the L1. + * @param tokenIn Address of the token + * @param extraOptions Extra options for the messaging protocol + * @param fee Messaging fee + * @return unsyncedAmountIn Amount of tokens deposited on Layer 2 + * @return unsyncedAmountOut Amount of tokens minted on Layer 2 + */ + function sync(address tokenIn, bytes calldata extraOptions, MessagingFee calldata fee) + public + payable + virtual + override + nonReentrant + returns (uint256 unsyncedAmountIn, uint256 unsyncedAmountOut) + { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + Token storage token = $.tokens[tokenIn]; + + address l1TokenIn = token.l1Address; + if (l1TokenIn == address(0)) revert L2BaseSyncPool__UnauthorizedToken(); + + unsyncedAmountIn = token.unsyncedAmountIn; + unsyncedAmountOut = token.unsyncedAmountOut; + + if (unsyncedAmountIn == 0 || unsyncedAmountIn < token.minSyncAmount) { + revert L2BaseSyncPool__InsufficientAmountToSync(); + } + + token.unsyncedAmountIn = 0; + token.unsyncedAmountOut = 0; + + uint32 dstEid = $.dstEid; + + emit Sync(dstEid, tokenIn, unsyncedAmountIn, unsyncedAmountOut); + + _sync(dstEid, tokenIn, l1TokenIn, unsyncedAmountIn, unsyncedAmountOut, extraOptions, fee); + + return (unsyncedAmountIn, unsyncedAmountOut); + } + + /** + * @dev Set the exchange rate provider + * @param l2ExchangeRateProvider Address of the exchange rate provider + */ + function setL2ExchangeRateProvider(address l2ExchangeRateProvider) public virtual onlyOwner { + _setL2ExchangeRateProvider(l2ExchangeRateProvider); + } + + /** + * @dev Set the rate limiter + * @param rateLimiter Address of the rate limiter + */ + function setRateLimiter(address rateLimiter) public virtual onlyOwner { + _setRateLimiter(rateLimiter); + } + + /** + * @dev Set the token to mint on Layer 2 + * @param tokenOut Address of the token to mint on Layer 2 + */ + function setTokenOut(address tokenOut) public virtual onlyOwner { + _setTokenOut(tokenOut); + } + + /** + * @dev Set the destination endpoint ID, most of the time the Layer 1 endpoint ID + * @param dstEid Destination endpoint ID + */ + function setDstEid(uint32 dstEid) public virtual onlyOwner { + _setDstEid(dstEid); + } + + /** + * @dev Set the minimum amount of tokens required to sync + * @param tokenIn Address of the token + * @param minSyncAmount Minimum amount of tokens required to sync + */ + function setMinSyncAmount(address tokenIn, uint256 minSyncAmount) public virtual onlyOwner { + _setMinSyncAmount(tokenIn, minSyncAmount); + } + + /** + * @dev Set the Layer 1 address of the token + * @param l2TokenIn Address of the token on Layer 2 + * @param l1TokenIn Address of the token on Layer 1 + */ + function setL1TokenIn(address l2TokenIn, address l1TokenIn) public virtual onlyOwner { + _setL1TokenIn(l2TokenIn, l1TokenIn); + } + + /** + * @dev Internal function to set the exchange rate provider + * @param l2ExchangeRateProvider Address of the exchange rate provider + */ + function _setL2ExchangeRateProvider(address l2ExchangeRateProvider) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.l2ExchangeRateProvider = IL2ExchangeRateProvider(l2ExchangeRateProvider); + + emit L2ExchangeRateProviderSet(l2ExchangeRateProvider); + } + + /** + * @dev Internal function to set the rate limiter + * @param rateLimiter Address of the rate limiter + */ + function _setRateLimiter(address rateLimiter) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.rateLimiter = IRateLimiter(rateLimiter); + + emit RateLimiterSet(rateLimiter); + } + + /** + * @dev Internal function to set the token to mint on Layer 2 + * @param tokenOut Address of the token to mint on Layer 2 + */ + function _setTokenOut(address tokenOut) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.tokenOut = tokenOut; + + emit TokenOutSet(tokenOut); + } + + /** + * @dev Internal function to set the destination endpoint ID, most of the time the Layer 1 endpoint ID + * @param dstEid Destination endpoint ID + */ + function _setDstEid(uint32 dstEid) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.dstEid = dstEid; + + emit DstEidSet(dstEid); + } + + /** + * @dev Internal function to set the minimum amount of tokens required to sync + * @param tokenIn Address of the token + * @param minSyncAmount Minimum amount of tokens required to sync + */ + function _setMinSyncAmount(address tokenIn, uint256 minSyncAmount) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.tokens[tokenIn].minSyncAmount = minSyncAmount; + + emit MinSyncAmountSet(tokenIn, minSyncAmount); + } + + /** + * @dev Internal function to set the Layer 1 address of the token + * @param l2TokenIn Address of the token on Layer 2 + * @param l1TokenIn Address of the token on Layer 1 + */ + function _setL1TokenIn(address l2TokenIn, address l1TokenIn) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + $.tokens[l2TokenIn].l1Address = l1TokenIn; + + emit L1TokenInSet(l2TokenIn, l1TokenIn); + } + + /** + * @dev Internal function to receive tokens on Layer 2 + * @param tokenIn Address of the token + * @param amountIn Amount of tokens to receive + */ + function _receiveTokenIn(address tokenIn, uint256 amountIn) internal virtual { + if (tokenIn == Constants.ETH_ADDRESS) { + if (amountIn != msg.value) revert L2BaseSyncPool__InvalidAmountIn(); + } else { + if (msg.value != 0) revert L2BaseSyncPool__InvalidAmountIn(); + + // warning: not safe with transfer tax tokens + SafeERC20.safeTransferFrom(IERC20(tokenIn), msg.sender, address(this), amountIn); + } + } + + /** + * @dev Internal function to sync tokens to Layer 1 + * @param dstEid Destination endpoint ID + * @param l1TokenIn Address of the token on Layer 1 + * @param amountIn Amount of tokens deposited on Layer 2 + * @param amountOut Amount of tokens minted on Layer 2 + * @param extraOptions Extra options for the messaging protocol + * @param fee Messaging fee + * @return receipt Messaging receipt + */ + function _sync( + uint32 dstEid, + address, + address l1TokenIn, + uint256 amountIn, + uint256 amountOut, + bytes calldata extraOptions, + MessagingFee calldata fee + ) internal virtual returns (MessagingReceipt memory) { + (bytes memory message, bytes memory options) = + _buildMessageAndOptions(dstEid, l1TokenIn, amountIn, amountOut, extraOptions); + + return _lzSend(dstEid, message, options, fee, msg.sender); + } + + /** + * @dev Internal function to build the message and options for the messaging protocol + * @param dstEid Destination endpoint ID + * @param tokenIn Address of the token + * @param amountIn Amount of tokens deposited on Layer 2 + * @param amountOut Amount of tokens minted on Layer 2 + * @param extraOptions Extra options for the messaging protocol + * @return message Message for the messaging protocol + * @return options Options for the messaging protocol + */ + function _buildMessageAndOptions( + uint32 dstEid, + address tokenIn, + uint256 amountIn, + uint256 amountOut, + bytes calldata extraOptions + ) internal view virtual returns (bytes memory message, bytes memory options) { + message = abi.encode(tokenIn, amountIn, amountOut); + options = combineOptions(dstEid, 0, extraOptions); + } + + /** + * @dev Internal function to send tokenOut to an account + * @param account Address of the account + * @param amount Amount of tokens to send + */ + function _sendTokenOut(address account, uint256 amount) internal virtual { + L2BaseSyncPoolStorage storage $ = _getL2BaseSyncPoolStorage(); + IMintableERC20($.tokenOut).mint(account, amount); + } +} diff --git a/contracts/NativeMinting/L2ExchangeRateProviderUpgradeable.sol b/contracts/NativeMinting/L2ExchangeRateProviderUpgradeable.sol new file mode 100644 index 0000000..051163e --- /dev/null +++ b/contracts/NativeMinting/L2ExchangeRateProviderUpgradeable.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +import {IL2ExchangeRateProvider} from "../../interfaces/IL2ExchangeRateProvider.sol"; +import {Constants} from "../../libraries/Constants.sol"; + +/** + * @title Exchange Rate Provider + * @dev Provides exchange rate for different tokens against a common quote token + * The rates oracles are expected to all use the same quote token. + * For example, if quote is ETH and token is worth 2 ETH, the rate should be 2e18. + */ +abstract contract L2ExchangeRateProviderUpgradeable is OwnableUpgradeable, IL2ExchangeRateProvider { + struct L2ExchangeRateProviderStorage { + /** + * @dev Mapping of token address to rate parameters + * All rate oracles are expected to return rates with the `18 + decimalsIn - decimalsOut` decimals + */ + mapping(address => RateParameters) rateParameters; + } + + // keccak256(abi.encode(uint256(keccak256(syncpools.storage.l2exchangerateprovider)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant L2ExchangeRateProviderStorageLocation = + 0xe04a73ceb6eb109286b5315cfafd156065d9e3fbfa5269d3606a1b3095f3ad00; + + function _getL2ExchangeRateProviderStorage() internal pure returns (L2ExchangeRateProviderStorage storage $) { + assembly { + $.slot := L2ExchangeRateProviderStorageLocation + } + } + + error L2ExchangeRateProvider__DepositFeeExceedsMax(); + error L2ExchangeRateProvider__OutdatedRate(); + error L2ExchangeRateProvider__NoRateOracle(); + + event RateParametersSet(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod); + + function __L2ExchangeRateProvider_init() internal onlyInitializing {} + + function __L2ExchangeRateProvider_init_unchained() internal onlyInitializing {} + + /** + * @dev Get rate parameters for a token + * @param token Token address + * @return parameters Rate parameters + */ + function getRateParameters(address token) public view virtual returns (RateParameters memory parameters) { + L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage(); + return $.rateParameters[token]; + } + + /** + * @dev Get conversion amount for a token, given an amount in of token it should return the amount out. + * It also applies the deposit fee. + * Will revert if: + * - No rate oracle is set for the token + * - The rate is outdated (fresh period has passed) + * @param token Token address + * @param amountIn Amount in + * @return amountOut Amount out + */ + function getConversionAmount(address token, uint256 amountIn) + public + view + virtual + override + returns (uint256 amountOut) + { + L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage(); + RateParameters storage rateParameters = $.rateParameters[token]; + + address rateOracle = rateParameters.rateOracle; + + if (rateOracle == address(0)) revert L2ExchangeRateProvider__NoRateOracle(); + + (uint256 rate, uint256 lastUpdated) = _getRateAndLastUpdated(rateOracle, token); + + if (lastUpdated + rateParameters.freshPeriod < block.timestamp) revert L2ExchangeRateProvider__OutdatedRate(); + + uint256 feeAmount = (amountIn * rateParameters.depositFee + Constants.PRECISION_SUB_ONE) / Constants.PRECISION; + uint256 amountInAfterFee = amountIn - feeAmount; + + amountOut = amountInAfterFee * Constants.PRECISION / rate; + + return amountOut; + } + + // Skip the test for freshPeriod requirement + function getConversionAmountUnsafe(address token, uint256 amountIn) + public + view + returns (uint256 amountOut) + { + L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage(); + RateParameters storage rateParameters = $.rateParameters[token]; + + address rateOracle = rateParameters.rateOracle; + + if (rateOracle == address(0)) revert L2ExchangeRateProvider__NoRateOracle(); + + (uint256 rate, uint256 lastUpdated) = _getRateAndLastUpdated(rateOracle, token); + + uint256 feeAmount = (amountIn * rateParameters.depositFee + Constants.PRECISION_SUB_ONE) / Constants.PRECISION; + uint256 amountInAfterFee = amountIn - feeAmount; + + amountOut = amountInAfterFee * Constants.PRECISION / rate; + + return amountOut; + } + + /** + * @dev Set rate parameters for a token + * @param token Token address + * @param rateOracle Rate oracle contract, providing the exchange rate + * @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee) + * @param freshPeriod Fresh period, in seconds + */ + function setRateParameters(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod) + public + virtual + onlyOwner + { + _setRateParameters(token, rateOracle, depositFee, freshPeriod); + } + + /** + * @dev Internal function to set rate parameters for a token + * Will revert if: + * - Deposit fee exceeds 100% (1e18) + * @param token Token address + * @param rateOracle Rate oracle contract, providing the exchange rate + * @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee) + * @param freshPeriod Fresh period, in seconds + */ + function _setRateParameters(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod) + internal + virtual + { + if (depositFee > Constants.PRECISION) revert L2ExchangeRateProvider__DepositFeeExceedsMax(); + + L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage(); + $.rateParameters[token] = RateParameters(rateOracle, depositFee, freshPeriod); + + emit RateParametersSet(token, rateOracle, depositFee, freshPeriod); + } + + /** + * @dev Internal function to get rate and last updated time from a rate oracle + * @param rateOracle Rate oracle contract + * @param token The token address which the rate is for + * @return rate The exchange rate in 1e18 precision + * @return lastUpdated Last updated time + */ + function _getRateAndLastUpdated(address rateOracle, address token) + internal + view + virtual + returns (uint256 rate, uint256 lastUpdated); +} diff --git a/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol b/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol new file mode 100644 index 0000000..d62087a --- /dev/null +++ b/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {L2ModeSyncPoolETHUpgradeable} from "./L2ModeSyncPoolETHUpgradeable.sol"; + +contract EtherfiL2ModeSyncPoolETH is L2ModeSyncPoolETHUpgradeable { + constructor(address endpoint) L2ModeSyncPoolETHUpgradeable(endpoint) { + _disableInitializers(); + } + + function initialize( + address l2ExchangeRateProvider, + address rateLimiter, + address tokenOut, + uint32 dstEid, + address messenger, + address receiver, + address delegate + ) external override initializer { + __L2BaseSyncPool_init(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid, delegate); + __BaseMessenger_init(messenger); + __BaseReceiver_init(receiver); + __Ownable_init(delegate); + } +} diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol new file mode 100644 index 0000000..404e9e1 --- /dev/null +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import { + MessagingFee, + MessagingReceipt +} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; + +import {BaseMessengerUpgradeable} from "../../../utils/BaseMessengerUpgradeable.sol"; +import {BaseReceiverUpgradeable} from "../../../utils/BaseReceiverUpgradeable.sol"; +import {L2BaseSyncPoolUpgradeable} from "../L2BaseSyncPoolUpgradeable.sol"; +import {ICrossDomainMessenger} from "../../../interfaces/ICrossDomainMessenger.sol"; +import {Constants} from "../../../libraries/Constants.sol"; +import {IL1Receiver} from "../../../interfaces/IL1Receiver.sol"; + +/** + * @title L2 Mode Sync Pool for ETH + * @dev A sync pool that only supports ETH on Mode L2 + * This contract allows to send ETH from L2 to L1 during the sync process + */ +contract L2ModeSyncPoolETHUpgradeable is + L2BaseSyncPoolUpgradeable, + BaseMessengerUpgradeable, + BaseReceiverUpgradeable +{ + error L2ModeSyncPoolETH__OnlyETH(); + + /** + * @dev Constructor for L2 Mode Sync Pool for ETH + * @param endpoint Address of the LayerZero endpoint + */ + constructor(address endpoint) L2BaseSyncPoolUpgradeable(endpoint) {} + + /** + * @dev Initialize the contract + * @param l2ExchangeRateProvider Address of the exchange rate provider + * @param rateLimiter Address of the rate limiter + * @param tokenOut Address of the token to mint on Layer 2 + * @param dstEid Destination endpoint ID (most of the time, the Layer 1 endpoint ID) + * @param messenger Address of the messenger contract (most of the time, the L2 native bridge address) + * @param receiver Address of the receiver contract (most of the time, the L1 receiver contract) + * @param delegate Address of the owner + */ + function initialize( + address l2ExchangeRateProvider, + address rateLimiter, + address tokenOut, + uint32 dstEid, + address messenger, + address receiver, + address delegate + ) external virtual initializer { + __L2BaseSyncPool_init(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid, delegate); + __BaseMessenger_init(messenger); + __BaseReceiver_init(receiver); + __Ownable_init(delegate); + } + + /** + * @dev Only allows ETH to be received + * @param tokenIn The token address + * @param amountIn The amount of tokens + */ + function _receiveTokenIn(address tokenIn, uint256 amountIn) internal virtual override { + if (tokenIn != Constants.ETH_ADDRESS) revert L2ModeSyncPoolETH__OnlyETH(); + + super._receiveTokenIn(tokenIn, amountIn); + } + + /** + * @dev Internal function to sync tokens to L1 + * This will send an additional message to the messenger contract after the LZ message + * This message will contain the ETH that the LZ message anticipates to receive + * @param dstEid Destination endpoint ID + * @param l1TokenIn Address of the token on Layer 1 + * @param amountIn Amount of tokens deposited on Layer 2 + * @param amountOut Amount of tokens minted on Layer 2 + * @param extraOptions Extra options for the messaging protocol + * @param fee Messaging fee + * @return receipt Messaging receipt + */ + function _sync( + uint32 dstEid, + address l2TokenIn, + address l1TokenIn, + uint256 amountIn, + uint256 amountOut, + bytes calldata extraOptions, + MessagingFee calldata fee + ) internal virtual override returns (MessagingReceipt memory) { + if (l1TokenIn != Constants.ETH_ADDRESS || l2TokenIn != Constants.ETH_ADDRESS) { + revert L2ModeSyncPoolETH__OnlyETH(); + } + + address receiver = getReceiver(); + address messenger = getMessenger(); + + uint32 originEid = endpoint.eid(); + + MessagingReceipt memory receipt = + super._sync(dstEid, l2TokenIn, l1TokenIn, amountIn, amountOut, extraOptions, fee); + + bytes memory data = abi.encode(originEid, receipt.guid, l1TokenIn, amountIn, amountOut); + bytes memory message = abi.encodeCall(IL1Receiver.onMessageReceived, data); + + ICrossDomainMessenger(messenger).sendMessage{value: amountIn}(receiver, message, 0); + + return receipt; + } +} diff --git a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol new file mode 100644 index 0000000..3816270 --- /dev/null +++ b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol @@ -0,0 +1,46 @@ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {L1BaseReceiverUpgradeable} from "../L1BaseReceiverUpgradeable.sol"; +import {IL1ScrollMessenger} from "../../../interfaces/IL1ScrollMessenger.sol"; +import {Constants} from "../../../libraries/Constants.sol"; + +/** + * @title L1 Scroll Receiver ETH + * @notice L1 receiver contract for ETH + * @dev This contract receives messages from the scroll L2 messenger and forwards them to the L1 sync pool + * It only supports ETH + */ +contract L1ScrollReceiverETHUpgradeable is L1BaseReceiverUpgradeable { + error L1ScrollReceiverETH__OnlyETH(); + + /** + * @dev Initializer for L1 Mode Receiver ETH + * @param l1SyncPool Address of the L1 sync pool + * @param messenger Address of the messenger contract + * @param owner Address of the owner + */ + function initialize(address l1SyncPool, address messenger, address owner) external initializer { + __Ownable_init(owner); + __L1BaseReceiver_init(l1SyncPool, messenger); + } + + /** + * @dev Function to receive messages from the L2 messenger + * @param message The message received from the L2 messenger + */ + function onMessageReceived(bytes calldata message) external payable virtual override { + (uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) = + abi.decode(message, (uint32, bytes32, address, uint256, uint256)); + + if (tokenIn != Constants.ETH_ADDRESS) revert L1ScrollReceiverETH__OnlyETH(); + + // address sender = IL1ScrollMessenger(msg.sender).xDomainMessageSender(); + address sender = address(0); + + _forwardToL1SyncPool( + originEid, bytes32(uint256(uint160(sender))), guid, tokenIn, amountIn, amountOut, msg.value + ); + } +} diff --git a/interfaces/IAggregatorV3.sol b/interfaces/IAggregatorV3.sol new file mode 100644 index 0000000..e764841 --- /dev/null +++ b/interfaces/IAggregatorV3.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +interface IAggregatorV3 { + function decimals() external view returns (uint8); + + function description() external view returns (string memory); + + function version() external view returns (uint256); + + function getRoundData(uint80 _roundId) + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); + + function latestRoundData() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); +} diff --git a/interfaces/ICrossDomainMessenger.sol b/interfaces/ICrossDomainMessenger.sol new file mode 100644 index 0000000..d06764f --- /dev/null +++ b/interfaces/ICrossDomainMessenger.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +interface ICrossDomainMessenger { + function MESSAGE_VERSION() external view returns (uint16); + function MIN_GAS_CALLDATA_OVERHEAD() external view returns (uint64); + function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() external view returns (uint64); + function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() external view returns (uint64); + function OTHER_MESSENGER() external view returns (address); + function RELAY_CALL_OVERHEAD() external view returns (uint64); + function RELAY_CONSTANT_OVERHEAD() external view returns (uint64); + function RELAY_GAS_CHECK_BUFFER() external view returns (uint64); + function RELAY_RESERVED_GAS() external view returns (uint64); + function baseGas(bytes memory _message, uint32 _minGasLimit) external pure returns (uint64); + function failedMessages(bytes32) external view returns (bool); + function messageNonce() external view returns (uint256); + function relayMessage( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _minGasLimit, + bytes memory _message + ) external payable; + function sendMessage(address _target, bytes memory _message, uint32 _minGasLimit) external payable; + function successfulMessages(bytes32) external view returns (bool); + function xDomainMessageSender() external view returns (address); +} diff --git a/interfaces/IL1Receiver.sol b/interfaces/IL1Receiver.sol new file mode 100644 index 0000000..3b6e805 --- /dev/null +++ b/interfaces/IL1Receiver.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +interface IL1Receiver { + function onMessageReceived(bytes calldata message) external payable; +} diff --git a/interfaces/IL1ScrollMessenger.sol b/interfaces/IL1ScrollMessenger.sol new file mode 100644 index 0000000..aa2582e --- /dev/null +++ b/interfaces/IL1ScrollMessenger.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.16; + +import {IScrollMessenger} from "./IScrollMessenger.sol"; + +interface IL1ScrollMessenger is IScrollMessenger { + /********** + * Events * + **********/ + + /// @notice Emitted when the maximum number of times each message can be replayed is updated. + /// @param oldMaxReplayTimes The old maximum number of times each message can be replayed. + /// @param newMaxReplayTimes The new maximum number of times each message can be replayed. + event UpdateMaxReplayTimes(uint256 oldMaxReplayTimes, uint256 newMaxReplayTimes); + + /*********** + * Structs * + ***********/ + + struct L2MessageProof { + // The index of the batch where the message belongs to. + uint256 batchIndex; + // Concatenation of merkle proof for withdraw merkle trie. + bytes merkleProof; + } + + /***************************** + * Public Mutating Functions * + *****************************/ + + /// @notice Relay a L2 => L1 message with message proof. + /// @param from The address of the sender of the message. + /// @param to The address of the recipient of the message. + /// @param value The msg.value passed to the message call. + /// @param nonce The nonce of the message to avoid replay attack. + /// @param message The content of the message. + /// @param proof The proof used to verify the correctness of the transaction. + function relayMessageWithProof( + address from, + address to, + uint256 value, + uint256 nonce, + bytes memory message, + L2MessageProof memory proof + ) external; + + /// @notice Replay an existing message. + /// @param from The address of the sender of the message. + /// @param to The address of the recipient of the message. + /// @param value The msg.value passed to the message call. + /// @param messageNonce The nonce for the message to replay. + /// @param message The content of the message. + /// @param newGasLimit New gas limit to be used for this message. + /// @param refundAddress The address of account who will receive the refunded fee. + function replayMessage( + address from, + address to, + uint256 value, + uint256 messageNonce, + bytes memory message, + uint32 newGasLimit, + address refundAddress + ) external payable; + + /// @notice Drop a skipped message. + /// @param from The address of the sender of the message. + /// @param to The address of the recipient of the message. + /// @param value The msg.value passed to the message call. + /// @param messageNonce The nonce for the message to drop. + /// @param message The content of the message. + function dropMessage( + address from, + address to, + uint256 value, + uint256 messageNonce, + bytes memory message + ) external; +} diff --git a/interfaces/IL2ExchangeRateProvider.sol b/interfaces/IL2ExchangeRateProvider.sol new file mode 100644 index 0000000..aa7d8e4 --- /dev/null +++ b/interfaces/IL2ExchangeRateProvider.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +interface IL2ExchangeRateProvider { + /** + * @dev Rate parameters for a token + * @param rateOracle Rate oracle contract, providing the exchange rate + * @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee) + * @param freshPeriod Fresh period, in seconds + */ + struct RateParameters { + address rateOracle; + uint64 depositFee; + uint32 freshPeriod; + } + + function getConversionAmount(address tokenIn, uint256 amountIn) external view returns (uint256 amountOut); + function getConversionAmountUnsafe(address token, uint256 amountIn) external view returns (uint256 amountOut); + function getRateParameters(address token) external view returns (RateParameters memory parameters); + function setRateParameters(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod) external; +} diff --git a/interfaces/IL2SyncPool.sol b/interfaces/IL2SyncPool.sol new file mode 100644 index 0000000..c4baa26 --- /dev/null +++ b/interfaces/IL2SyncPool.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {IOAppCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppCore.sol"; +import {MessagingFee} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; + +interface IL2SyncPool is IOAppCore { + function deposit(address tokenIn, uint256 amountIn, uint256 minAmountOut) + external + payable + returns (uint256 amountOut); + + function sync(address tokenIn, bytes calldata extraOptions, MessagingFee calldata fee) + external + payable + returns (uint256 unsyncedAmountIn, uint256 unsyncedAmountOut); +} diff --git a/interfaces/IRateLimiter.sol b/interfaces/IRateLimiter.sol new file mode 100644 index 0000000..be3acd6 --- /dev/null +++ b/interfaces/IRateLimiter.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +// Used by {L1,L2}SyncPool +interface IRateLimiter { + function updateRateLimit(address sender, address tokenIn, uint256 amountIn, uint256 amountOut) external; +} diff --git a/interfaces/IScrollMessenger.sol b/interfaces/IScrollMessenger.sol new file mode 100644 index 0000000..82ce7a7 --- /dev/null +++ b/interfaces/IScrollMessenger.sol @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.16; + +interface IScrollMessenger { + /********** + * Events * + **********/ + + /// @notice Emitted when a cross domain message is sent. + /// @param sender The address of the sender who initiates the message. + /// @param target The address of target contract to call. + /// @param value The amount of value passed to the target contract. + /// @param messageNonce The nonce of the message. + /// @param gasLimit The optional gas limit passed to L1 or L2. + /// @param message The calldata passed to the target contract. + event SentMessage( + address indexed sender, + address indexed target, + uint256 value, + uint256 messageNonce, + uint256 gasLimit, + bytes message + ); + + /// @notice Emitted when a cross domain message is relayed successfully. + /// @param messageHash The hash of the message. + event RelayedMessage(bytes32 indexed messageHash); + + /// @notice Emitted when a cross domain message is failed to relay. + /// @param messageHash The hash of the message. + event FailedRelayedMessage(bytes32 indexed messageHash); + + /********** + * Errors * + **********/ + + /// @dev Thrown when the given address is `address(0)`. + error ErrorZeroAddress(); + + /************************* + * Public View Functions * + *************************/ + + /// @notice Return the sender of a cross domain message. + function xDomainMessageSender() external view returns (address); + + /***************************** + * Public Mutating Functions * + *****************************/ + + /// @notice Send cross chain message from L1 to L2 or L2 to L1. + /// @param target The address of account who receive the message. + /// @param value The amount of ether passed when call target contract. + /// @param message The content of the message. + /// @param gasLimit Gas limit required to complete the message relay on corresponding chain. + function sendMessage( + address target, + uint256 value, + bytes calldata message, + uint256 gasLimit + ) external payable; + + /// @notice Send cross chain message from L1 to L2 or L2 to L1. + /// @param target The address of account who receive the message. + /// @param value The amount of ether passed when call target contract. + /// @param message The content of the message. + /// @param gasLimit Gas limit required to complete the message relay on corresponding chain. + /// @param refundAddress The address of account who will receive the refunded fee. + function sendMessage( + address target, + uint256 value, + bytes calldata message, + uint256 gasLimit, + address refundAddress + ) external payable; +} diff --git a/scripts/NativeMintingDeployment/L1.s.sol b/scripts/NativeMintingDeployment/L1.s.sol new file mode 100644 index 0000000..c910674 --- /dev/null +++ b/scripts/NativeMintingDeployment/L1.s.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/console.sol"; +import "forge-std/Script.sol"; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "../../contracts/NativeMinting/DummyTokenUpgradeable.sol"; +import "../../contracts/DummyTokenUpgradeable.sol"; + +import "../../utils/Constants.sol"; +import "../../utils/LayerZeroHelpers.sol"; + +contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { + + function run() public { + + uint256 privateKey = vm.envUint("PRIVATE_KEY"); + address scriptDeployer = vm.addr(privateKey); + vm.startBroadcast(privateKey); + + console.log("Deploying contracts on L1..."); + + address dummyTokenImp = address(new DummyTokenUpgradeable(18)); + address dummyTokenProxy = address( + new TransparentUpgradeableProxy( + dummyTokenImp, + scriptDeployer, + abi.encodeWithSelector( + MintableOFTUpgradeable.initialize.selector, "Scroll Dummy ETH", "scrollETH", scriptDeployer + ) + ) + ); + + console.log("DummyToken deployed at: ", dummyTokenProxy); + + // todo + } +} diff --git a/utils/BaseMessengerUpgradeable.sol b/utils/BaseMessengerUpgradeable.sol new file mode 100644 index 0000000..28eb2fb --- /dev/null +++ b/utils/BaseMessengerUpgradeable.sol @@ -0,0 +1,63 @@ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +/** + * @title Base Messenger + * @dev Base contract for setting the messenger contract + */ +abstract contract BaseMessengerUpgradeable is OwnableUpgradeable { + struct BaseMessengerStorage { + address messenger; + } + + // keccak256(abi.encode(uint256(keccak256(syncpools.storage.basemessenger)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant BaseMessengerStorageLocation = + 0x2d365d82646798ae645c4baa2dc2ee228626f61d8b5395bf298ba125a3c6b100; + + function _getBaseMessengerStorage() internal pure returns (BaseMessengerStorage storage $) { + assembly { + $.slot := BaseMessengerStorageLocation + } + } + + event MessengerSet(address messenger); + + function __BaseMessenger_init(address messenger) internal onlyInitializing { + __BaseMessenger_init_unchained(messenger); + } + + function __BaseMessenger_init_unchained(address messenger) internal onlyInitializing { + _setMessenger(messenger); + } + + /** + * @dev Get the messenger address + * @return The messenger address + */ + function getMessenger() public view virtual returns (address) { + BaseMessengerStorage storage $ = _getBaseMessengerStorage(); + return $.messenger; + } + + /** + * @dev Set the messenger address + * @param messenger The messenger address + */ + function setMessenger(address messenger) public virtual onlyOwner { + _setMessenger(messenger); + } + + /** + * @dev Internal function to set the messenger address + * @param messenger The messenger address + */ + function _setMessenger(address messenger) internal { + BaseMessengerStorage storage $ = _getBaseMessengerStorage(); + $.messenger = messenger; + + emit MessengerSet(messenger); + } +} diff --git a/utils/BaseReceiverUpgradeable.sol b/utils/BaseReceiverUpgradeable.sol new file mode 100644 index 0000000..b43a104 --- /dev/null +++ b/utils/BaseReceiverUpgradeable.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +/** + * @title Base Receiver + * @dev Base contract for setting the receiver contract + */ +abstract contract BaseReceiverUpgradeable is OwnableUpgradeable { + struct BaseReceiverStorage { + address receiver; + } + + // keccak256(abi.encode(uint256(keccak256(syncpools.storage.basereceiver)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant BaseReceiverStorageLocation = + 0x487698e326934c06370ca3c28e3bca79fe27d578048e9d42af7fa98f2e481e00; + + function _getBaseReceiverStorage() internal pure returns (BaseReceiverStorage storage $) { + assembly { + $.slot := BaseReceiverStorageLocation + } + } + + event ReceiverSet(address receiver); + + function __BaseReceiver_init(address receiver) internal onlyInitializing { + __BaseReceiver_init_unchained(receiver); + } + + function __BaseReceiver_init_unchained(address receiver) internal onlyInitializing { + _setReceiver(receiver); + } + + /** + * @dev Get the receiver address + * @return The receiver address + */ + function getReceiver() public view virtual returns (address) { + BaseReceiverStorage storage $ = _getBaseReceiverStorage(); + return $.receiver; + } + + /** + * @dev Set the receiver address + * @param receiver The receiver address + */ + function setReceiver(address receiver) public virtual onlyOwner { + _setReceiver(receiver); + } + + /** + * @dev Internal function to set the receiver address + * @param receiver The receiver address + */ + function _setReceiver(address receiver) internal { + BaseReceiverStorage storage $ = _getBaseReceiverStorage(); + $.receiver = receiver; + + emit ReceiverSet(receiver); + } +} diff --git a/utils/BucketLimiter.sol b/utils/BucketLimiter.sol new file mode 100644 index 0000000..2f9e41d --- /dev/null +++ b/utils/BucketLimiter.sol @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** + * The BucketLimiter contract is used to limit the rate of some action. + * + * Buckets refill at a constant rate, and have a maximum capacity. Each time + * the consume function is called, the bucket gets depleted by the provided + * amount. If the bucket is empty, the consume function will return false + * and the bucket will not be depleted. Rates are measured in units per + * second. + * + * To limit storage usage to a single slot, the Bucket struct is packed into + * a single word, meaning all fields are uint64. + * + * Examples: + * + * ```sol + * BucketLimiter.Limit storage limit = BucketLimiter.create(100, 1); + * limit.consume(10); // returns true, remaining = 90 + * limit.consume(80); // returns true, remaining = 10 + * limit.consume(20); // returns false, remaining = 10 + * // Wait 10 seconds (10 tokens get refilled) + * limit.consume(20); // returns true, remaining = 0) + * // Increase capacity + * limit.setCapacity(200); // remaining = 0, capacity = 200 + * // Increase refill rate + * limit.setRefillRate(2); // remaining = 0, capacity = 200, refillRate = 2 + * // Wait 10 seconds (20 tokens get refilled) + * limit.consume(20); // returns true, remaining = 0 + * ``` + * + * Developers should notice that rate-limits are vulnerable to two attacks: + * 1. Sybil-attacks: Rate limits should typically be global across all user + * accounts, otherwise an attacker can simply create many accounts to + * bypass the rate limit. + * 2. DoS attacks: Rate limits should typically apply to actions with a + * friction such as a fee or a minimum stake time. Otherwise, an + * attacker can simply spam the action to deplete the rate limit. + */ +library BucketLimiter { + struct Limit { + // The maximum capacity of the bucket, in consumable units (eg. tokens) + uint64 capacity; + // The remaining capacity in the bucket, that can be consumed + uint64 remaining; + // The timestamp of the last time the bucket was refilled + uint64 lastRefill; + // The rate at which the bucket refills, in units per second + uint64 refillRate; + } + + /* + * Creates a new bucket with the given capacity and refill rate. + * + * @param capacity The maximum capacity of the bucket, in consumable units (eg. tokens) + * @param refillRate The rate at which the bucket refills, in units per second + * @return The created bucket + */ + function create(uint64 capacity, uint64 refillRate) internal view returns (Limit memory) { + return Limit({ + capacity: capacity, + remaining: capacity, + lastRefill: uint64(block.timestamp), + refillRate: refillRate + }); + } + + /* + * Consumes the given amount from the bucket, if there is sufficient capacity, and returns + * whether the bucket had enough remaining capacity to consume the amount. + * + * @param limit The bucket to consume from + * @param amount The amount to consume + * @return True if the bucket had enough remaining capacity to consume the amount, false otherwise + */ + function consume(Limit storage limit, uint64 amount) internal returns (bool) { + Limit memory _limit = limit; + _refill(_limit); + if (_limit.remaining < amount) { + return false; + } + limit.remaining = _limit.remaining - amount; + limit.lastRefill = _limit.lastRefill; + return true; + } + + /* + * Refills the bucket based on the time elapsed since the last refill. This effectively simulates + * the idea of the bucket continuously refilling at a constant rate. + * + * @param limit The bucket to refill + */ + function refill(Limit storage limit) internal { + Limit memory _limit = limit; + _refill(_limit); + limit.remaining = _limit.remaining; + limit.lastRefill = _limit.lastRefill; + } + + function _refill(Limit memory limit) internal view { + // We allow for overflow here, as the delta is resilient against it. + uint64 now_ = uint64(block.timestamp); + uint64 delta; + unchecked { + delta = now_ - limit.lastRefill; + } + uint64 tokens = delta * limit.refillRate; + uint64 newRemaining = limit.remaining + tokens; + if (newRemaining > limit.capacity) { + limit.remaining = limit.capacity; + } else { + limit.remaining = newRemaining; + } + limit.lastRefill = now_; + } + + /* + * Sets the capacity of the bucket. If the new capacity is less than the remaining capacity, + * the remaining capacity is set to the new capacity. + * + * @param limit The bucket to set the capacity of + * @param capacity The new capacity + */ + function setCapacity(Limit storage limit, uint64 capacity) internal { + refill(limit); + limit.capacity = capacity; + if (limit.remaining > capacity) { + limit.remaining = capacity; + } + } + + /* + * Sets the refill rate of the bucket, in units per second. + * + * @param limit The bucket to set the refill rate of + * @param refillRate The new refill rate + */ + function setRefillRate(Limit storage limit, uint64 refillRate) internal { + refill(limit); + limit.refillRate = refillRate; + } + + /* + * Sets the remaining capacity of the bucket. If the new remaining capacity is greater than + * the capacity, the remaining capacity is set to the capacity. + * + * @param limit The bucket to set the remaining capacity of + * @param remaining The new remaining capacity + */ + function setRemaining(Limit storage limit, uint64 remaining) internal { + refill(limit); + limit.remaining = remaining; + } +} diff --git a/utils/Constants.sol b/utils/Constants.sol index 579782e..ceb5607 100644 --- a/utils/Constants.sol +++ b/utils/Constants.sol @@ -307,7 +307,7 @@ contract Constants { L2_OFT: 0x5A7fACB970D094B6C7FF1df0eA68D99E6e73CBFF, L2_CONTRACT_CONTROLLER_SAFE: 0x764682c769CcB119349d92f1B63ee1c03d6AECFf, - L2_OFT_PROXY_ADMIN: 0x764682c769CcB119349d92f1B63ee1c03d6AECFf, + L2_OFT_PROXY_ADMIN: 0x632304Edc891Afed1a7bDe9A40b19F1c393ad5F3, L2_SYNC_POOL: address(0), L2_SYNC_POOL_RATE_LIMITER: address(0), From 8467b3903c71790c08f183bcbe8224bfb1c6b0b2 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Fri, 11 Oct 2024 17:17:18 -0500 Subject: [PATCH 02/13] removing unnecessary layer of inheritance --- .../EtherfiL2ModeSyncPoolETH.sol | 25 ------------ ...ol => L2OPStackSyncPoolETHUpgradeable.sol} | 38 +++++++++++++------ 2 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol rename contracts/NativeMinting/L2SyncPoolContracts/{L2ModeSyncPoolETHUpgradeable.sol => L2OPStackSyncPoolETHUpgradeable.sol} (79%) diff --git a/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol b/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol deleted file mode 100644 index d62087a..0000000 --- a/contracts/NativeMinting/L2SyncPoolContracts/EtherfiL2ModeSyncPoolETH.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {L2ModeSyncPoolETHUpgradeable} from "./L2ModeSyncPoolETHUpgradeable.sol"; - -contract EtherfiL2ModeSyncPoolETH is L2ModeSyncPoolETHUpgradeable { - constructor(address endpoint) L2ModeSyncPoolETHUpgradeable(endpoint) { - _disableInitializers(); - } - - function initialize( - address l2ExchangeRateProvider, - address rateLimiter, - address tokenOut, - uint32 dstEid, - address messenger, - address receiver, - address delegate - ) external override initializer { - __L2BaseSyncPool_init(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid, delegate); - __BaseMessenger_init(messenger); - __BaseReceiver_init(receiver); - __Ownable_init(delegate); - } -} diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2OPStackSyncPoolETHUpgradeable.sol similarity index 79% rename from contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol rename to contracts/NativeMinting/L2SyncPoolContracts/L2OPStackSyncPoolETHUpgradeable.sol index 404e9e1..42e0ac7 100644 --- a/contracts/NativeMinting/L2SyncPoolContracts/L2ModeSyncPoolETHUpgradeable.sol +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2OPStackSyncPoolETHUpgradeable.sol @@ -14,22 +14,23 @@ import {Constants} from "../../../libraries/Constants.sol"; import {IL1Receiver} from "../../../interfaces/IL1Receiver.sol"; /** - * @title L2 Mode Sync Pool for ETH - * @dev A sync pool that only supports ETH on Mode L2 + * @title L2 OP Stack Sync Pool for ETH + * @dev A sync pool that only supports ETH on OP Stack L2s * This contract allows to send ETH from L2 to L1 during the sync process */ -contract L2ModeSyncPoolETHUpgradeable is - L2BaseSyncPoolUpgradeable, - BaseMessengerUpgradeable, - BaseReceiverUpgradeable -{ - error L2ModeSyncPoolETH__OnlyETH(); +contract L2OPStackSyncPoolETHUpgradeable is L2BaseSyncPoolUpgradeable, BaseMessengerUpgradeable, BaseReceiverUpgradeable { + + event DepositWithReferral(address indexed sender, uint256 amount, address referral); + + error L2OPStackSyncPoolETH__OnlyETH(); /** - * @dev Constructor for L2 Mode Sync Pool for ETH + * @dev Constructor for L2 OP Stack Sync Pool for ETH * @param endpoint Address of the LayerZero endpoint */ - constructor(address endpoint) L2BaseSyncPoolUpgradeable(endpoint) {} + constructor(address endpoint) L2BaseSyncPoolUpgradeable(endpoint) { + _disableInitializers(); + } /** * @dev Initialize the contract @@ -62,7 +63,7 @@ contract L2ModeSyncPoolETHUpgradeable is * @param amountIn The amount of tokens */ function _receiveTokenIn(address tokenIn, uint256 amountIn) internal virtual override { - if (tokenIn != Constants.ETH_ADDRESS) revert L2ModeSyncPoolETH__OnlyETH(); + if (tokenIn != Constants.ETH_ADDRESS) revert L2OPStackSyncPoolETH__OnlyETH(); super._receiveTokenIn(tokenIn, amountIn); } @@ -89,7 +90,7 @@ contract L2ModeSyncPoolETHUpgradeable is MessagingFee calldata fee ) internal virtual override returns (MessagingReceipt memory) { if (l1TokenIn != Constants.ETH_ADDRESS || l2TokenIn != Constants.ETH_ADDRESS) { - revert L2ModeSyncPoolETH__OnlyETH(); + revert L2OPStackSyncPoolETH__OnlyETH(); } address receiver = getReceiver(); @@ -107,4 +108,17 @@ contract L2ModeSyncPoolETHUpgradeable is return receipt; } + + /** + * @dev Deposit function with referral event + */ + function deposit( + address tokenIn, + uint256 amountIn, + uint256 minAmountOut, + address referral + ) public payable returns (uint256 amountOut) { + emit DepositWithReferral(msg.sender, msg.value, referral); + return super.deposit(tokenIn, amountIn, minAmountOut); + } } From 58c84c10fa9b71ce642cbb28fce0d66ca1b9256b Mon Sep 17 00:00:00 2001 From: jtfirek Date: Mon, 14 Oct 2024 12:49:27 -0500 Subject: [PATCH 03/13] scroll contracts --- .../L2ScrollSyncPoolETHUpgradeable.sol | 124 ++++++++++++++++++ .../L1ScrollReceiverETHUpgradeable.sol | 3 +- interfaces/IL2ScrollMessenger.sol | 35 +++++ .../01_DeployConfigureL2.s.sol | 35 +++++ .../{L1.s.sol => 02_DeployConfigureL1.s.sol} | 3 +- 5 files changed, 196 insertions(+), 4 deletions(-) create mode 100644 contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol create mode 100644 interfaces/IL2ScrollMessenger.sol create mode 100644 scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol rename scripts/NativeMintingDeployment/{L1.s.sol => 02_DeployConfigureL1.s.sol} (98%) diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol new file mode 100644 index 0000000..db61a6f --- /dev/null +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import { + MessagingFee, + MessagingReceipt +} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; + +import {BaseMessengerUpgradeable} from "../../../utils/BaseMessengerUpgradeable.sol"; +import {BaseReceiverUpgradeable} from "../../../utils/BaseReceiverUpgradeable.sol"; +import {L2BaseSyncPoolUpgradeable} from "../L2BaseSyncPoolUpgradeable.sol"; +import {IL2ScrollMessenger} from "../../../interfaces/IL2ScrollMessenger.sol"; +import {Constants} from "../../../libraries/Constants.sol"; +import {IL1Receiver} from "../../../interfaces/IL1Receiver.sol"; + +/** + * @title L2 Scroll Stack Sync Pool for ETH + * @dev A sync pool that only supports ETH on Scroll Stack L2s + * This contract allows to send ETH from L2 to L1 during the sync process + */ +contract L2ScrollSyncPoolETHUpgradeable is L2BaseSyncPoolUpgradeable, BaseMessengerUpgradeable, BaseReceiverUpgradeable { + + event DepositWithReferral(address indexed sender, uint256 amount, address referral); + + error L2ScrollStackSyncPoolETH__OnlyETH(); + + /** + * @dev Constructor for L2 Scroll Stack Sync Pool for ETH + * @param endpoint Address of the LayerZero endpoint + */ + constructor(address endpoint) L2BaseSyncPoolUpgradeable(endpoint) { + _disableInitializers(); + } + + /** + * @dev Initialize the contract + * @param l2ExchangeRateProvider Address of the exchange rate provider + * @param rateLimiter Address of the rate limiter + * @param tokenOut Address of the token to mint on Layer 2 + * @param dstEid Destination endpoint ID (most of the time, the Layer 1 endpoint ID) + * @param messenger Address of the messenger contract (most of the time, the L2 native bridge address) + * @param receiver Address of the receiver contract (most of the time, the L1 receiver contract) + * @param delegate Address of the owner + */ + function initialize( + address l2ExchangeRateProvider, + address rateLimiter, + address tokenOut, + uint32 dstEid, + address messenger, + address receiver, + address delegate + ) external virtual initializer { + __L2BaseSyncPool_init(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid, delegate); + __BaseMessenger_init(messenger); + __BaseReceiver_init(receiver); + __Ownable_init(delegate); + } + + /** + * @dev Only allows ETH to be received + * @param tokenIn The token address + * @param amountIn The amount of tokens + */ + function _receiveTokenIn(address tokenIn, uint256 amountIn) internal virtual override { + if (tokenIn != Constants.ETH_ADDRESS) revert L2ScrollStackSyncPoolETH__OnlyETH(); + + super._receiveTokenIn(tokenIn, amountIn); + } + + /** + * @dev Internal function to sync tokens to L1 + * This will send an additional message to the messenger contract after the LZ message + * This message will contain the ETH that the LZ message anticipates to receive + * @param dstEid Destination endpoint ID + * @param l1TokenIn Address of the token on Layer 1 + * @param amountIn Amount of tokens deposited on Layer 2 + * @param amountOut Amount of tokens minted on Layer 2 + * @param extraOptions Extra options for the messaging protocol + * @param fee Messaging fee + * @return receipt Messaging receipt + */ + function _sync( + uint32 dstEid, + address l2TokenIn, + address l1TokenIn, + uint256 amountIn, + uint256 amountOut, + bytes calldata extraOptions, + MessagingFee calldata fee + ) internal virtual override returns (MessagingReceipt memory) { + if (l1TokenIn != Constants.ETH_ADDRESS || l2TokenIn != Constants.ETH_ADDRESS) { + revert L2ScrollStackSyncPoolETH__OnlyETH(); + } + + address receiver = getReceiver(); + address messenger = getMessenger(); + + uint32 originEid = endpoint.eid(); + + MessagingReceipt memory receipt = + super._sync(dstEid, l2TokenIn, l1TokenIn, amountIn, amountOut, extraOptions, fee); + + bytes memory data = abi.encode(originEid, receipt.guid, l1TokenIn, amountIn, amountOut); + bytes memory message = abi.encodeCall(IL1Receiver.onMessageReceived, data); + + IL2ScrollMessenger(messenger).sendMessage{value: amountIn}(receiver, amountIn, message, 0, receiver); + + return receipt; + } + + /** + * @dev Deposit function with referral event + */ + function deposit( + address tokenIn, + uint256 amountIn, + uint256 minAmountOut, + address referral + ) public payable returns (uint256 amountOut) { + emit DepositWithReferral(msg.sender, msg.value, referral); + return super.deposit(tokenIn, amountIn, minAmountOut); + } +} diff --git a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol index 3816270..e663da5 100644 --- a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol +++ b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol @@ -36,8 +36,7 @@ contract L1ScrollReceiverETHUpgradeable is L1BaseReceiverUpgradeable { if (tokenIn != Constants.ETH_ADDRESS) revert L1ScrollReceiverETH__OnlyETH(); - // address sender = IL1ScrollMessenger(msg.sender).xDomainMessageSender(); - address sender = address(0); + address sender = IL1ScrollMessenger(msg.sender).xDomainMessageSender(); _forwardToL1SyncPool( originEid, bytes32(uint256(uint160(sender))), guid, tokenIn, amountIn, amountOut, msg.value diff --git a/interfaces/IL2ScrollMessenger.sol b/interfaces/IL2ScrollMessenger.sol new file mode 100644 index 0000000..6728569 --- /dev/null +++ b/interfaces/IL2ScrollMessenger.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.16; + +import {IScrollMessenger} from "./IScrollMessenger.sol"; + +interface IL2ScrollMessenger is IScrollMessenger { + /********** + * Events * + **********/ + + /// @notice Emitted when the maximum number of times each message can fail in L2 is updated. + /// @param oldMaxFailedExecutionTimes The old maximum number of times each message can fail in L2. + /// @param newMaxFailedExecutionTimes The new maximum number of times each message can fail in L2. + event UpdateMaxFailedExecutionTimes(uint256 oldMaxFailedExecutionTimes, uint256 newMaxFailedExecutionTimes); + + /***************************** + * Public Mutating Functions * + *****************************/ + + /// @notice execute L1 => L2 message + /// @dev Make sure this is only called by privileged accounts. + /// @param from The address of the sender of the message. + /// @param to The address of the recipient of the message. + /// @param value The msg.value passed to the message call. + /// @param nonce The nonce of the message to avoid replay attack. + /// @param message The content of the message. + function relayMessage( + address from, + address to, + uint256 value, + uint256 nonce, + bytes calldata message + ) external; +} diff --git a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol new file mode 100644 index 0000000..9fefb43 --- /dev/null +++ b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/console.sol"; +import "forge-std/Script.sol"; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; +import "../../utils/Constants.sol"; + + +contract L1NativeMintingScript is Script, Constants { + ConfigPerL2 public DEPLOYMENT_L2; + + function run() public { + DEPLOYMENT_L2 = SCROLL; + + uint256 privateKey = vm.envUint("PRIVATE_KEY"); + address scriptDeployer = vm.addr(privateKey); + vm.startBroadcast(privateKey); + + console.log("Deploying contracts on L2..."); + + // Deploy Sync Pool + address syncPoolImp = address(new L2ScrollSyncPoolETHUpgradeable(DEPLOYMENT_L2.L2_ENDPOINT)); + + + address bucketRateLimiterImp = address(new BucketRateLimiter()); + UUPSProxy proxy = new UUPSProxy(bucketRateLimiterImp, abi.encodeWithSelector(BucketRateLimiter.initialize.selector)); + BucketRateLimiter bucketRateLimiter = BucketRateLimiter(address(proxy)); + + } +} diff --git a/scripts/NativeMintingDeployment/L1.s.sol b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol similarity index 98% rename from scripts/NativeMintingDeployment/L1.s.sol rename to scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol index c910674..abd292d 100644 --- a/scripts/NativeMintingDeployment/L1.s.sol +++ b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol @@ -33,7 +33,6 @@ contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { ); console.log("DummyToken deployed at: ", dummyTokenProxy); - - // todo + } } From 22851a2e4848de8ee2dfe6b473916986f5bec1ed Mon Sep 17 00:00:00 2001 From: jtfirek Date: Mon, 14 Oct 2024 16:49:16 -0500 Subject: [PATCH 04/13] general deploy scripts --- .../L1ScrollReceiverETHUpgradeable.sol | 4 ++ .../01_DeployUpgradeableAdapter.s.sol | 4 +- .../02_DeployMigrationOFT.s.sol | 4 +- .../03_MigrationTransactions.s.sol | 2 +- .../01_DeployConfigureL2.s.sol | 71 ++++++++++++++++--- .../02_DeployConfigureL1.s.sol | 37 ++++++++-- scripts/OFTDeployment/01_OFTConfigure.s.sol | 2 +- .../02_UpdateOFTPeersTransactions.s.sol | 2 +- .../03_OFTOwnershipTransfer.s.sol | 2 +- scripts/OFTDeployment/04_OFTSend.s.sol | 2 +- scripts/OFTDeployment/05_ProdRateLimit.sol | 2 +- test/AdapterMigration.t.sol | 4 +- test/OFTDeployment.t.sol | 4 +- test/syncSimulation.t.sol | 8 +-- utils/{Constants.sol => L2Constants.sol} | 25 +++---- utils/LayerZeroHelpers.sol | 2 +- 16 files changed, 125 insertions(+), 50 deletions(-) rename utils/{Constants.sol => L2Constants.sol} (96%) diff --git a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol index e663da5..8c3d04a 100644 --- a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol +++ b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol @@ -15,6 +15,10 @@ import {Constants} from "../../../libraries/Constants.sol"; contract L1ScrollReceiverETHUpgradeable is L1BaseReceiverUpgradeable { error L1ScrollReceiverETH__OnlyETH(); + constructor() { + _disableInitializers(); + } + /** * @dev Initializer for L1 Mode Receiver ETH * @param l1SyncPool Address of the L1 sync pool diff --git a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol index 705edaf..9a8ead4 100644 --- a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol +++ b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol @@ -13,9 +13,9 @@ import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAp import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; import "../../contracts/EtherFiOFTAdapterUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; -contract DeployUpgradeableOFTAdapter is Script, Constants, LayerZeroHelpers { +contract DeployUpgradeableOFTAdapter is Script, L2Constants, LayerZeroHelpers { using OptionsBuilder for bytes; EnforcedOptionParam[] public enforcedOptions; diff --git a/scripts/AdapterMigration/02_DeployMigrationOFT.s.sol b/scripts/AdapterMigration/02_DeployMigrationOFT.s.sol index a8db165..c956878 100644 --- a/scripts/AdapterMigration/02_DeployMigrationOFT.s.sol +++ b/scripts/AdapterMigration/02_DeployMigrationOFT.s.sol @@ -10,11 +10,11 @@ import { EnforcedOptionParam } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oap import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "../../contracts/MigrationOFT.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; -contract DeployMigrationOFT is Script, Constants, LayerZeroHelpers { +contract DeployMigrationOFT is Script, L2Constants, LayerZeroHelpers { using OptionsBuilder for bytes; address public migrationOFTAddress; diff --git a/scripts/AdapterMigration/03_MigrationTransactions.s.sol b/scripts/AdapterMigration/03_MigrationTransactions.s.sol index e66dc5d..ca4dd7f 100644 --- a/scripts/AdapterMigration/03_MigrationTransactions.s.sol +++ b/scripts/AdapterMigration/03_MigrationTransactions.s.sol @@ -12,7 +12,7 @@ import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManage import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract GenerationMigrationTransactions is Script, Constants, LayerZeroHelpers { diff --git a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol index 9fefb43..8d931b8 100644 --- a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol @@ -5,17 +5,31 @@ import "forge-std/console.sol"; import "forge-std/Script.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; + +import "../../contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol"; import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../contracts/NativeMinting/BucketRateLimiter.sol"; +import "../../utils/L2Constants.sol"; + + +contract L1NativeMintingScript is Script, L2Constants { + + /*////////////////////////////////////////////////////////////// + Current Deployment Parameters + //////////////////////////////////////////////////////////////*/ + + ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; + address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; + address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; -contract L1NativeMintingScript is Script, Constants { - ConfigPerL2 public DEPLOYMENT_L2; + /*////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////*/ function run() public { - DEPLOYMENT_L2 = SCROLL; uint256 privateKey = vm.envUint("PRIVATE_KEY"); address scriptDeployer = vm.addr(privateKey); @@ -23,13 +37,50 @@ contract L1NativeMintingScript is Script, Constants { console.log("Deploying contracts on L2..."); - // Deploy Sync Pool - address syncPoolImp = address(new L2ScrollSyncPoolETHUpgradeable(DEPLOYMENT_L2.L2_ENDPOINT)); - + address exchangeRateProviderImp = address(new EtherfiL2ExchangeRateProvider()); + address exchangeRateProviderProxy = address( + new TransparentUpgradeableProxy( + exchangeRateProviderImp, + DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE, + abi.encodeWithSelector( + EtherfiL2ExchangeRateProvider.initialize.selector, scriptDeployer + ) + ) + ); + EtherfiL2ExchangeRateProvider exchangeRateProvider = EtherfiL2ExchangeRateProvider(exchangeRateProviderProxy); + exchangeRateProvider.setRateParameters(ETH_ADDRESS, WEETH_RATE_PROVIDER, 0, L2_PRICE_ORACLE_HEART_BEAT); + exchangeRateProvider.transferOwnership(DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE); + console.log("Exchange Rate Provider deployed at: ", address(exchangeRateProviderProxy)); + // BucketRateLimiter is our only native minting contract that uses UUPS address bucketRateLimiterImp = address(new BucketRateLimiter()); - UUPSProxy proxy = new UUPSProxy(bucketRateLimiterImp, abi.encodeWithSelector(BucketRateLimiter.initialize.selector)); - BucketRateLimiter bucketRateLimiter = BucketRateLimiter(address(proxy)); + ERC1967Proxy bucketRateLimitierProxy = new ERC1967Proxy(bucketRateLimiterImp, abi.encodeWithSelector(BucketRateLimiter.initialize.selector)); + BucketRateLimiter bucketRateLimiter = BucketRateLimiter(address(bucketRateLimitierProxy)); + bucketRateLimiter.initialize(scriptDeployer); + bucketRateLimiter.setCapacity(BUCKET_SIZE); + bucketRateLimiter.setRefillRatePerSecond(BUCKET_REFILL_PER_SECOND); + console.log("Bucket Rate Limiter deployed at: ", address(bucketRateLimitierProxy)); + + address syncPoolImp = address(new L2ScrollSyncPoolETHUpgradeable(DEPLOYMENT_L2.L2_ENDPOINT)); + address syncPoolProxy = address( + new TransparentUpgradeableProxy( + syncPoolImp, + DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE, + abi.encodeWithSelector( + L2ScrollSyncPoolETHUpgradeable.initialize.selector, + exchangeRateProviderProxy, + bucketRateLimitierProxy, + L1_EID, + DEPLOYMENT_L2.L2_OFT, + L2_MESSENGER, + address(0), // Receiver contract hasn't been deployed on mainnet yet + scriptDeployer + ) + ) + ); + console.log("Sync Pool deployed at: ", syncPoolProxy); + bucketRateLimiter.updateConsumer(syncPoolProxy); + bucketRateLimiter.transferOwnership(DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE); } } diff --git a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol index abd292d..f2c2d4f 100644 --- a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol @@ -4,15 +4,28 @@ pragma solidity ^0.8.13; import "forge-std/console.sol"; import "forge-std/Script.sol"; +import import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "../../contracts/NativeMinting/DummyTokenUpgradeable.sol"; import "../../contracts/DummyTokenUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { + /*////////////////////////////////////////////////////////////// + Current Deployment Parameters + //////////////////////////////////////////////////////////////*/ + + ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; + string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; + string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; + + /*////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////*/ + function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); @@ -20,19 +33,29 @@ contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { vm.startBroadcast(privateKey); console.log("Deploying contracts on L1..."); - - address dummyTokenImp = address(new DummyTokenUpgradeable(18)); + + address dummyTokenImpl = address(new DummyTokenUpgradeable(18)); address dummyTokenProxy = address( new TransparentUpgradeableProxy( - dummyTokenImp, - scriptDeployer, + dummyTokenImpl, + L1_CONTRACT_CONTROLLER, abi.encodeWithSelector( - MintableOFTUpgradeable.initialize.selector, "Scroll Dummy ETH", "scrollETH", scriptDeployer + MintableOFTUpgradeable.initialize.selector, DUMMY_TOKEN_NAME, DUMMY_TOKEN_SYMBOL, scriptDeployer + ) + ) + ); + + address scrollReceiverImpl = address(new L1ScrollReceiverETHUpgradeable()); + address scrollReceiverProxy = address( + new TransparentUpgradeableProxy( + scrollReceiverImpl, + L1_CONTRACT_CONTROLLER, + abi.encodeWithSelector( + L1ScrollReceiverETHUpgradeable.initialize.selector, L1_SYNC_POOL, L1_MESSENGER, L1_CONTRACT_CONTROLLER ) ) ); console.log("DummyToken deployed at: ", dummyTokenProxy); - } } diff --git a/scripts/OFTDeployment/01_OFTConfigure.s.sol b/scripts/OFTDeployment/01_OFTConfigure.s.sol index 61e7131..80214b3 100644 --- a/scripts/OFTDeployment/01_OFTConfigure.s.sol +++ b/scripts/OFTDeployment/01_OFTConfigure.s.sol @@ -13,7 +13,7 @@ import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAp import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; struct OFTDeployment { diff --git a/scripts/OFTDeployment/02_UpdateOFTPeersTransactions.s.sol b/scripts/OFTDeployment/02_UpdateOFTPeersTransactions.s.sol index 2a7327f..8114411 100644 --- a/scripts/OFTDeployment/02_UpdateOFTPeersTransactions.s.sol +++ b/scripts/OFTDeployment/02_UpdateOFTPeersTransactions.s.sol @@ -12,7 +12,7 @@ import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManage import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract UpdateOFTPeersTransactions is Script, Constants, LayerZeroHelpers { diff --git a/scripts/OFTDeployment/03_OFTOwnershipTransfer.s.sol b/scripts/OFTDeployment/03_OFTOwnershipTransfer.s.sol index d0a93ca..cf2631d 100644 --- a/scripts/OFTDeployment/03_OFTOwnershipTransfer.s.sol +++ b/scripts/OFTDeployment/03_OFTOwnershipTransfer.s.sol @@ -16,7 +16,7 @@ import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/lib import "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; contract OFTOwnershipTransfer is Script, Constants { using OptionsBuilder for bytes; diff --git a/scripts/OFTDeployment/04_OFTSend.s.sol b/scripts/OFTDeployment/04_OFTSend.s.sol index c939340..28544bc 100644 --- a/scripts/OFTDeployment/04_OFTSend.s.sol +++ b/scripts/OFTDeployment/04_OFTSend.s.sol @@ -17,7 +17,7 @@ import "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; import "forge-std/Test.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract CrossChainSend is Script, Constants, LayerZeroHelpers { diff --git a/scripts/OFTDeployment/05_ProdRateLimit.sol b/scripts/OFTDeployment/05_ProdRateLimit.sol index fedc378..eea0b24 100644 --- a/scripts/OFTDeployment/05_ProdRateLimit.sol +++ b/scripts/OFTDeployment/05_ProdRateLimit.sol @@ -6,7 +6,7 @@ import "forge-std/Script.sol"; import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../utils/Constants.sol"; +import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract SetRateLimits is Script, Constants, LayerZeroHelpers { diff --git a/test/AdapterMigration.t.sol b/test/AdapterMigration.t.sol index f3cd06e..f836b81 100644 --- a/test/AdapterMigration.t.sol +++ b/test/AdapterMigration.t.sol @@ -13,7 +13,7 @@ import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "../scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol" as DeployOFTAdapter; import "../scripts/AdapterMigration/02_DeployMigrationOFT.s.sol" as DeployMigrationOFT; -import "../utils/Constants.sol"; +import "../utils/L2Constants.sol"; import "../utils/LayerZeroHelpers.sol"; import "../contracts/MigrationOFT.sol"; import "../contracts/EtherFiOFTAdapter.sol"; @@ -27,7 +27,7 @@ interface EndpointDelegates { function delegates(address) external view returns (address); } -contract OFTMigrationUnitTests is Test, Constants, LayerZeroHelpers { +contract OFTMigrationUnitTests is Test, L2Constants, LayerZeroHelpers { // Send a migration message on arbitrum and ensures access control is enforced function test_MigrationSend() public { diff --git a/test/OFTDeployment.t.sol b/test/OFTDeployment.t.sol index 473a0a5..a4279ba 100644 --- a/test/OFTDeployment.t.sol +++ b/test/OFTDeployment.t.sol @@ -15,12 +15,12 @@ import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/lib import { SendParam } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol"; import "../contracts/MintableOFTUpgradeable.sol"; -import "../utils/Constants.sol"; +import "../utils/L2Constants.sol"; import "../utils/LayerZeroHelpers.sol"; import "forge-std/Test.sol"; -contract OFTDeploymentTest is Test, Constants, LayerZeroHelpers { +contract OFTDeploymentTest is Test, L2Constants, LayerZeroHelpers { using OptionsBuilder for bytes; function testGnosisMainnet() public { diff --git a/test/syncSimulation.t.sol b/test/syncSimulation.t.sol index 37f85bb..845cdec 100644 --- a/test/syncSimulation.t.sol +++ b/test/syncSimulation.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.13; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "forge-std/Test.sol"; -import "../utils/Constants.sol"; +import "../utils/L2Constants.sol"; interface ILineaBridge { struct ClaimMessageWithProofParams { @@ -24,7 +24,7 @@ interface ILineaBridge { ) external; } -contract simulationLineaClaim is Test, Constants { +contract simulationLineaClaim is Test, L2Constants { address public lineaBridge = 0xd19d4B5d358258f05D7B411E21A1460D11B0876F; @@ -75,7 +75,7 @@ contract simulationLineaClaim is Test, Constants { vm.prank(0xC83bb94779c5577AF1D48dF8e2A113dFf0cB127c); uint256 vampireDummyTokenBalanceBefore = lineaDummyToken.balanceOf(L1_VAMP); - uint256 syncPoolEthBalanceBefore = address(L1_SYNC_POOL_ADDRESS).balance; + uint256 syncPoolEthBalanceBefore = address(L1_SYNC_POOL).balance; uint256 vampireEthBalanceBefore = address(L1_VAMP).balance; console.log("Vampire Linea Dummy Token Balance Before:", vampireDummyTokenBalanceBefore / 1 ether); @@ -85,7 +85,7 @@ contract simulationLineaClaim is Test, Constants { linea.claimMessageWithProof(params); uint256 vampireDummyTokenBalanceAfter = lineaDummyToken.balanceOf(L1_VAMP); - uint256 syncPoolEthBalanceAfter = address(L1_SYNC_POOL_ADDRESS).balance; + uint256 syncPoolEthBalanceAfter = address(L1_SYNC_POOL).balance; uint256 vampireEthBalanceAfter = address(L1_VAMP).balance; console.log("Vampire Linea Dummy Token Balance After:", vampireDummyTokenBalanceAfter / 1 ether); diff --git a/utils/Constants.sol b/utils/L2Constants.sol similarity index 96% rename from utils/Constants.sol rename to utils/L2Constants.sol index ceb5607..575e6e0 100644 --- a/utils/Constants.sol +++ b/utils/L2Constants.sol @@ -32,7 +32,6 @@ pragma solidity ^0.8.13; address L2_EXCHANGE_RATE_PROVIDER; address L2_PRICE_ORACLE; address L2_MESSENGER; - uint32 L2_PRICE_ORACLE_HEART_BEAT; address L1_MESSENGER; address L1_DUMMY_TOKEN; @@ -44,7 +43,7 @@ pragma solidity ^0.8.13; address L1_RECEIVER_PROXY_ADMIN; } -contract Constants { +contract L2Constants { /*////////////////////////////////////////////////////////////// CURRENT DEPLOYMENT CONSTANTS @@ -79,14 +78,21 @@ contract Constants { // OFT Token Constants string constant TOKEN_NAME = "Wrapped eETH"; string constant TOKEN_SYMBOL = "weETH"; + + // weETH Bridge Rate Limits + uint256 constant BUCKET_SIZE = 1000 ether; + uint256 constant BUCKET_REFILL_PER_SECOND = 0.1 ether; - // Global Production Rate Limits + // Global Production weETH Bridge Rate Limits uint256 constant LIMIT = 2000 ether; uint256 constant WINDOW = 4 hours; - // Global Stand by Rate Limits + // Global Stand By weETH Bridge Rate Limits uint256 constant STANDBY_LIMIT = 0.0001 ether; uint256 constant STANDBY_WINDOW = 1 minutes; + // Standard Native Minting Rates + uint32 constant L2_PRICE_ORACLE_HEART_BEAT = 24 hours; + // Mainnet Constants string constant L1_RPC_URL = "https://mainnet.gateway.tenderly.co"; uint32 constant L1_EID = 30101; @@ -96,7 +102,7 @@ contract Constants { address constant L1_CONTRACT_CONTROLLER = 0x2aCA71020De61bb532008049e1Bd41E451aE8AdC; address constant L1_TIMELOCK = 0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761; - address constant L1_SYNC_POOL_ADDRESS = 0xD789870beA40D056A4d26055d0bEFcC8755DA146; + address constant L1_SYNC_POOL = 0xD789870beA40D056A4d26055d0bEFcC8755DA146; address constant L1_OFT_ADAPTER = 0xFE7fe01F8B9A76803aF3750144C2715D9bcf7D0D; address constant L1_VAMP = 0x9FFDF407cDe9a93c47611799DA23924Af3EF764F; address constant L1_SEND_302 = 0xbB2Ea70C9E858123480642Cf96acbcCE1372dCe1; @@ -108,7 +114,6 @@ contract Constants { // https://docs.layerzero.network/v2/developers/solana/configuration/oapp-config#dead-dvn address constant DEAD_DVN = 0x000000000000000000000000000000000000dEaD; - address constant L1_SYNC_POOL_PROXY_ADMIN = 0xDBf6bE120D4dc72f01534673a1223182D9F6261D; // Construct an array of all the L2s that are currently supported @@ -145,7 +150,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: 0xc42853c0C6624F42fcB8219aCeb67Ad188087DCB, L2_PRICE_ORACLE: 0xcD96262Df56127f298b452FA40759632868A472a, L2_MESSENGER: 0x4200000000000000000000000000000000000007, - L2_PRICE_ORACLE_HEART_BEAT: 24 hours, L1_MESSENGER: 0x5D4472f31Bd9385709ec61305AFc749F0fA8e9d0, L1_DUMMY_TOKEN: 0x83998e169026136760bE6AF93e776C2F352D4b28, @@ -178,7 +182,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: 0xc42853c0C6624F42fcB8219aCeb67Ad188087DCB, L2_PRICE_ORACLE: 0x7C1DAAE7BB0688C9bfE3A918A4224041c7177256, L2_MESSENGER: 0xC0d3c0d3c0D3c0D3C0d3C0D3C0D3c0d3c0d30007, - L2_PRICE_ORACLE_HEART_BEAT: 6 hours, L1_MESSENGER: 0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f, L1_DUMMY_TOKEN: 0xDc400f3da3ea5Df0B7B6C127aE2e54CE55644CF3, @@ -211,7 +214,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: 0x241a91F095B2020890Bc8518bea168C195518344, L2_PRICE_ORACLE: 0x100c8e61aB3BeA812A42976199Fc3daFbcDD7272, L2_MESSENGER: 0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec, - L2_PRICE_ORACLE_HEART_BEAT: 6 hours, L1_MESSENGER: 0xd19d4B5d358258f05D7B411E21A1460D11B0876F, L1_DUMMY_TOKEN: 0x61Ff310aC15a517A846DA08ac9f9abf2A0f9A2bf, @@ -245,7 +247,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: 0xF2c5519c634796B73dE90c7Dc27B4fEd560fC3ca, L2_PRICE_ORACLE: 0x35e9D7001819Ea3B39Da906aE6b06A62cfe2c181, L2_MESSENGER: 0x4200000000000000000000000000000000000007, - L2_PRICE_ORACLE_HEART_BEAT: 24 hours, L1_MESSENGER: 0x866E82a600A1414e583f7F13623F1aC5d58b0Afa, L1_DUMMY_TOKEN: 0x0295E0CE709723FB25A28b8f67C54a488BA5aE46, @@ -281,7 +282,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: address(0), L2_PRICE_ORACLE: address(0), L2_MESSENGER: address(0), - L2_PRICE_ORACLE_HEART_BEAT: 0, L1_MESSENGER: address(0), L1_DUMMY_TOKEN: address(0), @@ -314,7 +314,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: address(0), L2_PRICE_ORACLE: address(0), L2_MESSENGER: address(0), - L2_PRICE_ORACLE_HEART_BEAT: 0, L1_MESSENGER: address(0), L1_DUMMY_TOKEN: address(0), @@ -348,7 +347,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: address(0), L2_PRICE_ORACLE: address(0), L2_MESSENGER: address(0), - L2_PRICE_ORACLE_HEART_BEAT: 0, L1_MESSENGER: address(0), L1_DUMMY_TOKEN: address(0), @@ -381,7 +379,6 @@ contract Constants { L2_EXCHANGE_RATE_PROVIDER: address(0), L2_PRICE_ORACLE: address(0), L2_MESSENGER: address(0), - L2_PRICE_ORACLE_HEART_BEAT: 0, L1_MESSENGER: address(0), L1_DUMMY_TOKEN: address(0), diff --git a/utils/LayerZeroHelpers.sol b/utils/LayerZeroHelpers.sol index c7c619b..7c54da6 100644 --- a/utils/LayerZeroHelpers.sol +++ b/utils/LayerZeroHelpers.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; import "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/UlnBase.sol"; -import "./Constants.sol"; +import "./L2Constants.sol"; contract LayerZeroHelpers { // TODO: move all layerzero helper functions here From 58c3fbd7b6c998ba71ae90a5252214d41558140f Mon Sep 17 00:00:00 2001 From: jtfirek Date: Tue, 15 Oct 2024 11:34:36 -0500 Subject: [PATCH 05/13] fix --- .../01_DeployUpgradeableAdapter.s.sol | 1 + .../01_DeployConfigureL2.s.sol | 38 ++++++++++++------- .../02_DeployConfigureL1.s.sol | 12 ------ utils/L2Constants.sol | 14 ++++++- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol index 9a8ead4..209c4ab 100644 --- a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol +++ b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol @@ -15,6 +15,7 @@ import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/lib import "../../contracts/EtherFiOFTAdapterUpgradeable.sol"; import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; + contract DeployUpgradeableOFTAdapter is Script, L2Constants, LayerZeroHelpers { using OptionsBuilder for bytes; diff --git a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol index 8d931b8..eb81eb8 100644 --- a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol @@ -5,6 +5,7 @@ import "forge-std/console.sol"; import "forge-std/Script.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; @@ -12,22 +13,10 @@ import "../../contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol"; import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; import "../../contracts/NativeMinting/BucketRateLimiter.sol"; import "../../utils/L2Constants.sol"; +import "../../utils/LayerZeroHelpers.sol"; -contract L1NativeMintingScript is Script, L2Constants { - - - /*////////////////////////////////////////////////////////////// - Current Deployment Parameters - //////////////////////////////////////////////////////////////*/ - - ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; - address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; - address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; - - /*////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////*/ +contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers { function run() public { @@ -78,9 +67,30 @@ contract L1NativeMintingScript is Script, L2Constants { ) ) ); + L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(syncPoolProxy); console.log("Sync Pool deployed at: ", syncPoolProxy); bucketRateLimiter.updateConsumer(syncPoolProxy); bucketRateLimiter.transferOwnership(DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE); + + // setting OFT config for the L2 sync pool + syncPool.setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); + + ILayerZeroEndpointV2(DEPLOYMENT_L2.L2_ENDPOINT).setConfig(syncPoolProxy, DEPLOYMENT_SEND_LID_302, params); + + SetConfigParam[] memory params = new SetConfigParam[](1); + + UlnConfig memory ulnConfig = UlnConfig({ + confirmations: 64, + requiredDVNCount: 2, + optionalDVNCount: 0, + optionalDVNThreshold: 0, + requiredDVNs: DEPLOYMENT_L2.L2_DVNS, + optionalDVNs: new address[](0) + }); + + params[0] = SetConfigParam(dstEid, 2, abi.encode(ulnConfig)); + ILayerZeroEndpointV2(DEPLOYMENT_L2.L2_ENDPOINT).setConfig(oftDeployment.proxyAddress, DEPLOYMENT_L2.SEND_302, params); + } } diff --git a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol index f2c2d4f..5abc904 100644 --- a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol @@ -13,19 +13,7 @@ import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { - - /*////////////////////////////////////////////////////////////// - Current Deployment Parameters - //////////////////////////////////////////////////////////////*/ - ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; - string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; - string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; - - /*////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////*/ - function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 6076ce1..37420a4 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -46,7 +46,19 @@ pragma solidity ^0.8.13; contract L2Constants { /*////////////////////////////////////////////////////////////// - CURRENT DEPLOYMENT CONSTANTS + Native Minting Deployment Parameters + //////////////////////////////////////////////////////////////*/ + + ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; + address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; + address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; + string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; + string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; + + + + /*////////////////////////////////////////////////////////////// + OFT Deployment Parameters //////////////////////////////////////////////////////////////*/ // General chain constants From 3bcd8dd431b089fb85880546e81d97e54bbb314f Mon Sep 17 00:00:00 2001 From: jtfirek Date: Thu, 17 Oct 2024 08:59:32 -0500 Subject: [PATCH 06/13] deploy scripts and unit tests --- .vscode/settings.json | 11 - contracts/NativeMinting/BucketRateLimiter.sol | 2 + .../NativeMinting/EtherfiL1SyncPoolETH.sol | 205 +++++++++++ .../L1BaseSyncPoolUpgradeable.sol | 328 ++++++++++++++++++ .../L2ScrollSyncPoolETHUpgradeable.sol | 2 +- foundry.toml | 2 - libraries/AppendOnlyMerkleTree.sol | 73 ++++ .../01_DeployUpgradeableAdapter.s.sol | 4 +- .../01_DeployConfigureL2.s.sol | 133 ++++--- .../02_DeployConfigureL1.s.sol | 97 +++++- .../03_ConfigureL2.s.sol | 49 +++ scripts/OFTDeployment/01_OFTConfigure.s.sol | 2 +- test/AdapterMigration.t.sol | 2 +- test/OFTDeployment.t.sol | 2 +- test/nativeMintingScroll.t.sol | 146 ++++++++ .../connnect-migration-peer.json | 28 -- .../02_pauseCrossChain/disconnect-base.json | 48 --- .../02_pauseCrossChain/disconnect-blast.json | 48 --- .../02_pauseCrossChain/disconnect-bnb.json | 48 --- .../02_pauseCrossChain/disconnect-linea.json | 48 --- .../disconnect-mainnet.json | 48 --- .../02_pauseCrossChain/disconnect-mode.json | 48 --- .../02_pauseCrossChain/disconnect-op.json | 48 --- .../02_pauseCrossChain/disconnect-scroll.json | 48 --- .../02_pauseCrossChain/disconnect-zksync.json | 48 --- .../03_unpauseCrossChain/reconnect-base.json | 53 --- .../03_unpauseCrossChain/reconnect-blast.json | 53 --- .../03_unpauseCrossChain/reconnect-bnb.json | 53 --- .../03_unpauseCrossChain/reconnect-linea.json | 53 --- .../03_unpauseCrossChain/reconnect-mode.json | 53 --- .../03_unpauseCrossChain/reconnect-op.json | 53 --- .../reconnect-scroll.json | 53 --- .../reconnect-zksync.json | 53 --- utils/GnosisHelpers.sol | 23 +- utils/L2Constants.sol | 19 +- utils/LayerZeroHelpers.sol | 53 +++ 36 files changed, 1050 insertions(+), 987 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 contracts/NativeMinting/EtherfiL1SyncPoolETH.sol create mode 100644 contracts/NativeMinting/L1BaseSyncPoolUpgradeable.sol create mode 100644 libraries/AppendOnlyMerkleTree.sol create mode 100644 scripts/NativeMintingDeployment/03_ConfigureL2.s.sol create mode 100644 test/nativeMintingScroll.t.sol delete mode 100644 transactions/01_migrationSetup/connnect-migration-peer.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-base.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-blast.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-bnb.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-linea.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-mainnet.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-mode.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-op.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-scroll.json delete mode 100644 transactions/02_pauseCrossChain/disconnect-zksync.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-base.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-blast.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-bnb.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-linea.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-mode.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-op.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-scroll.json delete mode 100644 transactions/03_unpauseCrossChain/reconnect-zksync.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 060cef2..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "solidity.compileUsingRemoteVersion": "v0.8.20+commit.a1b79de6", - "solidity.remappings": [ - "ds-test/=lib/forge-std/lib/ds-test/src/", - "forge-std/=lib/forge-std/src/", - "@layerzerolabs/lz-evm-oapp-v2/contracts/=node_modules/@layerzerolabs/lz-evm-oapp-v2/contracts/", - "@layerzerolabs/lz-evm-protocol-v2/contracts/=node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/", - "@layerzerolabs/lz-evm-messagelib-v2/contracts/=node_modules/@layerzerolabs/lz-evm-messagelib-v2/contracts/", - "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/=node_modules/layerzero-v2/oapp/contracts/" - ] -} diff --git a/contracts/NativeMinting/BucketRateLimiter.sol b/contracts/NativeMinting/BucketRateLimiter.sol index e1a962e..b20902b 100644 --- a/contracts/NativeMinting/BucketRateLimiter.sol +++ b/contracts/NativeMinting/BucketRateLimiter.sol @@ -6,6 +6,8 @@ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "forge-std/console.sol"; + import "../../interfaces/IRateLimiter.sol"; import "../../utils/BucketLimiter.sol"; diff --git a/contracts/NativeMinting/EtherfiL1SyncPoolETH.sol b/contracts/NativeMinting/EtherfiL1SyncPoolETH.sol new file mode 100644 index 0000000..08815e7 --- /dev/null +++ b/contracts/NativeMinting/EtherfiL1SyncPoolETH.sol @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import {IDummyToken} from "../../interfaces/IDummyToken.sol"; +import {L1BaseSyncPoolUpgradeable, Constants} from "./L1BaseSyncPoolUpgradeable.sol"; +import {ILiquifier} from "../../interfaces/ILiquifier.sol"; +import {IWeEth} from "../../interfaces/IWeEth.sol"; + +contract EtherfiL1SyncPoolETH is L1BaseSyncPoolUpgradeable { + error EtherfiL1SyncPoolETH__OnlyETH(); + error EtherfiL1SyncPoolETH__InvalidAmountIn(); + error EtherfiL1SyncPoolETH__UnsetDummyToken(); + + ILiquifier private _liquifier; + IERC20 private _eEth; + + mapping(uint32 => IDummyToken) private _dummyTokens; + + event LiquifierSet(address liquifier); + event EEthSet(address eEth); + event DummyTokenSet(uint32 originEid, address dummyToken); + + /** + * @dev Constructor for Etherfi L1 Sync Pool ETH + * @param endpoint Address of the LayerZero endpoint + */ + constructor(address endpoint) L1BaseSyncPoolUpgradeable(endpoint) {} + + /** + * @dev Initialize the contract + * @param liquifier Address of the liquifier + * @param eEth Address of the eEth + * @param tokenOut Address of the main token + * @param lockBox Address of the lock box + * @param owner Address of the owner + */ + function initialize(address liquifier, address eEth, address tokenOut, address lockBox, address owner) + external + initializer + { + __L1BaseSyncPool_init(tokenOut, lockBox, owner); + __Ownable_init(owner); + + _setLiquifier(liquifier); + _setEEth(eEth); + } + + /** + * @dev Get the liquifier address + * @return The liquifier address + */ + function getLiquifier() public view returns (address) { + return address(_liquifier); + } + + /** + * @dev Get the eEth address + * @return The eEth address + */ + function getEEth() public view returns (address) { + return address(_eEth); + } + + /** + * @dev Get the dummy token address for a given origin EID + * @param originEid Origin EID + * @return The dummy token address + */ + function getDummyToken(uint32 originEid) public view virtual returns (address) { + return address(_dummyTokens[originEid]); + } + + /** + * @dev Set the liquifier address + * @param liquifier The liquifier address + */ + function setLiquifier(address liquifier) public onlyOwner { + _setLiquifier(liquifier); + } + + /** + * @dev Set the eEth address + * @param eEth The eEth address + */ + function setEEth(address eEth) public onlyOwner { + _setEEth(eEth); + } + + /** + * @dev Set the dummy token address for a given origin EID + * @param originEid Origin EID + * @param dummyToken The dummy token address + */ + function setDummyToken(uint32 originEid, address dummyToken) public onlyOwner { + _setDummyToken(originEid, dummyToken); + } + + /** + * @dev Internal function to set the liquifier address + * @param liquifier The liquifier address + */ + function _setLiquifier(address liquifier) internal { + _liquifier = ILiquifier(liquifier); + + emit LiquifierSet(liquifier); + } + + /** + * @dev Internal function to set the eEth address + * @param eEth The eEth address + */ + function _setEEth(address eEth) internal { + _eEth = IERC20(eEth); + + emit EEthSet(eEth); + } + + /** + * @dev Internal function to set the dummy token address for a given origin EID + * @param originEid Origin EID + * @param dummyToken The dummy token address + */ + function _setDummyToken(uint32 originEid, address dummyToken) internal { + _dummyTokens[originEid] = IDummyToken(dummyToken); + + emit DummyTokenSet(originEid, dummyToken); + } + + /** + * @dev Internal function to anticipate a deposit + * Will mint the dummy tokens and deposit them to the L1 deposit pool + * Will revert if: + * - The token in is not ETH + * - The dummy token is not set + * @param originEid Origin EID + * @param tokenIn Address of the token in + * @param amountIn Amount in + * @return actualAmountOut The actual amount of token received + */ + function _anticipatedDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256) + internal + virtual + override + returns (uint256 actualAmountOut) + { + if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH(); + + IERC20 tokenOut = IERC20(getTokenOut()); + + ILiquifier liquifier = _liquifier; + IDummyToken dummyToken = _dummyTokens[originEid]; + + if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken(); + + uint256 balanceBefore = tokenOut.balanceOf(address(this)); + + dummyToken.mint(address(this), amountIn); + dummyToken.approve(address(liquifier), amountIn); + + liquifier.depositWithERC20(address(dummyToken), amountIn, address(0)); + + uint256 eEthBalance = _eEth.balanceOf(address(this)); + + _eEth.approve(address(tokenOut), eEthBalance); + IWeEth(address(tokenOut)).wrap(eEthBalance); + + return tokenOut.balanceOf(address(this)) - balanceBefore; + } + + /** + * @dev Internal function to finalize a deposit + * Will swap the dummy tokens for the actual ETH + * Will revert if: + * - The token in is not ETH + * - The amount in is not equal to the value + * - The dummy token is not set + * @param originEid Origin EID + * @param tokenIn Address of the token in + * @param amountIn Amount in + */ + function _finalizeDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256) + internal + virtual + override + { + if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH(); + if (amountIn != msg.value) revert EtherfiL1SyncPoolETH__InvalidAmountIn(); + + ILiquifier liquifier = _liquifier; + IDummyToken dummyToken = _dummyTokens[originEid]; + + if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken(); + + uint256 dummyBalance = dummyToken.balanceOf(address(liquifier)); + uint256 ethBalance = address(this).balance; + + uint256 swapAmount = ethBalance > dummyBalance ? dummyBalance : ethBalance; + + liquifier.unwrapL2Eth{value: swapAmount}(address(dummyToken)); + + dummyToken.burn(swapAmount); + } +} diff --git a/contracts/NativeMinting/L1BaseSyncPoolUpgradeable.sol b/contracts/NativeMinting/L1BaseSyncPoolUpgradeable.sol new file mode 100644 index 0000000..d942258 --- /dev/null +++ b/contracts/NativeMinting/L1BaseSyncPoolUpgradeable.sol @@ -0,0 +1,328 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; +import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { + OAppReceiverUpgradeable, + OAppCoreUpgradeable +} from "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/OAppReceiverUpgradeable.sol"; +import {Origin} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; + +import {IL1SyncPool} from "../../interfaces/IL1SyncPool.sol"; +import {Constants} from "../../libraries/Constants.sol"; + +/** + * @title L1 Base Sync Pool + * @dev Base contract for L1 Sync Pools + * A sync pool is an OApp that allows users to deposit tokens on Layer 2, and then sync them to Layer 1 + * using the LayerZero messaging protocol. + * The L1 sync pool takes care of the actual syncing process, it receives different messages from L2s + * and handles the anticipated deposits and the actual deposits. + * The L1 sync pool is responsible for managing the lock box making sure it is backed by the correct amount of tokens. + * Fast messages are used to anticipate the deposit, and slow messages are used to finalize the deposit. + * For example, a user can deposit 100 ETH on L2, the L2 sync pool will send a fast message to the L1 sync pool + * anticipating the actual 100 ETH deposit (as it takes ~7 days to finalize the deposit), and finalize the deposit + * when the 100 ETH is actually received from the L2. + */ +abstract contract L1BaseSyncPoolUpgradeable is OAppReceiverUpgradeable, ReentrancyGuardUpgradeable, IL1SyncPool { + struct L1BaseSyncPoolStorage { + IERC20 tokenOut; + address lockBox; + uint256 totalUnbackedTokens; + mapping(uint32 => address) receivers; + } + + // keccak256(abi.encode(uint256(keccak256(syncpools.storage.l1basesyncpool)) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant L1BaseSyncPoolStorageLocation = + 0xd96cd964f71a052084af61290ff53294a8f76de4d8f66ba7682fe6598635ef00; + + function _getL1BaseSyncPoolStorage() internal pure returns (L1BaseSyncPoolStorage storage $) { + assembly { + $.slot := L1BaseSyncPoolStorageLocation + } + } + + error L1BaseSyncPool__UnauthorizedCaller(); + error L1BaseSyncPool__NativeTransferFailed(); + + event ReceiverSet(uint32 indexed originEid, address receiver); + event TokenOutSet(address tokenOut); + event LockBoxSet(address lockBox); + event InsufficientDeposit( + uint32 indexed originEid, + bytes32 guid, + uint256 actualAmountOut, + uint256 expectedAmountOut, + uint256 unbackedTokens + ); + event Fee(uint32 indexed originEid, bytes32 guid, uint256 actualAmountOut, uint256 expectedAmountOut, uint256 fee); + event Sweep(address token, address receiver, uint256 amount); + + /** + * @dev Constructor for L1 Base Sync Pool + * @param endpoint Address of the LayerZero endpoint + */ + constructor(address endpoint) OAppCoreUpgradeable(endpoint) {} + + function __L1BaseSyncPool_init(address tokenOut, address lockBox, address delegate) internal onlyInitializing { + __ReentrancyGuard_init(); + __OAppCore_init(delegate); + __L1BaseSyncPool_init_unchained(tokenOut, lockBox); + } + + function __L1BaseSyncPool_init_unchained(address tokenOut, address lockBox) internal onlyInitializing { + _setTokenOut(tokenOut); + _setLockBox(lockBox); + } + + /** + * @dev Get the main token address + * @return The main token address + */ + function getTokenOut() public view virtual returns (address) { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + return address($.tokenOut); + } + + /** + * @dev Get the lock box address + * @return The lock box address + */ + function getLockBox() public view virtual returns (address) { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + return $.lockBox; + } + + /** + * @dev Get the receiver address for a specific origin EID + * @param originEid Origin EID + * @return The receiver address + */ + function getReceiver(uint32 originEid) public view virtual returns (address) { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + return $.receivers[originEid]; + } + + /** + * @dev Get the total unbacked tokens + * @return The total unbacked tokens + */ + function getTotalUnbackedTokens() public view virtual returns (uint256) { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + return $.totalUnbackedTokens; + } + + /** + * @dev Receive a message from an L2 + * Will revert if: + * - The caller is not the receiver + * @param originEid Origin EID + * @param guid Message GUID + * @param tokenIn Token address + * @param amountIn Amount in + * @param amountOut Amount out + */ + function onMessageReceived(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) + public + payable + override + nonReentrant + { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + + if (msg.sender != $.receivers[originEid]) revert L1BaseSyncPool__UnauthorizedCaller(); + + _finalizeDeposit(originEid, guid, tokenIn, amountIn, amountOut); + } + + /** + * @dev Receive a message from LayerZero + * Overriden to add reentrancy guard + * @param origin Origin + * @param guid Message GUID + * @param message Message + * @param executor Executor + * @param extraData Extra data + */ + function lzReceive( + Origin calldata origin, + bytes32 guid, + bytes calldata message, + address executor, + bytes calldata extraData + ) public payable virtual override nonReentrant { + super.lzReceive(origin, guid, message, executor, extraData); + } + + /** + * @dev Set the main token address + * @param tokenOut Address of the main token + */ + function setTokenOut(address tokenOut) public virtual onlyOwner { + _setTokenOut(tokenOut); + } + + /** + * @dev Set the lock box address + * @param lockBox Address of the lock box + */ + function setLockBox(address lockBox) public virtual onlyOwner { + _setLockBox(lockBox); + } + + /** + * @dev Set the receiver address for a specific origin EID + * @param originEid Origin EID + * @param receiver Receiver address + */ + function setReceiver(uint32 originEid, address receiver) public virtual onlyOwner { + _setReceiver(originEid, receiver); + } + + /** + * @dev Sweep tokens from the contract + * @param token Token address + * @param receiver Receiver address + * @param amount Amount to sweep + */ + function sweep(address token, address receiver, uint256 amount) public virtual onlyOwner { + if (token == Constants.ETH_ADDRESS) { + (bool success,) = receiver.call{value: amount}(""); + if (!success) revert L1BaseSyncPool__NativeTransferFailed(); + } else { + SafeERC20.safeTransfer(IERC20(token), receiver, amount); + } + + emit Sweep(token, receiver, amount); + } + + /** + * @dev Internal function called when a LZ message is received + * @param origin Origin + * @param guid Message GUID + * @param message Message + */ + function _lzReceive(Origin calldata origin, bytes32 guid, bytes calldata message, address, bytes calldata) + internal + virtual + override + { + (address tokenIn, uint256 amountIn, uint256 amountOut) = abi.decode(message, (address, uint256, uint256)); + + uint256 actualAmountOut = _anticipatedDeposit(origin.srcEid, guid, tokenIn, amountIn, amountOut); + + _handleAnticipatedDeposit(origin.srcEid, guid, actualAmountOut, amountOut); + } + + /** + * @dev Internal function to set the main token address + * @param tokenOut Address of the main token + */ + function _setTokenOut(address tokenOut) internal virtual { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + $.tokenOut = IERC20(tokenOut); + + emit TokenOutSet(tokenOut); + } + + /** + * @dev Internal function to set the receiver address for a specific origin EID + * @param originEid Origin EID + * @param receiver Receiver address + */ + function _setReceiver(uint32 originEid, address receiver) internal virtual { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + $.receivers[originEid] = receiver; + + emit ReceiverSet(originEid, receiver); + } + + /** + * @dev Internal function to set the lock box address + * @param lockBox Address of the lock box + */ + function _setLockBox(address lockBox) internal virtual { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + $.lockBox = lockBox; + + emit LockBoxSet(lockBox); + } + + /** + * @dev Internal function to handle an anticipated deposit + * Will emit an InsufficientDeposit event if the actual amount out is less than the expected amount out + * Will emit a Fee event if the actual amount out is equal or greater than the expected amount out + * The fee kept in this contract will be used to back any future insufficient deposits + * When the fee is used, the total unbacked tokens will be lower than the actual missing amount + * Any time the InsufficientDeposit event is emitted, necessary actions should be taken to back the lock box + * such as using POL, increasing the deposit fee on the faulty L2, etc. + * @param originEid Origin EID + * @param guid Message GUID + * @param actualAmountOut Actual amount out + * @param expectedAmountOut Expected amount out + */ + function _handleAnticipatedDeposit( + uint32 originEid, + bytes32 guid, + uint256 actualAmountOut, + uint256 expectedAmountOut + ) internal virtual { + L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage(); + + IERC20 tokenOut = $.tokenOut; + + uint256 totalUnbackedTokens = $.totalUnbackedTokens; + uint256 balance = tokenOut.balanceOf(address(this)); + + uint256 totalAmountOut = expectedAmountOut + totalUnbackedTokens; + uint256 amountToSend; + + if (balance < totalAmountOut) { + amountToSend = balance; + + $.totalUnbackedTokens = totalAmountOut - balance; + } else { + amountToSend = totalAmountOut; + + if (totalUnbackedTokens > 0) $.totalUnbackedTokens = 0; + } + + if (actualAmountOut < expectedAmountOut) { + uint256 unbackedTokens = expectedAmountOut - actualAmountOut; + emit InsufficientDeposit(originEid, guid, actualAmountOut, expectedAmountOut, unbackedTokens); + } else { + uint256 fee = actualAmountOut - expectedAmountOut; + emit Fee(originEid, guid, actualAmountOut, expectedAmountOut, fee); + } + + SafeERC20.safeTransfer(tokenOut, $.lockBox, amountToSend); + } + + /** + * @dev Internal function to anticipate a deposit + * @param originEid Origin EID + * @param guid Message GUID + * @param tokenIn Token address + * @param amountIn Amount in + * @param amountOut Amount out + * @return actualAmountOut Actual amount out + */ + function _anticipatedDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) + internal + virtual + returns (uint256 actualAmountOut); + + /** + * @dev Internal function to finalize a deposit + * @param originEid Origin EID + * @param guid Message GUID (will match the one used in the anticipated deposit) + * @param tokenIn Token address + * @param amountIn Amount in + * @param amountOut Amount out + */ + function _finalizeDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut) + internal + virtual; +} diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol index db61a6f..6bda265 100644 --- a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol @@ -109,7 +109,7 @@ contract L2ScrollSyncPoolETHUpgradeable is L2BaseSyncPoolUpgradeable, BaseMessen return receipt; } - /** + /** * @dev Deposit function with referral event */ function deposit( diff --git a/foundry.toml b/foundry.toml index f9a2b42..1696273 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,8 +6,6 @@ libs = ["node_modules", "lib"] test = "test" fs_permissions = [{ access = "read-write", path = "./"}] -optimizer = true -optimizer_runs = 200 solc_version = "0.8.20" diff --git a/libraries/AppendOnlyMerkleTree.sol b/libraries/AppendOnlyMerkleTree.sol new file mode 100644 index 0000000..466b5c9 --- /dev/null +++ b/libraries/AppendOnlyMerkleTree.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.16; + +abstract contract AppendOnlyMerkleTree { + /// @dev The maximum height of the withdraw merkle tree. + uint256 private constant MAX_TREE_HEIGHT = 40; + + /// @notice The merkle root of the current merkle tree. + /// @dev This is actual equal to `branches[n]`. + bytes32 public messageRoot; + + /// @notice The next unused message index. + uint256 public nextMessageIndex; + + /// @notice The list of zero hash in each height. + bytes32[MAX_TREE_HEIGHT] private zeroHashes; + + /// @notice The list of minimum merkle proofs needed to compute next root. + /// @dev Only first `n` elements are used, where `n` is the minimum value that `2^{n-1} >= currentMaxNonce + 1`. + /// It means we only use `currentMaxNonce + 1` leaf nodes to construct the merkle tree. + bytes32[MAX_TREE_HEIGHT] public branches; + + function _initializeMerkleTree() internal { + // Compute hashes in empty sparse Merkle tree + for (uint256 height = 0; height + 1 < MAX_TREE_HEIGHT; height++) { + zeroHashes[height + 1] = _efficientHash(zeroHashes[height], zeroHashes[height]); + } + } + + function _appendMessageHash(bytes32 _messageHash) internal returns (uint256, bytes32) { + require(zeroHashes[1] != bytes32(0), "call before initialization"); + + uint256 _currentMessageIndex = nextMessageIndex; + bytes32 _hash = _messageHash; + uint256 _height = 0; + + while (_currentMessageIndex != 0) { + if (_currentMessageIndex % 2 == 0) { + // it may be used in next round. + branches[_height] = _hash; + // it's a left child, the right child must be null + _hash = _efficientHash(_hash, zeroHashes[_height]); + } else { + // it's a right child, use previously computed hash + _hash = _efficientHash(branches[_height], _hash); + } + unchecked { + _height += 1; + } + _currentMessageIndex >>= 1; + } + + branches[_height] = _hash; + messageRoot = _hash; + + _currentMessageIndex = nextMessageIndex; + unchecked { + nextMessageIndex = _currentMessageIndex + 1; + } + + return (_currentMessageIndex, _hash); + } + + function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { + // solhint-disable-next-line no-inline-assembly + assembly { + mstore(0x00, a) + mstore(0x20, b) + value := keccak256(0x00, 0x40) + } + } +} diff --git a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol index 209c4ab..493e600 100644 --- a/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol +++ b/scripts/AdapterMigration/01_DeployUpgradeableAdapter.s.sol @@ -9,7 +9,7 @@ import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.so import "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/UlnBase.sol"; import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol"; -import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppOptionsType3.sol"; +// import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppOptionsType3.sol"; import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; import "../../contracts/EtherFiOFTAdapterUpgradeable.sol"; @@ -61,7 +61,7 @@ contract DeployUpgradeableOFTAdapter is Script, L2Constants, LayerZeroHelpers { for (uint256 i = 0; i < L2s.length; i++) { _appendEnforcedOptions(L2s[i].L2_EID); } - adapter.setEnforcedOptions(enforcedOptions); + IOAppOptionsType3(adapterProxy).setEnforcedOptions(enforcedOptions); console.log("Transfering ownership to the gnosis..."); adapter.setDelegate(L1_CONTRACT_CONTROLLER); diff --git a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol index eb81eb8..80bcb76 100644 --- a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol @@ -6,91 +6,114 @@ import "forge-std/Script.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; - +import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol"; +import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; - +import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol"; import "../../contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol"; import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; import "../../contracts/NativeMinting/BucketRateLimiter.sol"; import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; +contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers { + using OptionsBuilder for bytes; -contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers { - - function run() public { - - uint256 privateKey = vm.envUint("PRIVATE_KEY"); - address scriptDeployer = vm.addr(privateKey); - vm.startBroadcast(privateKey); - console.log("Deploying contracts on L2..."); + EnforcedOptionParam[] public enforcedOptions; + + address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; + address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; - address exchangeRateProviderImp = address(new EtherfiL2ExchangeRateProvider()); - address exchangeRateProviderProxy = address( + function deployExchangeRateProvider(address scriptDeployer) private returns (address) { + address impl = address(new EtherfiL2ExchangeRateProvider()); + address proxy = address( new TransparentUpgradeableProxy( - exchangeRateProviderImp, - DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE, + impl, + SCROLL.L2_CONTRACT_CONTROLLER_SAFE, abi.encodeWithSelector( - EtherfiL2ExchangeRateProvider.initialize.selector, scriptDeployer + EtherfiL2ExchangeRateProvider.initialize.selector, + scriptDeployer ) ) ); - EtherfiL2ExchangeRateProvider exchangeRateProvider = EtherfiL2ExchangeRateProvider(exchangeRateProviderProxy); - exchangeRateProvider.setRateParameters(ETH_ADDRESS, WEETH_RATE_PROVIDER, 0, L2_PRICE_ORACLE_HEART_BEAT); - exchangeRateProvider.transferOwnership(DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE); - console.log("Exchange Rate Provider deployed at: ", address(exchangeRateProviderProxy)); + + EtherfiL2ExchangeRateProvider provider = EtherfiL2ExchangeRateProvider(proxy); + provider.setRateParameters(ETH_ADDRESS, WEETH_RATE_PROVIDER, 0, L2_PRICE_ORACLE_HEART_BEAT); + provider.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + console.log("Exchange Rate Provider deployed at: ", proxy); + return proxy; + } - // BucketRateLimiter is our only native minting contract that uses UUPS - address bucketRateLimiterImp = address(new BucketRateLimiter()); - ERC1967Proxy bucketRateLimitierProxy = new ERC1967Proxy(bucketRateLimiterImp, abi.encodeWithSelector(BucketRateLimiter.initialize.selector)); - BucketRateLimiter bucketRateLimiter = BucketRateLimiter(address(bucketRateLimitierProxy)); - bucketRateLimiter.initialize(scriptDeployer); - bucketRateLimiter.setCapacity(BUCKET_SIZE); - bucketRateLimiter.setRefillRatePerSecond(BUCKET_REFILL_PER_SECOND); - console.log("Bucket Rate Limiter deployed at: ", address(bucketRateLimitierProxy)); + function deployBucketRateLimiter(address scriptDeployer) private returns (address) { + address impl = address(new BucketRateLimiter()); + ERC1967Proxy proxy = new ERC1967Proxy( + impl, + abi.encodeWithSelector(BucketRateLimiter.initialize.selector, scriptDeployer) + ); + + BucketRateLimiter limiter = BucketRateLimiter(address(proxy)); + limiter.setCapacity(BUCKET_SIZE); + limiter.setRefillRatePerSecond(BUCKET_REFILL_PER_SECOND); + + console.log("Bucket Rate Limiter deployed at: ", address(proxy)); + return address(proxy); + } - address syncPoolImp = address(new L2ScrollSyncPoolETHUpgradeable(DEPLOYMENT_L2.L2_ENDPOINT)); - address syncPoolProxy = address( + function deploySyncPool( + address scriptDeployer, + address exchangeRateProvider, + address bucketRateLimiter + ) private returns (address) { + address impl = address(new L2ScrollSyncPoolETHUpgradeable(SCROLL.L2_ENDPOINT)); + address proxy = address( new TransparentUpgradeableProxy( - syncPoolImp, - DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE, + impl, + SCROLL.L2_CONTRACT_CONTROLLER_SAFE, abi.encodeWithSelector( - L2ScrollSyncPoolETHUpgradeable.initialize.selector, - exchangeRateProviderProxy, - bucketRateLimitierProxy, + L2ScrollSyncPoolETHUpgradeable.initialize.selector, + exchangeRateProvider, + bucketRateLimiter, + SCROLL.L2_OFT, L1_EID, - DEPLOYMENT_L2.L2_OFT, L2_MESSENGER, - address(0), // Receiver contract hasn't been deployed on mainnet yet + address(0), scriptDeployer ) ) ); - L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(syncPoolProxy); - console.log("Sync Pool deployed at: ", syncPoolProxy); + + console.log("Sync Pool deployed at: ", proxy); + return proxy; + } - bucketRateLimiter.updateConsumer(syncPoolProxy); - bucketRateLimiter.transferOwnership(DEPLOYMENT_L2.L2_CONTRACT_CONTROLLER_SAFE); + function run() public returns (address) { + address scriptDeployer = vm.addr(1); + vm.startPrank(scriptDeployer); - // setting OFT config for the L2 sync pool - syncPool.setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); + console.log("Deploying contracts on L2..."); - ILayerZeroEndpointV2(DEPLOYMENT_L2.L2_ENDPOINT).setConfig(syncPoolProxy, DEPLOYMENT_SEND_LID_302, params); + address exchangeRateProvider = deployExchangeRateProvider(scriptDeployer); + address rateLimiter = deployBucketRateLimiter(scriptDeployer); + address syncPool = deploySyncPool(scriptDeployer, exchangeRateProvider, rateLimiter); - SetConfigParam[] memory params = new SetConfigParam[](1); - - UlnConfig memory ulnConfig = UlnConfig({ - confirmations: 64, - requiredDVNCount: 2, - optionalDVNCount: 0, - optionalDVNThreshold: 0, - requiredDVNs: DEPLOYMENT_L2.L2_DVNS, - optionalDVNs: new address[](0) - }); + // Configure the deployed contracts + BucketRateLimiter(rateLimiter).updateConsumer(syncPool); + BucketRateLimiter(rateLimiter).transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + L2ScrollSyncPoolETHUpgradeable(syncPool).setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); + ILayerZeroEndpointV2(SCROLL.L2_ENDPOINT).setConfig( + syncPool, + SCROLL.SEND_302, + getDVNConfig(L1_EID, SCROLL.LZ_DVN) + ); + IOAppOptionsType3(syncPool).setEnforcedOptions(getEnforcedOptions(L1_EID)); - params[0] = SetConfigParam(dstEid, 2, abi.encode(ulnConfig)); - ILayerZeroEndpointV2(DEPLOYMENT_L2.L2_ENDPOINT).setConfig(oftDeployment.proxyAddress, DEPLOYMENT_L2.SEND_302, params); + L2ScrollSyncPoolETHUpgradeable(syncPool).setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); + + vm.stopPrank(); + return syncPool; } } diff --git a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol index 5abc904..d8825be 100644 --- a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol @@ -3,22 +3,42 @@ pragma solidity ^0.8.13; import "forge-std/console.sol"; import "forge-std/Script.sol"; - -import import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "../../contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol"; import "../../contracts/NativeMinting/DummyTokenUpgradeable.sol"; -import "../../contracts/DummyTokenUpgradeable.sol"; - +import "../../utils/GnosisHelpers.sol"; import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; -contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { +contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisHelpers { + + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + address public dummyToken; + address public scrollReceiver; + + /*////////////////////////////////////////////////////////////// + Deployment Config + //////////////////////////////////////////////////////////////*/ + + string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; + string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; + address constant L1_MESSENGER = 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367; + + address public constant L2_SYNC_POOL = 0x6D411e0A54382eD43F02410Ce1c7a7c122afA6E1; + + /*////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////*/ function run() public { - - uint256 privateKey = vm.envUint("PRIVATE_KEY"); - address scriptDeployer = vm.addr(privateKey); - vm.startBroadcast(privateKey); + + // comment out for testing + // uint256 privateKey = vm.envUint("PRIVATE_KEY"); + // address scriptDeployer = vm.addr(privateKey); + // vm.startBroadcast(privateKey); + address scriptDeployer = vm.addr(1); + vm.startPrank(scriptDeployer); console.log("Deploying contracts on L1..."); @@ -26,24 +46,75 @@ contract L1NativeMintingScript is Script, Constants, LayerZeroHelpers { address dummyTokenProxy = address( new TransparentUpgradeableProxy( dummyTokenImpl, - L1_CONTRACT_CONTROLLER, + L1_TIMELOCK, abi.encodeWithSelector( - MintableOFTUpgradeable.initialize.selector, DUMMY_TOKEN_NAME, DUMMY_TOKEN_SYMBOL, scriptDeployer + DummyTokenUpgradeable.initialize.selector, DUMMY_TOKEN_NAME, DUMMY_TOKEN_SYMBOL, L1_CONTRACT_CONTROLLER ) ) ); + console.log("DummyToken deployed at: ", dummyTokenProxy); + dummyToken = dummyTokenProxy; address scrollReceiverImpl = address(new L1ScrollReceiverETHUpgradeable()); address scrollReceiverProxy = address( new TransparentUpgradeableProxy( scrollReceiverImpl, - L1_CONTRACT_CONTROLLER, + L1_TIMELOCK, abi.encodeWithSelector( L1ScrollReceiverETHUpgradeable.initialize.selector, L1_SYNC_POOL, L1_MESSENGER, L1_CONTRACT_CONTROLLER ) ) ); + console.log("ScrollReceiver deployed at: ", scrollReceiverProxy); + scrollReceiver = scrollReceiverProxy; - console.log("DummyToken deployed at: ", dummyTokenProxy); + // included for testing + vm.stopPrank(); + + // set LayerZero configure for L2 sync pool to communicate with the L1 sync pool (L1 sync pool via timelock) + + console.log("Generating L1 transactions for native minting..."); + + string memory timelock_schedule_transactions = _getGnosisHeader("1"); + string memory timelock_execute_transactions = _getGnosisHeader("1"); + + // register dummy token on liquifier + bytes memory setTokenData = abi.encodeWithSignature("registerToken(address,address,bool,uint16,uint32,uint32,bool)", dummyTokenProxy, address(0), true, 0, 20_000, 200_000, true); + + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_VAMP, setTokenData, false)); + timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_VAMP, setTokenData, false)); + + // set receiver and dummy token on the L1 sync pool + bytes memory setReceiverData = abi.encodeWithSignature("setReceiver(uint32,address)", SCROLL.L2_EID, scrollReceiverProxy); + bytes memory setDummyTokenData = abi.encodeWithSignature("setDummyToken(uint32,address)", SCROLL.L2_EID, dummyTokenProxy); + + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setReceiverData, false)); + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setDummyTokenData, false)); + timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setReceiverData, false)); + timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setDummyTokenData, false)); + + // OFT transactions that require the timelock for the L1 sync pool + bytes memory setPeerData = abi.encodeWithSignature("setPeer(uint32,bytes32)", SCROLL.L2_EID, _toBytes32(L2_SYNC_POOL)); + bytes memory setDelegate = abi.encodeWithSignature("setDelegate(address)", L1_CONTRACT_CONTROLLER); + + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setPeerData, false)); + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setDelegate, true)); + timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setPeerData, false)); + timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setDelegate, true)); + + vm.writeJson(timelock_schedule_transactions, "./output/L1NativeMintingScheduleTransactions.json"); + vm.writeJson(timelock_execute_transactions, "./output/L1NativeMintingExecuteTransactions.json"); + + // set config via L1 contract controller + string memory l1_contract_controller_transaction = _getGnosisHeader("1"); + string memory l1EndpointString = iToHex(abi.encodePacked(L1_ENDPOINT)); + string memory dummyTokenString = iToHex(abi.encodePacked(dummyTokenProxy)); + string memory setLZConfigReceive = iToHex(abi.encodeWithSignature("setConfig(address,address,(uint32,uint32,bytes)[])", L1_SYNC_POOL, L1_RECEIVE_302, getDVNConfig(SCROLL.L2_EID, L1_DVN))); + string memory setMinter = iToHex(abi.encodeWithSignature("grantRole(bytes32,address)", MINTER_ROLE, L1_SYNC_POOL)); + + l1_contract_controller_transaction = string.concat(l1_contract_controller_transaction, _getGnosisTransaction(l1EndpointString, setLZConfigReceive, false)); + l1_contract_controller_transaction = string.concat(l1_contract_controller_transaction, _getGnosisTransaction(dummyTokenString, setMinter, true)); + + vm.writeJson(l1_contract_controller_transaction, "./output/L1NativeMintingSetConfig.json"); } } diff --git a/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol b/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol new file mode 100644 index 0000000..1042505 --- /dev/null +++ b/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/console.sol"; +import "forge-std/Script.sol"; + +import "../../contracts/MintableOFTUpgradeable.sol"; +import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; +import "../../utils/L2Constants.sol"; +import "../../utils/GnosisHelpers.sol"; + + +contract L2ConfigureNativeMinting is Script, L2Constants, GnosisHelpers { + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + /*////////////////////////////////////////////////////////////// + Deployment Config + //////////////////////////////////////////////////////////////*/ + + address public L2_SYNC_POOL = address(0); + address public L1_RECEIVER = address(0); + + /*////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////*/ + + + function run(address l2SyncPool, address l1Receiver) public { + L2_SYNC_POOL = l2SyncPool; + L1_RECEIVER = l1Receiver; + // uint256 privateKey = vm.envUint("PRIVATE_KEY"); + // vm.startBroadcast(privateKey); + address scriptDeployer = vm.addr(1); + vm.startPrank(scriptDeployer); + + L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(L2_SYNC_POOL); + syncPool.setReceiver(L1_RECEIVER); + syncPool.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + string memory minterTransaction = _getGnosisHeader(SCROLL.CHAIN_ID); + + bytes memory setMinterData = abi.encodeWithSignature("grantRole(bytes32,address)", MINTER_ROLE, L2_SYNC_POOL); + minterTransaction = string.concat(minterTransaction, _getGnosisTransaction(iToHex(abi.encodePacked(SCROLL.L2_OFT)), iToHex(setMinterData), true)); + + vm.writeJson(minterTransaction, "./output/setMinter.json"); + + vm.stopPrank(); + } +} diff --git a/scripts/OFTDeployment/01_OFTConfigure.s.sol b/scripts/OFTDeployment/01_OFTConfigure.s.sol index 80214b3..5ceb64e 100644 --- a/scripts/OFTDeployment/01_OFTConfigure.s.sol +++ b/scripts/OFTDeployment/01_OFTConfigure.s.sol @@ -23,7 +23,7 @@ struct OFTDeployment { MintableOFTUpgradeable tokenContract; } -contract DeployOFTScript is Script, Constants, LayerZeroHelpers { +contract DeployOFTScript is Script, L2Constants, LayerZeroHelpers { using OptionsBuilder for bytes; address scriptDeployer; diff --git a/test/AdapterMigration.t.sol b/test/AdapterMigration.t.sol index 3b2c2c4..8499f35 100644 --- a/test/AdapterMigration.t.sol +++ b/test/AdapterMigration.t.sol @@ -27,7 +27,7 @@ interface EndpointDelegates { function delegates(address) external view returns (address); } -contract OFTMigrationUnitTests is Test, Constants, LayerZeroHelpers { +contract OFTMigrationUnitTests is Test, L2Constants, LayerZeroHelpers { address constant DEPLOYMENT_OFT_ADAPTER = 0xcd2eb13D6831d4602D80E5db9230A57596CDCA63; diff --git a/test/OFTDeployment.t.sol b/test/OFTDeployment.t.sol index a4279ba..5725c0b 100644 --- a/test/OFTDeployment.t.sol +++ b/test/OFTDeployment.t.sol @@ -8,7 +8,7 @@ import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManage import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/UlnBase.sol"; import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; -import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppOptionsType3.sol"; +// import "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppOptionsType3.sol"; import "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol"; import { MessagingFee } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; diff --git a/test/nativeMintingScroll.t.sol b/test/nativeMintingScroll.t.sol new file mode 100644 index 0000000..e0b6f04 --- /dev/null +++ b/test/nativeMintingScroll.t.sol @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +import "../scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol"; +import "../scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol"; +import "../scripts/NativeMintingDeployment/03_ConfigureL2.s.sol"; +import "../contracts/NativeMinting/EtherfiL1SyncPoolETH.sol"; +import "../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; +import {Origin} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; +import "../contracts/NativeMinting/BucketRateLimiter.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "../interfaces/IScrollMessenger.sol"; +import "../utils/L2Constants.sol"; +import "../utils/GnosisHelpers.sol"; +import "../utils/LayerZeroHelpers.sol"; +import "../libraries/AppendOnlyMerkleTree.sol"; + +import "forge-std/Test.sol"; +import "forge-std/console.sol"; + +contract nativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHelpers { + + + // event and data emitted from the scroll bridge + // useful to verify withdrawal message emitted from L2 bridge == message executed on mainnet + event SentMessage( + address indexed sender, + address indexed target, + uint256 value, + uint256 messageNonce, + uint256 gasLimit, + bytes message + ); + address constant sender = 0x6D411e0A54382eD43F02410Ce1c7a7c122afA6E1; + address constant target = 0x5d47653d3921731EaB6d9BA4805208dD55cfaDd0; + uint256 constant value = 1 ether; + bytes constant message = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000076061dcd5c213ae94098d843cce51b89ea93fe77df630c2b3ed2d4929d520b44e986000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d344af4eb17b1e7"; + + function testNativeMintingL1() public { + vm.createSelectFork(L1_RPC_URL); + + L1NativeMintingScript nativeMintingL1 = new L1NativeMintingScript(); + nativeMintingL1.run(); + console.log("L1 Receiver: ", l1Receiver); + + executeGnosisTransactionBundle("./output/L1NativeMintingScheduleTransactions.json", L1_TIMELOCK_GNOSIS); + + // warp block to the timelock execution + vm.warp(block.timestamp + 259200 + 1); + + executeGnosisTransactionBundle("./output/L1NativeMintingExecuteTransactions.json", L1_TIMELOCK_GNOSIS); + executeGnosisTransactionBundle("./output/L1NativeMintingSetConfig.json", L1_CONTRACT_CONTROLLER); + + // mock a `fast-sync` + EtherfiL1SyncPoolETH L1syncPool = EtherfiL1SyncPoolETH(L1_SYNC_POOL); + + // get lockbox balance before + uint256 lockBoxBalanceBefore = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); + + // Construct mock inbound LZ message from L2SyncPool + Origin memory origin = Origin({ + srcEid: SCROLL.L2_EID, + sender: _toBytes32(nativeMintingL1.L2_SYNC_POOL()), + nonce: 1 + }); + bytes32 guid = 0x1fb4f4c346dd3904d20a62a68ba66df159e012db8526b776cd5bb07b2f80f20e; + address lzExecutor = 0x173272739Bd7Aa6e4e214714048a9fE699453059; + bytes memory messageL2Message = hex"000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000008bf92a3188ea37b2c600000000000000000000000000000000000000000000008539e6cb6ac88d1154"; + vm.prank(L1_ENDPOINT); + L1syncPool.lzReceive(origin, guid, messageL2Message, lzExecutor, ""); + + IERC20 scrollDummyToken = IERC20(nativeMintingL1.dummyToken()); + + assertApproxEqAbs(scrollDummyToken.balanceOf(L1_VAMP), 2582 ether, 1 ether); + + // get lockbox balance after + uint256 lockBoxBalanceAfter = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); + assertApproxEqAbs(lockBoxBalanceAfter, lockBoxBalanceBefore + 2457 ether, 1 ether); + + // mock a `slow-sync` + + uint256 vampBalanceBefore = L1_VAMP.balance; + + // line of code called in `L1ScrollMessenger.relayMessageWithProof` called after verification of the proof + address _to = target; + uint256 _value = value; + bytes memory _message = message; + + vm.store( + address(0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367), + bytes32(0x00000000000000000000000000000000000000000000000000000000000000c9), + bytes32(uint256(uint160(sender))) + ); + + // prank from the message proxy + vm.prank(0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367); + + (bool success, ) = _to.call{value: _value}(_message); + + assertEq(vampBalanceBefore + 1 ether, L1_VAMP.balance); + } + + address constant l1Receiver = 0x5d47653d3921731EaB6d9BA4805208dD55cfaDd0; + + function testNativeMintingL2() public { + vm.createSelectFork(SCROLL.RPC_URL); + + L2NativeMintingScript nativeMintingL2 = new L2NativeMintingScript(); + address l2SyncPool = nativeMintingL2.run(); + + L2ConfigureNativeMinting configureNativeMinting = new L2ConfigureNativeMinting(); + configureNativeMinting.run(l2SyncPool, l1Receiver); + + executeGnosisTransactionBundle("./output/setMinter.json", SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(l2SyncPool); + vm.warp(block.timestamp + 3600); + + // simulation a deposit + address user = vm.addr(2); + startHoax(user); + syncPool.deposit{value: 1 ether}(Constants.ETH_ADDRESS, 1 ether, 0.95 ether); + + assertApproxEqAbs(IERC20(SCROLL.L2_OFT).balanceOf(user), 0.95 ether, 0.01 ether); + assertEq(address(syncPool).balance, 1 ether); + + // simulation a sync call + MessagingFee memory msgFee = syncPool.quoteSync(Constants.ETH_ADDRESS, hex"", false); + + + // get the expected message nonce + uint256 messageNonce = AppendOnlyMerkleTree(0x5300000000000000000000000000000000000000).nextMessageIndex(); + + vm.expectEmit(true, true, false, true); // (checkTopic1, checkTopic2, checkTopic3, checkData) + emit SentMessage( + sender, + target, + value, + messageNonce, + 0, + message + ); + syncPool.sync{value: msgFee.nativeFee}(Constants.ETH_ADDRESS, hex"", msgFee); + } + +} diff --git a/transactions/01_migrationSetup/connnect-migration-peer.json b/transactions/01_migrationSetup/connnect-migration-peer.json deleted file mode 100644 index 0bd4cf6..0000000 --- a/transactions/01_migrationSetup/connnect-migration-peer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "chainId": "1", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0xfe7fe01f8b9a76803af3750144c2715d9bcf7d0d", - "value": "0", - "data": "0x3400288b000000000000000000000000000000000000000000000000000000000000759e000000000000000000000000703956bea5f198d63379f28a2d6179cbd9c1c9c5" - }, - { - "to": "0xfe7fe01f8b9a76803af3750144c2715d9bcf7d0d", - "value": "0", - "data": "0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016000301001101000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000759e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016000301001101000000000000000000000000000f424000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000c02ab410f0734efa3f14628780e6e695156024c2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759e0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000589dedbd617e0cbcb916a9223f4d1300c294236b000000000000000000000000a59ba433ac34d2927232918ef5b2eaafcf130ba50000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759e0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-base.json b/transactions/02_pauseCrossChain/disconnect-base.json deleted file mode 100644 index e6c29cf..0000000 --- a/transactions/02_pauseCrossChain/disconnect-base.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "8453", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-blast.json b/transactions/02_pauseCrossChain/disconnect-blast.json deleted file mode 100644 index c442911..0000000 --- a/transactions/02_pauseCrossChain/disconnect-blast.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "81457", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c09821000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-bnb.json b/transactions/02_pauseCrossChain/disconnect-bnb.json deleted file mode 100644 index fde74a9..0000000 --- a/transactions/02_pauseCrossChain/disconnect-bnb.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "56", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-linea.json b/transactions/02_pauseCrossChain/disconnect-linea.json deleted file mode 100644 index 1e0d027..0000000 --- a/transactions/02_pauseCrossChain/disconnect-linea.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "59144", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea06000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-mainnet.json b/transactions/02_pauseCrossChain/disconnect-mainnet.json deleted file mode 100644 index fa81ae2..0000000 --- a/transactions/02_pauseCrossChain/disconnect-mainnet.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "1", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000fe7fe01f8b9a76803af3750144c2715d9bcf7d0d000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-mode.json b/transactions/02_pauseCrossChain/disconnect-mode.json deleted file mode 100644 index b5e776a..0000000 --- a/transactions/02_pauseCrossChain/disconnect-mode.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "34443", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f58312000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-op.json b/transactions/02_pauseCrossChain/disconnect-op.json deleted file mode 100644 index 7aa36d7..0000000 --- a/transactions/02_pauseCrossChain/disconnect-op.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "10", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-scroll.json b/transactions/02_pauseCrossChain/disconnect-scroll.json deleted file mode 100644 index 10d4db3..0000000 --- a/transactions/02_pauseCrossChain/disconnect-scroll.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "534352", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/02_pauseCrossChain/disconnect-zksync.json b/transactions/02_pauseCrossChain/disconnect-zksync.json deleted file mode 100644 index 27397a9..0000000 --- a/transactions/02_pauseCrossChain/disconnect-zksync.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "chainId": "324", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-base.json b/transactions/03_unpauseCrossChain/reconnect-base.json deleted file mode 100644 index 4ea6d74..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-base.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "8453", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x04c0599ae5a44757c0af6f9ec3b93da8976c150a", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000b5320b0b3a13cc860893e2bd79fcd7e13484dda200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009e059a54699a285714207b43b055483e78faac25000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f60000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-blast.json b/transactions/03_unpauseCrossChain/reconnect-blast.json deleted file mode 100644 index b843582..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-blast.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "81457", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x04c0599ae5a44757c0af6f9ec3b93da8976c150a", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c09821000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a000000000000000000000000c1b621b18187f74c8f6d52a6f709dd2780c0982100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c097ab8cd7b053326dfe9fb3e3a31a0cce3b526f000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-bnb.json b/transactions/03_unpauseCrossChain/reconnect-bnb.json deleted file mode 100644 index cb57dba..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-bnb.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "56", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x04c0599ae5a44757c0af6f9ec3b93da8976c150a", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000009f8c645f2d0b2159767bd6e0839de4be49e823de00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031f748a368a893bdb5abb67ec95f232507601a73000000000000000000000000fd6865c841c2d64565562fcc7e05e619a30615f00000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-linea.json b/transactions/03_unpauseCrossChain/reconnect-linea.json deleted file mode 100644 index 2bbcf81..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-linea.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "59144", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x1bf74c010e6320bab11e2e5a532b5ac15e0b8aa6", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea06000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000001bf74c010e6320bab11e2e5a532b5ac15e0b8aa600000000000000000000000032042142dd551b4ebe17b6fed53131dd4b4eea0600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000129ee430cb2ff2708ccaddbdb408a88fe4ffd480000000000000000000000000dd7b5e1db4aafd5c8ec3b764efb8ed265aa5445b0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-mode.json b/transactions/03_unpauseCrossChain/reconnect-mode.json deleted file mode 100644 index 330e5d9..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-mode.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "34443", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x04c0599ae5a44757c0af6f9ec3b93da8976c150a", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f58312000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000004c0599ae5a44757c0af6f9ec3b93da8976c150a0000000000000000000000002367325334447c5e1e0f1b3a6fb947b262f5831200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd37ca043f8479064e10635020c65ffc005d36f6000000000000000000000000ce8358bc28dd8296ce8caf1cd2b44787abd658870000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-op.json b/transactions/03_unpauseCrossChain/reconnect-op.json deleted file mode 100644 index e03e727..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-op.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "10", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x5a7facb970d094b6c7ff1df0ea68d99e6e73cbff", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f900000000000000000000000005a7facb970d094b6c7ff1df0ea68d99e6e73cbff0000000000000000000000001322871e4ab09bc7f5717189434f97bbd9546e9500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006a02d83e8d433304bba74ef1c427913958187142000000000000000000000000a7b5189bca84cd304d8553977c7c614329750d990000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-scroll.json b/transactions/03_unpauseCrossChain/reconnect-scroll.json deleted file mode 100644 index 5933857..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-scroll.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "534352", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0x01f0a31698c4d065659b9bdc21b3610292a1c506", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075d50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0x1a44076050125825900e736c501f859c50fe728c", - "value": "0", - "data": "0x6dbd9f9000000000000000000000000001f0a31698c4d065659b9bdc21b3610292a1c5060000000000000000000000009bbeb2b2184b9313cf5ed4a4ddfea2ef62a2a03b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000446755349101cb20c582c224462c3912d3584dce000000000000000000000000be0d08a85eebfcc6eda0a843521f7cbb1180d2e20000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/transactions/03_unpauseCrossChain/reconnect-zksync.json b/transactions/03_unpauseCrossChain/reconnect-zksync.json deleted file mode 100644 index 46391a2..0000000 --- a/transactions/03_unpauseCrossChain/reconnect-zksync.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "chainId": "324", - "meta": { - "txBuilderVersion": "1.16.5" - }, - "transactions": [ - { - "to": "0xc1fa6e2e8667d9be0ca938a54c7e0285e9df924a", - "value": "0", - "data": "0x3400288b0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000cd2eb13d6831d4602d80e5db9230a57596cdca63" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076230000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076340000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075960000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000076060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "to": "0xd07c30af3ff30d96bdc9c6044958230eb797ddbf", - "value": "0", - "data": "0x6dbd9f90000000000000000000000000c1fa6e2e8667d9be0ca938a54c7e0285e9df924a00000000000000000000000007fd0e370b49919ca8da0ce842b8177263c0e12c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075950000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000620a9df73d2f1015ea75aea1067227f9013f5c51000000000000000000000000b183c2b91cf76cad13602b32ada2fd273f19009c0000000000000000000000000000000000000000000000000000000000000000" - } - ] -} \ No newline at end of file diff --git a/utils/GnosisHelpers.sol b/utils/GnosisHelpers.sol index fc6d65e..c7b5100 100644 --- a/utils/GnosisHelpers.sol +++ b/utils/GnosisHelpers.sol @@ -26,7 +26,6 @@ contract GnosisHelpers is Test { } } - // Get the gnosis transaction header function _getGnosisHeader(string memory chainId) internal pure returns (string memory) { return string.concat('{"chainId":"', chainId, '","meta": { "txBuilderVersion": "1.16.5" }, "transactions": ['); @@ -60,4 +59,26 @@ contract GnosisHelpers is Test { return iToHex(abi.encodePacked(addr)); } + address constant timelock = 0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761; + bytes32 constant predecessor = 0x0000000000000000000000000000000000000000000000000000000000000000; + bytes32 constant salt = 0x0000000000000000000000000000000000000000000000000000000000000000; + uint256 constant delay = 259200; + + // Generates the schedule transaction for a gnosis safe + function _getGnosisScheduleTransaction(address to, bytes memory data, bool isLasts) internal pure returns (string memory) { + + string memory timelockAddressHex = iToHex(abi.encodePacked(address(timelock))); + string memory scheduleTransactionData = iToHex(abi.encodeWithSignature("schedule(address,uint256,bytes,bytes32,bytes32,uint256)", to, 0, data, predecessor, salt, delay)); + + return _getGnosisTransaction(timelockAddressHex, scheduleTransactionData, isLasts); + } + + function _getGnosisExecuteTransaction(address to, bytes memory data, bool isLasts) internal pure returns (string memory) { + + string memory timelockAddressHex = iToHex(abi.encodePacked(address(timelock))); + string memory executeTransactionData = iToHex(abi.encodeWithSignature("execute(address,uint256,bytes,bytes32,bytes32)", to, 0, data, predecessor, salt)); + + return _getGnosisTransaction(timelockAddressHex, executeTransactionData, isLasts); + } + } diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 37420a4..602905d 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -45,18 +45,6 @@ pragma solidity ^0.8.13; contract L2Constants { - /*////////////////////////////////////////////////////////////// - Native Minting Deployment Parameters - //////////////////////////////////////////////////////////////*/ - - ConfigPerL2 public DEPLOYMENT_L2 = SCROLL; - address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; - address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; - string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; - string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; - - - /*////////////////////////////////////////////////////////////// OFT Deployment Parameters //////////////////////////////////////////////////////////////*/ @@ -89,8 +77,8 @@ contract L2Constants { string constant TOKEN_SYMBOL = "weETH"; // weETH Bridge Rate Limits - uint256 constant BUCKET_SIZE = 1000 ether; - uint256 constant BUCKET_REFILL_PER_SECOND = 0.1 ether; + uint256 constant BUCKET_SIZE = 3600000000000000000000; + uint256 constant BUCKET_REFILL_PER_SECOND = 1000000000000000000; // Global Production weETH Bridge Rate Limits uint256 constant LIMIT = 2000 ether; @@ -109,6 +97,7 @@ contract L2Constants { address constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address constant L1_WEETH = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee; address constant L1_CONTRACT_CONTROLLER = 0x2aCA71020De61bb532008049e1Bd41E451aE8AdC; + address constant L1_TIMELOCK_GNOSIS = 0xcdd57D11476c22d265722F68390b036f3DA48c21; address constant L1_TIMELOCK = 0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761; address constant L1_SYNC_POOL = 0xD789870beA40D056A4d26055d0bEFcC8755DA146; @@ -338,7 +327,7 @@ contract L2Constants { ConfigPerL2 SCROLL = ConfigPerL2({ NAME: "scroll", - RPC_URL: "https://scroll-mainnet.public.blastapi.io", + RPC_URL: "https://scroll-mainnet.g.alchemy.com/v2/tboG4m2gbe7vHzF_NTjyT2Jrx8fPmyjf", CHAIN_ID: "534352", L2_EID: 30214, diff --git a/utils/LayerZeroHelpers.sol b/utils/LayerZeroHelpers.sol index 7c54da6..8e39489 100644 --- a/utils/LayerZeroHelpers.sol +++ b/utils/LayerZeroHelpers.sol @@ -3,10 +3,14 @@ pragma solidity ^0.8.0; import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/utils/RateLimiter.sol"; import "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/UlnBase.sol"; +import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; +import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol"; +import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol"; import "./L2Constants.sol"; contract LayerZeroHelpers { + using OptionsBuilder for bytes; // TODO: move all layerzero helper functions here // Converts an address to bytes32 @@ -66,4 +70,53 @@ contract LayerZeroHelpers { return abi.encode(ulnConfig); } + function getEnforcedOptions(uint32 _eid) public pure returns (EnforcedOptionParam[] memory) { + EnforcedOptionParam[] memory enforcedOptions = new EnforcedOptionParam[](3); + + enforcedOptions[0] = EnforcedOptionParam({ + eid: _eid, + msgType: 0, + options: OptionsBuilder.newOptions().addExecutorLzReceiveOption(1_000_000, 0) + }); + + enforcedOptions[1] = EnforcedOptionParam({ + eid: _eid, + msgType: 1, + options: OptionsBuilder.newOptions().addExecutorLzReceiveOption(1_000_000, 0) + }); + enforcedOptions[2] = EnforcedOptionParam({ + eid: _eid, + msgType: 2, + options: OptionsBuilder.newOptions().addExecutorLzReceiveOption(1_000_000, 0) + }); + + return enforcedOptions; + } + + function getDVNConfig(uint32 eid, address[2] memory lzDvn) internal pure returns (SetConfigParam[] memory) { + SetConfigParam[] memory params = new SetConfigParam[](1); + address[] memory requiredDVNs = new address[](2); + if (lzDvn[0] > lzDvn[1]) { + requiredDVNs[0] = lzDvn[1]; + requiredDVNs[1] = lzDvn[0]; + } else { + requiredDVNs[0] = lzDvn[0]; + requiredDVNs[1] = lzDvn[1]; + } + + UlnConfig memory ulnConfig = UlnConfig({ + confirmations: 64, + requiredDVNCount: 2, + optionalDVNCount: 0, + optionalDVNThreshold: 0, + requiredDVNs: requiredDVNs, + optionalDVNs: new address[](0) + }); + + params[0] = SetConfigParam(eid, 2, abi.encode(ulnConfig)); + + return params; + } + + } From aa5fd7687686c67febe7f07c3f68da798ef3fd41 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Thu, 24 Oct 2024 17:30:42 -0500 Subject: [PATCH 07/13] refactor to use deterministic deploy --- .../L2ScrollSyncPoolETHUpgradeable.sol | 1 + foundry.toml | 4 +- .../01_DeployConfigureL2.s.sol | 119 ------------- .../03_ConfigureL2.s.sol | 49 ------ ...figureL1.s.sol => DeployConfigureL1.s.sol} | 85 ++++------ .../DeployConfigureL2.s.sol | 137 +++++++++++++++ test/nativeMintingScroll.t.sol | 156 ++++++++---------- utils/L2Constants.sol | 22 +-- 8 files changed, 255 insertions(+), 318 deletions(-) delete mode 100644 scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol delete mode 100644 scripts/NativeMintingDeployment/03_ConfigureL2.s.sol rename scripts/NativeMintingDeployment/{02_DeployConfigureL1.s.sol => DeployConfigureL1.s.sol} (68%) create mode 100644 scripts/NativeMintingDeployment/DeployConfigureL2.s.sol diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol index 6bda265..20d250b 100644 --- a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol @@ -51,6 +51,7 @@ contract L2ScrollSyncPoolETHUpgradeable is L2BaseSyncPoolUpgradeable, BaseMessen address receiver, address delegate ) external virtual initializer { + __L2BaseSyncPool_init(l2ExchangeRateProvider, rateLimiter, tokenOut, dstEid, delegate); __BaseMessenger_init(messenger); __BaseReceiver_init(receiver); diff --git a/foundry.toml b/foundry.toml index 1696273..e35e997 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,7 +6,7 @@ libs = ["node_modules", "lib"] test = "test" fs_permissions = [{ access = "read-write", path = "./"}] -solc_version = "0.8.20" - +solc_version = "0.8.24" +via_ir = true # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol deleted file mode 100644 index 80bcb76..0000000 --- a/scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/console.sol"; -import "forge-std/Script.sol"; - -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; -import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol"; -import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; -import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol"; -import "../../contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol"; -import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; -import "../../contracts/NativeMinting/BucketRateLimiter.sol"; -import "../../utils/L2Constants.sol"; -import "../../utils/LayerZeroHelpers.sol"; - -contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers { - using OptionsBuilder for bytes; - - - EnforcedOptionParam[] public enforcedOptions; - - address constant WEETH_RATE_PROVIDER = 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258; - address constant L2_MESSENGER = 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC; - - function deployExchangeRateProvider(address scriptDeployer) private returns (address) { - address impl = address(new EtherfiL2ExchangeRateProvider()); - address proxy = address( - new TransparentUpgradeableProxy( - impl, - SCROLL.L2_CONTRACT_CONTROLLER_SAFE, - abi.encodeWithSelector( - EtherfiL2ExchangeRateProvider.initialize.selector, - scriptDeployer - ) - ) - ); - - EtherfiL2ExchangeRateProvider provider = EtherfiL2ExchangeRateProvider(proxy); - provider.setRateParameters(ETH_ADDRESS, WEETH_RATE_PROVIDER, 0, L2_PRICE_ORACLE_HEART_BEAT); - provider.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); - - console.log("Exchange Rate Provider deployed at: ", proxy); - return proxy; - } - - function deployBucketRateLimiter(address scriptDeployer) private returns (address) { - address impl = address(new BucketRateLimiter()); - ERC1967Proxy proxy = new ERC1967Proxy( - impl, - abi.encodeWithSelector(BucketRateLimiter.initialize.selector, scriptDeployer) - ); - - BucketRateLimiter limiter = BucketRateLimiter(address(proxy)); - limiter.setCapacity(BUCKET_SIZE); - limiter.setRefillRatePerSecond(BUCKET_REFILL_PER_SECOND); - - console.log("Bucket Rate Limiter deployed at: ", address(proxy)); - return address(proxy); - } - - function deploySyncPool( - address scriptDeployer, - address exchangeRateProvider, - address bucketRateLimiter - ) private returns (address) { - address impl = address(new L2ScrollSyncPoolETHUpgradeable(SCROLL.L2_ENDPOINT)); - address proxy = address( - new TransparentUpgradeableProxy( - impl, - SCROLL.L2_CONTRACT_CONTROLLER_SAFE, - abi.encodeWithSelector( - L2ScrollSyncPoolETHUpgradeable.initialize.selector, - exchangeRateProvider, - bucketRateLimiter, - SCROLL.L2_OFT, - L1_EID, - L2_MESSENGER, - address(0), - scriptDeployer - ) - ) - ); - - console.log("Sync Pool deployed at: ", proxy); - return proxy; - } - - function run() public returns (address) { - address scriptDeployer = vm.addr(1); - vm.startPrank(scriptDeployer); - - console.log("Deploying contracts on L2..."); - - address exchangeRateProvider = deployExchangeRateProvider(scriptDeployer); - address rateLimiter = deployBucketRateLimiter(scriptDeployer); - address syncPool = deploySyncPool(scriptDeployer, exchangeRateProvider, rateLimiter); - - // Configure the deployed contracts - BucketRateLimiter(rateLimiter).updateConsumer(syncPool); - BucketRateLimiter(rateLimiter).transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); - - L2ScrollSyncPoolETHUpgradeable(syncPool).setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); - ILayerZeroEndpointV2(SCROLL.L2_ENDPOINT).setConfig( - syncPool, - SCROLL.SEND_302, - getDVNConfig(L1_EID, SCROLL.LZ_DVN) - ); - IOAppOptionsType3(syncPool).setEnforcedOptions(getEnforcedOptions(L1_EID)); - - L2ScrollSyncPoolETHUpgradeable(syncPool).setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); - - vm.stopPrank(); - - return syncPool; - } -} diff --git a/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol b/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol deleted file mode 100644 index 1042505..0000000 --- a/scripts/NativeMintingDeployment/03_ConfigureL2.s.sol +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/console.sol"; -import "forge-std/Script.sol"; - -import "../../contracts/MintableOFTUpgradeable.sol"; -import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; -import "../../utils/L2Constants.sol"; -import "../../utils/GnosisHelpers.sol"; - - -contract L2ConfigureNativeMinting is Script, L2Constants, GnosisHelpers { - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - - /*////////////////////////////////////////////////////////////// - Deployment Config - //////////////////////////////////////////////////////////////*/ - - address public L2_SYNC_POOL = address(0); - address public L1_RECEIVER = address(0); - - /*////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////*/ - - - function run(address l2SyncPool, address l1Receiver) public { - L2_SYNC_POOL = l2SyncPool; - L1_RECEIVER = l1Receiver; - // uint256 privateKey = vm.envUint("PRIVATE_KEY"); - // vm.startBroadcast(privateKey); - address scriptDeployer = vm.addr(1); - vm.startPrank(scriptDeployer); - - L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(L2_SYNC_POOL); - syncPool.setReceiver(L1_RECEIVER); - syncPool.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); - - string memory minterTransaction = _getGnosisHeader(SCROLL.CHAIN_ID); - - bytes memory setMinterData = abi.encodeWithSignature("grantRole(bytes32,address)", MINTER_ROLE, L2_SYNC_POOL); - minterTransaction = string.concat(minterTransaction, _getGnosisTransaction(iToHex(abi.encodePacked(SCROLL.L2_OFT)), iToHex(setMinterData), true)); - - vm.writeJson(minterTransaction, "./output/setMinter.json"); - - vm.stopPrank(); - } -} diff --git a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol similarity index 68% rename from scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol rename to scripts/NativeMintingDeployment/DeployConfigureL1.s.sol index d8825be..c47bbe3 100644 --- a/scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; +pragma solidity =0.8.24; import "forge-std/console.sol"; import "forge-std/Script.sol"; @@ -11,109 +11,92 @@ import "../../utils/L2Constants.sol"; import "../../utils/LayerZeroHelpers.sol"; contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisHelpers { - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - - address public dummyToken; - address public scrollReceiver; - - /*////////////////////////////////////////////////////////////// - Deployment Config - //////////////////////////////////////////////////////////////*/ - - string constant DUMMY_TOKEN_NAME = "Scroll Dummy ETH"; - string constant DUMMY_TOKEN_SYMBOL = "scrollETH"; - address constant L1_MESSENGER = 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367; - - address public constant L2_SYNC_POOL = 0x6D411e0A54382eD43F02410Ce1c7a7c122afA6E1; - - /*////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////*/ + bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; function run() public { // comment out for testing // uint256 privateKey = vm.envUint("PRIVATE_KEY"); - // address scriptDeployer = vm.addr(privateKey); // vm.startBroadcast(privateKey); - address scriptDeployer = vm.addr(1); - vm.startPrank(scriptDeployer); + vm.startPrank(DEPLOYER_ADDRESS); console.log("Deploying contracts on L1..."); - address dummyTokenImpl = address(new DummyTokenUpgradeable(18)); + address dummyTokenImpl = address(new DummyTokenUpgradeable{salt: keccak256("ScrollDummyTokenImpl")}(18)); address dummyTokenProxy = address( - new TransparentUpgradeableProxy( + new TransparentUpgradeableProxy{salt: keccak256("ScrollDummyToken")}( dummyTokenImpl, L1_TIMELOCK, abi.encodeWithSelector( - DummyTokenUpgradeable.initialize.selector, DUMMY_TOKEN_NAME, DUMMY_TOKEN_SYMBOL, L1_CONTRACT_CONTROLLER + DummyTokenUpgradeable.initialize.selector, "Scroll Dummy ETH", "scrollETH", DEPLOYER_ADDRESS ) ) ); console.log("DummyToken deployed at: ", dummyTokenProxy); - dummyToken = dummyTokenProxy; + require(dummyTokenProxy == SCROLL.L1_DUMMY_TOKEN, "Dummy Token address mismatch"); - address scrollReceiverImpl = address(new L1ScrollReceiverETHUpgradeable()); + DummyTokenUpgradeable dummyToken = DummyTokenUpgradeable(dummyTokenProxy); + dummyToken.grantRole(MINTER_ROLE, L1_SYNC_POOL); + dummyToken.grantRole(DEFAULT_ADMIN_ROLE, L1_CONTRACT_CONTROLLER); + dummyToken.renounceRole(DEFAULT_ADMIN_ROLE, DEPLOYER_ADDRESS); + + address scrollReceiverImpl = address(new L1ScrollReceiverETHUpgradeable{salt: keccak256("ScrollReceiverImpl")}()); address scrollReceiverProxy = address( - new TransparentUpgradeableProxy( + new TransparentUpgradeableProxy{salt: keccak256("ScrollReceiver")}( scrollReceiverImpl, L1_TIMELOCK, abi.encodeWithSelector( - L1ScrollReceiverETHUpgradeable.initialize.selector, L1_SYNC_POOL, L1_MESSENGER, L1_CONTRACT_CONTROLLER + L1ScrollReceiverETHUpgradeable.initialize.selector, L1_SYNC_POOL, SCROLL.L1_MESSENGER, L1_CONTRACT_CONTROLLER ) ) ); console.log("ScrollReceiver deployed at: ", scrollReceiverProxy); - scrollReceiver = scrollReceiverProxy; + require(scrollReceiverProxy == SCROLL.L1_RECEIVER, "ScrollReceiver address mismatch"); // included for testing vm.stopPrank(); - - // set LayerZero configure for L2 sync pool to communicate with the L1 sync pool (L1 sync pool via timelock) - + console.log("Generating L1 transactions for native minting..."); - + + // the require transactions to integrate native minting on the L1 side are spilt between the timelock and the L1 contract controller + + // 1. generate the schedule and execute transactions for the L1 sync pool string memory timelock_schedule_transactions = _getGnosisHeader("1"); string memory timelock_execute_transactions = _getGnosisHeader("1"); - - // register dummy token on liquifier + + // registers the new dummy token as an acceptable token for the vamp contract bytes memory setTokenData = abi.encodeWithSignature("registerToken(address,address,bool,uint16,uint32,uint32,bool)", dummyTokenProxy, address(0), true, 0, 20_000, 200_000, true); - timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_VAMP, setTokenData, false)); timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_VAMP, setTokenData, false)); - // set receiver and dummy token on the L1 sync pool + // set {receiver, dummy} token on the L1 sync pool bytes memory setReceiverData = abi.encodeWithSignature("setReceiver(uint32,address)", SCROLL.L2_EID, scrollReceiverProxy); bytes memory setDummyTokenData = abi.encodeWithSignature("setDummyToken(uint32,address)", SCROLL.L2_EID, dummyTokenProxy); - timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setReceiverData, false)); timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setDummyTokenData, false)); timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setReceiverData, false)); timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setDummyTokenData, false)); - // OFT transactions that require the timelock for the L1 sync pool - bytes memory setPeerData = abi.encodeWithSignature("setPeer(uint32,bytes32)", SCROLL.L2_EID, _toBytes32(L2_SYNC_POOL)); - bytes memory setDelegate = abi.encodeWithSignature("setDelegate(address)", L1_CONTRACT_CONTROLLER); - + // set OFT peer to scroll L2 sync pool that require the timelock for the L1 sync pool + bytes memory setPeerData = abi.encodeWithSignature("setPeer(uint32,bytes32)", SCROLL.L2_EID, _toBytes32(SCROLL.L2_SYNC_POOL)); timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setPeerData, false)); - timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setDelegate, true)); timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setPeerData, false)); + + // TODO: remove this transaction after the scroll native minting upgrade. It is a one time call to transfer the LZ delegate for the L1 sync pool from the deployer EOA to the L1 contract controller + bytes memory setDelegate = abi.encodeWithSignature("setDelegate(address)", L1_CONTRACT_CONTROLLER); + timelock_schedule_transactions = string.concat(timelock_schedule_transactions, _getGnosisScheduleTransaction(L1_SYNC_POOL, setDelegate, true)); timelock_execute_transactions = string.concat(timelock_execute_transactions, _getGnosisExecuteTransaction(L1_SYNC_POOL, setDelegate, true)); vm.writeJson(timelock_schedule_transactions, "./output/L1NativeMintingScheduleTransactions.json"); vm.writeJson(timelock_execute_transactions, "./output/L1NativeMintingExecuteTransactions.json"); - // set config via L1 contract controller + // 2. generate transactions required by the L1 contract controller string memory l1_contract_controller_transaction = _getGnosisHeader("1"); - string memory l1EndpointString = iToHex(abi.encodePacked(L1_ENDPOINT)); - string memory dummyTokenString = iToHex(abi.encodePacked(dummyTokenProxy)); - string memory setLZConfigReceive = iToHex(abi.encodeWithSignature("setConfig(address,address,(uint32,uint32,bytes)[])", L1_SYNC_POOL, L1_RECEIVE_302, getDVNConfig(SCROLL.L2_EID, L1_DVN))); - string memory setMinter = iToHex(abi.encodeWithSignature("grantRole(bytes32,address)", MINTER_ROLE, L1_SYNC_POOL)); - l1_contract_controller_transaction = string.concat(l1_contract_controller_transaction, _getGnosisTransaction(l1EndpointString, setLZConfigReceive, false)); - l1_contract_controller_transaction = string.concat(l1_contract_controller_transaction, _getGnosisTransaction(dummyTokenString, setMinter, true)); + // set DVN receive config for the L1 sync to receive messages from the L2 sync pool + string memory setLZConfigReceive = iToHex(abi.encodeWithSignature("setConfig(address,address,(uint32,uint32,bytes)[])", L1_SYNC_POOL, L1_RECEIVE_302, getDVNConfig(SCROLL.L2_EID, L1_DVN))); + l1_contract_controller_transaction = string.concat(l1_contract_controller_transaction, _getGnosisTransaction(iToHex(abi.encodePacked(L1_ENDPOINT)), setLZConfigReceive, true)); vm.writeJson(l1_contract_controller_transaction, "./output/L1NativeMintingSetConfig.json"); } diff --git a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol new file mode 100644 index 0000000..caf2af0 --- /dev/null +++ b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import "forge-std/console.sol"; +import "forge-std/Script.sol"; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; +import "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol"; +import { OptionsBuilder } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol"; +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol"; +import "../../contracts/NativeMinting/EtherfiL2ExchangeRateProvider.sol"; +import "../../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; +import "../../contracts/NativeMinting/BucketRateLimiter.sol"; + +import "../../utils/L2Constants.sol"; +import "../../utils/LayerZeroHelpers.sol"; +import "../../utils/GnosisHelpers.sol"; + +contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisHelpers { + using OptionsBuilder for bytes; + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + EnforcedOptionParam[] public enforcedOptions; + + function deployConfigureExchangeRateProvider(address scriptDeployer) private returns (address) { + address impl = address(new EtherfiL2ExchangeRateProvider{salt: keccak256("ExchangeRateProviderImpl")}()); + address proxy = address( + new TransparentUpgradeableProxy{salt: keccak256("ExchangeRateProvider")}( + impl, + SCROLL.L2_CONTRACT_CONTROLLER_SAFE, + abi.encodeWithSelector( + EtherfiL2ExchangeRateProvider.initialize.selector, + scriptDeployer + ) + ) + ); + console.log("Exchange Rate Provider deployed at: ", proxy); + require(proxy == SCROLL.L2_EXCHANGE_RATE_PROVIDER, "Exchange Rate Provider address mismatch"); + + EtherfiL2ExchangeRateProvider provider = EtherfiL2ExchangeRateProvider(proxy); + provider.setRateParameters(ETH_ADDRESS, SCROLL.L2_PRICE_ORACLE, 0, L2_PRICE_ORACLE_HEART_BEAT); + provider.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + return proxy; + } + + function deployConfigureBucketRateLimiter(address scriptDeployer) private returns (address) { + address impl = address(new BucketRateLimiter{salt: keccak256("BucketRateLimiterImpl")}()); + ERC1967Proxy proxy = new ERC1967Proxy{salt: keccak256("BucketRateLimiter")}( + impl, + abi.encodeWithSelector(BucketRateLimiter.initialize.selector, scriptDeployer) + ); + console.log("Bucket Rate Limiter deployed at: ", address(proxy)); + require(address(proxy) == SCROLL.L2_SYNC_POOL_RATE_LIMITER, "Bucket Rate Limiter address mismatch"); + + BucketRateLimiter limiter = BucketRateLimiter(address(proxy)); + limiter.setCapacity(BUCKET_SIZE); + limiter.setRefillRatePerSecond(BUCKET_REFILL_PER_SECOND); + limiter.updateConsumer(SCROLL.L2_SYNC_POOL); + limiter.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + return address(proxy); + } + + function deployConfigureSyncPool( + address scriptDeployer, + address exchangeRateProvider, + address bucketRateLimiter + ) private returns (address) { + address impl = address(new L2ScrollSyncPoolETHUpgradeable{salt: keccak256("L2SyncPoolImpl")}(SCROLL.L2_ENDPOINT)); + address proxy = address( + new TransparentUpgradeableProxy{salt: keccak256("L2SyncPool")}( + impl, + SCROLL.L2_CONTRACT_CONTROLLER_SAFE, + abi.encodeWithSelector( + L2ScrollSyncPoolETHUpgradeable.initialize.selector, + exchangeRateProvider, + bucketRateLimiter, + SCROLL.L2_OFT, + L1_EID, + SCROLL.L2_MESSENGER, + SCROLL.L1_RECEIVER, + scriptDeployer + ) + ) + ); + + console.log("Sync Pool deployed at: ", proxy); + require(proxy == SCROLL.L2_SYNC_POOL, "Sync Pool address mismatch"); + + L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(proxy); + + // set all LayerZero configurations and sync pool specific configurations + syncPool.setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); + syncPool.setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); + IOAppOptionsType3(proxy).setEnforcedOptions(getEnforcedOptions(L1_EID)); + ILayerZeroEndpointV2(SCROLL.L2_ENDPOINT).setConfig( + address(syncPool), + SCROLL.SEND_302, + getDVNConfig(L1_EID, SCROLL.LZ_DVN) + ); + + L2ScrollSyncPoolETHUpgradeable(syncPool).setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); + syncPool.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + + return proxy; + } + + function run() public { + vm.startPrank(DEPLOYER_ADDRESS); + + console.log("Deploying contracts on L2..."); + + // deploy and configure the native minting related contracts + address exchangeRateProvider = deployConfigureExchangeRateProvider(DEPLOYER_ADDRESS); + address rateLimiter = deployConfigureBucketRateLimiter(DEPLOYER_ADDRESS); + address syncPool = deployConfigureSyncPool(DEPLOYER_ADDRESS, exchangeRateProvider, rateLimiter); + + // generate the transactions required by the L2 contract controller + + // give the L2 sync pool permission to mint the dummy token + string memory minterTransaction = _getGnosisHeader(SCROLL.CHAIN_ID); + bytes memory setMinterData = abi.encodeWithSignature("grantRole(bytes32,address)", MINTER_ROLE, SCROLL.L2_SYNC_POOL); + minterTransaction = string.concat(minterTransaction, _getGnosisTransaction(iToHex(abi.encodePacked(SCROLL.L2_OFT)), iToHex(setMinterData), true)); + vm.writeJson(minterTransaction, "./output/setScrollMinter.json"); + + // transaction to set the min sync + string memory minSyncTransaction = _getGnosisHeader(SCROLL.CHAIN_ID); + bytes memory setMinSyncData = abi.encodeWithSignature("setMinSyncAmount(address,uint256)", Constants.ETH_ADDRESS, 10 ether); + minSyncTransaction = string.concat(minSyncTransaction, _getGnosisTransaction(iToHex(abi.encodePacked(SCROLL.L2_SYNC_POOL)), iToHex(setMinSyncData), true)); + vm.writeJson(minSyncTransaction, "./output/setMinSyncAmount.json"); + + vm.stopPrank(); + } +} diff --git a/test/nativeMintingScroll.t.sol b/test/nativeMintingScroll.t.sol index e0b6f04..5537e46 100644 --- a/test/nativeMintingScroll.t.sol +++ b/test/nativeMintingScroll.t.sol @@ -1,9 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.13; +pragma solidity ^0.8.24; -import "../scripts/NativeMintingDeployment/02_DeployConfigureL1.s.sol"; -import "../scripts/NativeMintingDeployment/01_DeployConfigureL2.s.sol"; -import "../scripts/NativeMintingDeployment/03_ConfigureL2.s.sol"; +import "../scripts/NativeMintingDeployment/DeployConfigureL1.s.sol"; +import "../scripts/NativeMintingDeployment/DeployConfigureL2.s.sol"; import "../contracts/NativeMinting/EtherfiL1SyncPoolETH.sol"; import "../contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol"; import {Origin} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; @@ -18,11 +17,12 @@ import "../libraries/AppendOnlyMerkleTree.sol"; import "forge-std/Test.sol"; import "forge-std/console.sol"; -contract nativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHelpers { - - - // event and data emitted from the scroll bridge - // useful to verify withdrawal message emitted from L2 bridge == message executed on mainnet +/** + * @title Native Minting Unit Tests + * @notice Test suite for verifying native minting functionality across L1 and L2 + */ +contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHelpers { + // Events for verifying bridge messages event SentMessage( address indexed sender, address indexed target, @@ -31,116 +31,100 @@ contract nativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe uint256 gasLimit, bytes message ); - address constant sender = 0x6D411e0A54382eD43F02410Ce1c7a7c122afA6E1; - address constant target = 0x5d47653d3921731EaB6d9BA4805208dD55cfaDd0; - uint256 constant value = 1 ether; - bytes constant message = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000076061dcd5c213ae94098d843cce51b89ea93fe77df630c2b3ed2d4929d520b44e986000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d344af4eb17b1e7"; + // Canonical bridge message expected values + address private SENDER = SCROLL.L2_SYNC_POOL; + address private TARGET = SCROLL.L1_RECEIVER; + uint256 private MESSAGE_VALUE = 1 ether; + bytes private BRIDGE_MESSAGE = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007606cfdefe81475092062f6ad888d215048e7e205c867241f2c2955d8797c8c56129000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d340c667d97d73a"; + + /// @notice Test the upgrade to natvie minting functionalilty and deposit/sync on L2 + function testNativeMintingL2() public { + // Setup L2 environment + vm.createSelectFork(SCROLL.RPC_URL); + L2NativeMintingScript nativeMintingL2 = new L2NativeMintingScript(); + nativeMintingL2.run(); + + executeGnosisTransactionBundle("./output/setScrollMinter.json", SCROLL.L2_CONTRACT_CONTROLLER_SAFE); + vm.warp(block.timestamp + 3600); + + // Test deposit functionality + L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(SCROLL.L2_SYNC_POOL); + address user = vm.addr(2); + startHoax(user); + syncPool.deposit{value: 1 ether}(Constants.ETH_ADDRESS, MESSAGE_VALUE, 0.95 ether); + + assertApproxEqAbs(IERC20(SCROLL.L2_OFT).balanceOf(user), 0.95 ether, 0.01 ether); + assertEq(address(syncPool).balance, 1 ether); + + // Test sync functionality + MessagingFee memory msgFee = syncPool.quoteSync(Constants.ETH_ADDRESS, hex"", false); + uint256 messageNonce = AppendOnlyMerkleTree(0x5300000000000000000000000000000000000000).nextMessageIndex(); + + vm.expectEmit(true, true, false, true); + emit SentMessage( + SENDER, + TARGET, + MESSAGE_VALUE, + messageNonce, + 0, + BRIDGE_MESSAGE + ); + + syncPool.sync{value: msgFee.nativeFee}(Constants.ETH_ADDRESS, hex"", msgFee); + } + + /// @notice Test upgrade to native minting functionality and fast/slow sync on L1 function testNativeMintingL1() public { + // Setup L1 environment vm.createSelectFork(L1_RPC_URL); - L1NativeMintingScript nativeMintingL1 = new L1NativeMintingScript(); nativeMintingL1.run(); - console.log("L1 Receiver: ", l1Receiver); + // Execute timelock transactions executeGnosisTransactionBundle("./output/L1NativeMintingScheduleTransactions.json", L1_TIMELOCK_GNOSIS); - - // warp block to the timelock execution - vm.warp(block.timestamp + 259200 + 1); - + vm.warp(block.timestamp + 259200 + 1); // Advance past timelock period executeGnosisTransactionBundle("./output/L1NativeMintingExecuteTransactions.json", L1_TIMELOCK_GNOSIS); executeGnosisTransactionBundle("./output/L1NativeMintingSetConfig.json", L1_CONTRACT_CONTROLLER); - // mock a `fast-sync` + // Test fast-sync scenario EtherfiL1SyncPoolETH L1syncPool = EtherfiL1SyncPoolETH(L1_SYNC_POOL); + uint256 lockBoxBalanceBefore = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); - // get lockbox balance before - uint256 lockBoxBalanceBefore = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); - - // Construct mock inbound LZ message from L2SyncPool + // Mock inbound LayerZero message from L2SyncPool Origin memory origin = Origin({ srcEid: SCROLL.L2_EID, - sender: _toBytes32(nativeMintingL1.L2_SYNC_POOL()), + sender: _toBytes32(SCROLL.L2_SYNC_POOL), nonce: 1 }); bytes32 guid = 0x1fb4f4c346dd3904d20a62a68ba66df159e012db8526b776cd5bb07b2f80f20e; address lzExecutor = 0x173272739Bd7Aa6e4e214714048a9fE699453059; bytes memory messageL2Message = hex"000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000008bf92a3188ea37b2c600000000000000000000000000000000000000000000008539e6cb6ac88d1154"; + vm.prank(L1_ENDPOINT); L1syncPool.lzReceive(origin, guid, messageL2Message, lzExecutor, ""); - IERC20 scrollDummyToken = IERC20(nativeMintingL1.dummyToken()); - + // Verify fast-sync results + IERC20 scrollDummyToken = IERC20(SCROLL.L1_DUMMY_TOKEN); assertApproxEqAbs(scrollDummyToken.balanceOf(L1_VAMP), 2582 ether, 1 ether); - - // get lockbox balance after - uint256 lockBoxBalanceAfter = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); + uint256 lockBoxBalanceAfter = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); assertApproxEqAbs(lockBoxBalanceAfter, lockBoxBalanceBefore + 2457 ether, 1 ether); - // mock a `slow-sync` - - uint256 vampBalanceBefore = L1_VAMP.balance; - - // line of code called in `L1ScrollMessenger.relayMessageWithProof` called after verification of the proof - address _to = target; - uint256 _value = value; - bytes memory _message = message; + // Test slow-sync scenario + uint256 vampBalanceBefore = L1_VAMP.balance; + // Mock Scroll messenger call vm.store( address(0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367), bytes32(0x00000000000000000000000000000000000000000000000000000000000000c9), - bytes32(uint256(uint160(sender))) + bytes32(uint256(uint160(SENDER))) ); - // prank from the message proxy vm.prank(0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367); - - (bool success, ) = _to.call{value: _value}(_message); - - assertEq(vampBalanceBefore + 1 ether, L1_VAMP.balance); - } - - address constant l1Receiver = 0x5d47653d3921731EaB6d9BA4805208dD55cfaDd0; - - function testNativeMintingL2() public { - vm.createSelectFork(SCROLL.RPC_URL); - - L2NativeMintingScript nativeMintingL2 = new L2NativeMintingScript(); - address l2SyncPool = nativeMintingL2.run(); - - L2ConfigureNativeMinting configureNativeMinting = new L2ConfigureNativeMinting(); - configureNativeMinting.run(l2SyncPool, l1Receiver); + (bool success, ) = TARGET.call{value: MESSAGE_VALUE}(BRIDGE_MESSAGE); + require(success, "Message call failed"); - executeGnosisTransactionBundle("./output/setMinter.json", SCROLL.L2_CONTRACT_CONTROLLER_SAFE); - - L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(l2SyncPool); - vm.warp(block.timestamp + 3600); - - // simulation a deposit - address user = vm.addr(2); - startHoax(user); - syncPool.deposit{value: 1 ether}(Constants.ETH_ADDRESS, 1 ether, 0.95 ether); - - assertApproxEqAbs(IERC20(SCROLL.L2_OFT).balanceOf(user), 0.95 ether, 0.01 ether); - assertEq(address(syncPool).balance, 1 ether); - - // simulation a sync call - MessagingFee memory msgFee = syncPool.quoteSync(Constants.ETH_ADDRESS, hex"", false); - - - // get the expected message nonce - uint256 messageNonce = AppendOnlyMerkleTree(0x5300000000000000000000000000000000000000).nextMessageIndex(); - - vm.expectEmit(true, true, false, true); // (checkTopic1, checkTopic2, checkTopic3, checkData) - emit SentMessage( - sender, - target, - value, - messageNonce, - 0, - message - ); - syncPool.sync{value: msgFee.nativeFee}(Constants.ETH_ADDRESS, hex"", msgFee); + assertEq(vampBalanceBefore + MESSAGE_VALUE, L1_VAMP.balance); } } diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 602905d..a6faedb 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -70,7 +70,7 @@ contract L2Constants { //////////////////////////////////////////////////////////////*/ - address constant DEPLOYER_ADDRESS = 0xaFa61D537A1814DE82776BF600cb10Ff26342208; + address constant DEPLOYER_ADDRESS = 0x8D5AAc5d3d5cda4c404fA7ee31B0822B648Bb150; // OFT Token Constants string constant TOKEN_NAME = "Wrapped eETH"; @@ -327,7 +327,7 @@ contract L2Constants { ConfigPerL2 SCROLL = ConfigPerL2({ NAME: "scroll", - RPC_URL: "https://scroll-mainnet.g.alchemy.com/v2/tboG4m2gbe7vHzF_NTjyT2Jrx8fPmyjf", + RPC_URL: "https://scroll-mainnet.g.alchemy.com/v2/u1nV6EBj7N1_SNFNv6vifP2719G3o9lQ", CHAIN_ID: "534352", L2_EID: 30214, @@ -341,15 +341,15 @@ contract L2Constants { L2_CONTRACT_CONTROLLER_SAFE: 0x3cD08f51D0EA86ac93368DE31822117cd70CECA3, L2_OFT_PROXY_ADMIN: 0x99fef08aEF9D6955138B66AD16Ab314DB17878ee, - L2_SYNC_POOL: address(0), - L2_SYNC_POOL_RATE_LIMITER: address(0), - L2_EXCHANGE_RATE_PROVIDER: address(0), - L2_PRICE_ORACLE: address(0), - L2_MESSENGER: address(0), - - L1_MESSENGER: address(0), - L1_DUMMY_TOKEN: address(0), - L1_RECEIVER: address(0), + L2_SYNC_POOL: 0xE5204F19B909abEf09fA08109771bCD6482DA94C, + L2_SYNC_POOL_RATE_LIMITER: 0x9ed20806B1aFA01455FAa8f56ab847ED873aD62a, + L2_EXCHANGE_RATE_PROVIDER: 0xC6bf4dd1C58110DFF04872BE2386Db90602b736C, + L2_PRICE_ORACLE: 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258 , + L2_MESSENGER: 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC, + + L1_MESSENGER: 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367, + L1_DUMMY_TOKEN: 0xe1918E7E8cEf6bEd73B79fb3152064C88720ABa3, + L1_RECEIVER: 0x38e4C53F79c170114246c408dAD1FB4A6Ed4A647, L2_SYNC_POOL_PROXY_ADMIN: address(0), L2_EXCHANGE_RATE_PROVIDER_PROXY_ADMIN: address(0), From cdab1f25e1d9ecfcdb542c5984083585b9b8d506 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Mon, 28 Oct 2024 11:22:10 -0500 Subject: [PATCH 08/13] removing unnecessary field in scroll canonical bridge call --- .../L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol | 2 +- .../ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol index 20d250b..ba72b65 100644 --- a/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol +++ b/contracts/NativeMinting/L2SyncPoolContracts/L2ScrollSyncPoolETHUpgradeable.sol @@ -105,7 +105,7 @@ contract L2ScrollSyncPoolETHUpgradeable is L2BaseSyncPoolUpgradeable, BaseMessen bytes memory data = abi.encode(originEid, receipt.guid, l1TokenIn, amountIn, amountOut); bytes memory message = abi.encodeCall(IL1Receiver.onMessageReceived, data); - IL2ScrollMessenger(messenger).sendMessage{value: amountIn}(receiver, amountIn, message, 0, receiver); + IL2ScrollMessenger(messenger).sendMessage{value: amountIn}(receiver, amountIn, message, 0); return receipt; } diff --git a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol index 8c3d04a..53ef66b 100644 --- a/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol +++ b/contracts/NativeMinting/ReceiverContracts/L1ScrollReceiverETHUpgradeable.sol @@ -40,7 +40,7 @@ contract L1ScrollReceiverETHUpgradeable is L1BaseReceiverUpgradeable { if (tokenIn != Constants.ETH_ADDRESS) revert L1ScrollReceiverETH__OnlyETH(); - address sender = IL1ScrollMessenger(msg.sender).xDomainMessageSender(); + address sender = IL1ScrollMessenger(getMessenger()).xDomainMessageSender(); _forwardToL1SyncPool( originEid, bytes32(uint256(uint160(sender))), guid, tokenIn, amountIn, amountOut, msg.value From b953a0260deef2f70ba556ff064d45b21d9bc894 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Mon, 28 Oct 2024 16:30:44 -0500 Subject: [PATCH 09/13] updating addresses --- foundry.toml | 2 +- test/nativeMintingScroll.t.sol | 11 +++++++---- utils/L2Constants.sol | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/foundry.toml b/foundry.toml index e35e997..8e02cfd 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,11 +1,11 @@ [profile.default] src = "contracts" -evm_version = "shanghai" out = "out" libs = ["node_modules", "lib"] test = "test" fs_permissions = [{ access = "read-write", path = "./"}] +evm_version = "shanghai" solc_version = "0.8.24" via_ir = true diff --git a/test/nativeMintingScroll.t.sol b/test/nativeMintingScroll.t.sol index 5537e46..53e1193 100644 --- a/test/nativeMintingScroll.t.sol +++ b/test/nativeMintingScroll.t.sol @@ -36,7 +36,7 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe address private SENDER = SCROLL.L2_SYNC_POOL; address private TARGET = SCROLL.L1_RECEIVER; uint256 private MESSAGE_VALUE = 1 ether; - bytes private BRIDGE_MESSAGE = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007606cfdefe81475092062f6ad888d215048e7e205c867241f2c2955d8797c8c56129000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d340c667d97d73a"; + bytes private BRIDGE_MESSAGE = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007606354f3d23887b1a2dbe602eccaa08d1057e7408e19dc8b7c9a72fd57aa7badcc9000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d332324faa0c769"; /// @notice Test the upgrade to natvie minting functionalilty and deposit/sync on L2 function testNativeMintingL2() public { @@ -92,6 +92,8 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe uint256 lockBoxBalanceBefore = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); // Mock inbound LayerZero message from L2SyncPool + // used the data from this call: + // https://layerzeroscan.com/tx/0x1107ae898ad34e942d2e007dbb358c26d24ec578d8e9628fafa9b6c1727ae92d Origin memory origin = Origin({ srcEid: SCROLL.L2_EID, sender: _toBytes32(SCROLL.L2_SYNC_POOL), @@ -99,16 +101,17 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe }); bytes32 guid = 0x1fb4f4c346dd3904d20a62a68ba66df159e012db8526b776cd5bb07b2f80f20e; address lzExecutor = 0x173272739Bd7Aa6e4e214714048a9fE699453059; - bytes memory messageL2Message = hex"000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000008bf92a3188ea37b2c600000000000000000000000000000000000000000000008539e6cb6ac88d1154"; + bytes memory messageL2Message = hex"000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000121cc50fba271ca2860000000000000000000000000000000000000000000000113ae1410d24beb5a6"; vm.prank(L1_ENDPOINT); L1syncPool.lzReceive(origin, guid, messageL2Message, lzExecutor, ""); // Verify fast-sync results IERC20 scrollDummyToken = IERC20(SCROLL.L1_DUMMY_TOKEN); - assertApproxEqAbs(scrollDummyToken.balanceOf(L1_VAMP), 2582 ether, 1 ether); + assertApproxEqAbs(scrollDummyToken.balanceOf(L1_VAMP), 334.114 ether, 0.01 ether); uint256 lockBoxBalanceAfter = IERC20(L1_WEETH).balanceOf(L1syncPool.getLockBox()); - assertApproxEqAbs(lockBoxBalanceAfter, lockBoxBalanceBefore + 2457 ether, 1 ether); + // As eETH continues to appreciate, the amount received from this fast-sync will decrease from the original 317 weETH + assertApproxEqAbs(lockBoxBalanceAfter, lockBoxBalanceBefore + 317 ether, 1 ether); // Test slow-sync scenario uint256 vampBalanceBefore = L1_VAMP.balance; diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index a6faedb..9e8c3e0 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -341,7 +341,7 @@ contract L2Constants { L2_CONTRACT_CONTROLLER_SAFE: 0x3cD08f51D0EA86ac93368DE31822117cd70CECA3, L2_OFT_PROXY_ADMIN: 0x99fef08aEF9D6955138B66AD16Ab314DB17878ee, - L2_SYNC_POOL: 0xE5204F19B909abEf09fA08109771bCD6482DA94C, + L2_SYNC_POOL: 0x9D44aAf17dE8D4c64E622701a7C2bb1fABa20F8a, L2_SYNC_POOL_RATE_LIMITER: 0x9ed20806B1aFA01455FAa8f56ab847ED873aD62a, L2_EXCHANGE_RATE_PROVIDER: 0xC6bf4dd1C58110DFF04872BE2386Db90602b736C, L2_PRICE_ORACLE: 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258 , @@ -349,7 +349,7 @@ contract L2Constants { L1_MESSENGER: 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367, L1_DUMMY_TOKEN: 0xe1918E7E8cEf6bEd73B79fb3152064C88720ABa3, - L1_RECEIVER: 0x38e4C53F79c170114246c408dAD1FB4A6Ed4A647, + L1_RECEIVER: 0x23F6c4930Da080b2d89bB5BB68c0d000Ad31d6a3, L2_SYNC_POOL_PROXY_ADMIN: address(0), L2_EXCHANGE_RATE_PROVIDER_PROXY_ADMIN: address(0), From 995c15531110e243a0aa9c2ebf142c643bf055b5 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Tue, 29 Oct 2024 09:42:59 -0500 Subject: [PATCH 10/13] removing redundent sync --- scripts/NativeMintingDeployment/DeployConfigureL2.s.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol index caf2af0..9be5993 100644 --- a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol @@ -94,7 +94,6 @@ contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH // set all LayerZero configurations and sync pool specific configurations syncPool.setPeer(L1_EID, _toBytes32(L1_SYNC_POOL)); - syncPool.setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); IOAppOptionsType3(proxy).setEnforcedOptions(getEnforcedOptions(L1_EID)); ILayerZeroEndpointV2(SCROLL.L2_ENDPOINT).setConfig( address(syncPool), @@ -102,7 +101,7 @@ contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH getDVNConfig(L1_EID, SCROLL.LZ_DVN) ); - L2ScrollSyncPoolETHUpgradeable(syncPool).setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); + syncPool.setL1TokenIn(Constants.ETH_ADDRESS, Constants.ETH_ADDRESS); syncPool.transferOwnership(SCROLL.L2_CONTRACT_CONTROLLER_SAFE); return proxy; From 198ad4d2261a1309e1fc12b53a1fb6d699e8e083 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Thu, 7 Nov 2024 15:46:02 +0000 Subject: [PATCH 11/13] updating deployment addresses --- .../NativeMintingDeployment/DeployConfigureL1.s.sol | 4 +--- .../NativeMintingDeployment/DeployConfigureL2.s.sol | 6 ++++-- utils/L2Constants.sol | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol index c47bbe3..f35bc98 100644 --- a/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol @@ -16,10 +16,8 @@ contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH function run() public { - // comment out for testing // uint256 privateKey = vm.envUint("PRIVATE_KEY"); - // vm.startBroadcast(privateKey); - vm.startPrank(DEPLOYER_ADDRESS); + vm.startBroadcast(DEPLOYER_ADDRESS); console.log("Deploying contracts on L1..."); diff --git a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol index 9be5993..6d58348 100644 --- a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol @@ -108,14 +108,16 @@ contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH } function run() public { - vm.startPrank(DEPLOYER_ADDRESS); + + // uint256 privateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(DEPLOYER_ADDRESS); console.log("Deploying contracts on L2..."); // deploy and configure the native minting related contracts address exchangeRateProvider = deployConfigureExchangeRateProvider(DEPLOYER_ADDRESS); address rateLimiter = deployConfigureBucketRateLimiter(DEPLOYER_ADDRESS); - address syncPool = deployConfigureSyncPool(DEPLOYER_ADDRESS, exchangeRateProvider, rateLimiter); + deployConfigureSyncPool(DEPLOYER_ADDRESS, exchangeRateProvider, rateLimiter); // generate the transactions required by the L2 contract controller diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 9e8c3e0..099b02e 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -341,15 +341,15 @@ contract L2Constants { L2_CONTRACT_CONTROLLER_SAFE: 0x3cD08f51D0EA86ac93368DE31822117cd70CECA3, L2_OFT_PROXY_ADMIN: 0x99fef08aEF9D6955138B66AD16Ab314DB17878ee, - L2_SYNC_POOL: 0x9D44aAf17dE8D4c64E622701a7C2bb1fABa20F8a, - L2_SYNC_POOL_RATE_LIMITER: 0x9ed20806B1aFA01455FAa8f56ab847ED873aD62a, - L2_EXCHANGE_RATE_PROVIDER: 0xC6bf4dd1C58110DFF04872BE2386Db90602b736C, + L2_SYNC_POOL: 0xe4B208106Ac060cC401258428cB4D55A4fFA405e, + L2_SYNC_POOL_RATE_LIMITER: 0xcE6b2347795dD53a9949A552E248782ce80a7D14, + L2_EXCHANGE_RATE_PROVIDER: 0xF89c0614A9dCb901132748E7a116E269B7F389F0, L2_PRICE_ORACLE: 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258 , L2_MESSENGER: 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC, L1_MESSENGER: 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367, - L1_DUMMY_TOKEN: 0xe1918E7E8cEf6bEd73B79fb3152064C88720ABa3, - L1_RECEIVER: 0x23F6c4930Da080b2d89bB5BB68c0d000Ad31d6a3, + L1_DUMMY_TOKEN: 0x8BeCa182e74D622B4C95518Fc259afDC546e5FB7, + L1_RECEIVER: 0x83DF8E01118bdf1f04530A6aE78dD612fB9ddAfA, L2_SYNC_POOL_PROXY_ADMIN: address(0), L2_EXCHANGE_RATE_PROVIDER_PROXY_ADMIN: address(0), From c94ddfee622cb4d7cc01513fed94856a70015bc0 Mon Sep 17 00:00:00 2001 From: jtfirek Date: Sun, 17 Nov 2024 17:59:53 -0500 Subject: [PATCH 12/13] prod deployment addresses --- foundry.toml | 2 +- .../NativeMintingDeployment/DeployConfigureL1.s.sol | 8 ++------ .../NativeMintingDeployment/DeployConfigureL2.s.sol | 4 ---- utils/L2Constants.sol | 10 +++++----- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/foundry.toml b/foundry.toml index 8e02cfd..3b9ab1d 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,7 +6,7 @@ test = "test" fs_permissions = [{ access = "read-write", path = "./"}] evm_version = "shanghai" -solc_version = "0.8.24" +solc_version = "0.8.26" via_ir = true # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol index f35bc98..e13fd10 100644 --- a/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL1.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity =0.8.24; +pragma solidity ^0.8.24; import "forge-std/console.sol"; import "forge-std/Script.sol"; @@ -16,8 +16,7 @@ contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH function run() public { - // uint256 privateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(DEPLOYER_ADDRESS); + // vm.startBroadcast(DEPLOYER_ADDRESS); console.log("Deploying contracts on L1..."); @@ -51,9 +50,6 @@ contract L1NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH ); console.log("ScrollReceiver deployed at: ", scrollReceiverProxy); require(scrollReceiverProxy == SCROLL.L1_RECEIVER, "ScrollReceiver address mismatch"); - - // included for testing - vm.stopPrank(); console.log("Generating L1 transactions for native minting..."); diff --git a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol index 6d58348..f86d75c 100644 --- a/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol +++ b/scripts/NativeMintingDeployment/DeployConfigureL2.s.sol @@ -108,8 +108,6 @@ contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH } function run() public { - - // uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(DEPLOYER_ADDRESS); console.log("Deploying contracts on L2..."); @@ -132,7 +130,5 @@ contract L2NativeMintingScript is Script, L2Constants, LayerZeroHelpers, GnosisH bytes memory setMinSyncData = abi.encodeWithSignature("setMinSyncAmount(address,uint256)", Constants.ETH_ADDRESS, 10 ether); minSyncTransaction = string.concat(minSyncTransaction, _getGnosisTransaction(iToHex(abi.encodePacked(SCROLL.L2_SYNC_POOL)), iToHex(setMinSyncData), true)); vm.writeJson(minSyncTransaction, "./output/setMinSyncAmount.json"); - - vm.stopPrank(); } } diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 099b02e..6a9e4f4 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -341,15 +341,15 @@ contract L2Constants { L2_CONTRACT_CONTROLLER_SAFE: 0x3cD08f51D0EA86ac93368DE31822117cd70CECA3, L2_OFT_PROXY_ADMIN: 0x99fef08aEF9D6955138B66AD16Ab314DB17878ee, - L2_SYNC_POOL: 0xe4B208106Ac060cC401258428cB4D55A4fFA405e, - L2_SYNC_POOL_RATE_LIMITER: 0xcE6b2347795dD53a9949A552E248782ce80a7D14, - L2_EXCHANGE_RATE_PROVIDER: 0xF89c0614A9dCb901132748E7a116E269B7F389F0, + L2_SYNC_POOL: 0x750cf0fd3bc891D8D864B732BC4AD340096e5e68, + L2_SYNC_POOL_RATE_LIMITER: 0x2Ebb099290C7Fb42Df5A31203fEc47EbEe15d576, + L2_EXCHANGE_RATE_PROVIDER: 0x6233BC9931De25A86be259D51Ca45558bbd6e8A7, L2_PRICE_ORACLE: 0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258 , L2_MESSENGER: 0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC, L1_MESSENGER: 0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367, - L1_DUMMY_TOKEN: 0x8BeCa182e74D622B4C95518Fc259afDC546e5FB7, - L1_RECEIVER: 0x83DF8E01118bdf1f04530A6aE78dD612fB9ddAfA, + L1_DUMMY_TOKEN: 0x641B33A2e1e46F3af8f3f0F9249e9111F24A51B3, + L1_RECEIVER: 0xb7c7CC336390c26BF6eC810e2f79BccBDb660567, L2_SYNC_POOL_PROXY_ADMIN: address(0), L2_EXCHANGE_RATE_PROVIDER_PROXY_ADMIN: address(0), From 9bcdf593696b69591368a6957ce983f9daa17d3c Mon Sep 17 00:00:00 2001 From: jtfirek Date: Sun, 17 Nov 2024 18:18:05 -0500 Subject: [PATCH 13/13] unit tests against mainnet --- test/nativeMintingScroll.t.sol | 11 +++++++---- utils/L2Constants.sol | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/nativeMintingScroll.t.sol b/test/nativeMintingScroll.t.sol index 53e1193..f6b797b 100644 --- a/test/nativeMintingScroll.t.sol +++ b/test/nativeMintingScroll.t.sol @@ -36,14 +36,15 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe address private SENDER = SCROLL.L2_SYNC_POOL; address private TARGET = SCROLL.L1_RECEIVER; uint256 private MESSAGE_VALUE = 1 ether; - bytes private BRIDGE_MESSAGE = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007606354f3d23887b1a2dbe602eccaa08d1057e7408e19dc8b7c9a72fd57aa7badcc9000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d332324faa0c769"; + bytes private BRIDGE_MESSAGE = hex"3a69197e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007606ebd50bcf19f47f644e6981a58d2287a3b8d6c0702ffa0a1cb9ecdd12c568a498000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d2ddfc66b17a973"; /// @notice Test the upgrade to natvie minting functionalilty and deposit/sync on L2 function testNativeMintingL2() public { // Setup L2 environment vm.createSelectFork(SCROLL.RPC_URL); L2NativeMintingScript nativeMintingL2 = new L2NativeMintingScript(); - nativeMintingL2.run(); + // contracts have already been deployed hence no need to simulate deployments + // nativeMintingL2.run(); executeGnosisTransactionBundle("./output/setScrollMinter.json", SCROLL.L2_CONTRACT_CONTROLLER_SAFE); vm.warp(block.timestamp + 3600); @@ -52,7 +53,7 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe L2ScrollSyncPoolETHUpgradeable syncPool = L2ScrollSyncPoolETHUpgradeable(SCROLL.L2_SYNC_POOL); address user = vm.addr(2); startHoax(user); - syncPool.deposit{value: 1 ether}(Constants.ETH_ADDRESS, MESSAGE_VALUE, 0.95 ether); + syncPool.deposit{value: 1 ether}(Constants.ETH_ADDRESS, MESSAGE_VALUE, 0.90 ether); assertApproxEqAbs(IERC20(SCROLL.L2_OFT).balanceOf(user), 0.95 ether, 0.01 ether); assertEq(address(syncPool).balance, 1 ether); @@ -68,6 +69,7 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe MESSAGE_VALUE, messageNonce, 0, + // this value becomes inaccurate as the oracle price changes BRIDGE_MESSAGE ); @@ -79,7 +81,8 @@ contract NativeMintingUnitTests is Test, L2Constants, GnosisHelpers, LayerZeroHe // Setup L1 environment vm.createSelectFork(L1_RPC_URL); L1NativeMintingScript nativeMintingL1 = new L1NativeMintingScript(); - nativeMintingL1.run(); + // contracts have already been deployed hence no need to simulate deployments + // nativeMintingL1.run(); // Execute timelock transactions executeGnosisTransactionBundle("./output/L1NativeMintingScheduleTransactions.json", L1_TIMELOCK_GNOSIS); diff --git a/utils/L2Constants.sol b/utils/L2Constants.sol index 6a9e4f4..7f828ce 100644 --- a/utils/L2Constants.sol +++ b/utils/L2Constants.sol @@ -327,7 +327,7 @@ contract L2Constants { ConfigPerL2 SCROLL = ConfigPerL2({ NAME: "scroll", - RPC_URL: "https://scroll-mainnet.g.alchemy.com/v2/u1nV6EBj7N1_SNFNv6vifP2719G3o9lQ", + RPC_URL: "https://rpc.scroll.io", CHAIN_ID: "534352", L2_EID: 30214,