Skip to content

Commit ee933f6

Browse files
authored
Merge pull request #230 from stabilitydao/sonic
tokenomics things
2 parents 43d5bbe + 38eecc5 commit ee933f6

File tree

11 files changed

+418
-6
lines changed

11 files changed

+418
-6
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ Contributions can be made in the form of developing strategies, developing the c
6363

6464
* **Platform** `0x4Aca671A420eEB58ecafE83700686a2AD06b20D8` [sonicscan](https://sonicscan.org/address/0x4aca671a420eeb58ecafe83700686a2ad06b20d8)
6565
* **Frontend** `0x15487495cce9210795f9C2E0e1A7238E336dFc32` [sonicscan](https://sonicscan.org/address/0x15487495cce9210795f9C2E0e1A7238E336dFc32)
66-
* **MerkleDistributor** `0x0391aBDCFaB86947d93f9dd032955733B639416b` [sonicscan](https://sonicscan.org/address/0x0391abdcfab86947d93f9dd032955733b639416b)
67-
* **sGEM1** `0x9A08cD5691E009cC72E2A4d8e7F2e6EE14E96d6d` [sonicscan](https://sonicscan.org/address/0x9A08cD5691E009cC72E2A4d8e7F2e6EE14E96d6d)
6866
* **RebalanceHelper** `0xA8416005bCDa0d9Fd694e08A6B90E04477Ee2319` [sonicscan](https://sonicscan.org/address/0xA8416005bCDa0d9Fd694e08A6B90E04477Ee2319)
6967

7068
### Polygon [137]

chains/SonicLib.sol

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ library SonicLib {
8383
address public constant TOKEN_stkscETH = 0x455d5f11Fea33A8fa9D3e285930b478B6bF85265;
8484
address public constant TOKEN_wstkscETH = 0xE8a41c62BB4d5863C6eadC96792cFE90A1f37C47;
8585
address public constant TOKEN_wOS = 0x9F0dF7799f6FDAd409300080cfF680f5A23df4b1;
86+
address public constant TOKEN_STBL = 0x78a76316F66224CBaCA6e70acB24D5ee5b2Bd2c7;
87+
address public constant TOKEN_anS = 0x0C4E186Eae8aCAA7F7de1315D5AD174BE39Ec987;
88+
address public constant TOKEN_wanS = 0xfA85Fe5A8F5560e9039C04f2b0a90dE1415aBD70;
89+
address public constant TOKEN_fBOMB = 0xEdF8b632b537d5993Adb5e2E15882CD791c284cB;
90+
address public constant TOKEN_EGGS = 0xf26Ff70573ddc8a90Bd7865AF8d7d70B8Ff019bC;
8691

8792
// AMMs
8893
address public constant POOL_BEETS_wS_stS = 0x374641076B68371e69D03C417DAc3E5F236c32FA;
@@ -132,6 +137,8 @@ library SonicLib {
132137
address public constant POOL_SWAPX_wS_sDOG = 0xbF23E7fC58b7094D17fe52ef8bdE979aa06b8916;
133138
address public constant POOL_SWAPX_wS_MOON = 0x8218825E5964e17D872adCEfA4C72D73c0D44021;
134139
address public constant POOL_SWAPX_wS_FS = 0xB545EA688f4d14d37B91df6370d75C922f4e9232;
140+
address public constant POOL_SWAPX_USDC_STBL = 0x4D864C2CFb4c11A2CeE4C2d5cBfa318c7B7e14F8;
141+
address public constant POOL_SWAPX_fBOMB_EGGS = 0xEBEeC250676833b96505D8e2967215E91C74e477;
135142
address public constant POOL_UNISWAPV3_wS_USDC_3000 = 0xEcb04e075503Bd678241f00155AbCB532c0a15Eb;
136143
address public constant POOL_UNISWAPV3_wS_WETH_3000 = 0x21043D7Ad92d9e7bC45C055AF29771E37307B111;
137144
address public constant POOL_UNISWAPV3_USDC_WETH_500 = 0xCfD41dF89D060b72eBDd50d65f9021e4457C477e;
@@ -147,6 +154,7 @@ library SonicLib {
147154
address public constant POOL_SHADOW_CL_scETH_WETH_100 = 0xC291CA0a0a0e793dC6A0442a34E1607Ce1905389;
148155
address public constant POOL_SHADOW_CL_stkscUSD_scUSD_3000 = 0x666805eBf99E2E797D09e07b7e255ad0e67B086B;
149156
address public constant POOL_SHADOW_CL_scETH_stkscETH_250 = 0x286Cc998298d9D0242C9ad30cdB587E0b2f59f22;
157+
address public constant POOL_SHADOW_CL_USDC_EGGS = 0x66A8289bdD968D1157eB1a608f60a87759632cd6;
150158

151159
// ALMs
152160
address public constant ALM_ICHI_SWAPX_SACRA_wS = 0x13939Ac0f09dADe88F8b1d86C26daD934d973081;
@@ -232,6 +240,8 @@ library SonicLib {
232240
address public constant SWAPX_GAUGE_wS_sDOG = 0x48C3fF29dAEaC7aFa7785A3977Aab247e6761576;
233241
address public constant SWAPX_GAUGE_wS_MOON = 0x9ad399ecC102212b4677B0Dbbc82c07ae1c74Cc5;
234242
address public constant SWAPX_GAUGE_wS_FS = 0x1cb9f6179A6A24f1A3756b6f6A14E5C5Fd3c0347;
243+
address public constant SWAPX_GAUGE_USDC_STBL = 0x17D11842cCECd5166BFC6c6D7aAa440476A9F883;
244+
address public constant SWAPX_GAUGE_fBOMB_EGGS = 0x2E5228cFEcFEFA439f92Aa4823E5593de5bFcB7D;
235245

236246
// Silo
237247
address public constant SILO_LENS = 0xE05966aee69CeCD677a30f469812Ced650cE3b5E;
@@ -256,6 +266,7 @@ library SonicLib {
256266
address public constant SHADOW_GAUGE_CL_wS_USDC = 0x0ac98Ce57D24f77F48161D12157cb815Af469fc0;
257267
address public constant SHADOW_GAUGE_CL_wS_GOGLZ_5000 = 0x5631cEa9AE0ED0b3637c0099Ee241B926663da1A;
258268
address public constant SHADOW_GAUGE_CL_SACRA_scUSD_20000 = 0x05A2f49425108095cf65ebFEb1424905D24a1BB5;
269+
address public constant SHADOW_ROUTER = 0x1D368773735ee1E678950B7A97bcA2CafB330CDc;
259270

260271
// Oracles
261272
address public constant ORACLE_API3_USDC_USD = 0xD3C586Eec1C6C3eC41D276a23944dea080eDCf7f;
@@ -433,7 +444,7 @@ library SonicLib {
433444
pools[i++] =
434445
_makePoolData(POOL_BEETS_USDC_scUSD, AmmAdapterIdLib.BALANCER_COMPOSABLE_STABLE, TOKEN_scUSD, TOKEN_USDC);
435446
pools[i++] = _makePoolData(POOL_EQUALIZER_wS_EQUAL, AmmAdapterIdLib.SOLIDLY, TOKEN_EQUAL, TOKEN_wS);
436-
pools[i++] = _makePoolData(POOL_EQUALIZER_USDC_WETH, AmmAdapterIdLib.SOLIDLY, TOKEN_wETH, TOKEN_USDC);
447+
pools[i++] = _makePoolData(POOL_EQUALIZER_USDC_WETH, AmmAdapterIdLib.SOLIDLY, TOKEN_wETH, TOKEN_USDC); // changed
437448
pools[i++] = _makePoolData(POOL_EQUALIZER_wS_GOGLZ, AmmAdapterIdLib.SOLIDLY, TOKEN_GOGLZ, TOKEN_wS);
438449
pools[i++] = _makePoolData(POOL_SWAPX_CL_wS_SWPx, AmmAdapterIdLib.ALGEBRA_V4, TOKEN_SWPx, TOKEN_wS);
439450
pools[i++] = _makePoolData(POOL_SWAPX_CL_wS_SACRA, AmmAdapterIdLib.ALGEBRA_V4, TOKEN_SACRA, TOKEN_wS);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.23;
3+
4+
import "forge-std/Script.sol";
5+
import {TokenSender} from "../../src/tokenomics/TokenSender.sol";
6+
7+
contract DeployTokenSender is Script {
8+
address public constant PLATFORM = 0x4Aca671A420eEB58ecafE83700686a2AD06b20D8;
9+
10+
function run() external {
11+
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
12+
vm.startBroadcast(deployerPrivateKey);
13+
new TokenSender(PLATFORM);
14+
vm.stopBroadcast();
15+
}
16+
17+
function testDeployScript() external {}
18+
}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.23;
3+
4+
interface ISolidlyRouter {
5+
/// @notice calculates the CREATE2 address for a pair without making any external calls
6+
/// @param tokenA the address of tokenA
7+
/// @param tokenB the address of tokenB
8+
/// @param stable if the pair is using the stable curve
9+
/// @return pair address of the pair
10+
function pairFor(address tokenA, address tokenB, bool stable) external view returns (address pair);
11+
12+
/// @notice performs calculations to determine the expected state when adding liquidity
13+
/// @param tokenA the address of tokenA
14+
/// @param tokenB the address of tokenB
15+
/// @param stable if the pair is using the stable curve
16+
/// @param amountADesired amount of tokenA desired to be added
17+
/// @param amountBDesired amount of tokenB desired to be added
18+
/// @return amountA amount of tokenA added
19+
/// @return amountB amount of tokenB added
20+
/// @return liquidity liquidity value added
21+
function quoteAddLiquidity(
22+
address tokenA,
23+
address tokenB,
24+
bool stable,
25+
uint amountADesired,
26+
uint amountBDesired
27+
) external view returns (uint amountA, uint amountB, uint liquidity);
28+
29+
/// @param tokenA the address of tokenA
30+
/// @param tokenB the address of tokenB
31+
/// @param stable if the pair is using the stable curve
32+
/// @param liquidity liquidity value to remove
33+
/// @return amountA amount of tokenA removed
34+
/// @return amountB amount of tokenB removed
35+
function quoteRemoveLiquidity(
36+
address tokenA,
37+
address tokenB,
38+
bool stable,
39+
uint liquidity
40+
) external view returns (uint amountA, uint amountB);
41+
42+
/// @param tokenA the address of tokenA
43+
/// @param tokenB the address of tokenB
44+
/// @param stable if the pair is using the stable curve
45+
/// @param amountADesired amount of tokenA desired to be added
46+
/// @param amountBDesired amount of tokenB desired to be added
47+
/// @param amountAMin slippage for tokenA calculated from this param
48+
/// @param amountBMin slippage for tokenB calculated from this param
49+
/// @param to the address the liquidity tokens should be minted to
50+
/// @param deadline timestamp deadline
51+
/// @return amountA amount of tokenA used
52+
/// @return amountB amount of tokenB used
53+
/// @return liquidity amount of liquidity minted
54+
function addLiquidity(
55+
address tokenA,
56+
address tokenB,
57+
bool stable,
58+
uint amountADesired,
59+
uint amountBDesired,
60+
uint amountAMin,
61+
uint amountBMin,
62+
address to,
63+
uint deadline
64+
) external returns (uint amountA, uint amountB, uint liquidity);
65+
66+
/// @param token the address of token
67+
/// @param stable if the pair is using the stable curve
68+
/// @param amountTokenDesired desired amount for token
69+
/// @param amountTokenMin slippage for token
70+
/// @param amountETHMin minimum amount of ETH added (slippage)
71+
/// @param to the address the liquidity tokens should be minted to
72+
/// @param deadline timestamp deadline
73+
/// @return amountToken amount of the token used
74+
/// @return amountETH amount of ETH used
75+
/// @return liquidity amount of liquidity minted
76+
function addLiquidityETH(
77+
address token,
78+
bool stable,
79+
uint amountTokenDesired,
80+
uint amountTokenMin,
81+
uint amountETHMin,
82+
address to,
83+
uint deadline
84+
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
85+
86+
/// @param tokenA the address of tokenA
87+
/// @param tokenB the address of tokenB
88+
/// @param stable if the pair is using the stable curve
89+
/// @param amountADesired amount of tokenA desired to be added
90+
/// @param amountBDesired amount of tokenB desired to be added
91+
/// @param amountAMin slippage for tokenA calculated from this param
92+
/// @param amountBMin slippage for tokenB calculated from this param
93+
/// @param to the address the liquidity tokens should be minted to
94+
/// @param deadline timestamp deadline
95+
/// @return amountA amount of tokenA used
96+
/// @return amountB amount of tokenB used
97+
/// @return liquidity amount of liquidity minted
98+
function addLiquidityAndStake(
99+
address tokenA,
100+
address tokenB,
101+
bool stable,
102+
uint amountADesired,
103+
uint amountBDesired,
104+
uint amountAMin,
105+
uint amountBMin,
106+
address to,
107+
uint deadline
108+
) external returns (uint amountA, uint amountB, uint liquidity);
109+
110+
/// @notice adds liquidity to a legacy pair using ETH, and stakes it into a gauge on "to's" behalf
111+
/// @param token the address of token
112+
/// @param stable if the pair is using the stable curve
113+
/// @param amountTokenDesired amount of token to be used
114+
/// @param amountTokenMin slippage of token
115+
/// @param amountETHMin slippage of ETH
116+
/// @param to the address the liquidity tokens should be minted to
117+
/// @param deadline timestamp deadline
118+
/// @return amountA amount of tokenA used
119+
/// @return amountB amount of tokenB used
120+
/// @return liquidity amount of liquidity minted
121+
function addLiquidityETHAndStake(
122+
address token,
123+
bool stable,
124+
uint amountTokenDesired,
125+
uint amountTokenMin,
126+
uint amountETHMin,
127+
address to,
128+
uint deadline
129+
) external payable returns (uint amountA, uint amountB, uint liquidity);
130+
131+
/// @param tokenA the address of tokenA
132+
/// @param tokenB the address of tokenB
133+
/// @param stable if the pair is using the stable curve
134+
/// @param liquidity amount of LP tokens to remove
135+
/// @param amountAMin slippage of tokenA
136+
/// @param amountBMin slippage of tokenB
137+
/// @param to the address the liquidity tokens should be minted to
138+
/// @param deadline timestamp deadline
139+
/// @return amountA amount of tokenA used
140+
/// @return amountB amount of tokenB used
141+
function removeLiquidity(
142+
address tokenA,
143+
address tokenB,
144+
bool stable,
145+
uint liquidity,
146+
uint amountAMin,
147+
uint amountBMin,
148+
address to,
149+
uint deadline
150+
) external returns (uint amountA, uint amountB);
151+
152+
/// @param token address of the token
153+
/// @param stable if the pair is using the stable curve
154+
/// @param liquidity liquidity tokens to remove
155+
/// @param amountTokenMin slippage of token
156+
/// @param amountETHMin slippage of ETH
157+
/// @param to the address the liquidity tokens should be minted to
158+
/// @param deadline timestamp deadline
159+
/// @return amountToken amount of token used
160+
/// @return amountETH amount of ETH used
161+
function removeLiquidityETH(
162+
address token,
163+
bool stable,
164+
uint liquidity,
165+
uint amountTokenMin,
166+
uint amountETHMin,
167+
address to,
168+
uint deadline
169+
) external returns (uint amountToken, uint amountETH);
170+
}

src/integrations/shadow/IXShadow.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ interface IXShadow {
66
* @dev exit instantly with a penalty
77
* @param amount amount of xShadows to exit
88
*/
9-
function exit(uint amount) external returns(uint exitedAmount);
9+
function exit(uint amount) external returns (uint exitedAmount);
1010

1111
/// @notice address of the shadow token
1212
function SHADOW() external view returns (address);
13-
1413
}

src/integrations/swapx/IRouterV2.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
pragma solidity ^0.8.23;
33

44
interface IRouterV2 {
5+
// calculates the CREATE2 address for a pair without making any external calls
6+
function pairFor(address tokenA, address tokenB, bool stable) external view returns (address pair);
7+
58
function addLiquidity(
69
address tokenA,
710
address tokenB,

src/tokenomics/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Tokenomics
2+
3+
## Sonic deployments
4+
5+
* **MerkleDistributor** `0x0391aBDCFaB86947d93f9dd032955733B639416b` [sonicscan](https://sonicscan.org/address/0x0391abdcfab86947d93f9dd032955733b639416b)
6+
* **sGEM1** `0x9A08cD5691E009cC72E2A4d8e7F2e6EE14E96d6d` [sonicscan](https://sonicscan.org/address/0x9A08cD5691E009cC72E2A4d8e7F2e6EE14E96d6d)
7+
* **saleSTBL** `0x4D61CB8553bB5Db02DF3bdc6CDa88AA85b32224b` [sonicscan](https://sonicscan.org/address/0x4D61CB8553bB5Db02DF3bdc6CDa88AA85b32224b)
8+
* **STBL** `0x78a76316F66224CBaCA6e70acB24D5ee5b2Bd2c7` [sonicscan](https://sonicscan.org/address/0x78a76316F66224CBaCA6e70acB24D5ee5b2Bd2c7)
9+
* **Allocator** `0xB6Dd49fbb6a6Ee28f0655baD5e509a2A8002933B` [sonicscan](https://sonicscan.org/address/0xB6Dd49fbb6a6Ee28f0655baD5e509a2A8002933B)
10+
* **Sale** `0x0a02Be0de3Dd109B1AbF4C197f0B58A3bb68eA1F` [sonicscan](https://sonicscan.org/address/0x0a02Be0de3Dd109B1AbF4C197f0B58A3bb68eA1F)
11+
* **Vesting Investors** `0x1a125ff7efdB54dc9EFB4Ad90C552C4C8822b212` [sonicscan](https://sonicscan.org/address/0x1a125ff7efdB54dc9EFB4Ad90C552C4C8822b212)
12+
* **Vesting Foundation** `0x8C42C261A3104cEEFBb388CFd6C1f0E7c9F22062` [sonicscan](https://sonicscan.org/address/0x8C42C261A3104cEEFBb388CFd6C1f0E7c9F22062)
13+
* **Vesting Community** `0xEF2CE83527FAE22E0012Efc4d64987C1a51448c5` [sonicscan](https://sonicscan.org/address/0xEF2CE83527FAE22E0012Efc4d64987C1a51448c5)
14+
* **Vesting Team** `0xe6C2AA6e67EF1B806B9Daec7147b113051a445E8` [sonicscan](https://sonicscan.org/address/0xe6C2AA6e67EF1B806B9Daec7147b113051a445E8)
15+
* **TokenSender** `0x018AF6336C7cEdBa68a1745B063a87e437321bf9` [sonicscan](https://sonicscan.org/address/0x018AF6336C7cEdBa68a1745B063a87e437321bf9)

src/tokenomics/TokenSender.sol

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.23;
3+
4+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import {IPlatform} from "../interfaces/IPlatform.sol";
6+
7+
contract TokenSender {
8+
address public immutable platform;
9+
10+
constructor(address platform_) {
11+
platform = platform_;
12+
}
13+
14+
function send(address token, address[] calldata receivers, uint[] calldata amounts) external {
15+
require(IPlatform(platform).isOperator(msg.sender), "denied");
16+
uint len = receivers.length;
17+
for (uint i; i < len; ++i) {
18+
// slither-disable-next-line unchecked-transfer
19+
IERC20(token).transferFrom(msg.sender, receivers[i], amounts[i]);
20+
}
21+
}
22+
}

test/strategies/SiAL.Sonic.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract SiloAdvancedLeverageStrategyTest is SonicSetup, UniversalTest {
2020
//_addStrategy(SonicLib.SILO_VAULT_23_wstkscUSD, SonicLib.SILO_VAULT_23_USDC, 80_00);
2121
// not work because Swapper need support longer route
2222
//_addStrategy(SonicLib.SILO_VAULT_26_wstkscETH, SonicLib.SILO_VAULT_26_wETH, 80_00);
23-
_addStrategy(SonicLib.SILO_VAULT_22_wOS, SonicLib.SILO_VAULT_22_wS, 87_00);
23+
_addStrategy(SonicLib.SILO_VAULT_22_wOS, SonicLib.SILO_VAULT_22_wS, 86_90);
2424
}
2525

2626
function _addStrategy(

0 commit comments

Comments
 (0)