From 73ab39343538d4b9575cc7743af22727c6df9f5e Mon Sep 17 00:00:00 2001 From: Zaki Manian Date: Thu, 12 Sep 2024 15:47:30 +0200 Subject: [PATCH] Add sample desposit script --- .../DepositIntoTestCellar.s.sol | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 script/Arbitrum/peggyjv_production/DepositIntoTestCellar.s.sol diff --git a/script/Arbitrum/peggyjv_production/DepositIntoTestCellar.s.sol b/script/Arbitrum/peggyjv_production/DepositIntoTestCellar.s.sol new file mode 100644 index 00000000..7817c6fb --- /dev/null +++ b/script/Arbitrum/peggyjv_production/DepositIntoTestCellar.s.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.21; + +import { Deployer } from "src/Deployer.sol"; +import { ArbitrumAddresses } from "test/resources/Arbitrum/ArbitrumAddressesPeggyJV.sol"; +import "forge-std/Script.sol"; +import { CellarWithOracleWithBalancerFlashLoansWithMultiAssetDeposit } from "src/base/permutations/advanced/CellarWithOracleWithBalancerFlashLoansWithMultiAssetDeposit.sol"; +import { ContractDeploymentNames } from "resources/PeggyJVContractDeploymentNames.sol"; +import { SafeTransferLib } from "@solmate/utils/SafeTransferLib.sol"; +import { ERC20 } from "@solmate/tokens/ERC20.sol"; + +/** + * @dev Run + * source .env && forge script script/Arbitrum/peggyjv_production/DepositIntoTestCellar.s.sol:DepositIntoTestCellar --evm-version london --with-gas-price 100000000 --slow --broadcast --etherscan-api-key $ARBISCAN_KEY --verify --private-key $PRIVATE_KEY + + * @dev Optionally can change `--with-gas-price` to something more reasonable + */ + +contract DepositIntoTestCellar is Script, ArbitrumAddresses, ContractDeploymentNames { + uint256 public privateKey; + + Deployer public deployer = Deployer(deployerAddress); + address public ryusd_address; + + CellarWithOracleWithBalancerFlashLoansWithMultiAssetDeposit public RYUSD; + + function setUp() external { + privateKey = vm.envUint("PRIVATE_KEY"); + vm.createSelectFork("arbitrum"); + ryusd_address = deployer.getAddress(realYieldUsdName); + RYUSD = CellarWithOracleWithBalancerFlashLoansWithMultiAssetDeposit(ryusd_address); + } + + function run() external { + vm.startBroadcast(privateKey); + + USDC.approve(ryusd_address, 100e6); + + address my_address = vm.addr(vm.envUint("PRIVATE_KEY")); + + RYUSD.deposit(100e6, my_address); + + vm.stopBroadcast(); + } +}