Skip to content

Commit

Permalink
refactor constants
Browse files Browse the repository at this point in the history
  • Loading branch information
a17 committed Jan 2, 2025
1 parent 5e806ed commit 6620c80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions chains/SonicLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ library SonicLib {
address public constant TOKEN_scUSD = 0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE;

// AMMs
address public constant POOL_BEETHOVENX_wS_stS = 0x374641076B68371e69D03C417DAc3E5F236c32FA;
address public constant POOL_BEETHOVENX_BEETS_stS = 0x10ac2F9DaE6539E77e372aDB14B1BF8fBD16b3e8;
address public constant POOL_BEETHOVENX_wS_USDC = 0xE93a5fc4Ba77179F6843b30cff33a97d89FF441C;
address public constant POOL_BEETHOVENX_USDC_scUSD = 0xCd4D2b142235D5650fFA6A38787eD0b7d7A51c0C;
address public constant POOL_BEETS_wS_stS = 0x374641076B68371e69D03C417DAc3E5F236c32FA;
address public constant POOL_BEETS_BEETS_stS = 0x10ac2F9DaE6539E77e372aDB14B1BF8fBD16b3e8;
address public constant POOL_BEETS_wS_USDC = 0xE93a5fc4Ba77179F6843b30cff33a97d89FF441C;
address public constant POOL_BEETS_USDC_scUSD = 0xCd4D2b142235D5650fFA6A38787eD0b7d7A51c0C;
address public constant POOL_SUSHI_wS_USDC = 0xE72b6DD415cDACeAC76616Df2C9278B33079E0D3;
address public constant POOL_EQUALIZER_USDC_WETH = 0xbCbC5777537c0D0462fb82BA48Eeb6cb361E853f;
address public constant POOL_EQUALIZER_wS_stS = 0xB75C9073ea00AbDa9ff420b5Ae46fEe248993380;
Expand Down Expand Up @@ -177,8 +177,8 @@ library SonicLib {
//region ----- BC pools ----
bcPools = new ISwapper.AddPoolData[](2);
bcPools[0] =
_makePoolData(POOL_BEETHOVENX_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_stS, TOKEN_wS);
// bcPools[1] = _makePoolData(POOL_BEETHOVENX_wS_USDC, AmmAdapterIdLib.BALANCER_WEIGHTED, TOKEN_USDC, TOKEN_wS);
_makePoolData(POOL_BEETS_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_stS, TOKEN_wS);
// bcPools[1] = _makePoolData(POOL_BEETS_wS_USDC, AmmAdapterIdLib.BALANCER_WEIGHTED, TOKEN_USDC, TOKEN_wS);
// bcPools[1] = _makePoolData(POOL_SUSHI_wS_USDC, AmmAdapterIdLib.UNISWAPV3, TOKEN_USDC, TOKEN_wS);
bcPools[1] = _makePoolData(POOL_EQUALIZER_wS_USDC, AmmAdapterIdLib.SOLIDLY, TOKEN_USDC, TOKEN_wS);
//endregion ----- BC pools ----
Expand All @@ -187,12 +187,12 @@ library SonicLib {
pools = new ISwapper.AddPoolData[](7);
uint i;
pools[i++] =
_makePoolData(POOL_BEETHOVENX_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_wS, TOKEN_stS);
_makePoolData(POOL_BEETS_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_wS, TOKEN_stS);
pools[i++] =
_makePoolData(POOL_BEETHOVENX_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_stS, TOKEN_wS);
pools[i++] = _makePoolData(POOL_BEETHOVENX_BEETS_stS, AmmAdapterIdLib.BALANCER_WEIGHTED, TOKEN_BEETS, TOKEN_stS);
_makePoolData(POOL_BEETS_wS_stS, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_stS, TOKEN_wS);
pools[i++] = _makePoolData(POOL_BEETS_BEETS_stS, AmmAdapterIdLib.BALANCER_WEIGHTED, TOKEN_BEETS, TOKEN_stS);
pools[i++] = _makePoolData(POOL_EQUALIZER_wS_USDC, AmmAdapterIdLib.SOLIDLY, TOKEN_USDC, TOKEN_wS);
pools[i++] = _makePoolData(POOL_BEETHOVENX_USDC_scUSD, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_scUSD, TOKEN_USDC);
pools[i++] = _makePoolData(POOL_BEETS_USDC_scUSD, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_scUSD, TOKEN_USDC);
pools[i++] = _makePoolData(POOL_EQUALIZER_wS_EQUAL, AmmAdapterIdLib.SOLIDLY, TOKEN_EQUAL, TOKEN_wS);
pools[i++] = _makePoolData(POOL_EQUALIZER_USDC_WETH, AmmAdapterIdLib.SOLIDLY, TOKEN_wETH, TOKEN_USDC);
//endregion ----- Pools ----
Expand Down
6 changes: 3 additions & 3 deletions test/adapters/BalancerComposableStableAdapter.Sonic.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract BalancerComposableStableAdapterTest is SonicSetup {
vm.expectRevert(IControllable.AlreadyExist.selector);
balancerAdapter.setupHelpers(address(1));

address pool = SonicLib.POOL_BEETHOVENX_wS_stS;
address pool = SonicLib.POOL_BEETS_wS_stS;
uint[] memory amounts = new uint[](2);
amounts[0] = 1e18;
amounts[1] = 100e18;
Expand All @@ -33,7 +33,7 @@ contract BalancerComposableStableAdapterTest is SonicSetup {
}

function testSwaps() public {
address pool = SonicLib.POOL_BEETHOVENX_wS_stS;
address pool = SonicLib.POOL_BEETS_wS_stS;
deal(SonicLib.TOKEN_wS, address(adapter), 1e16);
adapter.swap(pool, SonicLib.TOKEN_wS, SonicLib.TOKEN_stS, address(this), 10_000);
uint out = IERC20(SonicLib.TOKEN_stS).balanceOf(address(this));
Expand All @@ -49,7 +49,7 @@ contract BalancerComposableStableAdapterTest is SonicSetup {
function testViewMethods() public view {
assertEq(keccak256(bytes(adapter.ammAdapterId())), _hash);

address pool = SonicLib.POOL_BEETHOVENX_wS_stS;
address pool = SonicLib.POOL_BEETS_wS_stS;
uint price;
price = adapter.getPrice(pool, SonicLib.TOKEN_stS, SonicLib.TOKEN_wS, 1e10);
assertGt(price, 9e9);
Expand Down
6 changes: 3 additions & 3 deletions test/adapters/BalancerWeightedAdapter.Sonic.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract BalancerWeightedAdapterTest is SonicSetup {
vm.expectRevert(IControllable.AlreadyExist.selector);
balancerAdapter.setupHelpers(address(1));

address pool = SonicLib.POOL_BEETHOVENX_BEETS_stS;
address pool = SonicLib.POOL_BEETS_BEETS_stS;
uint[] memory amounts = new uint[](2);
amounts[0] = 1e18;
amounts[1] = 100e18;
Expand All @@ -33,7 +33,7 @@ contract BalancerWeightedAdapterTest is SonicSetup {
}

function testSwaps() public {
address pool = SonicLib.POOL_BEETHOVENX_BEETS_stS;
address pool = SonicLib.POOL_BEETS_BEETS_stS;
deal(SonicLib.TOKEN_stS, address(adapter), 1e15);
adapter.swap(pool, SonicLib.TOKEN_stS, SonicLib.TOKEN_BEETS, address(this), 10_000);
uint out = IERC20(SonicLib.TOKEN_BEETS).balanceOf(address(this));
Expand All @@ -49,7 +49,7 @@ contract BalancerWeightedAdapterTest is SonicSetup {
function testViewMethods() public view {
assertEq(keccak256(bytes(adapter.ammAdapterId())), _hash);

address pool = SonicLib.POOL_BEETHOVENX_BEETS_stS;
address pool = SonicLib.POOL_BEETS_BEETS_stS;
address[] memory tokens = adapter.poolTokens(pool);
assertEq(tokens.length, 2);
assertEq(tokens[0], SonicLib.TOKEN_BEETS);
Expand Down

0 comments on commit 6620c80

Please sign in to comment.