Skip to content

Commit

Permalink
chore: fix finalize withdrawal script II
Browse files Browse the repository at this point in the history
  • Loading branch information
fedealconada committed Sep 18, 2024
1 parent 0018267 commit 3f38ad5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions script/FinalizeWithdrawal.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ interface IERC20 {
contract FinalizeDepositScript is Script {
L1SharedBridge public bridge;

address public constant SEPOLIA_CUSTOM_SHARED_BRIDGE_L1 = 0x8dA770B66f6F4F71068Fe5Dd1cB879a0353f90D8; // Ethereum Sepolia TODO: get from ENV
uint256 SOPHON_CHAIN_ID = 531050104; // Sophon Sepolia TODO: get from ENV

function setUp() public {}

struct FinalizationData {
Expand Down Expand Up @@ -42,7 +39,7 @@ contract FinalizeDepositScript is Script {
// grab only proof
args = new string[](5);
args[0] = "node";
args[1] = "contracts/custom-usdc-bridge/script/getWithdrawalParmas";
args[1] = "script/getWithdrawalParams";
args[2] = "--proof";
args[3] = "--hash";
args[4] = vm.envString("L2_WITHDRAWAL_HASH");
Expand All @@ -56,8 +53,13 @@ contract FinalizeDepositScript is Script {
vm.startBroadcast();

(FinalizationData memory data, bytes32[] memory merkleProof) = finalizeWithdrawalParams();
L1SharedBridge(SEPOLIA_CUSTOM_SHARED_BRIDGE_L1).finalizeWithdrawal(
SOPHON_CHAIN_ID, data.l1BatchNumber, data.l2MessageIndex, data.l2TxNumberInBlock, data.message, merkleProof
L1SharedBridge(vm.envAddress("SEPOLIA_CUSTOM_SHARED_BRIDGE_L1")).finalizeWithdrawal(
vm.envUint("SOPHON_SEPOLIA_CHAIN_ID"),
data.l1BatchNumber,
data.l2MessageIndex,
data.l2TxNumberInBlock,
data.message,
merkleProof
);

vm.stopBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion src/L1SharedBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ contract L1SharedBridge is IL1SharedBridge, ReentrancyGuard, Ownable2StepUpgrade

function _parseL2WithdrawalMessage(bytes memory _l2ToL1message)
internal
view
pure
returns (address l1Receiver, address l1Token, uint256 amount)
{
// We check that the message is long enough to read the data.
Expand Down

0 comments on commit 3f38ad5

Please sign in to comment.