Skip to content

Commit

Permalink
Merge pull request #15 from yearn/fp-script
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia authored Jun 28, 2024
2 parents aacf153 + 98465eb commit 3dec8a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scripts/RegisterRollup.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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("---------------------------------------");
}
}
}
12 changes: 7 additions & 5 deletions scripts/lib/BatchScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
Expand Down

0 comments on commit 3dec8a4

Please sign in to comment.