Skip to content

Commit

Permalink
chore: fix finalize withdrawal script
Browse files Browse the repository at this point in the history
  • Loading branch information
fedealconada committed Sep 18, 2024
1 parent eb7d3a7 commit 0018267
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion script/FinalizeWithdrawal.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ contract FinalizeDepositScript is Script {
// grab all params except for proof (since it fails)
string[] memory args = new string[](4);
args[0] = "node";
args[1] = "contracts/custom-usdc-bridge/script/getWithdrawalParams";
args[1] = "script/getWithdrawalParams";
args[2] = "--hash";
args[3] = vm.envString("L2_WITHDRAWAL_HASH");
string memory result = string(vm.ffi(args));
FinalizationData memory data = abi.decode(vm.parseJson(result), (FinalizationData));

if (data.sender == address(0)) {
revert(result);
}

// grab only proof
args = new string[](5);
args[0] = "node";
Expand Down
8 changes: 7 additions & 1 deletion script/getWithdrawalParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ async function main() {
console.log(JSON.stringify(finalizationHandle));
}
} catch (error) {
console.error('Error finalizing withdrawal params:', error);
const sender = "0x0000000000000000000000000000000000000000";
console.log(JSON.stringify({l1BatchNumber: 0,
l2MessageIndex: 0,
l2TxNumberInBlock: 0,
message: error.message,
sender,
}))
}
}

Expand Down

0 comments on commit 0018267

Please sign in to comment.