Skip to content

Commit

Permalink
fmt it
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Oct 21, 2024
1 parent c563f7d commit 67f6b07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
20 changes: 8 additions & 12 deletions contracts/SmartVaultYieldManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable {
error HypervisorDataError();
error IncompatibleHypervisor();

constructor(
address _USDs,
address _USDC,
address _uniProxy,
address _usdsHypervisor,
address _uniswapRouter
) Ownable(msg.sender) {
constructor(address _USDs, address _USDC, address _uniProxy, address _usdsHypervisor, address _uniswapRouter)
Ownable(msg.sender)
{
USDs = _USDs;
USDC = _USDC;
uniProxy = _uniProxy;
Expand Down Expand Up @@ -162,16 +158,16 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable {
uint256 _denominator =
1e36 + FullMath.mulDiv(_ratio - FullMath.mulDiv(_ratio, _fee, 1e6), 1e36, price36);
// a - rb / (1 + (1-f) * ratio / price)
_amountIn =
FullMath.mulDiv(_tokenABalance * (10 ** (36 - aDec)) - _rb, 1e36, _denominator) / 10 ** (36 - aDec);
_amountIn = FullMath.mulDiv(_tokenABalance * (10 ** (36 - aDec)) - _rb, 1e36, _denominator)
/ 10 ** (36 - aDec);
} else {
// b -> a

uint256 _denominator =
uint256 _denominator =
1e36 + FullMath.mulDiv(_ratio, 1e36, price36 + FullMath.mulDiv(price36, _fee, 1e6));
// rb - a / (1 + ratio / ((1+f) * price))
_amountOut =
FullMath.mulDiv(_rb - _tokenABalance * (10 ** (36 - aDec)), 1e36, _denominator) / 10 ** (36 - aDec);
_amountOut = FullMath.mulDiv(_rb - _tokenABalance * (10 ** (36 - aDec)), 1e36, _denominator)
/ 10 ** (36 - aDec);
}
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/test_utils/interfaces/IAdminUSDs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import {IUSDs} from "src/interfaces/IUSDs.sol";

interface IAdminUSDs is IUSDs {
function setSupplyLimit(uint256 _supplyLimit) external;
}
}
8 changes: 2 additions & 6 deletions test/foundry/fixtures/ForkFixture.sol
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,7 @@ contract ForkFixture is Test {
// deploy SmartVaultYieldManager
vm.prank(YIELD_MANAGER_OWNER);
yieldManager = new SmartVaultYieldManager(
USDS_ADDRESS,
USDC_ADDRESS,
UNI_PROXY_ADDRESS,
USDS_HYPERVISOR_ADDRESS,
UNISWAP_ROUTER_ADDRESS
USDS_ADDRESS, USDC_ADDRESS, UNI_PROXY_ADDRESS, USDS_HYPERVISOR_ADDRESS, UNISWAP_ROUTER_ADDRESS
);

// add hypervisor data
Expand Down Expand Up @@ -303,7 +299,7 @@ contract ForkFixture is Test {
_deal(USDC, USDC_WHALE, address(this));

IUniswapV3Pool pool = IUniswapV3Pool(USD_POOL_ADDRESS);
(,int24 tick,,,,,) = pool.slot0();
(, int24 tick,,,,,) = pool.slot0();
int24 tickSpacing = pool.tickSpacing();
// int24 tickLower = (tick - tick) / tickSpacing * tickSpacing;
// int24 tickLower = tick / tickSpacing * tickSpacing - tickSpacing;
Expand Down
6 changes: 1 addition & 5 deletions test/foundry/fixtures/SmartVaultYieldManagerFixture.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ contract SmartVaultYieldManagerFixture is SmartVaultManagerFixture {
);

yieldManager = new SmartVaultYieldManager(
address(usds),
address(usdc),
address(uniProxy),
address(usdsHypervisor),
address(uniswapRouter)
address(usds), address(usdc), address(uniProxy), address(usdsHypervisor), address(uniswapRouter)
);

// add hypervisor data
Expand Down

0 comments on commit 67f6b07

Please sign in to comment.