@pendle/core-v2 4.4.4 → 4.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleUSDEL2SY.sol/PendleUSDEL2SY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/{PendleUSDEMantleSY.sol/PendleUSDEMantleSY.json → PendleUSDEL2SY.sol/PendleUSDEL2SY.json} +4 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol/PendleStTAOSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol/PendleStTAOSY.json +1036 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeERC20SY.sol/PendleZtakeERC20SY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeERC20SY.sol/PendleZtakeERC20SY.json +1036 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeUSDESY.sol/PendleZtakeUSDESY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeUSDESY.sol/PendleZtakeUSDESY.json +1086 -0
- package/build/artifacts/contracts/interfaces/Tensorplex/ITensorplexStTAO.sol/ITensorplexStTAO.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Tensorplex/ITensorplexStTAO.sol/ITensorplexStTAO.json +106 -0
- package/contracts/core/StandardizedYield/implementations/Ethena/{PendleUSDEMantleSY.sol → PendleUSDEL2SY.sol} +1 -2
- package/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol +106 -0
- package/contracts/core/StandardizedYield/implementations/Zircuit/{PendleZtakeWETHSY.sol → PendleZtakeERC20SY.sol} +16 -16
- package/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeUSDESY.sol +133 -0
- package/contracts/interfaces/Tensorplex/ITensorplexStTAO.sol +16 -0
- package/deployments/1-markets/STTAO-JUNE2024.json +13 -0
- package/deployments/1-markets/ZIRCUIT-USDE-JUNE2024.json +13 -0
- package/deployments/1-offchain-helper.json +2 -1
- package/deployments/10-offchain-helper.json +2 -1
- package/deployments/42161-markets/USDE-ARBITRUM-AUG2024.json +11 -0
- package/deployments/42161-offchain-helper.json +2 -1
- package/deployments/5000-offchain-helper.json +2 -1
- package/deployments/56-offchain-helper.json +2 -1
- package/package.json +1 -1
- package/typechain-types/ITensorplexStTAO.ts +221 -0
- package/typechain-types/PendleStTAOSY.ts +1314 -0
- package/typechain-types/PendleUSDEL2SY.ts +1363 -0
- package/typechain-types/PendleZtakeERC20SY.ts +1336 -0
- package/typechain-types/PendleZtakeUSDESY.ts +1393 -0
- package/typechain-types/factories/ITensorplexStTAO__factory.ts +121 -0
- package/typechain-types/factories/PendleStTAOSY__factory.ts +1088 -0
- package/typechain-types/factories/PendleUSDEL2SY__factory.ts +1110 -0
- package/typechain-types/factories/PendleZtakeERC20SY__factory.ts +1097 -0
- package/typechain-types/factories/PendleZtakeUSDESY__factory.ts +1147 -0
- package/typechain-types/hardhat.d.ts +45 -0
- package/typechain-types/index.ts +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleUSDEMantleSY.sol/PendleUSDEMantleSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeWETHSY.sol/PendleZtakeWETHSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zircuit/PendleZtakeWETHSY.sol/PendleZtakeWETHSY.json +0 -1025
package/build/artifacts/contracts/interfaces/Tensorplex/ITensorplexStTAO.sol/ITensorplexStTAO.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "ITensorplexStTAO",
|
|
4
|
+
"sourceName": "contracts/interfaces/Tensorplex/ITensorplexStTAO.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "uint256",
|
|
10
|
+
"name": "wtaoAmount",
|
|
11
|
+
"type": "uint256"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"name": "calculateAmtAfterFee",
|
|
15
|
+
"outputs": [
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256",
|
|
18
|
+
"name": "",
|
|
19
|
+
"type": "uint256"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"stateMutability": "view",
|
|
28
|
+
"type": "function"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"inputs": [],
|
|
32
|
+
"name": "exchangeRate",
|
|
33
|
+
"outputs": [
|
|
34
|
+
{
|
|
35
|
+
"internalType": "uint256",
|
|
36
|
+
"name": "",
|
|
37
|
+
"type": "uint256"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"stateMutability": "view",
|
|
41
|
+
"type": "function"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"inputs": [
|
|
45
|
+
{
|
|
46
|
+
"internalType": "uint256",
|
|
47
|
+
"name": "wtaoAmount",
|
|
48
|
+
"type": "uint256"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"name": "getWstTAObyWTAO",
|
|
52
|
+
"outputs": [
|
|
53
|
+
{
|
|
54
|
+
"internalType": "uint256",
|
|
55
|
+
"name": "",
|
|
56
|
+
"type": "uint256"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"stateMutability": "view",
|
|
60
|
+
"type": "function"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"inputs": [],
|
|
64
|
+
"name": "maxTaoForWrap",
|
|
65
|
+
"outputs": [
|
|
66
|
+
{
|
|
67
|
+
"internalType": "uint256",
|
|
68
|
+
"name": "",
|
|
69
|
+
"type": "uint256"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"stateMutability": "view",
|
|
73
|
+
"type": "function"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"inputs": [
|
|
77
|
+
{
|
|
78
|
+
"internalType": "uint256",
|
|
79
|
+
"name": "wtaoAmount",
|
|
80
|
+
"type": "uint256"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"name": "wrap",
|
|
84
|
+
"outputs": [],
|
|
85
|
+
"stateMutability": "nonpayable",
|
|
86
|
+
"type": "function"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"inputs": [],
|
|
90
|
+
"name": "wrappedToken",
|
|
91
|
+
"outputs": [
|
|
92
|
+
{
|
|
93
|
+
"internalType": "address",
|
|
94
|
+
"name": "",
|
|
95
|
+
"type": "address"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"stateMutability": "view",
|
|
99
|
+
"type": "function"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"bytecode": "0x",
|
|
103
|
+
"deployedBytecode": "0x",
|
|
104
|
+
"linkReferences": {},
|
|
105
|
+
"deployedLinkReferences": {}
|
|
106
|
+
}
|
|
@@ -3,7 +3,7 @@ pragma solidity ^0.8.17;
|
|
|
3
3
|
|
|
4
4
|
import "../PendleERC20SYUpg.sol";
|
|
5
5
|
|
|
6
|
-
contract
|
|
6
|
+
contract PendleUSDEL2SY is PendleERC20SYUpg {
|
|
7
7
|
uint256 public supplyCap;
|
|
8
8
|
|
|
9
9
|
event SupplyCapUpdated(uint256 newSupplyCap);
|
|
@@ -19,7 +19,6 @@ contract PendleUSDEMantleSY is PendleERC20SYUpg {
|
|
|
19
19
|
_updateSupplyCap(_initialSupplyCap);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
function _previewDeposit(
|
|
24
23
|
address /*tokenIn*/,
|
|
25
24
|
uint256 amountTokenToDeposit
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.23;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseUpg.sol";
|
|
5
|
+
import "../../../../interfaces/Tensorplex/ITensorplexStTAO.sol";
|
|
6
|
+
|
|
7
|
+
// wTAO can be modified on stTAO contract on very unlikely special occasions.
|
|
8
|
+
// However in such case, depositing using stTAO should still be feasible so making wTAO address mutable is not worth the gas cost of users.
|
|
9
|
+
|
|
10
|
+
// @notice: stTAO and wstTAO is the same one.
|
|
11
|
+
// Tensorplex use wstTAO for naming convention on contract writing and stTAO for the name of the token
|
|
12
|
+
|
|
13
|
+
contract PendleStTAOSY is SYBaseUpg {
|
|
14
|
+
using PMath for uint256;
|
|
15
|
+
|
|
16
|
+
error MaxStTAOSupplyExceeded(uint256 amountTaoToWrap, uint256 maxTaoForWrap);
|
|
17
|
+
|
|
18
|
+
// solhint-disable immutable-vars-naming
|
|
19
|
+
address public immutable stTAO;
|
|
20
|
+
address public immutable wTAO;
|
|
21
|
+
|
|
22
|
+
constructor(address _stTAO) SYBaseUpg(_stTAO) {
|
|
23
|
+
_disableInitializers();
|
|
24
|
+
stTAO = _stTAO;
|
|
25
|
+
wTAO = ITensorplexStTAO(stTAO).wrappedToken();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function initialize() initializer external {
|
|
29
|
+
__SYBaseUpg_init("SY Tensorplex Staked TAO", "SY-stTAO");
|
|
30
|
+
_safeApproveInf(wTAO, stTAO);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*///////////////////////////////////////////////////////////////
|
|
34
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
35
|
+
//////////////////////////////////////////////////////////////*/
|
|
36
|
+
|
|
37
|
+
function _deposit(address tokenIn, uint256 amountDeposited) internal virtual override returns (uint256) {
|
|
38
|
+
if (tokenIn == stTAO) {
|
|
39
|
+
return amountDeposited;
|
|
40
|
+
}
|
|
41
|
+
uint256 preBalance = _selfBalance(stTAO);
|
|
42
|
+
ITensorplexStTAO(stTAO).wrap(amountDeposited);
|
|
43
|
+
return _selfBalance(stTAO) - preBalance;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _redeem(
|
|
47
|
+
address receiver,
|
|
48
|
+
address /*tokenOut*/,
|
|
49
|
+
uint256 amountSharesToRedeem
|
|
50
|
+
) internal virtual override returns (uint256) {
|
|
51
|
+
_transferOut(stTAO, receiver, amountSharesToRedeem);
|
|
52
|
+
return amountSharesToRedeem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*///////////////////////////////////////////////////////////////
|
|
56
|
+
EXCHANGE-RATE
|
|
57
|
+
//////////////////////////////////////////////////////////////*/
|
|
58
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
59
|
+
return PMath.ONE.divDown(ITensorplexStTAO(stTAO).exchangeRate());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*///////////////////////////////////////////////////////////////
|
|
63
|
+
MISC FUNCTIONS FOR METADATA
|
|
64
|
+
//////////////////////////////////////////////////////////////*/
|
|
65
|
+
|
|
66
|
+
function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit) internal view override returns (uint256) {
|
|
67
|
+
if (tokenIn == stTAO) {
|
|
68
|
+
return amountTokenToDeposit;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
uint256 maxTaoForWrap = ITensorplexStTAO(stTAO).maxTaoForWrap();
|
|
72
|
+
if (amountTokenToDeposit > maxTaoForWrap) {
|
|
73
|
+
revert MaxStTAOSupplyExceeded(amountTokenToDeposit, maxTaoForWrap);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
(uint256 amountWTaoAfterFee, ) = ITensorplexStTAO(stTAO).calculateAmtAfterFee(amountTokenToDeposit);
|
|
77
|
+
return ITensorplexStTAO(stTAO).getWstTAObyWTAO(amountWTaoAfterFee);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function _previewRedeem(
|
|
81
|
+
address /*tokenOut*/,
|
|
82
|
+
uint256 amountSharesToRedeem
|
|
83
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
84
|
+
return amountSharesToRedeem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getTokensIn() public view virtual override returns (address[] memory) {
|
|
88
|
+
return ArrayLib.create(wTAO, stTAO);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function getTokensOut() public view virtual override returns (address[] memory) {
|
|
92
|
+
return ArrayLib.create(stTAO);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
96
|
+
return token == wTAO || token == stTAO;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
100
|
+
return token == stTAO;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
104
|
+
return (AssetType.TOKEN, wTAO, IERC20Metadata(wTAO).decimals());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -4,20 +4,20 @@ pragma solidity ^0.8.17;
|
|
|
4
4
|
import "../../SYBaseUpg.sol";
|
|
5
5
|
import "../../../../interfaces/Zircuit/IZircuitZtaking.sol";
|
|
6
6
|
|
|
7
|
-
contract
|
|
7
|
+
contract PendleZtakeERC20SY is SYBaseUpg {
|
|
8
8
|
// solhint-disable immutable-vars-naming
|
|
9
9
|
address public immutable zircuitStaking;
|
|
10
|
-
address public immutable
|
|
10
|
+
address public immutable asset;
|
|
11
11
|
|
|
12
|
-
constructor(address _zircuitStaking, address
|
|
12
|
+
constructor(address _zircuitStaking, address _asset) SYBaseUpg(_asset) {
|
|
13
13
|
_disableInitializers();
|
|
14
14
|
zircuitStaking = _zircuitStaking;
|
|
15
|
-
|
|
15
|
+
asset = _asset;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function initialize() external initializer {
|
|
19
|
-
__SYBaseUpg_init(
|
|
20
|
-
_safeApproveInf(
|
|
18
|
+
function initialize(string memory name, string memory symbol) external initializer {
|
|
19
|
+
__SYBaseUpg_init(name, symbol);
|
|
20
|
+
_safeApproveInf(asset, zircuitStaking);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -25,7 +25,7 @@ contract PendleZtakeWETHSY is SYBaseUpg {
|
|
|
25
25
|
//////////////////////////////////////////////////////////////*/
|
|
26
26
|
|
|
27
27
|
function _deposit(address /*tokenIn*/, uint256 amountDeposited) internal virtual override returns (uint256) {
|
|
28
|
-
IZircuitZtaking(zircuitStaking).depositFor(
|
|
28
|
+
IZircuitZtaking(zircuitStaking).depositFor(asset, address(this), amountDeposited);
|
|
29
29
|
return amountDeposited;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -34,8 +34,8 @@ contract PendleZtakeWETHSY is SYBaseUpg {
|
|
|
34
34
|
address /*tokenOut*/,
|
|
35
35
|
uint256 amountSharesToRedeem
|
|
36
36
|
) internal override returns (uint256 /*amountTokenOut*/) {
|
|
37
|
-
IZircuitZtaking(zircuitStaking).withdraw(
|
|
38
|
-
_transferOut(
|
|
37
|
+
IZircuitZtaking(zircuitStaking).withdraw(asset, amountSharesToRedeem);
|
|
38
|
+
_transferOut(asset, receiver, amountSharesToRedeem);
|
|
39
39
|
return amountSharesToRedeem;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -66,24 +66,24 @@ contract PendleZtakeWETHSY is SYBaseUpg {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function getTokensIn() public view override returns (address[] memory res) {
|
|
69
|
-
return ArrayLib.create(
|
|
69
|
+
return ArrayLib.create(asset);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function getTokensOut() public view override returns (address[] memory res) {
|
|
73
|
-
return ArrayLib.create(
|
|
73
|
+
return ArrayLib.create(asset);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function isValidTokenIn(address token) public view override returns (bool) {
|
|
77
|
-
return token ==
|
|
77
|
+
return token == asset;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function isValidTokenOut(address token) public view override returns (bool) {
|
|
81
|
-
return token ==
|
|
81
|
+
return token == asset;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
85
85
|
assetType = AssetType.TOKEN;
|
|
86
|
-
assetAddress =
|
|
87
|
-
assetDecimals =
|
|
86
|
+
assetAddress = asset;
|
|
87
|
+
assetDecimals = IERC20Metadata(asset).decimals();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseUpg.sol";
|
|
5
|
+
import "../../../../interfaces/Zircuit/IZircuitZtaking.sol";
|
|
6
|
+
|
|
7
|
+
contract PendleZtakeUSDESY is SYBaseUpg {
|
|
8
|
+
// solhint-disable immutable-vars-naming
|
|
9
|
+
address public immutable zircuitStaking;
|
|
10
|
+
address public immutable usde;
|
|
11
|
+
|
|
12
|
+
// Supply cap might be updated more often than on special occasion. Leave it as normal storage for better conveinence.
|
|
13
|
+
uint256 public supplyCap;
|
|
14
|
+
|
|
15
|
+
event SupplyCapUpdated(uint256 newSupplyCap);
|
|
16
|
+
|
|
17
|
+
error SupplyCapExceeded(uint256 totalSupply, uint256 supplyCap);
|
|
18
|
+
|
|
19
|
+
constructor(address _zircuitStaking, address _usde) SYBaseUpg(_usde) {
|
|
20
|
+
_disableInitializers();
|
|
21
|
+
zircuitStaking = _zircuitStaking;
|
|
22
|
+
usde = _usde;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function initialize(uint256 _initialSupplyCap) external initializer {
|
|
26
|
+
__SYBaseUpg_init("SY Zircuit Staking USDe", "SY-zs-USDe");
|
|
27
|
+
_safeApproveInf(usde, zircuitStaking);
|
|
28
|
+
_updateSupplyCap(_initialSupplyCap);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*///////////////////////////////////////////////////////////////
|
|
32
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
33
|
+
//////////////////////////////////////////////////////////////*/
|
|
34
|
+
|
|
35
|
+
function _deposit(address /*tokenIn*/, uint256 amountDeposited) internal virtual override returns (uint256) {
|
|
36
|
+
IZircuitZtaking(zircuitStaking).depositFor(usde, address(this), amountDeposited);
|
|
37
|
+
return amountDeposited;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _redeem(
|
|
41
|
+
address receiver,
|
|
42
|
+
address /*tokenOut*/,
|
|
43
|
+
uint256 amountSharesToRedeem
|
|
44
|
+
) internal override returns (uint256 /*amountTokenOut*/) {
|
|
45
|
+
IZircuitZtaking(zircuitStaking).withdraw(usde, amountSharesToRedeem);
|
|
46
|
+
_transferOut(usde, receiver, amountSharesToRedeem);
|
|
47
|
+
return amountSharesToRedeem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/*///////////////////////////////////////////////////////////////
|
|
51
|
+
EXCHANGE-RATE
|
|
52
|
+
//////////////////////////////////////////////////////////////*/
|
|
53
|
+
|
|
54
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
55
|
+
return PMath.ONE;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*///////////////////////////////////////////////////////////////
|
|
59
|
+
MISC FUNCTIONS FOR METADATA
|
|
60
|
+
//////////////////////////////////////////////////////////////*/
|
|
61
|
+
|
|
62
|
+
function _previewDeposit(
|
|
63
|
+
address /*tokenIn*/,
|
|
64
|
+
uint256 amountTokenToDeposit
|
|
65
|
+
) internal view override returns (uint256 /*amountSharesOut*/) {
|
|
66
|
+
uint256 _newSupply = totalSupply() + amountTokenToDeposit;
|
|
67
|
+
uint256 _supplyCap = supplyCap;
|
|
68
|
+
|
|
69
|
+
if (_newSupply > _supplyCap) {
|
|
70
|
+
revert SupplyCapExceeded(_newSupply, _supplyCap);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return amountTokenToDeposit;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _previewRedeem(
|
|
77
|
+
address /*tokenOut*/,
|
|
78
|
+
uint256 amountSharesToRedeem
|
|
79
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
80
|
+
return amountSharesToRedeem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/*///////////////////////////////////////////////////////////////
|
|
84
|
+
SUPPLY CAP RELATED FUNCTIONS
|
|
85
|
+
//////////////////////////////////////////////////////////////*/
|
|
86
|
+
|
|
87
|
+
function updateSupplyCap(uint256 newSupplyCap) external onlyOwner {
|
|
88
|
+
_updateSupplyCap(newSupplyCap);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function _updateSupplyCap(uint256 newSupplyCap) internal {
|
|
92
|
+
supplyCap = newSupplyCap;
|
|
93
|
+
emit SupplyCapUpdated(newSupplyCap);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// @dev: whenNotPaused not needed as it has already been added to beforeTransfer
|
|
97
|
+
function _afterTokenTransfer(address from, address, uint256) internal virtual override {
|
|
98
|
+
// only check for minting case
|
|
99
|
+
// saving gas on user->user transfers
|
|
100
|
+
// skip supply cap checking on burn to allow lowering supply cap
|
|
101
|
+
if (from != address(0)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
uint256 _supply = totalSupply();
|
|
106
|
+
uint256 _supplyCap = supplyCap;
|
|
107
|
+
if (_supply > _supplyCap) {
|
|
108
|
+
revert SupplyCapExceeded(_supply, _supplyCap);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getTokensIn() public view override returns (address[] memory res) {
|
|
113
|
+
return ArrayLib.create(usde);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getTokensOut() public view override returns (address[] memory res) {
|
|
117
|
+
return ArrayLib.create(usde);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function isValidTokenIn(address token) public view override returns (bool) {
|
|
121
|
+
return token == usde;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function isValidTokenOut(address token) public view override returns (bool) {
|
|
125
|
+
return token == usde;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
129
|
+
assetType = AssetType.TOKEN;
|
|
130
|
+
assetAddress = usde;
|
|
131
|
+
assetDecimals = IERC20Metadata(usde).decimals();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
interface ITensorplexStTAO {
|
|
5
|
+
function wrappedToken() external view returns (address);
|
|
6
|
+
|
|
7
|
+
function wrap(uint256 wtaoAmount) external;
|
|
8
|
+
|
|
9
|
+
function exchangeRate() external view returns (uint256);
|
|
10
|
+
|
|
11
|
+
function maxTaoForWrap() external view returns (uint256);
|
|
12
|
+
|
|
13
|
+
function calculateAmtAfterFee(uint256 wtaoAmount) external view returns (uint256, uint256);
|
|
14
|
+
|
|
15
|
+
function getWstTAObyWTAO(uint256 wtaoAmount) external view returns (uint256);
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "STTAO-JUNE2024",
|
|
3
|
+
"SY": "0x60CceFd60bA522f9221f122BB80A1e8cbAB9285F",
|
|
4
|
+
"YT": "0x233D32d4D33eD5F2D6b8544137c8836249de372F",
|
|
5
|
+
"PT": "0x5282Ec643C3790E0F781508162a4Aa13fd09C528",
|
|
6
|
+
"market": "0x2084b373979415Bc93190071AF3390F92DcDD189",
|
|
7
|
+
"expiry": 1719446400,
|
|
8
|
+
"lnFeeRateRoot": "9950330853000000",
|
|
9
|
+
"scalarRoot": "2097143853000000000",
|
|
10
|
+
"initAnchor": "1249220799000000000",
|
|
11
|
+
"doCacheIndexSameBlock": true,
|
|
12
|
+
"deployTxHash": "0xc7b0a026346cd4dae528e85ad21ab019c84e80cebe1b9b65be7683c4e02618bb"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ZIRCUIT-USDE-JUNE2024",
|
|
3
|
+
"SY": "0x293C6937D8D82e05B01335F7B33FBA0c8e256E30",
|
|
4
|
+
"YT": "0x40357b9f22B4DfF0Bf56A90661b8eC106C259d29",
|
|
5
|
+
"PT": "0x3d4F535539A33FEAd4D76D7b3B7A9cB5B21C73f1",
|
|
6
|
+
"market": "0x90c98ab215498B72Abfec04c651e2e496bA364C0",
|
|
7
|
+
"expiry": 1719446400,
|
|
8
|
+
"lnFeeRateRoot": "9950330853000000",
|
|
9
|
+
"scalarRoot": "1422786054000000000",
|
|
10
|
+
"initAnchor": "1371644990000000000",
|
|
11
|
+
"doCacheIndexSameBlock": true,
|
|
12
|
+
"deployTxHash": "0xcc9b9e5433c77f24cc9b4095d7367805672656c0884d2ad8283ca54dc47461e8"
|
|
13
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"multicall": "0xfd6Df9EFACfEfdF4E610d687A9c9b941D1b1Bf75",
|
|
3
3
|
"pendleMulticallV2": "0x539fd510fE352CC81822a222F821c340133Ed41C",
|
|
4
|
-
"implicitSwapfeeContract": "0x43D03031FAb845065e9CEfE89Dd122d63F72011F"
|
|
4
|
+
"implicitSwapfeeContract": "0x43D03031FAb845065e9CEfE89Dd122d63F72011F",
|
|
5
|
+
"simulateHelper": "0x2b3EC64160F658fFe7061769415Ff080fca80BbA"
|
|
5
6
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY USDe",
|
|
3
|
+
"SY": "0xb3C24D9dcCC2Ec5f778742389ffe448E295B84e0",
|
|
4
|
+
"YT": "0xF478f7FeaeAB0DFdC91E02cDd6C63c66E30a7335",
|
|
5
|
+
"PT": "0xad853EB4fB3Fe4a66CdFCD7b75922a0494955292",
|
|
6
|
+
"market": "0x2Dfaf9a5E4F293BceedE49f2dBa29aACDD88E0C4",
|
|
7
|
+
"expiry": 1724889600,
|
|
8
|
+
"scalarRoot": "1120571444000000000",
|
|
9
|
+
"initAnchor": "1821342325000000000",
|
|
10
|
+
"lnFeeRateRoot": "9950330853000000"
|
|
11
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"multicall": "0xfd6Df9EFACfEfdF4E610d687A9c9b941D1b1Bf75",
|
|
3
3
|
"pendleMulticallV2": "0x539fd510fE352CC81822a222F821c340133Ed41C",
|
|
4
|
-
"implicitSwapfeeContract": "0x704478Dd72FD7F9B83d1F1e0fc18C14B54F034d0"
|
|
4
|
+
"implicitSwapfeeContract": "0x704478Dd72FD7F9B83d1F1e0fc18C14B54F034d0",
|
|
5
|
+
"simulateHelper": "0x2b3EC64160F658fFe7061769415Ff080fca80BbA"
|
|
5
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"multicall": "0xfd6Df9EFACfEfdF4E610d687A9c9b941D1b1Bf75",
|
|
3
3
|
"pendleMulticallV2": "0x539fd510fE352CC81822a222F821c340133Ed41C",
|
|
4
|
-
"implicitSwapfeeContract": "0xa87f7EeDD570943BcFFcE6D00B13D9a95ede8810"
|
|
4
|
+
"implicitSwapfeeContract": "0xa87f7EeDD570943BcFFcE6D00B13D9a95ede8810",
|
|
5
|
+
"simulateHelper": "0x2b3EC64160F658fFe7061769415Ff080fca80BbA"
|
|
5
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"multicall": "0xfd6Df9EFACfEfdF4E610d687A9c9b941D1b1Bf75",
|
|
3
3
|
"pendleMulticallV2": "0x539fd510fE352CC81822a222F821c340133Ed41C",
|
|
4
|
-
"implicitSwapfeeContract": "0xed18de5442297a4ec1ce59c7c7d9427adc2a012b"
|
|
4
|
+
"implicitSwapfeeContract": "0xed18de5442297a4ec1ce59c7c7d9427adc2a012b",
|
|
5
|
+
"simulateHelper": "0x2b3EC64160F658fFe7061769415Ff080fca80BbA"
|
|
5
6
|
}
|