From 46bff6abaade42dad889e116a151b66996c68a61 Mon Sep 17 00:00:00 2001 From: otsalex Date: Fri, 13 Sep 2024 14:54:34 +0300 Subject: [PATCH] Initialize Price Oracle script --- .../InitializePriceOracle.s.sol | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 script/Arbitrum/peggyjv_production/InitializePriceOracle.s.sol diff --git a/script/Arbitrum/peggyjv_production/InitializePriceOracle.s.sol b/script/Arbitrum/peggyjv_production/InitializePriceOracle.s.sol new file mode 100644 index 00000000..4f416d3e --- /dev/null +++ b/script/Arbitrum/peggyjv_production/InitializePriceOracle.s.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.21; + +import "forge-std/Script.sol"; +import { ERC4626SharePriceOracle } from "src/base/ERC4626SharePriceOracle.sol"; +import { SafeTransferLib } from "lib/solmate/src/utils/SafeTransferLib.sol"; +import { ERC4626 } from "@solmate/mixins/ERC4626.sol"; +import "test/resources/Arbitrum/ArbitrumAddressesPeggyJV.sol"; +/** + * @dev Run + * + source .env && forge script script/Arbitrum/peggyjv_production/InitializePriceOracle.s.sol:InitializePriceOracle --evm-version london --with-gas-price 1000000 --slow --broadcast --private-key $PRIVATE_KEY + + */ + +contract InitializePriceOracle is Script, ArbitrumAddresses { + using SafeTransferLib for ERC20; + + uint256 public privateKey; + + address internal contractAddress = 0xDDF603866d6d8D207C6200552655Df1eBdE5a641; + uint96 internal initialUpkeepFunds = 1e18; + + function setUp() external { + privateKey = vm.envUint("PRIVATE_KEY"); + vm.createSelectFork("arbitrum"); + } + + function run() external { + vm.startBroadcast(privateKey); + + ERC4626SharePriceOracle contractInstance = ERC4626SharePriceOracle(contractAddress); + LINK.safeApprove(contractAddress, initialUpkeepFunds); + contractInstance.initialize(initialUpkeepFunds); + + vm.stopBroadcast(); + } +}