From ba01785a3f70de2f14c8283f6b71d791a5932d3c Mon Sep 17 00:00:00 2001 From: FP Date: Tue, 25 Jun 2024 12:54:53 -0700 Subject: [PATCH 1/2] fix: don't overwrite nonce --- scripts/lib/BatchScript.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/lib/BatchScript.sol b/scripts/lib/BatchScript.sol index c510d8a..1c1a5a7 100644 --- a/scripts/lib/BatchScript.sol +++ b/scripts/lib/BatchScript.sol @@ -300,14 +300,16 @@ abstract contract BatchScript is Script, DelegatePrank { function _getNonce(address safe_) internal returns (uint256) { string memory endpoint = string.concat( - SAFE_API_BASE_URL, - vm.toString(safe_), - "/" + _getSafeAPIEndpoint(safe_), + "?limit=1" ); (uint256 status, bytes memory data) = endpoint.get(); if (status == 200) { - string memory result = string(data); - return result.readUint(".nonce"); + string memory resp = string(data); + string[] memory results; + results = resp.readStringArray(".results"); + if (results.length == 0) return 0; + return resp.readUint(".results[0].nonce") + 1; } else { revert("Get nonce failed!"); } From 98465eb5858cddabfc3cc7eb8f4893973d499c64 Mon Sep 17 00:00:00 2001 From: FP Date: Fri, 28 Jun 2024 11:19:11 -0700 Subject: [PATCH 2/2] fix: 'Visit' print --- scripts/RegisterRollup.s.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/RegisterRollup.s.sol b/scripts/RegisterRollup.s.sol index c42f6b0..e07247e 100644 --- a/scripts/RegisterRollup.s.sol +++ b/scripts/RegisterRollup.s.sol @@ -90,7 +90,7 @@ contract RegisterRollup is BatchScript { require(L1_DEPLOYER.getRollupContract(rollupID) != address(0), "txn failed"); console2.log("TXN posted"); - console2.log("Visit https://app.safe.global/transactions/queue?safe=eth:", safe); + console2.log("Visit https://app.safe.global/transactions/queue?safe=eth:%s", safe); console2.log("---------------------------------------"); } -} \ No newline at end of file +}