Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Oct 7, 2024
1 parent f522464 commit a5acb1d
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

Check warning on line 10 in script/Deploy.s.sol

View workflow job for this annotation

GitHub Actions / lint

imported name UUPSUpgradeable is not used
import { DevOpsTools } from "lib/foundry-devops/src/DevOpsTools.sol";
import { BaseScript } from "./Base.s.sol";
import "forge-std/console.sol";

Check warning on line 13 in script/Deploy.s.sol

View workflow job for this annotation

GitHub Actions / lint

global import of path forge-std/console.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

contract DeployPriceCalculator is BaseScript {
function run() public broadcast returns (address) {
Expand Down Expand Up @@ -53,8 +54,28 @@ contract DeployProxy is BaseScript {
uint32 public constant GRACE_PERIOD = 30 days;

function run() public broadcast returns (address) {
address priceCalcAddr = DevOpsTools.get_most_recent_deployment("LinearPriceCalculator", block.chainid);
address wakuRlnV2ImplAddr = DevOpsTools.get_most_recent_deployment("WakuRlnV2", block.chainid);
address priceCalcAddr;
address wakuRlnV2ImplAddr;

try vm.envAddress("PRICE_CALCULATOR_ADDRESS") returns (address envPriceCalcAddress) {
console.log("Loading price calculator address from environment variable");
priceCalcAddr = envPriceCalcAddress;
} catch {
console.log("Loading price calculator address from broadcast directory");
priceCalcAddr = DevOpsTools.get_most_recent_deployment("LinearPriceCalculator", block.chainid);
}

try vm.envAddress("WAKURLNV2_ADDRESS") returns (address envWakuRlnV2ImplAddr) {
console.log("Loading WakuRlnV2 address from environment variable");
wakuRlnV2ImplAddr = envWakuRlnV2ImplAddr;
} catch {
console.log("Loading WakuRlnV2 address from broadcast directory");
wakuRlnV2ImplAddr = DevOpsTools.get_most_recent_deployment("WakuRlnV2", block.chainid);
}

console.log("Using price calculator address: %s", priceCalcAddr);
console.log("Using WakuRLNV2 address: %s", wakuRlnV2ImplAddr);

return address(deploy(priceCalcAddr, wakuRlnV2ImplAddr));
}

Expand Down

0 comments on commit a5acb1d

Please sign in to comment.