@pendle/core-v2 0.13.0-testnet → 0.13.1-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/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +190 -0
- package/contracts/deployments/43113-core.json +16 -0
- package/contracts/deployments/43113-helper.json +3 -0
- package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/contracts/deployments/43113-testenv.json +22 -0
- package/contracts/deployments/80001-core.json +15 -0
- package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/contracts/deployments/80001-testenv.json +22 -0
- package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +26 -0
- package/package.json +1 -1
- package/typechain-types/ImplicitSwapfeeContract.ts +157 -0
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +247 -0
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +9 -0
- package/typechain-types/index.ts +2 -0
- package/deployments/kovan.json +0 -31
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": {
|
|
3
|
+
"fundKeeper": "0x45e03eB183962884d50eC0Af39B03970333426cb",
|
|
4
|
+
"faucet": "0xf9d2A793b446D200deC9FBB6f29a9DadcD0521cC",
|
|
5
|
+
"WAVAX": "0xe43a7aD7C09d8fAE3ADe7361f0b847b23adD5094",
|
|
6
|
+
"DAI": "0xCd3748CE3Bf75A01D99Bf301668E0748558a592C",
|
|
7
|
+
"USDC": "0xc2A6b8d7d0FAB3749A6Bda84cEdb58D2d58f045e",
|
|
8
|
+
"USDT": "0x9BE875cdBB8409DbC1a553c8ddc1FC05cdDF80Ce",
|
|
9
|
+
"WBTC": "0x82c18D07253603D04d25C8B1F1E60134a59C39ce",
|
|
10
|
+
"WETH": "0x1e2e40697603CA5b5ffc102c9D7A3310EA3f2Aa3",
|
|
11
|
+
"qiUSDC": "0xEE3a174F1478198fBc669132B1e2cc13B5686F94",
|
|
12
|
+
"qiWETH": "0xE5710EC5e4CeB255fb14d2c2BFC93E64d0c30A2c",
|
|
13
|
+
"qiAVAX": "0xf9aEd3b927dce44C6d53B334Cb759f4D230D9b9c"
|
|
14
|
+
},
|
|
15
|
+
"benqi": {
|
|
16
|
+
"comptroller": "0x4Af3e9CA6f86E655C01f03C13519BcAF867286EE",
|
|
17
|
+
"QI": "0x63554C4d2038c9B7973190f3E41f5158939Fe972",
|
|
18
|
+
"interestRateModel": "0xd66C253151539b3bE0a0C11699fB024E054227d4",
|
|
19
|
+
"qiErc20Impl": "0x184622Dd7B63299F87CBf21f11FF25c9c302fd5d",
|
|
20
|
+
"oracle": "0x44b789cBC190b7888d438cEb58f1Eb8A3Ae2d897"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
+
"network": 80001,
|
|
4
|
+
"splitter": "0xC400c9D43a115599677EFde348784393E6E337Fb",
|
|
5
|
+
"celerBus": "0x7d43AABC515C356145049227CeE54B608342c0ad",
|
|
6
|
+
"treasury": "0xbAADca61726613E391b04c00D53ED738bF5282e0",
|
|
7
|
+
"PENDLE": "0x12B1b729024238D9850110dAB3cbBe732edA3151",
|
|
8
|
+
"yieldContractFactory": "0xceC760308Bb2a7672163Cda050a558BcdAE556B0",
|
|
9
|
+
"marketFactory": "0xB8dc44Da586A030fC23ABb6B1B2aa5a1d991B205",
|
|
10
|
+
"router": "0xaF173694aaAbfA708E35c2920e55Aac4A6184A42",
|
|
11
|
+
"routerStatic": "0xD05B49500F35d879F3Bf220c81BE3ff9d73Ca205",
|
|
12
|
+
"receiverEndpoint": "0x32f5b40Ae709314741D3b257c0838F438804Ad74",
|
|
13
|
+
"vePendle": "0x076990Fe896644989d8013AD32C384a6BA3Bb725",
|
|
14
|
+
"gaugeController": "0xEbaD5fc9Cf065FA51BB32D20948ba4A67595c6e5"
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"symbol": "SCY-qiUSDC",
|
|
3
|
+
"SCY": "0x36Bd12bdad524092E6a29540983C546a424A576A",
|
|
4
|
+
"expiry": 1675382400,
|
|
5
|
+
"PT": "0xc1D97E0AfD97dAb97156d6a7e49bdd6773513d63",
|
|
6
|
+
"YT": "0x3ab2B09929e1122e34754E88f93012df0000814d",
|
|
7
|
+
"market": "0x16b0eF5E1d4cEa7E91B7705fC6AdbdC4534288c0"
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"symbol": "SCY-qiWETH",
|
|
3
|
+
"SCY": "0x449f676be160C5C682E1E64934f29641D6096116",
|
|
4
|
+
"expiry": 1669852800,
|
|
5
|
+
"PT": "0x54Ec22Cb36077fdC53D21Db28aE5cBD6E9Dae375",
|
|
6
|
+
"YT": "0x1Ca4eE071FB1d326D60c58188bA562EA971Ed137",
|
|
7
|
+
"market": "0x600B627FBca59a109407065C2991e6fD67a1b312"
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": {
|
|
3
|
+
"fundKeeper": "0x7D301Cc4F91A9eDd8EDE1801344bd6516b5FA3d2",
|
|
4
|
+
"faucet": "0x35AC4A286F1f1234f09Ff43f42B1f7767c6fAA91",
|
|
5
|
+
"WAVAX": "0xdF3601014686674e53d1Fa52F7602525483F9122",
|
|
6
|
+
"DAI": "0x829bF32457394D1f1fA8C1b151cE5017bb04C17D",
|
|
7
|
+
"USDC": "0x5Ea8c8e02c2D413165C1ADcBb6916B0851f6cd73",
|
|
8
|
+
"USDT": "0xAFC1ac698E9b54C240e6Ebc7d64200BB84f2E4cd",
|
|
9
|
+
"WBTC": "0x4d89990738A071B9E597Ea442f2ba58e6EA97184",
|
|
10
|
+
"WETH": "0x1A6fCc85557BC4fB7B534ed835a03EF056552D52",
|
|
11
|
+
"qiUSDC": "0x76818c92936662e9b24f74395f38634C35604720",
|
|
12
|
+
"qiWETH": "0x0b9d0756AeaD1cBc6bC4e9f30FeEa377a73d407F",
|
|
13
|
+
"qiAVAX": "0x98030D8f342aA21424B07059Cb1405A179A1F668"
|
|
14
|
+
},
|
|
15
|
+
"benqi": {
|
|
16
|
+
"comptroller": "0x0d18d7a0B27CB5C2F33cDc0a087B7182a72e0fAb",
|
|
17
|
+
"QI": "0x9F10C77EF63a5706e53D82B249D9195BeB5774fd",
|
|
18
|
+
"interestRateModel": "0xfF334644479e70ae5C9545218574B17e9aF7A5DD",
|
|
19
|
+
"qiErc20Impl": "0xA3972f97074552de27cF747A126b2c5F36935818",
|
|
20
|
+
"oracle": "0x324D838b26Eb73786bDBBc53bb0682F1EBB50603"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../interfaces/IPMarket.sol";
|
|
5
|
+
|
|
6
|
+
contract ImplicitSwapfeeContract {
|
|
7
|
+
using MarketMathCore for MarketState;
|
|
8
|
+
|
|
9
|
+
int256 public constant K = 100;
|
|
10
|
+
|
|
11
|
+
constructor() {}
|
|
12
|
+
|
|
13
|
+
function execute(
|
|
14
|
+
address market,
|
|
15
|
+
MarketState calldata prevState,
|
|
16
|
+
int256 netPtToAccount
|
|
17
|
+
) external view returns (int256 netScyToAccount) {
|
|
18
|
+
(,, IPYieldToken YT) = IPMarket(market).readTokens();
|
|
19
|
+
PYIndex index = PYIndex.wrap(YT.pyIndexStored());
|
|
20
|
+
|
|
21
|
+
for(int256 i = 0; i < K; ++i) {
|
|
22
|
+
(int256 scyToAccount, ) = prevState.executeTradeCore(index, netPtToAccount / K, block.timestamp);
|
|
23
|
+
netScyToAccount += scyToAccount;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
PopulatedTransaction,
|
|
11
|
+
Signer,
|
|
12
|
+
utils,
|
|
13
|
+
} from "ethers";
|
|
14
|
+
import { FunctionFragment, Result } from "@ethersproject/abi";
|
|
15
|
+
import { Listener, Provider } from "@ethersproject/providers";
|
|
16
|
+
import type {
|
|
17
|
+
TypedEventFilter,
|
|
18
|
+
TypedEvent,
|
|
19
|
+
TypedListener,
|
|
20
|
+
OnEvent,
|
|
21
|
+
} from "./common";
|
|
22
|
+
|
|
23
|
+
export type MarketStateStruct = {
|
|
24
|
+
totalPt: BigNumberish;
|
|
25
|
+
totalScy: BigNumberish;
|
|
26
|
+
totalLp: BigNumberish;
|
|
27
|
+
treasury: string;
|
|
28
|
+
scalarRoot: BigNumberish;
|
|
29
|
+
lnFeeRateRoot: BigNumberish;
|
|
30
|
+
expiry: BigNumberish;
|
|
31
|
+
reserveFeePercent: BigNumberish;
|
|
32
|
+
lastLnImpliedRate: BigNumberish;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type MarketStateStructOutput = [
|
|
36
|
+
BigNumber,
|
|
37
|
+
BigNumber,
|
|
38
|
+
BigNumber,
|
|
39
|
+
string,
|
|
40
|
+
BigNumber,
|
|
41
|
+
BigNumber,
|
|
42
|
+
BigNumber,
|
|
43
|
+
BigNumber,
|
|
44
|
+
BigNumber
|
|
45
|
+
] & {
|
|
46
|
+
totalPt: BigNumber;
|
|
47
|
+
totalScy: BigNumber;
|
|
48
|
+
totalLp: BigNumber;
|
|
49
|
+
treasury: string;
|
|
50
|
+
scalarRoot: BigNumber;
|
|
51
|
+
lnFeeRateRoot: BigNumber;
|
|
52
|
+
expiry: BigNumber;
|
|
53
|
+
reserveFeePercent: BigNumber;
|
|
54
|
+
lastLnImpliedRate: BigNumber;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export interface ImplicitSwapfeeContractInterface extends utils.Interface {
|
|
58
|
+
contractName: "ImplicitSwapfeeContract";
|
|
59
|
+
functions: {
|
|
60
|
+
"K()": FunctionFragment;
|
|
61
|
+
"execute(address,(int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),int256)": FunctionFragment;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
encodeFunctionData(functionFragment: "K", values?: undefined): string;
|
|
65
|
+
encodeFunctionData(
|
|
66
|
+
functionFragment: "execute",
|
|
67
|
+
values: [string, MarketStateStruct, BigNumberish]
|
|
68
|
+
): string;
|
|
69
|
+
|
|
70
|
+
decodeFunctionResult(functionFragment: "K", data: BytesLike): Result;
|
|
71
|
+
decodeFunctionResult(functionFragment: "execute", data: BytesLike): Result;
|
|
72
|
+
|
|
73
|
+
events: {};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ImplicitSwapfeeContract extends BaseContract {
|
|
77
|
+
contractName: "ImplicitSwapfeeContract";
|
|
78
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
79
|
+
attach(addressOrName: string): this;
|
|
80
|
+
deployed(): Promise<this>;
|
|
81
|
+
|
|
82
|
+
interface: ImplicitSwapfeeContractInterface;
|
|
83
|
+
|
|
84
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
85
|
+
event: TypedEventFilter<TEvent>,
|
|
86
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
87
|
+
toBlock?: string | number | undefined
|
|
88
|
+
): Promise<Array<TEvent>>;
|
|
89
|
+
|
|
90
|
+
listeners<TEvent extends TypedEvent>(
|
|
91
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
92
|
+
): Array<TypedListener<TEvent>>;
|
|
93
|
+
listeners(eventName?: string): Array<Listener>;
|
|
94
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
95
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
96
|
+
): this;
|
|
97
|
+
removeAllListeners(eventName?: string): this;
|
|
98
|
+
off: OnEvent<this>;
|
|
99
|
+
on: OnEvent<this>;
|
|
100
|
+
once: OnEvent<this>;
|
|
101
|
+
removeListener: OnEvent<this>;
|
|
102
|
+
|
|
103
|
+
functions: {
|
|
104
|
+
K(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
105
|
+
|
|
106
|
+
execute(
|
|
107
|
+
market: string,
|
|
108
|
+
prevState: MarketStateStruct,
|
|
109
|
+
netPtToAccount: BigNumberish,
|
|
110
|
+
overrides?: CallOverrides
|
|
111
|
+
): Promise<[BigNumber] & { netScyToAccount: BigNumber }>;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
K(overrides?: CallOverrides): Promise<BigNumber>;
|
|
115
|
+
|
|
116
|
+
execute(
|
|
117
|
+
market: string,
|
|
118
|
+
prevState: MarketStateStruct,
|
|
119
|
+
netPtToAccount: BigNumberish,
|
|
120
|
+
overrides?: CallOverrides
|
|
121
|
+
): Promise<BigNumber>;
|
|
122
|
+
|
|
123
|
+
callStatic: {
|
|
124
|
+
K(overrides?: CallOverrides): Promise<BigNumber>;
|
|
125
|
+
|
|
126
|
+
execute(
|
|
127
|
+
market: string,
|
|
128
|
+
prevState: MarketStateStruct,
|
|
129
|
+
netPtToAccount: BigNumberish,
|
|
130
|
+
overrides?: CallOverrides
|
|
131
|
+
): Promise<BigNumber>;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
filters: {};
|
|
135
|
+
|
|
136
|
+
estimateGas: {
|
|
137
|
+
K(overrides?: CallOverrides): Promise<BigNumber>;
|
|
138
|
+
|
|
139
|
+
execute(
|
|
140
|
+
market: string,
|
|
141
|
+
prevState: MarketStateStruct,
|
|
142
|
+
netPtToAccount: BigNumberish,
|
|
143
|
+
overrides?: CallOverrides
|
|
144
|
+
): Promise<BigNumber>;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
populateTransaction: {
|
|
148
|
+
K(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
149
|
+
|
|
150
|
+
execute(
|
|
151
|
+
market: string,
|
|
152
|
+
prevState: MarketStateStruct,
|
|
153
|
+
netPtToAccount: BigNumberish,
|
|
154
|
+
overrides?: CallOverrides
|
|
155
|
+
): Promise<PopulatedTransaction>;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
|
|
5
|
+
import { Provider, TransactionRequest } from "@ethersproject/providers";
|
|
6
|
+
import type {
|
|
7
|
+
ImplicitSwapfeeContract,
|
|
8
|
+
ImplicitSwapfeeContractInterface,
|
|
9
|
+
} from "../ImplicitSwapfeeContract";
|
|
10
|
+
|
|
11
|
+
const _abi = [
|
|
12
|
+
{
|
|
13
|
+
inputs: [],
|
|
14
|
+
stateMutability: "nonpayable",
|
|
15
|
+
type: "constructor",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
internalType: "int256",
|
|
21
|
+
name: "exchangeRate",
|
|
22
|
+
type: "int256",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
name: "MarketExchangeRateBelowOne",
|
|
26
|
+
type: "error",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
inputs: [],
|
|
30
|
+
name: "MarketExpired",
|
|
31
|
+
type: "error",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{
|
|
36
|
+
internalType: "int256",
|
|
37
|
+
name: "currentAmount",
|
|
38
|
+
type: "int256",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
internalType: "int256",
|
|
42
|
+
name: "requiredAmount",
|
|
43
|
+
type: "int256",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
name: "MarketInsufficientPtForTrade",
|
|
47
|
+
type: "error",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
inputs: [],
|
|
51
|
+
name: "MarketProportionMustNotEqualOne",
|
|
52
|
+
type: "error",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
inputs: [
|
|
56
|
+
{
|
|
57
|
+
internalType: "int256",
|
|
58
|
+
name: "proportion",
|
|
59
|
+
type: "int256",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
internalType: "int256",
|
|
63
|
+
name: "maxProportion",
|
|
64
|
+
type: "int256",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
name: "MarketProportionTooHigh",
|
|
68
|
+
type: "error",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
inputs: [
|
|
72
|
+
{
|
|
73
|
+
internalType: "int256",
|
|
74
|
+
name: "rateScalar",
|
|
75
|
+
type: "int256",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
name: "MarketRateScalarBelowZero",
|
|
79
|
+
type: "error",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "MarketZeroLnImpliedRate",
|
|
84
|
+
type: "error",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
inputs: [
|
|
88
|
+
{
|
|
89
|
+
internalType: "int256",
|
|
90
|
+
name: "totalPt",
|
|
91
|
+
type: "int256",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
internalType: "int256",
|
|
95
|
+
name: "totalAsset",
|
|
96
|
+
type: "int256",
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
name: "MarketZeroTotalPtOrTotalAsset",
|
|
100
|
+
type: "error",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
inputs: [],
|
|
104
|
+
name: "K",
|
|
105
|
+
outputs: [
|
|
106
|
+
{
|
|
107
|
+
internalType: "int256",
|
|
108
|
+
name: "",
|
|
109
|
+
type: "int256",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
stateMutability: "view",
|
|
113
|
+
type: "function",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
inputs: [
|
|
117
|
+
{
|
|
118
|
+
internalType: "address",
|
|
119
|
+
name: "market",
|
|
120
|
+
type: "address",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
components: [
|
|
124
|
+
{
|
|
125
|
+
internalType: "int256",
|
|
126
|
+
name: "totalPt",
|
|
127
|
+
type: "int256",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
internalType: "int256",
|
|
131
|
+
name: "totalScy",
|
|
132
|
+
type: "int256",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
internalType: "int256",
|
|
136
|
+
name: "totalLp",
|
|
137
|
+
type: "int256",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
internalType: "address",
|
|
141
|
+
name: "treasury",
|
|
142
|
+
type: "address",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
internalType: "int256",
|
|
146
|
+
name: "scalarRoot",
|
|
147
|
+
type: "int256",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
internalType: "uint256",
|
|
151
|
+
name: "lnFeeRateRoot",
|
|
152
|
+
type: "uint256",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
internalType: "uint256",
|
|
156
|
+
name: "expiry",
|
|
157
|
+
type: "uint256",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
internalType: "uint256",
|
|
161
|
+
name: "reserveFeePercent",
|
|
162
|
+
type: "uint256",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
internalType: "uint256",
|
|
166
|
+
name: "lastLnImpliedRate",
|
|
167
|
+
type: "uint256",
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
internalType: "struct MarketState",
|
|
171
|
+
name: "prevState",
|
|
172
|
+
type: "tuple",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
internalType: "int256",
|
|
176
|
+
name: "netPtToAccount",
|
|
177
|
+
type: "int256",
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
name: "execute",
|
|
181
|
+
outputs: [
|
|
182
|
+
{
|
|
183
|
+
internalType: "int256",
|
|
184
|
+
name: "netScyToAccount",
|
|
185
|
+
type: "int256",
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
stateMutability: "view",
|
|
189
|
+
type: "function",
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
const _bytecode =
|
|
194
|
+
"0x608060405234801561001057600080fd5b50611615806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063755bb5751461003b578063a932492f14610060575b600080fd5b61004e61004936600461130e565b610068565b60405190815260200160405180910390f35b61004e606481565b600080846001600160a01b0316632c8ce6bc6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156100a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100cd919061135b565b925050506000816001600160a01b031663d2a3584e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610111573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013591906113a8565b905060005b606481121561018d57600061016c836101546064896113ed565b42610164368c90038c018c611452565b929190610197565b50905061017981866114d4565b94505080610186906114fc565b905061013a565b5050509392505050565b6000806101a88660c0015184610232565b156101c65760405163b2094b5960e01b815260040160405180910390fd5b855184126101f9578551604051632185509b60e21b81526004810191909152602481018590526044015b60405180910390fd5b600061020687878661023d565b905061021487828888610346565b90935091506102288782888887878a61048c565b5094509492505050565b808211155b92915050565b6102686040518060800160405280600081526020016000815260200160008152602001600081525090565b6102768460c0015183610232565b156102945760405163b2094b5960e01b815260040160405180910390fd5b6000828560c001516102a6919061151b565b90506102b2858261051e565b825260208501516102c490859061057f565b6020830152845115806102d957506020820151155b15610307578451602083015160405163b1c4aefb60e01b8152600481019290925260248201526044016101f0565b610325856000015186610100015184602001518560000151856105be565b604083015260a0850151610339908261063f565b6060830152509392505050565b6000806000610368876000015187602001518860000151896040015188610678565b9050600061037e6103798684610735565b610764565b606088015190915060008613156103ed57600061039b8483610735565b9050670de0b6b3a76400008112156103c95760405163329e322960e21b8152600481018290526024016101f0565b6103e56103de83670de0b6b3a764000061152e565b8490610772565b91505061041a565b6104178161040381670de0b6b3a764000061152e565b61040d9085611555565b61037991906113ed565b90505b6000606461042b8b60e00151610790565b6104359084611555565b61043f91906113ed565b9050600061044d838561152e565b9050600081126104665761046189826107aa565b610470565b61047089826107d7565b965061047c89836107aa565b9550505050505094509492505050565b6000818860c0015161049e919061151b565b88519091506104ad9086610804565b88526104c76104bc84866114d4565b60208a015190610804565b6020890181905288516104ec916104df90899061057f565b895160408b015185610852565b610100890181905260000361051457604051635534d70f60e11b815260040160405180910390fd5b5050505050505050565b600061052982610790565b61054061053b6201518061016d611585565b610790565b846080015161054f9190611555565b61055991906113ed565b90506000811361023757604051630e520c3b60e11b8152600481018290526024016101f0565b60008060008312610591576001610595565b6000195b90506105ac61053b856105a7866108aa565b6108c1565b6105b69082611555565b949350505050565b6000806105cb868461063f565b9050670de0b6b3a76400008112156105f95760405163329e322960e21b8152600481018290526024016101f0565b600061060f610608878a6114d4565b8990610735565b9050600061061c826108e0565b90506106288187610735565b610632908461152e565b9998505050505050505050565b6000806106516201518061016d611585565b61065b8486611585565b610665919061159c565b90506105b661067382610790565b610933565b6000806106858784610804565b9050600061069d610696888a6114d4565b8390610735565b9050670d529ae9e86000008113156106d957604051637e34684f60e11b815260048101829052670d529ae9e860000060248201526044016101f0565b60006106e4826108e0565b9050856106f18289610735565b6106fb91906114d4565b9350670de0b6b3a76400008412156107295760405163329e322960e21b8152600481018590526024016101f0565b50505095945050505050565b60008061074a670de0b6b3a764000085611555565b905082818161075b5761075b6113c1565b05949350505050565b600061023782600019611555565b60008061077f8385611555565b9050670de0b6b3a76400008161075b565b60006001600160ff1b038211156107a657600080fd5b5090565b600080600083126107bc5760016107c0565b6000195b90506105ac61053b856107d2866108aa565b610d48565b600080600083126107e95760016107ed565b6000195b90506105ac61053b856107ff866108aa565b610d5d565b6000818312156108415760405162461bcd60e51b81526020600482015260086024820152676e6567617469766560c01b60448201526064016101f0565b61084b828461152e565b9392505050565b600080610863878787876000610678565b9050600061087861087383610d89565b610e1a565b90508361088a6201518061016d611585565b6108949083611585565b61089e919061159c565b98975050505050505050565b60008082136107a6576108bc826115b0565b610237565b6000670de0b6b3a76400006108d68484611585565b61084b919061159c565b6000670de0b6b3a7640000820361090a5760405163a9c8b14d60e01b815260040160405180910390fd5b600061092861092184670de0b6b3a764000061152e565b8490610735565b905061084b81610d89565b6000680238fd42c5cf03ffff198212158015610958575068070c1cc73b00c800008213155b6109975760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a5908195e1c1bdb995b9d60821b60448201526064016101f0565b60008212156109cf576109ac82600003610933565b6a0c097ce7bc90715b34b9f160241b816109c8576109c86113c1565b0592915050565b60006806f05b59d3b20000008312610a0d57506806f05b59d3b1ffffff199091019072195e54c5dd42177f53a27172fa9ec63026282760241b610a43565b6803782dace9d90000008312610a3f57506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380610a43565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412610a935768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412610acf576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412610b0957682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412610b43576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412610b7c57680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412610bb55768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412610bee576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412610c275768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b6000826108d6670de0b6b3a764000084611585565b600082600181610d75670de0b6b3a764000086611585565b610d7f91906115cc565b6108d6919061151b565b6000808213610dca5760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620626f756e647360981b60448201526064016101f0565b670c7d713b49da000082138015610de85750670f43fc2c04ee000082125b15610e0c57670de0b6b3a7640000610dff83610e29565b816109c8576109c86113c1565b61023782610f48565b919050565b6000808212156107a657600080fd5b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff1985010281610e6a57610e6a6113c1565b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f82050160020295945050505050565b6000670de0b6b3a7640000821215610f8957610f80826a0c097ce7bc90715b34b9f160241b81610f7a57610f7a6113c1565b05610f48565b60000392915050565b6000775803bcc5cb9634ba4cfb2213f784019318ed4dcb6017880f60361b8312610fd45772195e54c5dd42177f53a27172fa9ec63026282760241b830592506806f05b59d3b2000000015b6f8bcc0026baae9e45e470190267a230cf60191b831261100b576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff00840008312611053576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a700831261108e576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf85083126110c557693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e283126110fc57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126111315768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261115c57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312611191576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f177578893793783126111c6576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b28660383126111fa576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac831261122e576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d631000008086030281611257576112576113c1565b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6001600160a01b038116811461130057600080fd5b50565b8035610e15816112eb565b600080600083850361016081121561132557600080fd5b8435611330816112eb565b9350610120601f198201121561134557600080fd5b5060208401915061014084013590509250925092565b60008060006060848603121561137057600080fd5b835161137b816112eb565b602085015190935061138c816112eb565b604085015190925061139d816112eb565b809150509250925092565b6000602082840312156113ba57600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000826113fc576113fc6113c1565b600160ff1b821460001984141615611416576114166113d7565b500590565b60405161012081016001600160401b038111828210171561144c57634e487b7160e01b600052604160045260246000fd5b60405290565b6000610120828403121561146557600080fd5b61146d61141b565b82358152602083013560208201526040830135604082015261149160608401611303565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e08201526101008084013581830152508091505092915050565b80820182811260008312801582168215821617156114f4576114f46113d7565b505092915050565b60006001600160ff1b018201611514576115146113d7565b5060010190565b81810381811115610237576102376113d7565b818103600083128015838313168383128216171561154e5761154e6113d7565b5092915050565b80820260008212600160ff1b84141615611571576115716113d7565b8181058314821517610237576102376113d7565b8082028115828204841417610237576102376113d7565b6000826115ab576115ab6113c1565b500490565b6000600160ff1b82016115c5576115c56113d7565b5060000390565b80820180821115610237576102376113d756fea26469706673582212201b4ef25ff8ebae0bd00e3267cc339a4a20e17e3ed9dd6ddafab6591a9e5733f764736f6c63430008110033";
|
|
195
|
+
|
|
196
|
+
type ImplicitSwapfeeContractConstructorParams =
|
|
197
|
+
| [signer?: Signer]
|
|
198
|
+
| ConstructorParameters<typeof ContractFactory>;
|
|
199
|
+
|
|
200
|
+
const isSuperArgs = (
|
|
201
|
+
xs: ImplicitSwapfeeContractConstructorParams
|
|
202
|
+
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
|
203
|
+
|
|
204
|
+
export class ImplicitSwapfeeContract__factory extends ContractFactory {
|
|
205
|
+
constructor(...args: ImplicitSwapfeeContractConstructorParams) {
|
|
206
|
+
if (isSuperArgs(args)) {
|
|
207
|
+
super(...args);
|
|
208
|
+
} else {
|
|
209
|
+
super(_abi, _bytecode, args[0]);
|
|
210
|
+
}
|
|
211
|
+
this.contractName = "ImplicitSwapfeeContract";
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
deploy(
|
|
215
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
216
|
+
): Promise<ImplicitSwapfeeContract> {
|
|
217
|
+
return super.deploy(overrides || {}) as Promise<ImplicitSwapfeeContract>;
|
|
218
|
+
}
|
|
219
|
+
getDeployTransaction(
|
|
220
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
221
|
+
): TransactionRequest {
|
|
222
|
+
return super.getDeployTransaction(overrides || {});
|
|
223
|
+
}
|
|
224
|
+
attach(address: string): ImplicitSwapfeeContract {
|
|
225
|
+
return super.attach(address) as ImplicitSwapfeeContract;
|
|
226
|
+
}
|
|
227
|
+
connect(signer: Signer): ImplicitSwapfeeContract__factory {
|
|
228
|
+
return super.connect(signer) as ImplicitSwapfeeContract__factory;
|
|
229
|
+
}
|
|
230
|
+
static readonly contractName: "ImplicitSwapfeeContract";
|
|
231
|
+
public readonly contractName: "ImplicitSwapfeeContract";
|
|
232
|
+
static readonly bytecode = _bytecode;
|
|
233
|
+
static readonly abi = _abi;
|
|
234
|
+
static createInterface(): ImplicitSwapfeeContractInterface {
|
|
235
|
+
return new utils.Interface(_abi) as ImplicitSwapfeeContractInterface;
|
|
236
|
+
}
|
|
237
|
+
static connect(
|
|
238
|
+
address: string,
|
|
239
|
+
signerOrProvider: Signer | Provider
|
|
240
|
+
): ImplicitSwapfeeContract {
|
|
241
|
+
return new Contract(
|
|
242
|
+
address,
|
|
243
|
+
_abi,
|
|
244
|
+
signerOrProvider
|
|
245
|
+
) as ImplicitSwapfeeContract;
|
|
246
|
+
}
|
|
247
|
+
}
|