Skip to content

Commit

Permalink
feat: script
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Mar 22, 2024
1 parent 2d909aa commit 99a0811
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/scripts/RebalancerUSDATest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import { CollateralSetupProd } from "contracts/transmuter/configs/ProductionType
import { ITransmuter } from "interfaces/ITransmuter.sol";
import "utils/src/Constants.sol";
import { IERC20 } from "oz/interfaces/IERC20.sol";
import { MockMorphoOracle } from "../mock/MockMorphoOracle.sol";
import { IAgToken } from "interfaces/IAgToken.sol";

import { IFlashAngle } from "borrow/interfaces/IFlashAngle.sol";
import "contracts/helpers/RebalancerFlashloan.sol";
import { RebalancerFlashloan } from "contracts/helpers/RebalancerFlashloan.sol";

interface OldTransmuter {
function getOracle(
Expand Down Expand Up @@ -338,17 +337,26 @@ contract UpdateTransmuterFacetsUSDATest is Helpers, Test {
);

// Setup flashloan

vm.startPrank(governor);
FLASHLOAN.setFlashLoanParameters(address(USDA), 0, type(uint256).max);
vm.stopPrank();

// Initialize Transmuter reserves
deal(BIB01, NEW_DEPLOYER, 100000 * BASE_18);
deal(STEAK_USDC, NEW_DEPLOYER, 1000000 * BASE_18);
vm.startPrank(NEW_DEPLOYER);
IERC20(BIB01).approve(transmuter, type(uint256).max);
IERC20(STEAK_USDC).approve(transmuter, type(uint256).max);
transmuter.swapExactOutput(1200 * BASE_18, type(uint256).max, BIB01, USDA, NEW_DEPLOYER, block.timestamp);
transmuter.swapExactOutput(2400 * BASE_18, type(uint256).max, STEAK_USDC, USDA, NEW_DEPLOYER, block.timestamp);
vm.stopPrank();
}

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GETTERS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

function testUnit_UpgradeUSDA_AgToken() external {
function testUnit_Rebalance_AgToken() external {
assertEq(address(transmuter.agToken()), 0x0000206329b97DB379d5E1Bf586BbDB969C63274);
}
}

0 comments on commit 99a0811

Please sign in to comment.