Skip to content

Commit

Permalink
chore: add logs to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
EperezOk committed May 7, 2024
1 parent d3a6896 commit a0aaafa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions scripts/Create.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
pragma solidity ^0.8.0;

import {Script, console2} from "forge-std/Script.sol";
import {OverlayV1Factory} from "../contracts/OverlayV1Factory.sol";
import {OverlayV1Factory} from "contracts/OverlayV1Factory.sol";

// 1. Set required environment variables: ETHERSCAN_API_KEY, DEPLOYER_PK, RPC.
// 2. Run with:
// $ source .env
// $ forge script script/Create.s.sol:CreateMarketScript --rpc-url $RPC --verify -vvvv --broadcast
// $ forge script scripts/Create.s.sol:CreateMarketScript --rpc-url $RPC --verify -vvvv --broadcast

contract CreateMarketScript is Script {
// TODO: update values as needed
Expand All @@ -33,6 +33,7 @@ contract CreateMarketScript is Script {
];

function run() external {
// NOTE: this should be the private key of the GOVERNOR
uint256 DEPLOYER_PK = vm.envUint("DEPLOYER_PK");

OverlayV1Factory factory = OverlayV1Factory(FACTORY);
Expand All @@ -41,10 +42,12 @@ contract CreateMarketScript is Script {

// <!---- START DEPLOYMENT ---->

factory.deployMarket(FEED_FACTORY, FEED, MARKET_PARAMS);
address market = factory.deployMarket(FEED_FACTORY, FEED, MARKET_PARAMS);

// <!-- END DEPLOYMENT -->

vm.stopBroadcast();

console2.log("Market deployed at:", market);
}
}
11 changes: 7 additions & 4 deletions scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
pragma solidity ^0.8.0;

import {Script, console2} from "forge-std/Script.sol";
import {OverlayV1Token} from "../contracts/OverlayV1Token.sol";
import {MINTER_ROLE, GOVERNOR_ROLE} from "../contracts/interfaces/IOverlayV1Token.sol";
import {OverlayV1Factory} from "../contracts/OverlayV1Factory.sol";
import {OverlayV1Token} from "contracts/OverlayV1Token.sol";
import {MINTER_ROLE, GOVERNOR_ROLE} from "contracts/interfaces/IOverlayV1Token.sol";
import {OverlayV1Factory} from "contracts/OverlayV1Factory.sol";

// 1. Set required environment variables: ETHERSCAN_API_KEY, DEPLOYER_PK, RPC.
// 2. Deploy with:
// $ source .env
// $ forge script script/Deploy.s.sol:DeployScript --rpc-url $RPC --verify -vvvv --broadcast
// $ forge script scripts/Deploy.s.sol:DeployScript --rpc-url $RPC --verify -vvvv --broadcast

contract DeployScript is Script {
bytes32 constant ADMIN_ROLE = 0x00;
Expand Down Expand Up @@ -54,5 +54,8 @@ contract DeployScript is Script {
// <!-- END DEPLOYMENT -->

vm.stopBroadcast();

console2.log("Token deployed at:", address(ovl));
console2.log("Factory deployed at:", address(factory));
}
}

0 comments on commit a0aaafa

Please sign in to comment.