@gearbox-protocol/sdk 0.0.100 → 0.0.103
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/.eslintignore +4 -0
- package/.eslintrc.js +52 -0
- package/.husky/pre-push +4 -0
- package/lib/apy/convexAPY.d.ts +8 -0
- package/lib/apy/convexAPY.js +200 -0
- package/lib/apy/lidoAPY.d.ts +4 -0
- package/lib/apy/lidoAPY.js +103 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +2 -1
- package/lib/contracts/contracts.d.ts +9 -4
- package/lib/contracts/contracts.js +52 -14
- package/lib/contracts/contractsRegister.js +16 -4
- package/lib/core/constants.d.ts +7 -1
- package/lib/core/constants.js +11 -5
- package/lib/core/creditAccount.d.ts +3 -1
- package/lib/core/creditAccount.js +33 -31
- package/lib/core/creditManager.d.ts +13 -2
- package/lib/core/creditManager.js +77 -33
- package/lib/core/creditSession.js +14 -3
- package/lib/core/errors.d.ts +10 -0
- package/lib/core/errors.js +16 -1
- package/lib/core/eventOrTx.d.ts +1 -1
- package/lib/core/events.d.ts +19 -19
- package/lib/core/events.js +32 -30
- package/lib/core/multicall.d.ts +1 -1
- package/lib/core/pool.d.ts +2 -2
- package/lib/core/pool.js +8 -12
- package/lib/core/price.d.ts +2 -0
- package/lib/core/price.js +14 -0
- package/lib/core/strategy.d.ts +36 -0
- package/lib/core/strategy.js +57 -0
- package/lib/core/tokenDistributor.js +1 -1
- package/lib/core/transactions.d.ts +18 -3
- package/lib/core/transactions.js +39 -3
- package/lib/index.d.ts +8 -3
- package/lib/index.js +9 -4
- package/lib/oracles/priceFeeds.js +1 -1
- package/lib/pathfinder/convexLP.d.ts +1 -1
- package/lib/pathfinder/convexLP.js +26 -29
- package/lib/pathfinder/curveLP.d.ts +1 -1
- package/lib/pathfinder/curveLP.js +5 -7
- package/lib/pathfinder/path.d.ts +1 -1
- package/lib/pathfinder/path.js +38 -42
- package/lib/pathfinder/trade.d.ts +1 -2
- package/lib/pathfinder/tradeTypes.d.ts +5 -5
- package/lib/pathfinder/yVault.d.ts +2 -2
- package/lib/pathfinder/yVault.js +22 -19
- package/lib/payload/creditAccount.d.ts +4 -26
- package/lib/payload/creditManager.d.ts +3 -25
- package/lib/payload/pool.d.ts +2 -17
- package/lib/payload/pool.js +0 -1
- package/lib/strategies/curve.d.ts +6 -60
- package/lib/strategies/curve.js +6 -0
- package/lib/strategies/uniswapV2.js +3 -19
- package/lib/strategies/uniswapV3.js +1 -1
- package/lib/strategies/yearn.js +15 -11
- package/lib/tokens/convex.d.ts +3 -3
- package/lib/tokens/curveLP.d.ts +2 -2
- package/lib/tokens/curveLP.js +1 -1
- package/lib/tokens/gear.d.ts +2 -2
- package/lib/tokens/gear.js +1 -1
- package/lib/tokens/normal.d.ts +1 -1
- package/lib/tokens/token.js +9 -9
- package/lib/tokens/tokenData.d.ts +3 -1
- package/lib/tokens/tokenData.js +10 -8
- package/lib/tokens/yearn.d.ts +3 -3
- package/lib/utils/errors.d.ts +6 -0
- package/lib/utils/errors.js +13 -0
- package/lib/utils/formatter.d.ts +2 -1
- package/lib/utils/formatter.js +23 -15
- package/lib/utils/loading.d.ts +2 -1
- package/lib/utils/loading.js +9 -13
- package/lib/utils/mappers.d.ts +2 -1
- package/lib/utils/mappers.js +13 -5
- package/lib/utils/multicall.js +4 -3
- package/lib/utils/network.js +2 -2
- package/lib/utils/repeater.js +12 -24
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/validate.js +1 -1
- package/package.json +26 -8
- package/src/apy/convexAPY.ts +250 -0
- package/src/apy/lidoAPY.ts +89 -0
- package/src/config.ts +2 -1
- package/src/contracts/contracts.ts +73 -19
- package/src/contracts/contractsRegister.ts +19 -4
- package/src/core/constants.ts +11 -4
- package/src/core/creditAccount.ts +69 -37
- package/src/core/creditManager.ts +256 -148
- package/src/core/creditOperation.ts +7 -7
- package/src/core/creditSession.ts +25 -5
- package/src/core/errors.ts +25 -0
- package/src/core/eventOrTx.ts +8 -5
- package/src/core/events.ts +978 -911
- package/src/core/history.ts +46 -46
- package/src/core/multicall.ts +1 -1
- package/src/core/operations.ts +6 -0
- package/src/core/pool.ts +75 -58
- package/src/core/price.ts +13 -0
- package/src/core/strategy.ts +134 -0
- package/src/core/tokenDistributor.ts +2 -2
- package/src/core/transactions.ts +427 -350
- package/src/index.ts +9 -4
- package/src/oracles/priceFeeds.ts +523 -523
- package/src/pathfinder/contracts.ts +15 -13
- package/src/pathfinder/convexLP.ts +29 -25
- package/src/pathfinder/curveLP.ts +57 -53
- package/src/pathfinder/path.ts +158 -150
- package/src/pathfinder/priority.ts +11 -11
- package/src/pathfinder/trade.ts +84 -77
- package/src/pathfinder/tradeTypes.ts +98 -94
- package/src/pathfinder/yVault.ts +79 -63
- package/src/payload/creditAccount.ts +4 -26
- package/src/payload/creditManager.ts +4 -26
- package/src/payload/pool.ts +2 -19
- package/src/payload/token.ts +3 -3
- package/src/strategies/convex.ts +217 -210
- package/src/strategies/creditFacade.ts +70 -53
- package/src/strategies/curve.ts +263 -194
- package/src/strategies/lido.ts +33 -37
- package/src/strategies/uniswapV2.ts +90 -112
- package/src/strategies/uniswapV3.ts +114 -91
- package/src/strategies/yearn.ts +58 -62
- package/src/tokens/connectors.ts +6 -6
- package/src/tokens/convex.ts +297 -296
- package/src/tokens/curveLP.ts +170 -165
- package/src/tokens/gear.ts +47 -45
- package/src/tokens/normal.ts +801 -802
- package/src/tokens/token.ts +19 -10
- package/src/tokens/tokenData.ts +19 -9
- package/src/tokens/tokenType.ts +11 -11
- package/src/tokens/yearn.ts +126 -124
- package/src/utils/errors.ts +11 -0
- package/src/utils/formatter.ts +26 -18
- package/src/utils/loading.ts +14 -6
- package/src/utils/mappers.ts +15 -6
- package/src/utils/multicall.ts +6 -9
- package/src/utils/network.ts +21 -21
- package/src/utils/repeater.ts +2 -2
- package/src/utils/types.ts +6 -2
- package/src/utils/validate.ts +1 -1
- package/lib/core/adapters.d.ts +0 -15
- package/lib/core/adapters.js +0 -19
- package/lib/core/contracts.d.ts +0 -67
- package/lib/core/contracts.js +0 -254
- package/lib/core/contractsRegister.d.ts +0 -2
- package/lib/core/contractsRegister.js +0 -58
- package/lib/core/creditCard.d.ts +0 -13
- package/lib/core/creditCard.js +0 -2
- package/lib/core/oracles.d.ts +0 -38
- package/lib/core/oracles.js +0 -12
- package/lib/core/priceFeeds.d.ts +0 -3
- package/lib/core/priceFeeds.js +0 -492
- package/lib/core/protocols.d.ts +0 -13
- package/lib/core/protocols.js +0 -39
- package/lib/core/swap.d.ts +0 -4
- package/lib/core/swap.js +0 -8
- package/lib/core/trade.d.ts +0 -35
- package/lib/core/trade.js +0 -62
- package/lib/core/tradeTypes.d.ts +0 -79
- package/lib/core/tradeTypes.js +0 -21
- package/lib/utils/events.d.ts +0 -2
- package/lib/utils/events.js +0 -13
- package/src/utils/events.ts +0 -10
package/src/core/events.ts
CHANGED
|
@@ -1,403 +1,418 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {formatBN} from "../utils/formatter";
|
|
4
|
-
import {LEVERAGE_DECIMALS} from "./constants";
|
|
5
|
-
import {EVMEvent, EVMTx, EVMEventProps} from "./eventOrTx";
|
|
6
|
-
import {getContractName} from "../contracts/contractsRegister";
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
import { TokenData } from "../tokens/tokenData";
|
|
3
|
+
import { formatBN } from "../utils/formatter";
|
|
4
|
+
import { LEVERAGE_DECIMALS, PERCENTAGE_DECIMALS } from "./constants";
|
|
5
|
+
import { EVMEvent, EVMTx, EVMEventProps } from "./eventOrTx";
|
|
6
|
+
import { getContractName } from "../contracts/contractsRegister";
|
|
7
7
|
|
|
8
8
|
export interface EventSerialized {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
type:
|
|
10
|
+
| "EventAddLiquidity"
|
|
11
|
+
| "EventRemoveLiquidity"
|
|
12
|
+
| "EventOpenCreditAccount"
|
|
13
|
+
| "EventCloseCreditAccount"
|
|
14
|
+
| "EventLiquidateCreditAccount"
|
|
15
|
+
| "EventRepayCreditAccount"
|
|
16
|
+
| "EventAddCollateral"
|
|
17
|
+
| "EventIncreaseBorrowAmount"
|
|
18
|
+
| "EventCMNewParameters"
|
|
19
|
+
| "EventTokenAllowed"
|
|
20
|
+
| "EventTokenForbidden"
|
|
21
|
+
| "EventContractAllowed"
|
|
22
|
+
| "EventContractForbidden"
|
|
23
|
+
| "EventNewFastCheckParameters"
|
|
24
|
+
| "EventPriceOracleUpdated"
|
|
25
|
+
| "EventTransferPluginAllowed"
|
|
26
|
+
| "EventNewInterestRateModel"
|
|
27
|
+
| "EventNewCreditManagerConnected"
|
|
28
|
+
| "EventBorrowForbidden"
|
|
29
|
+
| "EventNewExpectedLiquidityLimit"
|
|
30
|
+
| "EventNewWithdrawFee"
|
|
31
|
+
| "EventNewPriceFeed"
|
|
32
|
+
| "EventTakeForever"
|
|
33
|
+
| "EventPaused"
|
|
34
|
+
| "EventUnPaused"
|
|
35
|
+
| "EventPausableAdminAdded"
|
|
36
|
+
| "EventPausableAdminRemoved"
|
|
37
|
+
| "EventUnpausableAdminAdded"
|
|
38
|
+
| "EventUnpausableAdminRemoved"
|
|
39
|
+
| "EventOwnershipTransferred";
|
|
40
|
+
|
|
41
|
+
content: any;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export class EventParser {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
static serialize(items: Array<EVMTx>): string {
|
|
46
|
+
return JSON.stringify(items.map(i => i.serialize()));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static deserialize(data: EventSerialized): EVMEvent {
|
|
50
|
+
const params = data.content;
|
|
51
|
+
switch (data.type) {
|
|
52
|
+
case "EventAddLiquidity":
|
|
53
|
+
return new EventAddLiquidity(params);
|
|
54
|
+
case "EventRemoveLiquidity":
|
|
55
|
+
return new EventRemoveLiquidity(params);
|
|
56
|
+
case "EventOpenCreditAccount":
|
|
57
|
+
return new EventOpenCreditAccount(params);
|
|
58
|
+
case "EventCloseCreditAccount":
|
|
59
|
+
return new EventCloseCreditAccount(params);
|
|
60
|
+
case "EventLiquidateCreditAccount":
|
|
61
|
+
return new EventLiquidateCreditAccount(params);
|
|
62
|
+
case "EventRepayCreditAccount":
|
|
63
|
+
return new EventRepayCreditAccount(params);
|
|
64
|
+
case "EventAddCollateral":
|
|
65
|
+
return new EventAddCollateral(params);
|
|
66
|
+
case "EventIncreaseBorrowAmount":
|
|
67
|
+
return new EventIncreaseBorrowAmount(params);
|
|
68
|
+
case "EventCMNewParameters":
|
|
69
|
+
return new EventCMNewParameters(params);
|
|
70
|
+
case "EventTokenAllowed":
|
|
71
|
+
return new EventTokenAllowed(params);
|
|
72
|
+
case "EventTokenForbidden":
|
|
73
|
+
return new EventTokenForbidden(params);
|
|
74
|
+
case "EventContractAllowed":
|
|
75
|
+
return new EventContractAllowed(params);
|
|
76
|
+
case "EventContractForbidden":
|
|
77
|
+
return new EventContractForbidden(params);
|
|
78
|
+
case "EventNewFastCheckParameters":
|
|
79
|
+
return new EventNewFastCheckParameters(params);
|
|
80
|
+
case "EventPriceOracleUpdated":
|
|
81
|
+
return new EventPriceOracleUpdated(params);
|
|
82
|
+
case "EventTransferPluginAllowed":
|
|
83
|
+
return new EventTransferPluginAllowed(params);
|
|
84
|
+
case "EventNewInterestRateModel":
|
|
85
|
+
return new EventNewInterestRateModel(params);
|
|
86
|
+
case "EventNewCreditManagerConnected":
|
|
87
|
+
return new EventNewCreditManagerConnected(params);
|
|
88
|
+
case "EventBorrowForbidden":
|
|
89
|
+
return new EventBorrowForbidden(params);
|
|
90
|
+
case "EventNewExpectedLiquidityLimit":
|
|
91
|
+
return new EventNewExpectedLiquidityLimit(params);
|
|
92
|
+
case "EventNewWithdrawFee":
|
|
93
|
+
return new EventNewWithdrawFee(params);
|
|
94
|
+
case "EventNewPriceFeed":
|
|
95
|
+
return new EventNewPriceFeed(params);
|
|
96
|
+
case "EventTakeForever":
|
|
97
|
+
return new EventTakeForever(params);
|
|
98
|
+
case "EventPaused":
|
|
99
|
+
return new EventPaused(params);
|
|
100
|
+
case "EventUnPaused":
|
|
101
|
+
return new EventUnPaused(params);
|
|
102
|
+
case "EventPausableAdminAdded":
|
|
103
|
+
return new EventPausableAdminAdded(params);
|
|
104
|
+
case "EventPausableAdminRemoved":
|
|
105
|
+
return new EventPausableAdminRemoved(params);
|
|
106
|
+
case "EventUnpausableAdminAdded":
|
|
107
|
+
return new EventUnPausableAdminAdded(params);
|
|
108
|
+
case "EventUnpausableAdminRemoved":
|
|
109
|
+
return new EventUnPausableAdminRemoved(params);
|
|
110
|
+
case "EventOwnershipTransferred":
|
|
111
|
+
return new EventTransferOwnership(params);
|
|
112
|
+
|
|
113
|
+
default:
|
|
114
|
+
throw new Error("Unknown transaction for parsing");
|
|
47
115
|
}
|
|
116
|
+
}
|
|
48
117
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
case "EventAddLiquidity":
|
|
53
|
-
return new EventAddLiquidity(params);
|
|
54
|
-
case "EventRemoveLiquidity":
|
|
55
|
-
return new EventRemoveLiquidity(params);
|
|
56
|
-
case "EventOpenCreditAccount":
|
|
57
|
-
return new EventOpenCreditAccount(params);
|
|
58
|
-
case "EventCloseCreditAccount":
|
|
59
|
-
return new EventCloseCreditAccount(params);
|
|
60
|
-
case "EventLiquidateCreditAccount":
|
|
61
|
-
return new EventLiquidateCreditAccount(params);
|
|
62
|
-
case "EventRepayCreditAccount":
|
|
63
|
-
return new EventRepayCreditAccount(params);
|
|
64
|
-
case "EventAddCollateral":
|
|
65
|
-
return new EventAddCollateral(params);
|
|
66
|
-
case "EventIncreaseBorrowAmount":
|
|
67
|
-
return new EventIncreaseBorrowAmount(params);
|
|
68
|
-
case "EventCMNewParameters":
|
|
69
|
-
return new EventCMNewParameters(params);
|
|
70
|
-
case "EventTokenAllowed":
|
|
71
|
-
return new EventTokenAllowed(params);
|
|
72
|
-
case "EventTokenForbidden":
|
|
73
|
-
return new EventTokenForbidden(params);
|
|
74
|
-
case "EventContractAllowed":
|
|
75
|
-
return new EventContractAllowed(params);
|
|
76
|
-
case "EventContractForbidden":
|
|
77
|
-
return new EventContractForbidden(params);
|
|
78
|
-
case "EventNewFastCheckParameters":
|
|
79
|
-
return new EventNewFastCheckParameters(params);
|
|
80
|
-
case "EventPriceOracleUpdated":
|
|
81
|
-
return new EventPriceOracleUpdated(params);
|
|
82
|
-
case "EventTransferPluginAllowed":
|
|
83
|
-
return new EventTransferPluginAllowed(params);
|
|
84
|
-
case "EventNewInterestRateModel":
|
|
85
|
-
return new EventNewInterestRateModel(params);
|
|
86
|
-
case "EventNewCreditManagerConnected":
|
|
87
|
-
return new EventNewCreditManagerConnected(params);
|
|
88
|
-
case "EventBorrowForbidden":
|
|
89
|
-
return new EventBorrowForbidden(params);
|
|
90
|
-
case "EventNewExpectedLiquidityLimit":
|
|
91
|
-
return new EventNewExpectedLiquidityLimit(params);
|
|
92
|
-
case "EventNewWithdrawFee":
|
|
93
|
-
return new EventNewWithdrawFee(params);
|
|
94
|
-
case "EventNewPriceFeed":
|
|
95
|
-
return new EventNewPriceFeed(params);
|
|
96
|
-
case "EventTakeForever":
|
|
97
|
-
return new EventTakeForever(params);
|
|
98
|
-
case "EventPaused":
|
|
99
|
-
return new EventPaused(params);
|
|
100
|
-
case "EventUnPaused":
|
|
101
|
-
return new EventUnPaused(params);
|
|
102
|
-
case "EventPausableAdminAdded":
|
|
103
|
-
return new EventPausableAdminAdded(params);
|
|
104
|
-
case "EventPausableAdminRemoved":
|
|
105
|
-
return new EventPausableAdminRemoved(params);
|
|
106
|
-
case "EventUnpausableAdminAdded":
|
|
107
|
-
return new EventUnPausableAdminAdded(params);
|
|
108
|
-
case "EventUnpausableAdminRemoved":
|
|
109
|
-
return new EventUnPausableAdminRemoved(params);
|
|
110
|
-
case "EventOwnershipTransferred":
|
|
111
|
-
return new EventTransferOwnership(params);
|
|
112
|
-
|
|
113
|
-
default:
|
|
114
|
-
throw new Error("Unknown transaction for parsing");
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static deserializeArray(data: Array<EventSerialized>): Array<EVMEvent> {
|
|
119
|
-
return data.map(e => {
|
|
120
|
-
return EventParser.deserialize(e);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
118
|
+
static deserializeArray(data: Array<EventSerialized>): Array<EVMEvent> {
|
|
119
|
+
return data.map(e => EventParser.deserialize(e));
|
|
120
|
+
}
|
|
123
121
|
}
|
|
124
122
|
|
|
125
123
|
// POOL EVENTS
|
|
126
124
|
interface EventAddLiquidityProps extends EVMEventProps {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
amount: string;
|
|
126
|
+
underlyingToken: string;
|
|
127
|
+
pool: string;
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
export class EventAddLiquidity extends EVMEvent {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
131
|
+
public readonly amount: BigNumber;
|
|
132
|
+
|
|
133
|
+
public readonly underlyingToken: string;
|
|
134
|
+
|
|
135
|
+
public readonly pool: string;
|
|
136
|
+
|
|
137
|
+
constructor(opts: EventAddLiquidityProps) {
|
|
138
|
+
super({
|
|
139
|
+
block: opts.block,
|
|
140
|
+
txHash: opts.txHash,
|
|
141
|
+
timestamp: opts.timestamp
|
|
142
|
+
});
|
|
143
|
+
this.amount = BigNumber.from(opts.amount);
|
|
144
|
+
this.underlyingToken = opts.underlyingToken;
|
|
145
|
+
this.pool = opts.pool;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
149
|
+
const { decimals = 18, symbol } =
|
|
150
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
151
|
+
|
|
152
|
+
return `Pool ${getContractName(this.pool)}: Deposit ${formatBN(
|
|
153
|
+
this.amount,
|
|
154
|
+
decimals
|
|
155
|
+
)} ${symbol}`;
|
|
156
|
+
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
interface RemoveLiquidityProps extends EVMEventProps {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
amount: string;
|
|
161
|
+
underlyingToken: string;
|
|
162
|
+
dieselToken: string;
|
|
163
|
+
pool: string;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
export class EventRemoveLiquidity extends EVMEvent {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
167
|
+
public readonly amount: BigNumber;
|
|
168
|
+
|
|
169
|
+
public readonly underlyingToken: string;
|
|
170
|
+
|
|
171
|
+
public readonly dieselToken: string;
|
|
172
|
+
|
|
173
|
+
public readonly pool: string;
|
|
174
|
+
|
|
175
|
+
constructor(opts: RemoveLiquidityProps) {
|
|
176
|
+
super({
|
|
177
|
+
block: opts.block,
|
|
178
|
+
txHash: opts.txHash,
|
|
179
|
+
timestamp: opts.timestamp
|
|
180
|
+
});
|
|
181
|
+
this.amount = BigNumber.from(opts.amount);
|
|
182
|
+
this.underlyingToken = opts.underlyingToken;
|
|
183
|
+
this.dieselToken = opts.dieselToken;
|
|
184
|
+
this.pool = opts.pool;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
188
|
+
const { decimals = 18, symbol } =
|
|
189
|
+
tokenData[this.dieselToken.toLowerCase()] || {};
|
|
190
|
+
|
|
191
|
+
return `Pool ${getContractName(this.pool)}: withdraw ${formatBN(
|
|
192
|
+
this.amount,
|
|
193
|
+
decimals
|
|
194
|
+
)} ${symbol}`;
|
|
195
|
+
}
|
|
193
196
|
}
|
|
194
197
|
|
|
195
198
|
// CREDIT MANAGER EVENTS
|
|
196
199
|
|
|
197
200
|
interface OpenCreditAccountProps extends EVMEventProps {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
amount: string;
|
|
202
|
+
underlyingToken: string;
|
|
203
|
+
leverage: number;
|
|
204
|
+
creditManager: string;
|
|
202
205
|
}
|
|
203
206
|
|
|
204
207
|
export class EventOpenCreditAccount extends EVMEvent {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
208
|
+
public readonly amount: BigNumber;
|
|
209
|
+
|
|
210
|
+
public readonly underlyingToken: string;
|
|
211
|
+
|
|
212
|
+
public readonly leverage: number;
|
|
213
|
+
|
|
214
|
+
public readonly creditManager: string;
|
|
215
|
+
|
|
216
|
+
constructor(opts: OpenCreditAccountProps) {
|
|
217
|
+
super({
|
|
218
|
+
block: opts.block,
|
|
219
|
+
txHash: opts.txHash,
|
|
220
|
+
timestamp: opts.timestamp
|
|
221
|
+
});
|
|
222
|
+
this.amount = BigNumber.from(opts.amount);
|
|
223
|
+
this.underlyingToken = opts.underlyingToken;
|
|
224
|
+
this.leverage = opts.leverage;
|
|
225
|
+
this.creditManager = opts.creditManager;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
229
|
+
const { decimals = 18, symbol } =
|
|
230
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
231
|
+
|
|
232
|
+
return `Credit account ${getContractName(
|
|
233
|
+
this.creditManager
|
|
234
|
+
)}: open ${formatBN(
|
|
235
|
+
this.amount,
|
|
236
|
+
decimals
|
|
237
|
+
)} ${symbol} x ${this.leverage.toFixed(2)} ⇒
|
|
232
238
|
${formatBN(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
this.amount
|
|
240
|
+
.mul(Math.floor(this.leverage + LEVERAGE_DECIMALS))
|
|
241
|
+
.div(LEVERAGE_DECIMALS),
|
|
242
|
+
decimals + 2
|
|
243
|
+
)} ${symbol}`;
|
|
244
|
+
}
|
|
239
245
|
}
|
|
240
246
|
|
|
241
247
|
interface CloseCreditAccountProps extends EVMEventProps {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
amount: string;
|
|
249
|
+
underlyingToken: string;
|
|
250
|
+
creditManager: string;
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
export class EventCloseCreditAccount extends EVMEvent {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
254
|
+
public readonly amount: BigNumber;
|
|
255
|
+
|
|
256
|
+
public readonly underlyingToken: string;
|
|
257
|
+
|
|
258
|
+
public readonly creditManager: string;
|
|
259
|
+
|
|
260
|
+
constructor(opts: CloseCreditAccountProps) {
|
|
261
|
+
super({
|
|
262
|
+
block: opts.block,
|
|
263
|
+
txHash: opts.txHash,
|
|
264
|
+
timestamp: opts.timestamp
|
|
265
|
+
});
|
|
266
|
+
this.amount = BigNumber.from(opts.amount);
|
|
267
|
+
this.underlyingToken = opts.underlyingToken;
|
|
268
|
+
this.creditManager = opts.creditManager;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
272
|
+
const { decimals = 18, symbol } =
|
|
273
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
274
|
+
|
|
275
|
+
return `Credit account ${getContractName(
|
|
276
|
+
this.creditManager
|
|
277
|
+
)}: was closed and got ${formatBN(
|
|
278
|
+
this.amount,
|
|
279
|
+
decimals
|
|
280
|
+
)} ${symbol} as remaining funds`;
|
|
281
|
+
}
|
|
274
282
|
}
|
|
275
283
|
|
|
276
284
|
interface LiquidateCreditAccountProps extends EVMEventProps {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
amount: string;
|
|
286
|
+
underlyingToken: string;
|
|
287
|
+
creditManager: string;
|
|
280
288
|
}
|
|
281
289
|
|
|
282
290
|
export class EventLiquidateCreditAccount extends EVMEvent {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
291
|
+
public readonly amount: BigNumber;
|
|
292
|
+
|
|
293
|
+
public readonly underlyingToken: string;
|
|
294
|
+
|
|
295
|
+
public readonly creditManager: string;
|
|
296
|
+
|
|
297
|
+
constructor(opts: LiquidateCreditAccountProps) {
|
|
298
|
+
super({
|
|
299
|
+
block: opts.block,
|
|
300
|
+
txHash: opts.txHash,
|
|
301
|
+
timestamp: opts.timestamp
|
|
302
|
+
});
|
|
303
|
+
this.amount = BigNumber.from(opts.amount);
|
|
304
|
+
this.underlyingToken = opts.underlyingToken;
|
|
305
|
+
this.creditManager = opts.creditManager;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
309
|
+
const { decimals = 18, symbol } =
|
|
310
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
311
|
+
|
|
312
|
+
return `Credit account ${getContractName(
|
|
313
|
+
this.creditManager
|
|
314
|
+
)}: was liquidated. ${formatBN(
|
|
315
|
+
this.amount,
|
|
316
|
+
decimals
|
|
317
|
+
)} ${symbol} were paid back as remaining funds`;
|
|
318
|
+
}
|
|
309
319
|
}
|
|
310
320
|
|
|
311
321
|
interface RepayCreditAccountProps extends EVMEventProps {
|
|
312
|
-
|
|
313
|
-
|
|
322
|
+
underlyingToken: string;
|
|
323
|
+
creditManager: string;
|
|
314
324
|
}
|
|
315
325
|
|
|
316
326
|
export class EventRepayCreditAccount extends EVMEvent {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
327
|
+
public readonly underlyingToken: string;
|
|
328
|
+
|
|
329
|
+
public readonly creditManager: string;
|
|
330
|
+
|
|
331
|
+
constructor(opts: RepayCreditAccountProps) {
|
|
332
|
+
super({
|
|
333
|
+
block: opts.block,
|
|
334
|
+
txHash: opts.txHash,
|
|
335
|
+
timestamp: opts.timestamp
|
|
336
|
+
});
|
|
337
|
+
this.underlyingToken = opts.underlyingToken;
|
|
338
|
+
this.creditManager = opts.creditManager;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
toString(): string {
|
|
342
|
+
return `Credit account ${getContractName(this.creditManager)}: was repaid`;
|
|
343
|
+
}
|
|
333
344
|
}
|
|
334
345
|
|
|
335
346
|
interface AddCollateralProps extends EVMEventProps {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
amount: string;
|
|
348
|
+
addedToken: string;
|
|
349
|
+
creditManager: string;
|
|
339
350
|
}
|
|
340
351
|
|
|
341
352
|
export class EventAddCollateral extends EVMEvent {
|
|
342
|
-
|
|
343
|
-
public readonly addedToken: string;
|
|
344
|
-
public readonly creditManager: string;
|
|
345
|
-
|
|
346
|
-
constructor(opts: AddCollateralProps) {
|
|
347
|
-
super({
|
|
348
|
-
block: opts.block,
|
|
349
|
-
txHash: opts.txHash,
|
|
350
|
-
timestamp: opts.timestamp
|
|
351
|
-
});
|
|
352
|
-
this.amount = BigNumber.from(opts.amount);
|
|
353
|
-
|
|
354
|
-
this.addedToken = opts.addedToken;
|
|
355
|
-
this.creditManager = opts.creditManager;
|
|
356
|
-
}
|
|
353
|
+
public readonly amount: BigNumber;
|
|
357
354
|
|
|
358
|
-
|
|
359
|
-
const {decimals = 18, symbol} =
|
|
360
|
-
tokenData[this.addedToken.toLowerCase()] || {};
|
|
355
|
+
public readonly addedToken: string;
|
|
361
356
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
357
|
+
public readonly creditManager: string;
|
|
358
|
+
|
|
359
|
+
constructor(opts: AddCollateralProps) {
|
|
360
|
+
super({
|
|
361
|
+
block: opts.block,
|
|
362
|
+
txHash: opts.txHash,
|
|
363
|
+
timestamp: opts.timestamp
|
|
364
|
+
});
|
|
365
|
+
this.amount = BigNumber.from(opts.amount);
|
|
366
|
+
|
|
367
|
+
this.addedToken = opts.addedToken;
|
|
368
|
+
this.creditManager = opts.creditManager;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
372
|
+
const { decimals = 18, symbol } =
|
|
373
|
+
tokenData[this.addedToken.toLowerCase()] || {};
|
|
374
|
+
|
|
375
|
+
return `Credit account ${getContractName(
|
|
376
|
+
this.creditManager
|
|
377
|
+
)}: added ${formatBN(this.amount, decimals)} ${symbol} as collateral`;
|
|
378
|
+
}
|
|
366
379
|
}
|
|
367
380
|
|
|
368
381
|
interface IncreaseBorrowAmountProps extends EVMEventProps {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
382
|
+
amount: string;
|
|
383
|
+
underlyingToken: string;
|
|
384
|
+
creditManager: string;
|
|
372
385
|
}
|
|
373
386
|
|
|
374
387
|
export class EventIncreaseBorrowAmount extends EVMEvent {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
388
|
+
public readonly amount: BigNumber;
|
|
389
|
+
|
|
390
|
+
public readonly underlyingToken: string;
|
|
391
|
+
|
|
392
|
+
public readonly creditManager: string;
|
|
393
|
+
|
|
394
|
+
constructor(opts: IncreaseBorrowAmountProps) {
|
|
395
|
+
super({
|
|
396
|
+
block: opts.block,
|
|
397
|
+
txHash: opts.txHash,
|
|
398
|
+
timestamp: opts.timestamp
|
|
399
|
+
});
|
|
400
|
+
this.amount = BigNumber.from(opts.amount);
|
|
401
|
+
this.underlyingToken = opts.underlyingToken;
|
|
402
|
+
this.creditManager = opts.creditManager;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
406
|
+
const { decimals = 18, symbol } =
|
|
407
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
408
|
+
|
|
409
|
+
return `Credit account ${getContractName(
|
|
410
|
+
this.creditManager
|
|
411
|
+
)}: borrowed amount was increased for ${formatBN(
|
|
412
|
+
this.amount,
|
|
413
|
+
decimals
|
|
414
|
+
)} ${symbol}`;
|
|
415
|
+
}
|
|
401
416
|
}
|
|
402
417
|
|
|
403
418
|
// // Emits each time when new fees are set
|
|
@@ -411,105 +426,120 @@ export class EventIncreaseBorrowAmount extends EVMEvent {
|
|
|
411
426
|
// );
|
|
412
427
|
|
|
413
428
|
interface CMNewParametersProps extends EVMEventProps {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
429
|
+
creditManager: string;
|
|
430
|
+
underlyingToken: string;
|
|
431
|
+
minAmount: string;
|
|
432
|
+
maxAmount: string;
|
|
433
|
+
maxLeverage: number;
|
|
434
|
+
feeInterest: number;
|
|
435
|
+
feeLiquidation: number;
|
|
436
|
+
liquidationDiscount: number;
|
|
437
|
+
prevMinAmount: string;
|
|
438
|
+
prevMaxAmount: string;
|
|
439
|
+
prevMaxLeverage: number;
|
|
440
|
+
prevFeeInterest: number;
|
|
441
|
+
prevFeeLiquidation: number;
|
|
442
|
+
prevLiquidationDiscount: number;
|
|
428
443
|
}
|
|
429
444
|
|
|
430
445
|
export class EventCMNewParameters extends EVMEvent {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
446
|
+
public readonly creditManager: string;
|
|
447
|
+
|
|
448
|
+
public readonly underlyingToken: string;
|
|
449
|
+
|
|
450
|
+
public readonly minAmount: BigNumber;
|
|
451
|
+
|
|
452
|
+
public readonly maxAmount: BigNumber;
|
|
453
|
+
|
|
454
|
+
public readonly maxLeverage: number;
|
|
455
|
+
|
|
456
|
+
public readonly feeInterest: number;
|
|
457
|
+
|
|
458
|
+
public readonly feeLiquidation: number;
|
|
459
|
+
|
|
460
|
+
public readonly liquidationDiscount: number;
|
|
461
|
+
|
|
462
|
+
public readonly prevMinAmount: BigNumber;
|
|
463
|
+
|
|
464
|
+
public readonly prevMaxAmount: BigNumber;
|
|
465
|
+
|
|
466
|
+
public readonly prevMaxLeverage: number;
|
|
467
|
+
|
|
468
|
+
public readonly prevFeeInterest: number;
|
|
469
|
+
|
|
470
|
+
public readonly prevFeeLiquidation: number;
|
|
471
|
+
|
|
472
|
+
public readonly prevLiquidationDiscount: number;
|
|
473
|
+
|
|
474
|
+
constructor(opts: CMNewParametersProps) {
|
|
475
|
+
super({
|
|
476
|
+
block: opts.block,
|
|
477
|
+
txHash: opts.txHash,
|
|
478
|
+
timestamp: opts.timestamp
|
|
479
|
+
});
|
|
480
|
+
this.creditManager = opts.creditManager;
|
|
481
|
+
this.underlyingToken = opts.underlyingToken;
|
|
482
|
+
this.minAmount = BigNumber.from(opts.minAmount);
|
|
483
|
+
this.maxAmount = BigNumber.from(opts.maxAmount);
|
|
484
|
+
this.maxLeverage = opts.maxLeverage;
|
|
485
|
+
this.feeInterest = opts.feeInterest;
|
|
486
|
+
this.feeLiquidation = opts.feeLiquidation;
|
|
487
|
+
this.liquidationDiscount = opts.liquidationDiscount;
|
|
488
|
+
|
|
489
|
+
this.prevMinAmount = BigNumber.from(opts.prevMinAmount);
|
|
490
|
+
this.prevMaxAmount = BigNumber.from(opts.prevMaxAmount);
|
|
491
|
+
this.prevMaxLeverage = opts.prevMaxLeverage;
|
|
492
|
+
this.prevFeeInterest = opts.prevFeeInterest;
|
|
493
|
+
this.prevFeeLiquidation = opts.prevFeeLiquidation;
|
|
494
|
+
this.prevLiquidationDiscount = opts.prevLiquidationDiscount;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
498
|
+
const token = tokenData[this.underlyingToken.toLowerCase()];
|
|
499
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated: `;
|
|
500
|
+
|
|
501
|
+
if (this.minAmount !== this.prevMinAmount) {
|
|
502
|
+
msg += `min amount: ${formatBN(
|
|
503
|
+
this.prevMinAmount,
|
|
504
|
+
token.decimals
|
|
505
|
+
)} => ${formatBN(this.minAmount, token.decimals)} ${token.symbol}, `;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (this.maxAmount !== this.prevMaxAmount) {
|
|
509
|
+
msg += `max amount: ${formatBN(
|
|
510
|
+
this.prevMaxAmount,
|
|
511
|
+
token.decimals
|
|
512
|
+
)} => ${formatBN(this.maxAmount, token.decimals)} ${token.symbol}, `;
|
|
467
513
|
}
|
|
468
514
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (this.minAmount !== this.prevMinAmount) {
|
|
474
|
-
msg += `min amount: ${formatBN(
|
|
475
|
-
this.prevMinAmount,
|
|
476
|
-
token.decimals
|
|
477
|
-
)} => ${formatBN(this.minAmount, token.decimals)} ${token.symbol}, `;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if (this.maxAmount !== this.prevMaxAmount) {
|
|
481
|
-
msg += `max amount: ${formatBN(
|
|
482
|
-
this.prevMaxAmount,
|
|
483
|
-
token.decimals
|
|
484
|
-
)} => ${formatBN(this.maxAmount, token.decimals)} ${token.symbol}, `;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
if (this.maxLeverage !== this.prevMaxLeverage) {
|
|
488
|
-
msg += `max leverage: ${this.prevMaxLeverage / 100 + 1} => ${
|
|
489
|
-
this.maxLeverage / 100 + 1
|
|
490
|
-
}, `;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
if (this.feeInterest !== this.prevFeeInterest) {
|
|
494
|
-
msg += `interest fee: ${this.prevFeeInterest / 100}% => ${
|
|
495
|
-
this.feeInterest / 100
|
|
496
|
-
}%, `;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
if (this.feeLiquidation !== this.prevFeeLiquidation) {
|
|
500
|
-
msg += `liquidation fee: ${this.prevFeeLiquidation / 100}% => ${
|
|
501
|
-
this.feeLiquidation / 100
|
|
502
|
-
}%, `;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
if (this.liquidationDiscount !== this.prevLiquidationDiscount) {
|
|
506
|
-
msg += `liquidation premium: ${
|
|
507
|
-
100 - this.prevLiquidationDiscount / 100
|
|
508
|
-
}% => ${100 - this.liquidationDiscount / 100}%, `;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
return msg.slice(0, msg.length - 2);
|
|
515
|
+
if (this.maxLeverage !== this.prevMaxLeverage) {
|
|
516
|
+
msg += `max leverage: ${
|
|
517
|
+
this.prevMaxLeverage / LEVERAGE_DECIMALS + 1
|
|
518
|
+
} => ${this.maxLeverage / LEVERAGE_DECIMALS + 1}, `;
|
|
512
519
|
}
|
|
520
|
+
|
|
521
|
+
if (this.feeInterest !== this.prevFeeInterest) {
|
|
522
|
+
msg += `interest fee: ${this.prevFeeInterest / PERCENTAGE_DECIMALS}% => ${
|
|
523
|
+
this.feeInterest / PERCENTAGE_DECIMALS
|
|
524
|
+
}%, `;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if (this.feeLiquidation !== this.prevFeeLiquidation) {
|
|
528
|
+
msg += `liquidation fee: ${
|
|
529
|
+
this.prevFeeLiquidation / PERCENTAGE_DECIMALS
|
|
530
|
+
}% => ${this.feeLiquidation / PERCENTAGE_DECIMALS}%, `;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (this.liquidationDiscount !== this.prevLiquidationDiscount) {
|
|
534
|
+
msg += `liquidation premium: ${
|
|
535
|
+
PERCENTAGE_DECIMALS - this.prevLiquidationDiscount / PERCENTAGE_DECIMALS
|
|
536
|
+
}% => ${
|
|
537
|
+
PERCENTAGE_DECIMALS - this.liquidationDiscount / PERCENTAGE_DECIMALS
|
|
538
|
+
}%, `;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return msg.slice(0, msg.length - 2);
|
|
542
|
+
}
|
|
513
543
|
}
|
|
514
544
|
|
|
515
545
|
// // Emits each time token is allowed or liquidation threshold changed
|
|
@@ -518,83 +548,94 @@ export class EventCMNewParameters extends EVMEvent {
|
|
|
518
548
|
export type TokenAllowanceType = "NewToken" | "LTUpdated" | "Allowed";
|
|
519
549
|
|
|
520
550
|
interface TokenAllowedProps extends EVMEventProps {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
551
|
+
creditManager: string;
|
|
552
|
+
token: string;
|
|
553
|
+
liquidityThreshold: number;
|
|
554
|
+
prevLiquidationThreshold?: number;
|
|
555
|
+
status: TokenAllowanceType;
|
|
526
556
|
}
|
|
527
557
|
|
|
528
558
|
export class EventTokenAllowed extends EVMEvent {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
559
|
+
public readonly creditManager: string;
|
|
560
|
+
|
|
561
|
+
public readonly token: string;
|
|
562
|
+
|
|
563
|
+
public readonly liquidityThreshold: number;
|
|
564
|
+
|
|
565
|
+
public readonly prevLiquidationThreshold?: number;
|
|
566
|
+
|
|
567
|
+
public readonly status: TokenAllowanceType;
|
|
568
|
+
|
|
569
|
+
constructor(opts: TokenAllowedProps) {
|
|
570
|
+
super({
|
|
571
|
+
block: opts.block,
|
|
572
|
+
txHash: opts.txHash,
|
|
573
|
+
timestamp: opts.timestamp
|
|
574
|
+
});
|
|
575
|
+
this.creditManager = opts.creditManager;
|
|
576
|
+
this.token = opts.token;
|
|
577
|
+
this.liquidityThreshold = opts.liquidityThreshold;
|
|
578
|
+
this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
|
|
579
|
+
this.status = opts.status;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
583
|
+
const token = tokenData[this.token.toLowerCase()];
|
|
584
|
+
const msg = `Credit manager ${getContractName(
|
|
585
|
+
this.creditManager
|
|
586
|
+
)} updated `;
|
|
587
|
+
switch (this.status) {
|
|
588
|
+
case "NewToken":
|
|
589
|
+
return `${msg}: New token allowed: ${
|
|
590
|
+
token.symbol
|
|
591
|
+
}, liquidation threshold: ${
|
|
592
|
+
this.liquidityThreshold / PERCENTAGE_DECIMALS
|
|
593
|
+
}%`;
|
|
594
|
+
case "Allowed":
|
|
595
|
+
return `${msg}: ${
|
|
596
|
+
token.symbol
|
|
597
|
+
} is allowed now, liquidation threshold: ${
|
|
598
|
+
this.liquidityThreshold / PERCENTAGE_DECIMALS
|
|
599
|
+
}%`;
|
|
600
|
+
case "LTUpdated":
|
|
601
|
+
return `${msg}: ${token.symbol} liquidation threshold: ${
|
|
602
|
+
(this.prevLiquidationThreshold || 0) / PERCENTAGE_DECIMALS
|
|
603
|
+
} => ${this.liquidityThreshold / PERCENTAGE_DECIMALS}%`;
|
|
604
|
+
default:
|
|
605
|
+
return "Error: TokenAllowedProps";
|
|
567
606
|
}
|
|
607
|
+
}
|
|
568
608
|
}
|
|
569
609
|
|
|
570
610
|
// // Emits each time token is allowed or liquidtion threshold changed
|
|
571
611
|
// event TokenForbidden(address indexed token);
|
|
572
612
|
|
|
573
613
|
interface TokenForbiddenProps extends EVMEventProps {
|
|
574
|
-
|
|
575
|
-
|
|
614
|
+
creditManager: string;
|
|
615
|
+
token: string;
|
|
576
616
|
}
|
|
577
617
|
|
|
578
618
|
export class EventTokenForbidden extends EVMEvent {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
619
|
+
public readonly creditManager: string;
|
|
620
|
+
|
|
621
|
+
public readonly token: string;
|
|
622
|
+
|
|
623
|
+
constructor(opts: TokenForbiddenProps) {
|
|
624
|
+
super({
|
|
625
|
+
block: opts.block,
|
|
626
|
+
txHash: opts.txHash,
|
|
627
|
+
timestamp: opts.timestamp
|
|
628
|
+
});
|
|
629
|
+
this.creditManager = opts.creditManager;
|
|
630
|
+
this.token = opts.token;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
634
|
+
const token = tokenData[this.token.toLowerCase()];
|
|
635
|
+
return `Credit manager ${getContractName(this.creditManager)} updated ${
|
|
636
|
+
token.symbol
|
|
637
|
+
} forbidden`;
|
|
638
|
+
}
|
|
598
639
|
}
|
|
599
640
|
|
|
600
641
|
//
|
|
@@ -604,44 +645,49 @@ export class EventTokenForbidden extends EVMEvent {
|
|
|
604
645
|
export type EventContractAllowedStatus = "Connected" | "AdapterUpdate";
|
|
605
646
|
|
|
606
647
|
interface ContractAllowedProps extends EVMEventProps {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
648
|
+
creditManager: string;
|
|
649
|
+
protocol: string;
|
|
650
|
+
adapter: string;
|
|
651
|
+
status: EventContractAllowedStatus;
|
|
611
652
|
}
|
|
612
653
|
|
|
613
654
|
export class EventContractAllowed extends EVMEvent {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
655
|
+
public readonly creditManager: string;
|
|
656
|
+
|
|
657
|
+
public readonly protocol: string;
|
|
658
|
+
|
|
659
|
+
public readonly adapter: string;
|
|
660
|
+
|
|
661
|
+
public readonly status: EventContractAllowedStatus;
|
|
662
|
+
|
|
663
|
+
constructor(opts: ContractAllowedProps) {
|
|
664
|
+
super({
|
|
665
|
+
block: opts.block,
|
|
666
|
+
txHash: opts.txHash,
|
|
667
|
+
timestamp: opts.timestamp
|
|
668
|
+
});
|
|
669
|
+
this.creditManager = opts.creditManager;
|
|
670
|
+
this.protocol = opts.protocol;
|
|
671
|
+
this.adapter = opts.adapter;
|
|
672
|
+
this.status = opts.status;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
toString(): string {
|
|
676
|
+
const msg = `Credit manager ${getContractName(this.creditManager)} updated`;
|
|
677
|
+
|
|
678
|
+
switch (this.status) {
|
|
679
|
+
case "Connected":
|
|
680
|
+
return `${msg} : ${getContractName(
|
|
681
|
+
this.protocol
|
|
682
|
+
)} was connected. Adapter at: ${this.adapter}`;
|
|
683
|
+
case "AdapterUpdate":
|
|
684
|
+
return `${msg} : ${getContractName(
|
|
685
|
+
this.protocol
|
|
686
|
+
)} adapter was updated. New adapter: ${this.adapter}`;
|
|
687
|
+
default:
|
|
688
|
+
return "Error: EventContractAllowed";
|
|
644
689
|
}
|
|
690
|
+
}
|
|
645
691
|
}
|
|
646
692
|
|
|
647
693
|
//
|
|
@@ -649,29 +695,30 @@ export class EventContractAllowed extends EVMEvent {
|
|
|
649
695
|
// event ContractForbidden(address indexed protocol);
|
|
650
696
|
|
|
651
697
|
interface ContractForbiddenProps extends EVMEventProps {
|
|
652
|
-
|
|
653
|
-
|
|
698
|
+
creditManager: string;
|
|
699
|
+
protocol: string;
|
|
654
700
|
}
|
|
655
701
|
|
|
656
702
|
export class EventContractForbidden extends EVMEvent {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
703
|
+
public readonly creditManager: string;
|
|
704
|
+
|
|
705
|
+
public readonly protocol: string;
|
|
706
|
+
|
|
707
|
+
constructor(opts: ContractForbiddenProps) {
|
|
708
|
+
super({
|
|
709
|
+
block: opts.block,
|
|
710
|
+
txHash: opts.txHash,
|
|
711
|
+
timestamp: opts.timestamp
|
|
712
|
+
});
|
|
713
|
+
this.creditManager = opts.creditManager;
|
|
714
|
+
this.protocol = opts.protocol;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
toString(): string {
|
|
718
|
+
return `Credit manager ${getContractName(
|
|
719
|
+
this.creditManager
|
|
720
|
+
)} updated: ${getContractName(this.protocol)}`;
|
|
721
|
+
}
|
|
675
722
|
}
|
|
676
723
|
|
|
677
724
|
//
|
|
@@ -679,76 +726,81 @@ export class EventContractForbidden extends EVMEvent {
|
|
|
679
726
|
// event NewFastCheckParameters(uint256 chiThreshold, uint256 fastCheckDelay);
|
|
680
727
|
|
|
681
728
|
interface NewFastCheckParametersProps extends EVMEventProps {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
729
|
+
creditManager: string;
|
|
730
|
+
chiThreshold: number;
|
|
731
|
+
fastCheckDelay: number;
|
|
732
|
+
prevChiThreshold?: number;
|
|
733
|
+
prevFastCheckDelay?: number;
|
|
687
734
|
}
|
|
688
735
|
|
|
689
736
|
export class EventNewFastCheckParameters extends EVMEvent {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
super({
|
|
698
|
-
block: opts.block,
|
|
699
|
-
txHash: opts.txHash,
|
|
700
|
-
timestamp: opts.timestamp
|
|
701
|
-
});
|
|
702
|
-
this.creditManager = opts.creditManager;
|
|
703
|
-
this.chiThreshold = opts.chiThreshold;
|
|
704
|
-
this.fastCheckDelay = opts.fastCheckDelay;
|
|
705
|
-
this.prevChiThreshold = opts.prevChiThreshold;
|
|
706
|
-
this.prevFastCheckDelay = opts.prevFastCheckDelay;
|
|
707
|
-
}
|
|
737
|
+
public readonly creditManager: string;
|
|
738
|
+
|
|
739
|
+
public readonly chiThreshold: number;
|
|
740
|
+
|
|
741
|
+
public readonly fastCheckDelay: number;
|
|
742
|
+
|
|
743
|
+
public readonly prevChiThreshold?: number;
|
|
708
744
|
|
|
709
|
-
|
|
710
|
-
let msg = `Credit manager ${getContractName(this.creditManager)} updated: `;
|
|
745
|
+
public readonly prevFastCheckDelay?: number;
|
|
711
746
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
747
|
+
constructor(opts: NewFastCheckParametersProps) {
|
|
748
|
+
super({
|
|
749
|
+
block: opts.block,
|
|
750
|
+
txHash: opts.txHash,
|
|
751
|
+
timestamp: opts.timestamp
|
|
752
|
+
});
|
|
753
|
+
this.creditManager = opts.creditManager;
|
|
754
|
+
this.chiThreshold = opts.chiThreshold;
|
|
755
|
+
this.fastCheckDelay = opts.fastCheckDelay;
|
|
756
|
+
this.prevChiThreshold = opts.prevChiThreshold;
|
|
757
|
+
this.prevFastCheckDelay = opts.prevFastCheckDelay;
|
|
758
|
+
}
|
|
715
759
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
760
|
+
toString(): string {
|
|
761
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated: `;
|
|
719
762
|
|
|
720
|
-
|
|
763
|
+
if (this.chiThreshold !== this.prevChiThreshold) {
|
|
764
|
+
msg += `Chi threshold: ${this.prevChiThreshold} => ${this.chiThreshold}, `;
|
|
721
765
|
}
|
|
766
|
+
|
|
767
|
+
if (this.fastCheckDelay !== this.prevFastCheckDelay) {
|
|
768
|
+
msg += `fast check delay: ${this.prevFastCheckDelay} => ${this.fastCheckDelay}, `;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
return msg.slice(0, msg.length - 2);
|
|
772
|
+
}
|
|
722
773
|
}
|
|
723
774
|
|
|
724
775
|
// event PriceOracleUpdated(address indexed newPriceOracle);
|
|
725
776
|
|
|
726
777
|
interface PriceOracleUpdatedProps extends EVMEventProps {
|
|
727
|
-
|
|
728
|
-
|
|
778
|
+
creditManager: string;
|
|
779
|
+
priceOracle: string;
|
|
729
780
|
}
|
|
730
781
|
|
|
731
782
|
export class EventPriceOracleUpdated extends EVMEvent {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}
|
|
783
|
+
public readonly creditManager: string;
|
|
784
|
+
|
|
785
|
+
public readonly priceOracle: string;
|
|
786
|
+
|
|
787
|
+
constructor(opts: PriceOracleUpdatedProps) {
|
|
788
|
+
super({
|
|
789
|
+
block: opts.block,
|
|
790
|
+
txHash: opts.txHash,
|
|
791
|
+
timestamp: opts.timestamp
|
|
792
|
+
});
|
|
793
|
+
this.creditManager = opts.creditManager;
|
|
794
|
+
this.priceOracle = opts.priceOracle;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
toString(): string {
|
|
798
|
+
return `Credit manager ${getContractName(
|
|
799
|
+
this.creditManager
|
|
800
|
+
)} updated: price oracle was updated. New price oracle ${getContractName(
|
|
801
|
+
this.priceOracle
|
|
802
|
+
)}`;
|
|
803
|
+
}
|
|
752
804
|
}
|
|
753
805
|
|
|
754
806
|
// event TransferPluginAllowed(
|
|
@@ -757,65 +809,68 @@ export class EventPriceOracleUpdated extends EVMEvent {
|
|
|
757
809
|
// );
|
|
758
810
|
|
|
759
811
|
interface TransferPluginAllowedProps extends EVMEventProps {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
812
|
+
creditManager: string;
|
|
813
|
+
priceOracle: string;
|
|
814
|
+
state: boolean;
|
|
763
815
|
}
|
|
764
816
|
|
|
765
817
|
export class EventTransferPluginAllowed extends EVMEvent {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
818
|
+
public readonly creditManager: string;
|
|
819
|
+
|
|
820
|
+
public readonly plugin: string;
|
|
821
|
+
|
|
822
|
+
public readonly state: boolean;
|
|
823
|
+
|
|
824
|
+
constructor(opts: TransferPluginAllowedProps) {
|
|
825
|
+
super({
|
|
826
|
+
block: opts.block,
|
|
827
|
+
txHash: opts.txHash,
|
|
828
|
+
timestamp: opts.timestamp
|
|
829
|
+
});
|
|
830
|
+
this.creditManager = opts.creditManager;
|
|
831
|
+
this.plugin = opts.priceOracle;
|
|
832
|
+
this.state = opts.state;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
toString(): string {
|
|
836
|
+
return `Credit manager ${getContractName(
|
|
837
|
+
this.creditManager
|
|
838
|
+
)} updated: transfer plugin ${getContractName(this.plugin)} was ${
|
|
839
|
+
this.state ? "allowed" : "forbidden"
|
|
840
|
+
}`;
|
|
841
|
+
}
|
|
788
842
|
}
|
|
789
843
|
|
|
790
844
|
// // Emits each time when Interest Rate model was changed
|
|
791
845
|
// event NewInterestRateModel(address indexed newInterestRateModel);
|
|
792
846
|
|
|
793
847
|
interface NewInterestRateModelProps extends EVMEventProps {
|
|
794
|
-
|
|
795
|
-
|
|
848
|
+
pool: string;
|
|
849
|
+
newInterestRateModel: string;
|
|
796
850
|
}
|
|
797
851
|
|
|
798
852
|
export class EventNewInterestRateModel extends EVMEvent {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
}
|
|
853
|
+
public readonly pool: string;
|
|
854
|
+
|
|
855
|
+
public readonly newInterestRateModel: string;
|
|
856
|
+
|
|
857
|
+
constructor(opts: NewInterestRateModelProps) {
|
|
858
|
+
super({
|
|
859
|
+
block: opts.block,
|
|
860
|
+
txHash: opts.txHash,
|
|
861
|
+
timestamp: opts.timestamp
|
|
862
|
+
});
|
|
863
|
+
this.pool = opts.pool;
|
|
864
|
+
this.newInterestRateModel = opts.newInterestRateModel;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
toString(): string {
|
|
868
|
+
return `Pool ${getContractName(
|
|
869
|
+
this.pool
|
|
870
|
+
)} updated: interest rate model was updated. New model: ${getContractName(
|
|
871
|
+
this.newInterestRateModel
|
|
872
|
+
)}`;
|
|
873
|
+
}
|
|
819
874
|
}
|
|
820
875
|
|
|
821
876
|
//
|
|
@@ -823,31 +878,32 @@ export class EventNewInterestRateModel extends EVMEvent {
|
|
|
823
878
|
// event NewCreditManagerConnected(address indexed creditManager);
|
|
824
879
|
|
|
825
880
|
interface NewCreditManagerConnectedProps extends EVMEventProps {
|
|
826
|
-
|
|
827
|
-
|
|
881
|
+
pool: string;
|
|
882
|
+
creditManager: string;
|
|
828
883
|
}
|
|
829
884
|
|
|
830
885
|
export class EventNewCreditManagerConnected extends EVMEvent {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
886
|
+
public readonly pool: string;
|
|
887
|
+
|
|
888
|
+
public readonly creditManager: string;
|
|
889
|
+
|
|
890
|
+
constructor(opts: NewCreditManagerConnectedProps) {
|
|
891
|
+
super({
|
|
892
|
+
block: opts.block,
|
|
893
|
+
txHash: opts.txHash,
|
|
894
|
+
timestamp: opts.timestamp
|
|
895
|
+
});
|
|
896
|
+
this.pool = opts.pool;
|
|
897
|
+
this.creditManager = opts.creditManager;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
toString(): string {
|
|
901
|
+
return `Pool ${getContractName(
|
|
902
|
+
this.pool
|
|
903
|
+
)} updated: new credit manager ${getContractName(
|
|
904
|
+
this.creditManager
|
|
905
|
+
)} was connected`;
|
|
906
|
+
}
|
|
851
907
|
}
|
|
852
908
|
|
|
853
909
|
//
|
|
@@ -855,338 +911,349 @@ export class EventNewCreditManagerConnected extends EVMEvent {
|
|
|
855
911
|
// event BorrowForbidden(address indexed creditManager);
|
|
856
912
|
|
|
857
913
|
interface BorrowForbiddenProps extends EVMEventProps {
|
|
858
|
-
|
|
859
|
-
|
|
914
|
+
pool: string;
|
|
915
|
+
creditManager: string;
|
|
860
916
|
}
|
|
861
917
|
|
|
862
918
|
export class EventBorrowForbidden extends EVMEvent {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}
|
|
919
|
+
public readonly pool: string;
|
|
920
|
+
|
|
921
|
+
public readonly creditManager: string;
|
|
922
|
+
|
|
923
|
+
constructor(opts: BorrowForbiddenProps) {
|
|
924
|
+
super({
|
|
925
|
+
block: opts.block,
|
|
926
|
+
txHash: opts.txHash,
|
|
927
|
+
timestamp: opts.timestamp
|
|
928
|
+
});
|
|
929
|
+
this.pool = opts.pool;
|
|
930
|
+
this.creditManager = opts.creditManager;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
toString(): string {
|
|
934
|
+
return `Pool ${getContractName(
|
|
935
|
+
this.pool
|
|
936
|
+
)} updated: credit manager ${getContractName(
|
|
937
|
+
this.creditManager
|
|
938
|
+
)} was forbidden to borrow`;
|
|
939
|
+
}
|
|
883
940
|
}
|
|
884
941
|
|
|
885
942
|
// // Emits after expected liquidity limit update
|
|
886
943
|
// event NewExpectedLiquidityLimit(uint256 newLimit);
|
|
887
944
|
|
|
888
945
|
interface NewExpectedLiquidityLimitProps extends EVMEventProps {
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
946
|
+
pool: string;
|
|
947
|
+
underlyingToken: string;
|
|
948
|
+
newLimit: string;
|
|
949
|
+
oldLimit: string;
|
|
893
950
|
}
|
|
894
951
|
|
|
895
952
|
export class EventNewExpectedLiquidityLimit extends EVMEvent {
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
953
|
+
public readonly pool: string;
|
|
954
|
+
|
|
955
|
+
public readonly underlyingToken: string;
|
|
956
|
+
|
|
957
|
+
public readonly newLimit: BigNumber;
|
|
958
|
+
|
|
959
|
+
public readonly prevLimit: BigNumber;
|
|
960
|
+
|
|
961
|
+
constructor(opts: NewExpectedLiquidityLimitProps) {
|
|
962
|
+
super({
|
|
963
|
+
block: opts.block,
|
|
964
|
+
txHash: opts.txHash,
|
|
965
|
+
timestamp: opts.timestamp
|
|
966
|
+
});
|
|
967
|
+
this.pool = opts.pool;
|
|
968
|
+
this.underlyingToken = opts.underlyingToken;
|
|
969
|
+
this.newLimit = BigNumber.from(opts.newLimit);
|
|
970
|
+
this.prevLimit = BigNumber.from(opts.oldLimit);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
974
|
+
const { decimals = 18, symbol } =
|
|
975
|
+
tokenData[this.underlyingToken.toLowerCase()] || {};
|
|
976
|
+
|
|
977
|
+
return this.prevLimit.isZero()
|
|
978
|
+
? `Pool ${getContractName(
|
|
979
|
+
this.pool
|
|
980
|
+
)} updated: expected liquidity limit was set to ${formatBN(
|
|
981
|
+
this.newLimit,
|
|
982
|
+
decimals
|
|
983
|
+
)} ${symbol}`
|
|
984
|
+
: `Pool ${getContractName(
|
|
985
|
+
this.pool
|
|
986
|
+
)} updated: expected liquidity limit was ${
|
|
987
|
+
this.newLimit.gt(this.prevLimit) ? "increased" : "decreased"
|
|
988
|
+
}: ${formatBN(this.prevLimit, decimals)} ${symbol} => ${formatBN(
|
|
989
|
+
this.newLimit,
|
|
990
|
+
decimals
|
|
991
|
+
)} ${symbol}`;
|
|
992
|
+
}
|
|
933
993
|
}
|
|
934
994
|
|
|
935
995
|
// // Emits each time when withdraw fee is udpated
|
|
936
996
|
// event NewWithdrawFee(uint256 fee);
|
|
937
997
|
|
|
938
998
|
interface NewWithdrawFeeProps extends EVMEventProps {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
999
|
+
pool: string;
|
|
1000
|
+
underlyingToken: string;
|
|
1001
|
+
newFee: string;
|
|
1002
|
+
oldFee: string;
|
|
943
1003
|
}
|
|
944
1004
|
|
|
945
1005
|
export class EventNewWithdrawFee extends EVMEvent {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1006
|
+
public readonly pool: string;
|
|
1007
|
+
|
|
1008
|
+
public readonly underlyingToken: string;
|
|
1009
|
+
|
|
1010
|
+
public readonly newFee: number;
|
|
1011
|
+
|
|
1012
|
+
public readonly prevFee: number;
|
|
1013
|
+
|
|
1014
|
+
constructor(opts: NewWithdrawFeeProps) {
|
|
1015
|
+
super({
|
|
1016
|
+
block: opts.block,
|
|
1017
|
+
txHash: opts.txHash,
|
|
1018
|
+
timestamp: opts.timestamp
|
|
1019
|
+
});
|
|
1020
|
+
this.pool = opts.pool;
|
|
1021
|
+
this.underlyingToken = opts.underlyingToken;
|
|
1022
|
+
this.newFee = Number(opts.newFee);
|
|
1023
|
+
this.prevFee = Number(opts.oldFee);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
toString(): string {
|
|
1027
|
+
return this.prevFee === 0
|
|
1028
|
+
? `Pool ${getContractName(this.pool)} updated: withdraw fee was set to: ${
|
|
1029
|
+
this.newFee / PERCENTAGE_DECIMALS
|
|
1030
|
+
}%`
|
|
1031
|
+
: `Pool ${getContractName(this.pool)} updated: withdraw fee was ${
|
|
1032
|
+
this.newFee > this.prevFee ? "increased" : "decreased"
|
|
1033
|
+
}: ${this.prevFee / PERCENTAGE_DECIMALS}% => ${
|
|
1034
|
+
this.newFee / PERCENTAGE_DECIMALS
|
|
1035
|
+
}%`;
|
|
1036
|
+
}
|
|
972
1037
|
}
|
|
973
1038
|
|
|
974
1039
|
// // Emits each time new configurator is set up
|
|
975
1040
|
// event NewPriceFeed(address indexed token, address indexed priceFeed);
|
|
976
1041
|
|
|
977
1042
|
interface NewPriceFeedProps extends EVMEventProps {
|
|
978
|
-
|
|
979
|
-
|
|
1043
|
+
token: string;
|
|
1044
|
+
priceFeed: string;
|
|
980
1045
|
}
|
|
981
1046
|
|
|
982
1047
|
export class EventNewPriceFeed extends EVMEvent {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
}
|
|
1048
|
+
public readonly token: string;
|
|
1049
|
+
|
|
1050
|
+
public readonly priceFeed: string;
|
|
1051
|
+
|
|
1052
|
+
constructor(opts: NewPriceFeedProps) {
|
|
1053
|
+
super({
|
|
1054
|
+
block: opts.block,
|
|
1055
|
+
txHash: opts.txHash,
|
|
1056
|
+
timestamp: opts.timestamp
|
|
1057
|
+
});
|
|
1058
|
+
this.token = opts.token;
|
|
1059
|
+
this.priceFeed = opts.priceFeed;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
1063
|
+
const { symbol } = tokenData[this.token.toLowerCase()] || {};
|
|
1064
|
+
|
|
1065
|
+
return `PriceOracle: oracle for ${symbol} was updated to ${getContractName(
|
|
1066
|
+
this.priceFeed
|
|
1067
|
+
)}`;
|
|
1068
|
+
}
|
|
1003
1069
|
}
|
|
1004
1070
|
|
|
1005
1071
|
// // emits each time when DAO takes account from account factory forever
|
|
1006
1072
|
// event TakeForever(address indexed creditAccount, address indexed to);
|
|
1007
1073
|
|
|
1008
1074
|
interface TakeForeverProps extends EVMEventProps {
|
|
1009
|
-
|
|
1010
|
-
|
|
1075
|
+
creditAccount: string;
|
|
1076
|
+
to: string;
|
|
1011
1077
|
}
|
|
1012
1078
|
|
|
1013
1079
|
export class EventTakeForever extends EVMEvent {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}
|
|
1080
|
+
public readonly creditAccount: string;
|
|
1081
|
+
|
|
1082
|
+
public readonly to: string;
|
|
1083
|
+
|
|
1084
|
+
constructor(opts: TakeForeverProps) {
|
|
1085
|
+
super({
|
|
1086
|
+
block: opts.block,
|
|
1087
|
+
txHash: opts.txHash,
|
|
1088
|
+
timestamp: opts.timestamp
|
|
1089
|
+
});
|
|
1090
|
+
this.creditAccount = opts.creditAccount;
|
|
1091
|
+
this.to = opts.to;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
toString(): string {
|
|
1095
|
+
return `AccountFactory: account ${this.creditAccount} was taken forever and transferred to ${this.to}`;
|
|
1096
|
+
}
|
|
1030
1097
|
}
|
|
1031
1098
|
|
|
1032
1099
|
// Paused / Unpaused event (!)
|
|
1033
1100
|
|
|
1034
1101
|
interface PausedProps extends EVMEventProps {
|
|
1035
|
-
|
|
1102
|
+
contract: string;
|
|
1036
1103
|
}
|
|
1037
1104
|
|
|
1038
1105
|
export class EventPaused extends EVMEvent {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1106
|
+
public readonly contract: string;
|
|
1107
|
+
|
|
1108
|
+
constructor(opts: PausedProps) {
|
|
1109
|
+
super({
|
|
1110
|
+
block: opts.block,
|
|
1111
|
+
txHash: opts.txHash,
|
|
1112
|
+
timestamp: opts.timestamp
|
|
1113
|
+
});
|
|
1114
|
+
this.contract = opts.contract;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
toString(): string {
|
|
1118
|
+
return `${getContractName(this.contract)} was paused`;
|
|
1119
|
+
}
|
|
1053
1120
|
}
|
|
1054
1121
|
|
|
1055
1122
|
interface UnPausedProps extends EVMEventProps {
|
|
1056
|
-
|
|
1123
|
+
contract: string;
|
|
1057
1124
|
}
|
|
1058
1125
|
|
|
1059
1126
|
export class EventUnPaused extends EVMEvent {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1127
|
+
public readonly contract: string;
|
|
1128
|
+
|
|
1129
|
+
constructor(opts: UnPausedProps) {
|
|
1130
|
+
super({
|
|
1131
|
+
block: opts.block,
|
|
1132
|
+
txHash: opts.txHash,
|
|
1133
|
+
timestamp: opts.timestamp
|
|
1134
|
+
});
|
|
1135
|
+
this.contract = opts.contract;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
toString(): string {
|
|
1139
|
+
return `${getContractName(this.contract)} was unpaused`;
|
|
1140
|
+
}
|
|
1074
1141
|
}
|
|
1075
1142
|
|
|
1076
1143
|
// // emits each time when new pausable admin added
|
|
1077
1144
|
// event PausableAdminAdded(address indexed newAdmin);
|
|
1078
1145
|
|
|
1079
1146
|
interface PausableAdminAddedProps extends EVMEventProps {
|
|
1080
|
-
|
|
1147
|
+
admin: string;
|
|
1081
1148
|
}
|
|
1082
1149
|
|
|
1083
1150
|
export class EventPausableAdminAdded extends EVMEvent {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1151
|
+
public readonly admin: string;
|
|
1152
|
+
|
|
1153
|
+
constructor(opts: PausableAdminAddedProps) {
|
|
1154
|
+
super({
|
|
1155
|
+
block: opts.block,
|
|
1156
|
+
txHash: opts.txHash,
|
|
1157
|
+
timestamp: opts.timestamp
|
|
1158
|
+
});
|
|
1159
|
+
this.admin = opts.admin;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
toString(): string {
|
|
1163
|
+
return `ACL: pausable admin ${this.admin} was added`;
|
|
1164
|
+
}
|
|
1098
1165
|
}
|
|
1099
1166
|
|
|
1100
1167
|
// emits each time when pausable admin removed
|
|
1101
1168
|
// event PausableAdminRemoved(address indexed admin);
|
|
1102
1169
|
|
|
1103
1170
|
interface PausableAdminRemovedProps extends EVMEventProps {
|
|
1104
|
-
|
|
1171
|
+
admin: string;
|
|
1105
1172
|
}
|
|
1106
1173
|
|
|
1107
1174
|
export class EventPausableAdminRemoved extends EVMEvent {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1175
|
+
public readonly admin: string;
|
|
1176
|
+
|
|
1177
|
+
constructor(opts: PausableAdminRemovedProps) {
|
|
1178
|
+
super({
|
|
1179
|
+
block: opts.block,
|
|
1180
|
+
txHash: opts.txHash,
|
|
1181
|
+
timestamp: opts.timestamp
|
|
1182
|
+
});
|
|
1183
|
+
this.admin = opts.admin;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
toString(): string {
|
|
1187
|
+
return `ACL: pausable admin ${this.admin} was removed`;
|
|
1188
|
+
}
|
|
1122
1189
|
}
|
|
1123
1190
|
|
|
1124
1191
|
// // emits each time when new unpausable admin added
|
|
1125
1192
|
// event UnpausableAdminAdded(address indexed newAdmin);
|
|
1126
1193
|
|
|
1127
1194
|
interface UnPausableAdminAddedProps extends EVMEventProps {
|
|
1128
|
-
|
|
1195
|
+
admin: string;
|
|
1129
1196
|
}
|
|
1130
1197
|
|
|
1131
1198
|
export class EventUnPausableAdminAdded extends EVMEvent {
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1199
|
+
public readonly admin: string;
|
|
1200
|
+
|
|
1201
|
+
constructor(opts: UnPausableAdminAddedProps) {
|
|
1202
|
+
super({
|
|
1203
|
+
block: opts.block,
|
|
1204
|
+
txHash: opts.txHash,
|
|
1205
|
+
timestamp: opts.timestamp
|
|
1206
|
+
});
|
|
1207
|
+
this.admin = opts.admin;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
toString(): string {
|
|
1211
|
+
return `ACL: unpausable admin ${this.admin} was added`;
|
|
1212
|
+
}
|
|
1146
1213
|
}
|
|
1147
1214
|
|
|
1148
1215
|
// emits each times when unpausable admin removed
|
|
1149
1216
|
// event UnpausableAdminRemoved(address indexed admin);
|
|
1150
1217
|
|
|
1151
1218
|
interface UnPausableAdminRemovedProps extends EVMEventProps {
|
|
1152
|
-
|
|
1219
|
+
admin: string;
|
|
1153
1220
|
}
|
|
1154
1221
|
|
|
1155
1222
|
export class EventUnPausableAdminRemoved extends EVMEvent {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1223
|
+
public readonly admin: string;
|
|
1224
|
+
|
|
1225
|
+
constructor(opts: UnPausableAdminRemovedProps) {
|
|
1226
|
+
super({
|
|
1227
|
+
block: opts.block,
|
|
1228
|
+
txHash: opts.txHash,
|
|
1229
|
+
timestamp: opts.timestamp
|
|
1230
|
+
});
|
|
1231
|
+
this.admin = opts.admin;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
toString(): string {
|
|
1235
|
+
return `ACL: unpausable admin ${this.admin} was removed`;
|
|
1236
|
+
}
|
|
1170
1237
|
}
|
|
1171
1238
|
|
|
1172
1239
|
interface TransferOwnershipProps extends EVMEventProps {
|
|
1173
|
-
|
|
1240
|
+
admin: string;
|
|
1174
1241
|
}
|
|
1175
1242
|
|
|
1176
1243
|
// ACL: Transfer ownership
|
|
1177
1244
|
export class EventTransferOwnership extends EVMEvent {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1245
|
+
public readonly newOwner: string;
|
|
1246
|
+
|
|
1247
|
+
constructor(opts: TransferOwnershipProps) {
|
|
1248
|
+
super({
|
|
1249
|
+
block: opts.block,
|
|
1250
|
+
txHash: opts.txHash,
|
|
1251
|
+
timestamp: opts.timestamp
|
|
1252
|
+
});
|
|
1253
|
+
this.newOwner = opts.admin;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
toString(): string {
|
|
1257
|
+
return `ACL: configurator was changed to ${this.newOwner}`;
|
|
1258
|
+
}
|
|
1192
1259
|
}
|