@pendle/core-v2 0.11.8-testnet → 0.11.10-testnet
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/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.json +20 -2
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +4 -4
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +4 -0
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.json +185 -0
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/core/actions/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +180 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +169 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.json +93 -0
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +210 -56
- package/build/artifacts/contracts/offchain-helpers/SSTORE2DeployerContract.sol/SSTORE2DeployerContract.dbg.json +1 -1
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +6 -1
- package/contracts/core/PendleRouter.sol +10 -1
- package/contracts/core/actions/ActionAddRemoveLiq.sol +23 -2
- package/contracts/core/actions/ActionCallback.sol +39 -0
- package/contracts/core/actions/ActionSwapPTYT.sol +86 -0
- package/contracts/core/actions/base/CallbackHelper.sol +49 -1
- package/contracts/interfaces/IPActionSwapPTYT.sol +31 -0
- package/contracts/interfaces/IPAllAction.sol +2 -0
- package/contracts/interfaces/IPVotingEscrow.sol +1 -1
- package/contracts/libraries/math/MarketApproxLib.sol +117 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +69 -8
- package/contracts/offchain-helpers/RouterStatic.sol +76 -3
- package/deployments/43113-core.json +1 -1
- package/package.json +1 -3
- package/typechain-types/ActionSwapPTYT.ts +233 -0
- package/typechain-types/IPActionSwapPTYT.ts +233 -0
- package/typechain-types/IPAllAction.ts +138 -0
- package/typechain-types/IPVotingEscrow.ts +131 -0
- package/typechain-types/PendleFeeDistributorFactory.ts +97 -8
- package/typechain-types/PendleRouter.ts +19 -0
- package/typechain-types/RouterStatic.ts +174 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +238 -0
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- package/typechain-types/factories/IPActionSwapPTYT__factory.ts +195 -0
- package/typechain-types/factories/IPAllAction__factory.ts +169 -0
- package/typechain-types/factories/IPVotingEscrow__factory.ts +93 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +81 -8
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +23 -1
- package/typechain-types/factories/RouterStatic__factory.ts +143 -1
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +72 -117
- package/typechain-types/index.ts +16 -26
|
@@ -3,14 +3,22 @@ pragma solidity 0.8.15;
|
|
|
3
3
|
|
|
4
4
|
import "../interfaces/IPYieldContractFactory.sol";
|
|
5
5
|
import "../interfaces/IPMarketFactory.sol";
|
|
6
|
+
import "../interfaces/IPVotingEscrow.sol";
|
|
7
|
+
import "../periphery/BoringOwnableUpgradeable.sol";
|
|
6
8
|
import "./MarketMathStatic.sol";
|
|
7
9
|
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
8
10
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
9
11
|
import "../periphery/BoringOwnableUpgradeable.sol";
|
|
12
|
+
import "../libraries/math/WeekMath.sol";
|
|
10
13
|
|
|
11
14
|
/// EXCLUDED FROM ALL AUDITS, TO BE CALLED ONLY BY PENDLE's SDK
|
|
12
15
|
contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeable {
|
|
13
16
|
using Math for uint256;
|
|
17
|
+
using VeBalanceLib for VeBalance;
|
|
18
|
+
using VeBalanceLib for LockedPosition;
|
|
19
|
+
|
|
20
|
+
uint128 public constant MAX_LOCK_TIME = 104 weeks;
|
|
21
|
+
uint128 public constant MIN_LOCK_TIME = 1 weeks;
|
|
14
22
|
|
|
15
23
|
struct TokenAmount {
|
|
16
24
|
address token;
|
|
@@ -47,12 +55,16 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
47
55
|
|
|
48
56
|
IPYieldContractFactory internal immutable yieldContractFactory;
|
|
49
57
|
IPMarketFactory internal immutable marketFactory;
|
|
58
|
+
IPVotingEscrow internal immutable vePENDLE;
|
|
50
59
|
|
|
51
|
-
constructor(
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
constructor(
|
|
61
|
+
IPYieldContractFactory _yieldContractFactory,
|
|
62
|
+
IPMarketFactory _marketFactory,
|
|
63
|
+
IPVotingEscrow _vePENDLE
|
|
64
|
+
) initializer {
|
|
54
65
|
yieldContractFactory = _yieldContractFactory;
|
|
55
66
|
marketFactory = _marketFactory;
|
|
67
|
+
vePENDLE = _vePENDLE;
|
|
56
68
|
}
|
|
57
69
|
|
|
58
70
|
function initialize() external initializer {
|
|
@@ -570,6 +582,67 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
570
582
|
);
|
|
571
583
|
}
|
|
572
584
|
|
|
585
|
+
function swapExactPtForYtStatic(address market, uint256 exactPtIn)
|
|
586
|
+
external
|
|
587
|
+
returns (
|
|
588
|
+
uint256 netYtOut,
|
|
589
|
+
uint256 totalPtToSwap,
|
|
590
|
+
uint256 netScyFee,
|
|
591
|
+
uint256 priceImpact
|
|
592
|
+
)
|
|
593
|
+
{
|
|
594
|
+
return MarketMathStatic.swapExactPtForYt(market, exactPtIn, getDefaultApproxParams());
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function swapExactYtForPtStatic(address market, uint256 exactYtIn)
|
|
598
|
+
external
|
|
599
|
+
returns (
|
|
600
|
+
uint256 netPtOut,
|
|
601
|
+
uint256 totalPtSwapped,
|
|
602
|
+
uint256 netScyFee,
|
|
603
|
+
uint256 priceImpact
|
|
604
|
+
)
|
|
605
|
+
{
|
|
606
|
+
return MarketMathStatic.swapExactYtForPt(market, exactYtIn, getDefaultApproxParams());
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// ============= vePENDLE =============
|
|
610
|
+
|
|
611
|
+
function increaseLockPositionStatic(
|
|
612
|
+
address user,
|
|
613
|
+
uint128 additionalAmountToLock,
|
|
614
|
+
uint128 newExpiry
|
|
615
|
+
) external view returns (uint128 newVeBalance) {
|
|
616
|
+
require(
|
|
617
|
+
WeekMath.isValidWTime(newExpiry) && !MiniHelpers.isTimeInThePast(newExpiry),
|
|
618
|
+
"invalid newExpiry"
|
|
619
|
+
);
|
|
620
|
+
|
|
621
|
+
require(newExpiry <= block.timestamp + MAX_LOCK_TIME, "max lock time exceeded");
|
|
622
|
+
require(newExpiry >= block.timestamp + MIN_LOCK_TIME, "insufficient lock time");
|
|
623
|
+
|
|
624
|
+
LockedPosition memory oldPosition;
|
|
625
|
+
|
|
626
|
+
{
|
|
627
|
+
(uint128 amount, uint128 expiry) = vePENDLE.positionData(user);
|
|
628
|
+
oldPosition = LockedPosition(amount, expiry);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
require(oldPosition.expiry <= newExpiry, "new expiry must be after current expiry");
|
|
632
|
+
uint128 newTotalAmountLocked = additionalAmountToLock + oldPosition.amount;
|
|
633
|
+
require(newTotalAmountLocked > 0, "zero total amount locked");
|
|
634
|
+
|
|
635
|
+
uint128 additionalDurationToLock = newExpiry - oldPosition.expiry;
|
|
636
|
+
|
|
637
|
+
LockedPosition memory newPosition = LockedPosition(
|
|
638
|
+
oldPosition.amount + additionalAmountToLock,
|
|
639
|
+
oldPosition.expiry + additionalDurationToLock
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
VeBalance memory newBalance = newPosition.convertToVeBalance();
|
|
643
|
+
return newBalance.getCurrentValue();
|
|
644
|
+
}
|
|
645
|
+
|
|
573
646
|
// ============= OTHER HELPERS =============
|
|
574
647
|
|
|
575
648
|
function mintPYFromScyStatic(address YT, uint256 amountScyToMint)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"yieldContractFactory": "0x38E5A1D591553b5FF18b151B587745a4A9B206d2",
|
|
8
8
|
"marketFactory": "0xE646E5425fD448b2f9dDF6de12383CcF5275143B",
|
|
9
9
|
"router": "0xa4C21f51DE870a283f362A7331f0C4f8288c3e41",
|
|
10
|
-
"routerStatic": "
|
|
10
|
+
"routerStatic": "0x4ea00Cd73C773764A398e27ed2F789f50F168c52",
|
|
11
11
|
"startTime": 1657756800,
|
|
12
12
|
"vePendle": "0x3AE0fee115057cCF8A0B5255751027C26D83B912",
|
|
13
13
|
"votingController": "0x76815E13679C7F18a406f5BA94E352E656BeE378",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pendle/core-v2",
|
|
3
3
|
"description": "Core smart contracts of Pendle Protocol.",
|
|
4
4
|
"license": "BUSL-1.1",
|
|
5
|
-
"version": "0.11.
|
|
5
|
+
"version": "0.11.10-testnet",
|
|
6
6
|
"homepage": "https://pendle.finance",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"pendle",
|
|
@@ -37,8 +37,6 @@
|
|
|
37
37
|
"typescript": "^4.8.2"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"prepublish": "yarn hardhat compile",
|
|
41
|
-
"publish": "npm publish",
|
|
42
40
|
"compile": "yarn hardhat compile",
|
|
43
41
|
"size": "yarn hardhat size-contracts",
|
|
44
42
|
"clean": "yarn hardhat clean",
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumber,
|
|
7
|
+
BigNumberish,
|
|
8
|
+
BytesLike,
|
|
9
|
+
CallOverrides,
|
|
10
|
+
ContractTransaction,
|
|
11
|
+
Overrides,
|
|
12
|
+
PopulatedTransaction,
|
|
13
|
+
Signer,
|
|
14
|
+
utils,
|
|
15
|
+
} from "ethers";
|
|
16
|
+
import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
17
|
+
import { Listener, Provider } from "@ethersproject/providers";
|
|
18
|
+
import type {
|
|
19
|
+
TypedEventFilter,
|
|
20
|
+
TypedEvent,
|
|
21
|
+
TypedListener,
|
|
22
|
+
OnEvent,
|
|
23
|
+
} from "./common";
|
|
24
|
+
|
|
25
|
+
export type ApproxParamsStruct = {
|
|
26
|
+
guessMin: BigNumberish;
|
|
27
|
+
guessMax: BigNumberish;
|
|
28
|
+
guessOffchain: BigNumberish;
|
|
29
|
+
maxIteration: BigNumberish;
|
|
30
|
+
eps: BigNumberish;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ApproxParamsStructOutput = [
|
|
34
|
+
BigNumber,
|
|
35
|
+
BigNumber,
|
|
36
|
+
BigNumber,
|
|
37
|
+
BigNumber,
|
|
38
|
+
BigNumber
|
|
39
|
+
] & {
|
|
40
|
+
guessMin: BigNumber;
|
|
41
|
+
guessMax: BigNumber;
|
|
42
|
+
guessOffchain: BigNumber;
|
|
43
|
+
maxIteration: BigNumber;
|
|
44
|
+
eps: BigNumber;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface ActionSwapPTYTInterface extends utils.Interface {
|
|
48
|
+
contractName: "ActionSwapPTYT";
|
|
49
|
+
functions: {
|
|
50
|
+
"swapExactPtForYt(address,address,uint256,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
|
|
51
|
+
"swapExactYtForPt(address,address,uint256,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
encodeFunctionData(
|
|
55
|
+
functionFragment: "swapExactPtForYt",
|
|
56
|
+
values: [string, string, BigNumberish, BigNumberish, ApproxParamsStruct]
|
|
57
|
+
): string;
|
|
58
|
+
encodeFunctionData(
|
|
59
|
+
functionFragment: "swapExactYtForPt",
|
|
60
|
+
values: [string, string, BigNumberish, BigNumberish, ApproxParamsStruct]
|
|
61
|
+
): string;
|
|
62
|
+
|
|
63
|
+
decodeFunctionResult(
|
|
64
|
+
functionFragment: "swapExactPtForYt",
|
|
65
|
+
data: BytesLike
|
|
66
|
+
): Result;
|
|
67
|
+
decodeFunctionResult(
|
|
68
|
+
functionFragment: "swapExactYtForPt",
|
|
69
|
+
data: BytesLike
|
|
70
|
+
): Result;
|
|
71
|
+
|
|
72
|
+
events: {
|
|
73
|
+
"SwapPtAndYt(address,address,address,int256,int256)": EventFragment;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
getEvent(nameOrSignatureOrTopic: "SwapPtAndYt"): EventFragment;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type SwapPtAndYtEvent = TypedEvent<
|
|
80
|
+
[string, string, string, BigNumber, BigNumber],
|
|
81
|
+
{
|
|
82
|
+
caller: string;
|
|
83
|
+
market: string;
|
|
84
|
+
receiver: string;
|
|
85
|
+
netPtToAccount: BigNumber;
|
|
86
|
+
netYtToAccount: BigNumber;
|
|
87
|
+
}
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
export type SwapPtAndYtEventFilter = TypedEventFilter<SwapPtAndYtEvent>;
|
|
91
|
+
|
|
92
|
+
export interface ActionSwapPTYT extends BaseContract {
|
|
93
|
+
contractName: "ActionSwapPTYT";
|
|
94
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
95
|
+
attach(addressOrName: string): this;
|
|
96
|
+
deployed(): Promise<this>;
|
|
97
|
+
|
|
98
|
+
interface: ActionSwapPTYTInterface;
|
|
99
|
+
|
|
100
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
101
|
+
event: TypedEventFilter<TEvent>,
|
|
102
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
103
|
+
toBlock?: string | number | undefined
|
|
104
|
+
): Promise<Array<TEvent>>;
|
|
105
|
+
|
|
106
|
+
listeners<TEvent extends TypedEvent>(
|
|
107
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
108
|
+
): Array<TypedListener<TEvent>>;
|
|
109
|
+
listeners(eventName?: string): Array<Listener>;
|
|
110
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
111
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
112
|
+
): this;
|
|
113
|
+
removeAllListeners(eventName?: string): this;
|
|
114
|
+
off: OnEvent<this>;
|
|
115
|
+
on: OnEvent<this>;
|
|
116
|
+
once: OnEvent<this>;
|
|
117
|
+
removeListener: OnEvent<this>;
|
|
118
|
+
|
|
119
|
+
functions: {
|
|
120
|
+
swapExactPtForYt(
|
|
121
|
+
receiver: string,
|
|
122
|
+
market: string,
|
|
123
|
+
exactPtIn: BigNumberish,
|
|
124
|
+
minYtOut: BigNumberish,
|
|
125
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
126
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
127
|
+
): Promise<ContractTransaction>;
|
|
128
|
+
|
|
129
|
+
swapExactYtForPt(
|
|
130
|
+
receiver: string,
|
|
131
|
+
market: string,
|
|
132
|
+
exactYtIn: BigNumberish,
|
|
133
|
+
minPtOut: BigNumberish,
|
|
134
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
135
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
136
|
+
): Promise<ContractTransaction>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
swapExactPtForYt(
|
|
140
|
+
receiver: string,
|
|
141
|
+
market: string,
|
|
142
|
+
exactPtIn: BigNumberish,
|
|
143
|
+
minYtOut: BigNumberish,
|
|
144
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
145
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
146
|
+
): Promise<ContractTransaction>;
|
|
147
|
+
|
|
148
|
+
swapExactYtForPt(
|
|
149
|
+
receiver: string,
|
|
150
|
+
market: string,
|
|
151
|
+
exactYtIn: BigNumberish,
|
|
152
|
+
minPtOut: BigNumberish,
|
|
153
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
154
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
155
|
+
): Promise<ContractTransaction>;
|
|
156
|
+
|
|
157
|
+
callStatic: {
|
|
158
|
+
swapExactPtForYt(
|
|
159
|
+
receiver: string,
|
|
160
|
+
market: string,
|
|
161
|
+
exactPtIn: BigNumberish,
|
|
162
|
+
minYtOut: BigNumberish,
|
|
163
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
164
|
+
overrides?: CallOverrides
|
|
165
|
+
): Promise<BigNumber>;
|
|
166
|
+
|
|
167
|
+
swapExactYtForPt(
|
|
168
|
+
receiver: string,
|
|
169
|
+
market: string,
|
|
170
|
+
exactYtIn: BigNumberish,
|
|
171
|
+
minPtOut: BigNumberish,
|
|
172
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
173
|
+
overrides?: CallOverrides
|
|
174
|
+
): Promise<BigNumber>;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
filters: {
|
|
178
|
+
"SwapPtAndYt(address,address,address,int256,int256)"(
|
|
179
|
+
caller?: string | null,
|
|
180
|
+
market?: string | null,
|
|
181
|
+
receiver?: string | null,
|
|
182
|
+
netPtToAccount?: null,
|
|
183
|
+
netYtToAccount?: null
|
|
184
|
+
): SwapPtAndYtEventFilter;
|
|
185
|
+
SwapPtAndYt(
|
|
186
|
+
caller?: string | null,
|
|
187
|
+
market?: string | null,
|
|
188
|
+
receiver?: string | null,
|
|
189
|
+
netPtToAccount?: null,
|
|
190
|
+
netYtToAccount?: null
|
|
191
|
+
): SwapPtAndYtEventFilter;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
estimateGas: {
|
|
195
|
+
swapExactPtForYt(
|
|
196
|
+
receiver: string,
|
|
197
|
+
market: string,
|
|
198
|
+
exactPtIn: BigNumberish,
|
|
199
|
+
minYtOut: BigNumberish,
|
|
200
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
201
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
202
|
+
): Promise<BigNumber>;
|
|
203
|
+
|
|
204
|
+
swapExactYtForPt(
|
|
205
|
+
receiver: string,
|
|
206
|
+
market: string,
|
|
207
|
+
exactYtIn: BigNumberish,
|
|
208
|
+
minPtOut: BigNumberish,
|
|
209
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
210
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
211
|
+
): Promise<BigNumber>;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
populateTransaction: {
|
|
215
|
+
swapExactPtForYt(
|
|
216
|
+
receiver: string,
|
|
217
|
+
market: string,
|
|
218
|
+
exactPtIn: BigNumberish,
|
|
219
|
+
minYtOut: BigNumberish,
|
|
220
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
221
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
222
|
+
): Promise<PopulatedTransaction>;
|
|
223
|
+
|
|
224
|
+
swapExactYtForPt(
|
|
225
|
+
receiver: string,
|
|
226
|
+
market: string,
|
|
227
|
+
exactYtIn: BigNumberish,
|
|
228
|
+
minPtOut: BigNumberish,
|
|
229
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
230
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
231
|
+
): Promise<PopulatedTransaction>;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumber,
|
|
7
|
+
BigNumberish,
|
|
8
|
+
BytesLike,
|
|
9
|
+
CallOverrides,
|
|
10
|
+
ContractTransaction,
|
|
11
|
+
Overrides,
|
|
12
|
+
PopulatedTransaction,
|
|
13
|
+
Signer,
|
|
14
|
+
utils,
|
|
15
|
+
} from "ethers";
|
|
16
|
+
import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
17
|
+
import { Listener, Provider } from "@ethersproject/providers";
|
|
18
|
+
import type {
|
|
19
|
+
TypedEventFilter,
|
|
20
|
+
TypedEvent,
|
|
21
|
+
TypedListener,
|
|
22
|
+
OnEvent,
|
|
23
|
+
} from "./common";
|
|
24
|
+
|
|
25
|
+
export type ApproxParamsStruct = {
|
|
26
|
+
guessMin: BigNumberish;
|
|
27
|
+
guessMax: BigNumberish;
|
|
28
|
+
guessOffchain: BigNumberish;
|
|
29
|
+
maxIteration: BigNumberish;
|
|
30
|
+
eps: BigNumberish;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ApproxParamsStructOutput = [
|
|
34
|
+
BigNumber,
|
|
35
|
+
BigNumber,
|
|
36
|
+
BigNumber,
|
|
37
|
+
BigNumber,
|
|
38
|
+
BigNumber
|
|
39
|
+
] & {
|
|
40
|
+
guessMin: BigNumber;
|
|
41
|
+
guessMax: BigNumber;
|
|
42
|
+
guessOffchain: BigNumber;
|
|
43
|
+
maxIteration: BigNumber;
|
|
44
|
+
eps: BigNumber;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface IPActionSwapPTYTInterface extends utils.Interface {
|
|
48
|
+
contractName: "IPActionSwapPTYT";
|
|
49
|
+
functions: {
|
|
50
|
+
"swapExactPtForYt(address,address,uint256,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
|
|
51
|
+
"swapExactYtForPt(address,address,uint256,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
encodeFunctionData(
|
|
55
|
+
functionFragment: "swapExactPtForYt",
|
|
56
|
+
values: [string, string, BigNumberish, BigNumberish, ApproxParamsStruct]
|
|
57
|
+
): string;
|
|
58
|
+
encodeFunctionData(
|
|
59
|
+
functionFragment: "swapExactYtForPt",
|
|
60
|
+
values: [string, string, BigNumberish, BigNumberish, ApproxParamsStruct]
|
|
61
|
+
): string;
|
|
62
|
+
|
|
63
|
+
decodeFunctionResult(
|
|
64
|
+
functionFragment: "swapExactPtForYt",
|
|
65
|
+
data: BytesLike
|
|
66
|
+
): Result;
|
|
67
|
+
decodeFunctionResult(
|
|
68
|
+
functionFragment: "swapExactYtForPt",
|
|
69
|
+
data: BytesLike
|
|
70
|
+
): Result;
|
|
71
|
+
|
|
72
|
+
events: {
|
|
73
|
+
"SwapPtAndYt(address,address,address,int256,int256)": EventFragment;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
getEvent(nameOrSignatureOrTopic: "SwapPtAndYt"): EventFragment;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type SwapPtAndYtEvent = TypedEvent<
|
|
80
|
+
[string, string, string, BigNumber, BigNumber],
|
|
81
|
+
{
|
|
82
|
+
caller: string;
|
|
83
|
+
market: string;
|
|
84
|
+
receiver: string;
|
|
85
|
+
netPtToAccount: BigNumber;
|
|
86
|
+
netYtToAccount: BigNumber;
|
|
87
|
+
}
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
export type SwapPtAndYtEventFilter = TypedEventFilter<SwapPtAndYtEvent>;
|
|
91
|
+
|
|
92
|
+
export interface IPActionSwapPTYT extends BaseContract {
|
|
93
|
+
contractName: "IPActionSwapPTYT";
|
|
94
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
95
|
+
attach(addressOrName: string): this;
|
|
96
|
+
deployed(): Promise<this>;
|
|
97
|
+
|
|
98
|
+
interface: IPActionSwapPTYTInterface;
|
|
99
|
+
|
|
100
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
101
|
+
event: TypedEventFilter<TEvent>,
|
|
102
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
103
|
+
toBlock?: string | number | undefined
|
|
104
|
+
): Promise<Array<TEvent>>;
|
|
105
|
+
|
|
106
|
+
listeners<TEvent extends TypedEvent>(
|
|
107
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
108
|
+
): Array<TypedListener<TEvent>>;
|
|
109
|
+
listeners(eventName?: string): Array<Listener>;
|
|
110
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
111
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
112
|
+
): this;
|
|
113
|
+
removeAllListeners(eventName?: string): this;
|
|
114
|
+
off: OnEvent<this>;
|
|
115
|
+
on: OnEvent<this>;
|
|
116
|
+
once: OnEvent<this>;
|
|
117
|
+
removeListener: OnEvent<this>;
|
|
118
|
+
|
|
119
|
+
functions: {
|
|
120
|
+
swapExactPtForYt(
|
|
121
|
+
receiver: string,
|
|
122
|
+
market: string,
|
|
123
|
+
exactPtIn: BigNumberish,
|
|
124
|
+
minYtOut: BigNumberish,
|
|
125
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
126
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
127
|
+
): Promise<ContractTransaction>;
|
|
128
|
+
|
|
129
|
+
swapExactYtForPt(
|
|
130
|
+
receiver: string,
|
|
131
|
+
market: string,
|
|
132
|
+
exactYtIn: BigNumberish,
|
|
133
|
+
minPtOut: BigNumberish,
|
|
134
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
135
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
136
|
+
): Promise<ContractTransaction>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
swapExactPtForYt(
|
|
140
|
+
receiver: string,
|
|
141
|
+
market: string,
|
|
142
|
+
exactPtIn: BigNumberish,
|
|
143
|
+
minYtOut: BigNumberish,
|
|
144
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
145
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
146
|
+
): Promise<ContractTransaction>;
|
|
147
|
+
|
|
148
|
+
swapExactYtForPt(
|
|
149
|
+
receiver: string,
|
|
150
|
+
market: string,
|
|
151
|
+
exactYtIn: BigNumberish,
|
|
152
|
+
minPtOut: BigNumberish,
|
|
153
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
154
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
155
|
+
): Promise<ContractTransaction>;
|
|
156
|
+
|
|
157
|
+
callStatic: {
|
|
158
|
+
swapExactPtForYt(
|
|
159
|
+
receiver: string,
|
|
160
|
+
market: string,
|
|
161
|
+
exactPtIn: BigNumberish,
|
|
162
|
+
minYtOut: BigNumberish,
|
|
163
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
164
|
+
overrides?: CallOverrides
|
|
165
|
+
): Promise<BigNumber>;
|
|
166
|
+
|
|
167
|
+
swapExactYtForPt(
|
|
168
|
+
receiver: string,
|
|
169
|
+
market: string,
|
|
170
|
+
exactYtIn: BigNumberish,
|
|
171
|
+
minPtOut: BigNumberish,
|
|
172
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
173
|
+
overrides?: CallOverrides
|
|
174
|
+
): Promise<BigNumber>;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
filters: {
|
|
178
|
+
"SwapPtAndYt(address,address,address,int256,int256)"(
|
|
179
|
+
caller?: string | null,
|
|
180
|
+
market?: string | null,
|
|
181
|
+
receiver?: string | null,
|
|
182
|
+
netPtToAccount?: null,
|
|
183
|
+
netYtToAccount?: null
|
|
184
|
+
): SwapPtAndYtEventFilter;
|
|
185
|
+
SwapPtAndYt(
|
|
186
|
+
caller?: string | null,
|
|
187
|
+
market?: string | null,
|
|
188
|
+
receiver?: string | null,
|
|
189
|
+
netPtToAccount?: null,
|
|
190
|
+
netYtToAccount?: null
|
|
191
|
+
): SwapPtAndYtEventFilter;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
estimateGas: {
|
|
195
|
+
swapExactPtForYt(
|
|
196
|
+
receiver: string,
|
|
197
|
+
market: string,
|
|
198
|
+
exactPtIn: BigNumberish,
|
|
199
|
+
minYtOut: BigNumberish,
|
|
200
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
201
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
202
|
+
): Promise<BigNumber>;
|
|
203
|
+
|
|
204
|
+
swapExactYtForPt(
|
|
205
|
+
receiver: string,
|
|
206
|
+
market: string,
|
|
207
|
+
exactYtIn: BigNumberish,
|
|
208
|
+
minPtOut: BigNumberish,
|
|
209
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
210
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
211
|
+
): Promise<BigNumber>;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
populateTransaction: {
|
|
215
|
+
swapExactPtForYt(
|
|
216
|
+
receiver: string,
|
|
217
|
+
market: string,
|
|
218
|
+
exactPtIn: BigNumberish,
|
|
219
|
+
minYtOut: BigNumberish,
|
|
220
|
+
guessTotalPtToSwap: ApproxParamsStruct,
|
|
221
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
222
|
+
): Promise<PopulatedTransaction>;
|
|
223
|
+
|
|
224
|
+
swapExactYtForPt(
|
|
225
|
+
receiver: string,
|
|
226
|
+
market: string,
|
|
227
|
+
exactYtIn: BigNumberish,
|
|
228
|
+
minPtOut: BigNumberish,
|
|
229
|
+
guessTotalPtSwapped: ApproxParamsStruct,
|
|
230
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
231
|
+
): Promise<PopulatedTransaction>;
|
|
232
|
+
};
|
|
233
|
+
}
|