Skip to content

Commit

Permalink
Merge pull request #123 from open-format/fix--get-working-with-latest…
Browse files Browse the repository at this point in the history
…-version-of-foundry

fix: get working with latest version of foundry
  • Loading branch information
george-openformat authored May 10, 2024
2 parents 6c4029d + f9234cd commit 0804e2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/utils/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ contract Utils is Script {

string memory deploymentFile = _readDeploymentFile();
bool fileExists = bytes(deploymentFile).length > 0;
bool isInJsonFile = fileExists ? (vm.parseJson(deploymentFile, _contractName)).length > 0 : false;

bool isInJsonFile =
fileExists ? (vm.parseJson(deploymentFile, string.concat(".", _contractName))).length > 0 : false;
if (isInJsonFile) {
// just update existing deployment address
vm.writeJson(contractJson, path, string.concat(".", _contractName));
Expand All @@ -45,11 +45,11 @@ contract Utils is Script {

if (fileExists) {
// get all contract names from that file
contractNames = abi.decode(vm.parseJson(deploymentFile, namesKey), (string[]));
contractNames = abi.decode(vm.parseJson(deploymentFile, string.concat(".", namesKey)), (string[]));
// parse and reconstruct entire file
for (uint256 i = 0; i < contractNames.length; i++) {
(address contractAddress, uint256 startBlock) =
abi.decode(vm.parseJson(deploymentFile, contractNames[i]), (address, uint256));
abi.decode(vm.parseJson(deploymentFile, string.concat(".", contractNames[i])), (address, uint256));
tempContractJson = "";
tempContractJson = vm.serializeAddress(contractNames[i], "address", contractAddress);
tempContractJson = vm.serializeUint(contractNames[i], "startBlock", startBlock);
Expand Down

0 comments on commit 0804e2f

Please sign in to comment.