Skip to content

Commit

Permalink
Merge pull request #26 from GenerationSoftware/gen-1960-boost-gnosis-gp
Browse files Browse the repository at this point in the history
add support for gnosis boost
  • Loading branch information
trmid authored Sep 18, 2024
2 parents ee224f1 + d7bc920 commit 69fec7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ gas_reports = ["*"]

[rpc_endpoints]
scroll = "${SCROLL_RPC_URL}"
gnosis = "${GNOSIS_RPC_URL}"

[etherscan]
scroll = { key = "${SCROLL_ETHERSCAN_API_KEY}", url = "https://api.scrollscan.com/api" }
gnosis = { key = "${GNOSIS_ETHERSCAN_API_KEY}", url = "https://api.gnosisscan.io/api" }
14 changes: 9 additions & 5 deletions script/SimpleBoost.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract SimpleBoost is Script {
uint256 public amount;
uint256 public duration;
bool public makeDeposit;
uint256 public targetAuctionPriceWeth = uint256(1e15);
uint256 public targetAuctionPriceWeth;

function run() external {

Expand All @@ -45,10 +45,14 @@ contract SimpleBoost is Script {
}
uint256 targetAuctionPeriod = PrizePool(prizePool).drawPeriodSeconds();
address prizeToken = address(PrizePool(prizePool).prizeToken());
require(
keccak256(abi.encode(IERC20Metadata(prizeToken).symbol())) == keccak256(abi.encode("WETH")),
"script is currently set up to only handle boosts on WETH prize pools"
);
string memory prizeTokenSymbol = IERC20Metadata(prizeToken).symbol();
if (keccak256(abi.encode(prizeTokenSymbol)) == keccak256(abi.encode("WETH"))) {
targetAuctionPriceWeth = uint256(1e15);
} else if (keccak256(abi.encode(prizeTokenSymbol)) == keccak256(abi.encode("WXDAI"))) {
targetAuctionPriceWeth = uint256(1e18);
} else {
revert("script is currently set up to only handle boosts on WETH or WXDAI prize pools");
}

vm.startBroadcast();

Expand Down

0 comments on commit 69fec7d

Please sign in to comment.