@indigo-labs/indigo-sdk 0.1.19 → 0.1.21
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/.github/workflows/ci.yml +8 -3
- package/dist/index.d.mts +1298 -677
- package/dist/index.d.ts +1298 -677
- package/dist/index.js +4650 -2217
- package/dist/index.mjs +4592 -2192
- package/eslint.config.mjs +7 -1
- package/package.json +9 -4
- package/src/contracts/cdp/helpers.ts +167 -0
- package/src/contracts/cdp/scripts.ts +33 -0
- package/src/contracts/cdp/transactions.ts +1310 -0
- package/src/contracts/cdp/types.ts +161 -0
- package/src/contracts/cdp-creator/scripts.ts +39 -0
- package/src/{types/indigo/cdp-creator.ts → contracts/cdp-creator/types.ts} +6 -4
- package/src/contracts/collector/scripts.ts +32 -0
- package/src/contracts/collector/transactions.ts +44 -0
- package/src/contracts/execute/scripts.ts +48 -0
- package/src/contracts/execute/types.ts +57 -0
- package/src/contracts/gov/helpers.ts +157 -0
- package/src/contracts/gov/scripts.ts +34 -0
- package/src/contracts/gov/transactions.ts +1224 -0
- package/src/contracts/gov/types-new.ts +115 -0
- package/src/contracts/gov/types.ts +89 -0
- package/src/{helpers/interest-oracle.ts → contracts/interest-oracle/helpers.ts} +37 -9
- package/src/contracts/interest-oracle/scripts.ts +18 -0
- package/src/contracts/interest-oracle/transactions.ts +149 -0
- package/src/{types/indigo/interest-oracle.ts → contracts/interest-oracle/types.ts} +1 -1
- package/src/contracts/lrp/scripts.ts +27 -0
- package/src/contracts/{lrp.ts → lrp/transactions.ts} +23 -23
- package/src/{types/indigo/lrp.ts → contracts/lrp/types.ts} +3 -3
- package/src/{scripts/one-shot-policy.ts → contracts/one-shot/scripts.ts} +1 -1
- package/src/contracts/{one-shot.ts → one-shot/transactions.ts} +3 -3
- package/src/contracts/poll/helpers.ts +55 -0
- package/src/contracts/poll/scripts.ts +72 -0
- package/src/contracts/poll/types-poll-manager.ts +38 -0
- package/src/contracts/poll/types-poll-shard.ts +38 -0
- package/src/contracts/poll/types-poll.ts +88 -0
- package/src/{scripts/price-oracle-validator.ts → contracts/price-oracle/scripts.ts} +1 -4
- package/src/contracts/price-oracle/transactions.ts +112 -0
- package/src/{types/indigo/price-oracle.ts → contracts/price-oracle/types.ts} +16 -4
- package/src/{helpers/stability-pool-helpers.ts → contracts/stability-pool/helpers.ts} +110 -6
- package/src/contracts/stability-pool/scripts.ts +46 -0
- package/src/contracts/stability-pool/transactions.ts +660 -0
- package/src/contracts/stability-pool/types-new.ts +208 -0
- package/src/contracts/stability-pool/types.ts +42 -0
- package/src/contracts/staking/helpers.ts +116 -0
- package/src/contracts/staking/scripts.ts +41 -0
- package/src/contracts/staking/transactions.ts +268 -0
- package/src/contracts/staking/types-new.ts +81 -0
- package/src/contracts/staking/types.ts +41 -0
- package/src/contracts/treasury/scripts.ts +37 -0
- package/src/contracts/treasury/transactions.ts +44 -0
- package/src/contracts/treasury/types.ts +55 -0
- package/src/contracts/version-registry/scripts.ts +29 -0
- package/src/contracts/version-registry/types-new.ts +19 -0
- package/src/{types/indigo/version-record.ts → contracts/version-registry/types.ts} +1 -1
- package/src/contracts/vesting/helpers.ts +267 -0
- package/src/index.ts +38 -33
- package/src/types/evolution-schema-options.ts +16 -0
- package/src/types/generic.ts +78 -60
- package/src/types/on-chain-decimal.ts +22 -0
- package/src/types/system-params.ts +22 -11
- package/src/utils/bigint-utils.ts +7 -0
- package/src/{helpers → utils}/helper-txs.ts +1 -0
- package/src/utils/time-helpers.ts +4 -0
- package/src/{helpers/helpers.ts → utils/utils.ts} +0 -10
- package/src/{helpers → utils}/value-helpers.ts +10 -0
- package/src/{scripts → validators}/cdp-creator-validator.ts +4 -50
- package/src/{scripts → validators}/cdp-validator.ts +3 -5
- package/src/{scripts → validators}/collector-validator.ts +2 -3
- package/src/{scripts/version-registry.ts → validators/execute-validator.ts} +3 -11
- package/src/{scripts/gov-validator.ts → validators/governance-validator.ts} +3 -40
- package/src/{scripts → validators}/interest-oracle-validator.ts +4 -20
- package/src/validators/lrp-validator.ts +7 -0
- package/src/validators/poll-manager-validator.ts +7 -0
- package/src/{scripts → validators}/poll-shard-validator.ts +3 -43
- package/src/{scripts → validators}/stability-pool-validator.ts +4 -57
- package/src/{scripts → validators}/staking-validator.ts +2 -3
- package/src/{scripts → validators}/treasury-validator.ts +2 -3
- package/src/{scripts → validators}/version-record-policy.ts +4 -23
- package/src/validators/version-registry-validator.ts +7 -0
- package/tests/cdp.test.ts +1565 -0
- package/tests/datums.test.ts +125 -108
- package/tests/endpoints/initialize.ts +240 -338
- package/tests/gov.test.ts +1874 -0
- package/tests/hash-checks.test.ts +26 -21
- package/tests/indigo-test-helpers.ts +1 -55
- package/tests/initialize.test.ts +10 -5
- package/tests/interest-calculations.test.ts +18 -18
- package/tests/interest-oracle.test.ts +20 -18
- package/tests/lrp.test.ts +180 -78
- package/tests/mock/assets-mock.ts +59 -0
- package/tests/queries/cdp-queries.ts +144 -0
- package/tests/queries/collector-queries.ts +26 -0
- package/tests/queries/execute-queries.ts +46 -0
- package/tests/queries/governance-queries.ts +19 -16
- package/tests/queries/iasset-queries.ts +46 -23
- package/tests/queries/interest-oracle-queries.ts +3 -6
- package/tests/queries/lrp-queries.ts +2 -2
- package/tests/queries/poll-queries.ts +97 -0
- package/tests/queries/price-oracle-queries.ts +5 -22
- package/tests/queries/stability-pool-queries.ts +10 -8
- package/tests/queries/staking-queries.ts +28 -19
- package/tests/queries/treasury-queries.ts +19 -0
- package/tests/stability-pool.test.ts +186 -71
- package/tests/staking.test.ts +30 -23
- package/tests/test-helpers.ts +11 -2
- package/tests/utils/asserts.ts +13 -0
- package/tests/utils/index.ts +50 -0
- package/tsconfig.json +3 -1
- package/vitest.config.ts +1 -1
- package/.github/workflows/test.yml +0 -44
- package/src/contracts/cdp.ts +0 -748
- package/src/contracts/collector.ts +0 -98
- package/src/contracts/gov.ts +0 -1
- package/src/contracts/interest-oracle.ts +0 -149
- package/src/contracts/stability-pool.ts +0 -692
- package/src/contracts/staking.ts +0 -348
- package/src/contracts/treasury.ts +0 -112
- package/src/helpers/asset-helpers.ts +0 -57
- package/src/helpers/staking-helpers.ts +0 -94
- package/src/helpers/time-helpers.ts +0 -4
- package/src/scripts/execute-validator.ts +0 -52
- package/src/scripts/lrp-validator.ts +0 -40
- package/src/scripts/poll-manager-validator.ts +0 -52
- package/src/types/indigo/cdp.ts +0 -88
- package/src/types/indigo/execute.ts +0 -21
- package/src/types/indigo/gov.ts +0 -51
- package/src/types/indigo/poll-manager.ts +0 -21
- package/src/types/indigo/poll-shard.ts +0 -16
- package/src/types/indigo/stability-pool.ts +0 -233
- package/src/types/indigo/staking.ts +0 -99
- /package/src/{types/one-shot.ts → contracts/one-shot/types.ts} +0 -0
- /package/src/{helpers/price-oracle-helpers.ts → contracts/price-oracle/helpers.ts} +0 -0
- /package/src/{helpers → utils}/indigo-helpers.ts +0 -0
- /package/src/{helpers → utils}/lucid-utils.ts +0 -0
|
@@ -2,62 +2,70 @@ import {
|
|
|
2
2
|
Constr,
|
|
3
3
|
credentialToAddress,
|
|
4
4
|
Data,
|
|
5
|
+
fromHex,
|
|
5
6
|
fromText,
|
|
6
7
|
LucidEvolution,
|
|
7
8
|
mintingPolicyToId,
|
|
8
9
|
PolicyId,
|
|
9
10
|
SpendingValidator,
|
|
10
|
-
validatorToAddress,
|
|
11
11
|
validatorToScriptHash,
|
|
12
12
|
} from '@lucid-evolution/lucid';
|
|
13
13
|
import {
|
|
14
14
|
addrDetails,
|
|
15
15
|
AssetClass,
|
|
16
|
-
CDPContract,
|
|
17
16
|
CDPCreatorParamsSP,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
CdpParamsSP,
|
|
18
|
+
CollectorParamsSP,
|
|
19
|
+
createScriptAddress,
|
|
21
20
|
ExecuteParamsSP,
|
|
22
21
|
GovDatum,
|
|
23
22
|
GovParamsSP,
|
|
24
23
|
IAssetContent,
|
|
25
24
|
Input,
|
|
26
|
-
|
|
27
|
-
InterestOracleParams,
|
|
25
|
+
LrpParamsSP,
|
|
28
26
|
mkCDPCreatorValidatorFromSP,
|
|
29
|
-
|
|
27
|
+
mkCdpValidatorFromSP,
|
|
28
|
+
mkCollectorValidatorFromSP,
|
|
29
|
+
mkExecuteValidatorFromSP,
|
|
30
|
+
mkLrpValidatorFromSP,
|
|
30
31
|
mkPollManagerValidatorFromSP,
|
|
31
32
|
mkPollShardValidatorFromSP,
|
|
33
|
+
mkTreasuryValidatorFromSP,
|
|
32
34
|
PollManagerParamsSP,
|
|
33
35
|
PollShardParamsSP,
|
|
34
|
-
PriceOracleDatum,
|
|
35
36
|
PriceOracleParams,
|
|
36
37
|
runOneShotMintTx,
|
|
37
38
|
serialiseGovDatum,
|
|
38
39
|
serialiseIAssetDatum,
|
|
39
|
-
serialiseInterestOracleDatum,
|
|
40
|
-
serialisePriceOracleDatum,
|
|
41
|
-
serialiseStabilityPoolDatum,
|
|
42
|
-
StabilityPoolContent,
|
|
43
40
|
StabilityPoolParamsSP,
|
|
44
|
-
|
|
41
|
+
StakingParamsSP,
|
|
42
|
+
startInterestOracle,
|
|
45
43
|
SystemParams,
|
|
46
44
|
toSystemParamsAsset,
|
|
47
|
-
|
|
48
|
-
TreasuryParams,
|
|
45
|
+
TreasuryParamsSP,
|
|
49
46
|
VersionRecordParams,
|
|
50
47
|
} from '../../src';
|
|
51
48
|
import { mkAuthTokenPolicy } from '../../src/scripts/auth-token-policy';
|
|
52
|
-
import { StakingContract } from '../../src/contracts/staking';
|
|
53
|
-
import { serialiseStakingDatum } from '../../src/types/indigo/staking';
|
|
54
49
|
import { mkIAssetTokenPolicy } from '../../src/scripts/iasset-policy';
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
import { mkGovValidatorFromSP } from '../../src/
|
|
60
|
-
import { mkStabilityPoolValidatorFromSP } from '../../src/
|
|
50
|
+
import {
|
|
51
|
+
mkVersionRecordTokenPolicy,
|
|
52
|
+
mkVersionRegistryValidator,
|
|
53
|
+
} from '../../src/contracts/version-registry/scripts';
|
|
54
|
+
import { mkGovValidatorFromSP } from '../../src/contracts/gov/scripts';
|
|
55
|
+
import { mkStabilityPoolValidatorFromSP } from '../../src/contracts/stability-pool/scripts';
|
|
56
|
+
import { runAndAwaitTxBuilder } from '../test-helpers';
|
|
57
|
+
import { startPriceOracleTx } from '../../src/contracts/price-oracle/transactions';
|
|
58
|
+
import { serialiseStakingDatum } from '../../src/contracts/staking/types-new';
|
|
59
|
+
import {
|
|
60
|
+
initEpochToScaleToSumMap,
|
|
61
|
+
initSpSnapshot,
|
|
62
|
+
} from '../../src/contracts/stability-pool/helpers';
|
|
63
|
+
import {
|
|
64
|
+
serialiseStabilityPoolDatum,
|
|
65
|
+
StabilityPoolContent,
|
|
66
|
+
} from '../../src/contracts/stability-pool/types-new';
|
|
67
|
+
import { InitialAsset } from '../mock/assets-mock';
|
|
68
|
+
import { mkStakingValidatorFromSP } from '../../src/contracts/staking/scripts';
|
|
61
69
|
|
|
62
70
|
const indyTokenName = 'INDY';
|
|
63
71
|
const daoTokenName = 'DAO';
|
|
@@ -77,73 +85,16 @@ const accountTokenName = 'SP_ACCOUNT';
|
|
|
77
85
|
|
|
78
86
|
const totalIndySupply = 35000000000000n;
|
|
79
87
|
// const totalIndyDistribution = 0n;
|
|
80
|
-
const treasuryIndyAmount =
|
|
88
|
+
const treasuryIndyAmount = 100_000n;
|
|
81
89
|
|
|
82
90
|
const numCdpCreators = 2n;
|
|
83
91
|
const numCollectors = 2n;
|
|
84
92
|
|
|
85
|
-
type
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
tokenName: string;
|
|
89
|
-
startPrice: bigint;
|
|
90
|
-
params: {
|
|
91
|
-
biasTime: bigint;
|
|
92
|
-
expirationTime: bigint;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
initerestOracle: {
|
|
96
|
-
tokenName: string;
|
|
97
|
-
initialInterestRate: bigint;
|
|
98
|
-
params: {
|
|
99
|
-
biasTime: bigint;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
redemptionRatioPercentage: bigint;
|
|
103
|
-
maintenanceRatioPercentage: bigint;
|
|
104
|
-
liquidationRatioPercentage: bigint;
|
|
105
|
-
debtMintingFeePercentage: bigint;
|
|
106
|
-
liquidationProcessingFeePercentage: bigint;
|
|
107
|
-
stabilityPoolWithdrawalFeePercentage: bigint;
|
|
108
|
-
redemptionReimbursementPercentage: bigint;
|
|
109
|
-
redemptionProcessingFeePercentage: bigint;
|
|
110
|
-
interestCollectorPortionPercentage: bigint;
|
|
111
|
-
firstAsset: boolean;
|
|
112
|
-
nextAsset?: string;
|
|
93
|
+
export type AssetInfo = {
|
|
94
|
+
iassetTokenNameAscii: string;
|
|
95
|
+
oracleParams: PriceOracleParams;
|
|
113
96
|
};
|
|
114
97
|
|
|
115
|
-
const initialAssets: InitialAsset[] = [
|
|
116
|
-
{
|
|
117
|
-
name: 'iUSD',
|
|
118
|
-
priceOracle: {
|
|
119
|
-
tokenName: 'iUSD_ORACLE',
|
|
120
|
-
startPrice: 1_000_000n,
|
|
121
|
-
params: {
|
|
122
|
-
biasTime: 120_000n,
|
|
123
|
-
expirationTime: 1_800_000n,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
initerestOracle: {
|
|
127
|
-
tokenName: 'iUSD_ORACLE',
|
|
128
|
-
initialInterestRate: 1_000_000n,
|
|
129
|
-
params: {
|
|
130
|
-
biasTime: 120_000n,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
redemptionRatioPercentage: 200_000_000n,
|
|
134
|
-
maintenanceRatioPercentage: 150_000_000n,
|
|
135
|
-
liquidationRatioPercentage: 120_000_000n,
|
|
136
|
-
debtMintingFeePercentage: 500_000n,
|
|
137
|
-
liquidationProcessingFeePercentage: 2_000_000n,
|
|
138
|
-
stabilityPoolWithdrawalFeePercentage: 500_000n,
|
|
139
|
-
redemptionReimbursementPercentage: 1_000_000n,
|
|
140
|
-
redemptionProcessingFeePercentage: 1_000_000n,
|
|
141
|
-
interestCollectorPortionPercentage: 40_000_000n,
|
|
142
|
-
firstAsset: true,
|
|
143
|
-
nextAsset: null,
|
|
144
|
-
},
|
|
145
|
-
];
|
|
146
|
-
|
|
147
98
|
const alwaysFailValidatorHash =
|
|
148
99
|
'ea84d625650d066e1645e3e81d9c70a73f9ed837bd96dc49850ae744';
|
|
149
100
|
|
|
@@ -167,11 +118,11 @@ async function initScriptRef(
|
|
|
167
118
|
validator: SpendingValidator,
|
|
168
119
|
): Promise<Input> {
|
|
169
120
|
const tx = lucid.newTx().pay.ToContract(
|
|
170
|
-
credentialToAddress(lucid.config().network
|
|
121
|
+
credentialToAddress(lucid.config().network!, {
|
|
171
122
|
hash: alwaysFailValidatorHash,
|
|
172
123
|
type: 'Script',
|
|
173
124
|
}),
|
|
174
|
-
|
|
125
|
+
undefined,
|
|
175
126
|
undefined,
|
|
176
127
|
validator,
|
|
177
128
|
);
|
|
@@ -191,15 +142,21 @@ async function initScriptRef(
|
|
|
191
142
|
|
|
192
143
|
async function initCollector(
|
|
193
144
|
lucid: LucidEvolution,
|
|
194
|
-
collectorParams:
|
|
145
|
+
collectorParams: CollectorParamsSP,
|
|
195
146
|
): Promise<void> {
|
|
196
147
|
const tx = lucid.newTx();
|
|
197
148
|
|
|
198
149
|
for (let i = 0; i < Number(numCollectors); i++) {
|
|
199
|
-
tx.pay.ToContract(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
150
|
+
tx.pay.ToContract(
|
|
151
|
+
createScriptAddress(
|
|
152
|
+
lucid.config().network!,
|
|
153
|
+
validatorToScriptHash(mkCollectorValidatorFromSP(collectorParams)),
|
|
154
|
+
),
|
|
155
|
+
{
|
|
156
|
+
kind: 'inline',
|
|
157
|
+
value: Data.to(new Constr(0, [])),
|
|
158
|
+
},
|
|
159
|
+
);
|
|
203
160
|
}
|
|
204
161
|
|
|
205
162
|
const txHash = await tx
|
|
@@ -218,7 +175,7 @@ async function initCDPCreator(
|
|
|
218
175
|
|
|
219
176
|
for (let i = 0; i < Number(numCdpCreators); i++) {
|
|
220
177
|
tx.pay.ToContract(
|
|
221
|
-
credentialToAddress(lucid.config().network
|
|
178
|
+
credentialToAddress(lucid.config().network!, {
|
|
222
179
|
hash: validatorToScriptHash(
|
|
223
180
|
mkCDPCreatorValidatorFromSP(cdpCreatorParams),
|
|
224
181
|
),
|
|
@@ -242,14 +199,14 @@ async function initCDPCreator(
|
|
|
242
199
|
|
|
243
200
|
async function initTreasury(
|
|
244
201
|
lucid: LucidEvolution,
|
|
245
|
-
treasuryParams:
|
|
202
|
+
treasuryParams: TreasuryParamsSP,
|
|
246
203
|
daoAsset: AssetClass,
|
|
247
204
|
indyAsset: AssetClass,
|
|
248
205
|
treasuryIndyAmount: bigint,
|
|
249
206
|
): Promise<void> {
|
|
250
207
|
const tx = lucid.newTx().pay.ToContract(
|
|
251
|
-
credentialToAddress(lucid.config().network
|
|
252
|
-
hash:
|
|
208
|
+
credentialToAddress(lucid.config().network!, {
|
|
209
|
+
hash: validatorToScriptHash(mkTreasuryValidatorFromSP(treasuryParams)),
|
|
253
210
|
type: 'Script',
|
|
254
211
|
}),
|
|
255
212
|
{ kind: 'inline', value: Data.to(new Constr(0, [])) },
|
|
@@ -269,18 +226,20 @@ async function initTreasury(
|
|
|
269
226
|
|
|
270
227
|
async function initStakingManager(
|
|
271
228
|
lucid: LucidEvolution,
|
|
272
|
-
stakingParams:
|
|
229
|
+
stakingParams: StakingParamsSP,
|
|
273
230
|
): Promise<void> {
|
|
274
231
|
const txHash = await lucid
|
|
275
232
|
.newTx()
|
|
276
233
|
.pay.ToContract(
|
|
277
|
-
|
|
234
|
+
createScriptAddress(
|
|
235
|
+
lucid.config().network!,
|
|
236
|
+
validatorToScriptHash(mkStakingValidatorFromSP(stakingParams)),
|
|
237
|
+
),
|
|
278
238
|
{
|
|
279
239
|
kind: 'inline',
|
|
280
240
|
value: serialiseStakingDatum({
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
},
|
|
241
|
+
totalStake: 0n,
|
|
242
|
+
managerSnapshot: { snapshotAda: 0n },
|
|
284
243
|
}),
|
|
285
244
|
},
|
|
286
245
|
{
|
|
@@ -296,128 +255,55 @@ async function initStakingManager(
|
|
|
296
255
|
await lucid.awaitTx(txHash);
|
|
297
256
|
}
|
|
298
257
|
|
|
299
|
-
async function startPriceOracleTx(
|
|
300
|
-
lucid: LucidEvolution,
|
|
301
|
-
assetName: string,
|
|
302
|
-
startPrice: bigint,
|
|
303
|
-
oracleParams: PriceOracleParams,
|
|
304
|
-
now: number = Date.now(),
|
|
305
|
-
): Promise<string> {
|
|
306
|
-
const oraclePolicyId = await mintOneTimeToken(lucid, fromText(assetName), 1n);
|
|
307
|
-
const oracleValidator = mkPriceOracleValidator(oracleParams);
|
|
308
|
-
|
|
309
|
-
const oracleDatum: PriceOracleDatum = {
|
|
310
|
-
price: {
|
|
311
|
-
getOnChainInt: startPrice,
|
|
312
|
-
},
|
|
313
|
-
expiration: BigInt(now) + oracleParams.expiration,
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
const tx = lucid.newTx().pay.ToContract(
|
|
317
|
-
validatorToAddress(lucid.config().network, oracleValidator),
|
|
318
|
-
{ kind: 'inline', value: serialisePriceOracleDatum(oracleDatum) },
|
|
319
|
-
{
|
|
320
|
-
lovelace: 5_000_000n,
|
|
321
|
-
[oraclePolicyId + fromText(assetName)]: 1n,
|
|
322
|
-
},
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
const txHash = await tx
|
|
326
|
-
.complete()
|
|
327
|
-
.then((tx) => tx.sign.withWallet().complete())
|
|
328
|
-
.then((tx) => tx.submit());
|
|
329
|
-
|
|
330
|
-
await lucid.awaitTx(txHash);
|
|
331
|
-
|
|
332
|
-
return oraclePolicyId;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
async function startInterestOracleTx(
|
|
336
|
-
lucid: LucidEvolution,
|
|
337
|
-
assetName: string,
|
|
338
|
-
initialInterestRate: bigint,
|
|
339
|
-
oracleParams: InterestOracleParams,
|
|
340
|
-
): Promise<string> {
|
|
341
|
-
const oraclePolicyId = await mintOneTimeToken(lucid, fromText(assetName), 1n);
|
|
342
|
-
const oracleValidator = mkInterestOracleValidator(oracleParams);
|
|
343
|
-
|
|
344
|
-
const oracleDatum: InterestOracleDatum = {
|
|
345
|
-
unitaryInterest: 0n,
|
|
346
|
-
lastUpdated: 0n,
|
|
347
|
-
interestRate: {
|
|
348
|
-
getOnChainInt: initialInterestRate,
|
|
349
|
-
},
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
const tx = lucid.newTx().pay.ToContract(
|
|
353
|
-
validatorToAddress(lucid.config().network, oracleValidator),
|
|
354
|
-
{ kind: 'inline', value: serialiseInterestOracleDatum(oracleDatum) },
|
|
355
|
-
{
|
|
356
|
-
lovelace: 5_000_000n,
|
|
357
|
-
[oraclePolicyId + fromText(assetName)]: 1n,
|
|
358
|
-
},
|
|
359
|
-
);
|
|
360
|
-
|
|
361
|
-
const txHash = await tx
|
|
362
|
-
.complete()
|
|
363
|
-
.then((tx) => tx.sign.withWallet().complete())
|
|
364
|
-
.then((tx) => tx.submit());
|
|
365
|
-
|
|
366
|
-
await lucid.awaitTx(txHash);
|
|
367
|
-
|
|
368
|
-
return oraclePolicyId;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
258
|
async function initializeAsset(
|
|
372
259
|
lucid: LucidEvolution,
|
|
373
|
-
cdpParams:
|
|
260
|
+
cdpParams: CdpParamsSP,
|
|
374
261
|
iassetToken: AssetClass,
|
|
375
262
|
stabilityPoolParams: StabilityPoolParamsSP,
|
|
376
263
|
stabilityPoolToken: AssetClass,
|
|
377
264
|
asset: InitialAsset,
|
|
378
265
|
now: number = Date.now(),
|
|
379
|
-
): Promise<
|
|
266
|
+
): Promise<AssetInfo> {
|
|
380
267
|
const [pkh, _] = await addrDetails(lucid);
|
|
381
|
-
const
|
|
382
|
-
|
|
268
|
+
const priceOracleParams: PriceOracleParams = {
|
|
269
|
+
owner: pkh.hash,
|
|
270
|
+
biasTime: asset.priceOracle.params.biasTime,
|
|
271
|
+
expiration: asset.priceOracle.params.expirationTime,
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const [priceOracleStartTx, priceOracleNft] = await startPriceOracleTx(
|
|
383
275
|
lucid,
|
|
384
|
-
|
|
385
|
-
asset.priceOracle.startPrice,
|
|
276
|
+
asset.name + '_ORACLE',
|
|
386
277
|
{
|
|
387
|
-
|
|
388
|
-
biasTime: asset.priceOracle.params.biasTime,
|
|
389
|
-
expiration: asset.priceOracle.params.expirationTime,
|
|
278
|
+
getOnChainInt: asset.priceOracle.startPrice,
|
|
390
279
|
},
|
|
280
|
+
priceOracleParams,
|
|
391
281
|
now,
|
|
392
282
|
);
|
|
283
|
+
await runAndAwaitTxBuilder(lucid, priceOracleStartTx);
|
|
393
284
|
|
|
394
285
|
const interestOracleTokenName = asset.name + '_ORACLE';
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
interestOracleTokenName,
|
|
286
|
+
const [startInterestOracleTx, interestOracleNft] = await startInterestOracle(
|
|
287
|
+
0n,
|
|
398
288
|
asset.initerestOracle.initialInterestRate,
|
|
289
|
+
0n,
|
|
399
290
|
{
|
|
400
291
|
owner: pkh.hash,
|
|
401
292
|
biasTime: asset.priceOracle.params.biasTime,
|
|
402
293
|
},
|
|
294
|
+
lucid,
|
|
295
|
+
interestOracleTokenName,
|
|
403
296
|
);
|
|
297
|
+
await runAndAwaitTxBuilder(lucid, startInterestOracleTx);
|
|
404
298
|
|
|
405
299
|
const iassetDatum: IAssetContent = {
|
|
406
300
|
assetName: fromText(asset.name),
|
|
407
301
|
price: {
|
|
408
302
|
Oracle: {
|
|
409
|
-
|
|
410
|
-
asset: {
|
|
411
|
-
currencySymbol: priceOraclePolicyId,
|
|
412
|
-
tokenName: fromText(priceOracleTokenName),
|
|
413
|
-
},
|
|
414
|
-
},
|
|
303
|
+
content: priceOracleNft,
|
|
415
304
|
},
|
|
416
305
|
},
|
|
417
|
-
interestOracleNft:
|
|
418
|
-
currencySymbol: interestOraclePolicyId,
|
|
419
|
-
tokenName: fromText(interestOracleTokenName),
|
|
420
|
-
},
|
|
306
|
+
interestOracleNft: interestOracleNft,
|
|
421
307
|
redemptionRatio: { getOnChainInt: asset.redemptionRatioPercentage },
|
|
422
308
|
maintenanceRatio: { getOnChainInt: asset.maintenanceRatioPercentage },
|
|
423
309
|
liquidationRatio: { getOnChainInt: asset.liquidationRatioPercentage },
|
|
@@ -444,7 +330,10 @@ async function initializeAsset(
|
|
|
444
330
|
const assetTx = lucid
|
|
445
331
|
.newTx()
|
|
446
332
|
.pay.ToContract(
|
|
447
|
-
|
|
333
|
+
createScriptAddress(
|
|
334
|
+
lucid.config().network!,
|
|
335
|
+
validatorToScriptHash(mkCdpValidatorFromSP(cdpParams)),
|
|
336
|
+
),
|
|
448
337
|
{ kind: 'inline', value: serialiseIAssetDatum(iassetDatum) },
|
|
449
338
|
{ [iassetToken.currencySymbol + iassetToken.tokenName]: 1n },
|
|
450
339
|
);
|
|
@@ -457,19 +346,13 @@ async function initializeAsset(
|
|
|
457
346
|
await lucid.awaitTx(assetTxHash);
|
|
458
347
|
|
|
459
348
|
const stabilityPoolDatum: StabilityPoolContent = {
|
|
460
|
-
asset: fromText(asset.name),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
depositVal: { value: 0n },
|
|
464
|
-
sumVal: { value: 0n },
|
|
465
|
-
epoch: 0n,
|
|
466
|
-
scale: 0n,
|
|
467
|
-
},
|
|
468
|
-
epochToScaleToSum: new Map(),
|
|
349
|
+
asset: fromHex(fromText(asset.name)),
|
|
350
|
+
poolSnapshot: initSpSnapshot,
|
|
351
|
+
epochToScaleToSum: initEpochToScaleToSumMap(),
|
|
469
352
|
};
|
|
470
353
|
|
|
471
354
|
const spTx = lucid.newTx().pay.ToContract(
|
|
472
|
-
credentialToAddress(lucid.config().network
|
|
355
|
+
credentialToAddress(lucid.config().network!, {
|
|
473
356
|
hash: validatorToScriptHash(
|
|
474
357
|
mkStabilityPoolValidatorFromSP(stabilityPoolParams),
|
|
475
358
|
),
|
|
@@ -477,9 +360,7 @@ async function initializeAsset(
|
|
|
477
360
|
}),
|
|
478
361
|
{
|
|
479
362
|
kind: 'inline',
|
|
480
|
-
value: serialiseStabilityPoolDatum({
|
|
481
|
-
StabilityPool: { content: stabilityPoolDatum },
|
|
482
|
-
}),
|
|
363
|
+
value: serialiseStabilityPoolDatum({ StabilityPool: stabilityPoolDatum }),
|
|
483
364
|
},
|
|
484
365
|
{
|
|
485
366
|
[stabilityPoolToken.currencySymbol + stabilityPoolToken.tokenName]: 1n,
|
|
@@ -492,12 +373,15 @@ async function initializeAsset(
|
|
|
492
373
|
.then((spTx) => spTx.submit());
|
|
493
374
|
|
|
494
375
|
await lucid.awaitTx(spTxHash);
|
|
376
|
+
|
|
377
|
+
return { iassetTokenNameAscii: asset.name, oracleParams: priceOracleParams };
|
|
495
378
|
}
|
|
496
379
|
|
|
497
380
|
async function initGovernance(
|
|
498
381
|
lucid: LucidEvolution,
|
|
499
382
|
governanceParams: GovParamsSP,
|
|
500
383
|
govToken: AssetClass,
|
|
384
|
+
initialAssets: InitialAsset[],
|
|
501
385
|
): Promise<void> {
|
|
502
386
|
const datum: GovDatum = {
|
|
503
387
|
currentProposal: 0n,
|
|
@@ -505,12 +389,12 @@ async function initGovernance(
|
|
|
505
389
|
protocolParams: {
|
|
506
390
|
effectiveDelay: 1_000n,
|
|
507
391
|
expirationPeriod: 180_000n,
|
|
508
|
-
proposalDeposit:
|
|
509
|
-
proposingPeriod:
|
|
392
|
+
proposalDeposit: 1_000n,
|
|
393
|
+
proposingPeriod: 100_000n,
|
|
510
394
|
collateralFeePercentage: {
|
|
511
395
|
getOnChainInt: 1_500_000n,
|
|
512
396
|
},
|
|
513
|
-
votingPeriod:
|
|
397
|
+
votingPeriod: 1000_000n,
|
|
514
398
|
totalShards: 4n,
|
|
515
399
|
minimumQuorum: 100_000n,
|
|
516
400
|
maxTreasuryLovelaceSpend: 10_000_000n,
|
|
@@ -521,7 +405,7 @@ async function initGovernance(
|
|
|
521
405
|
iassetsCount: BigInt(initialAssets.length),
|
|
522
406
|
};
|
|
523
407
|
const tx = lucid.newTx().pay.ToContract(
|
|
524
|
-
credentialToAddress(lucid.config().network
|
|
408
|
+
credentialToAddress(lucid.config().network!, {
|
|
525
409
|
hash: validatorToScriptHash(mkGovValidatorFromSP(governanceParams)),
|
|
526
410
|
type: 'Script',
|
|
527
411
|
}),
|
|
@@ -577,8 +461,9 @@ async function mintAuthTokenDirect(
|
|
|
577
461
|
|
|
578
462
|
export async function init(
|
|
579
463
|
lucid: LucidEvolution,
|
|
464
|
+
initialAssets: InitialAsset[],
|
|
580
465
|
now: number = Date.now(),
|
|
581
|
-
): Promise<SystemParams> {
|
|
466
|
+
): Promise<[SystemParams, AssetInfo[]]> {
|
|
582
467
|
const indyAsset: AssetClass = {
|
|
583
468
|
currencySymbol: await mintOneTimeToken(
|
|
584
469
|
lucid,
|
|
@@ -689,15 +574,15 @@ export async function init(
|
|
|
689
574
|
tokenName: fromText(stakingTokenName),
|
|
690
575
|
};
|
|
691
576
|
|
|
692
|
-
const collectorParams:
|
|
577
|
+
const collectorParams: CollectorParamsSP = {
|
|
693
578
|
stakingManagerNFT: toSystemParamsAsset(stakingManagerAsset),
|
|
694
579
|
stakingToken: toSystemParamsAsset(stakingToken),
|
|
695
580
|
versionRecordToken: toSystemParamsAsset(versionRecordToken),
|
|
696
581
|
};
|
|
697
|
-
const collectorValidator =
|
|
698
|
-
const collectorValHash =
|
|
582
|
+
const collectorValidator = mkCollectorValidatorFromSP(collectorParams);
|
|
583
|
+
const collectorValHash = validatorToScriptHash(collectorValidator);
|
|
699
584
|
|
|
700
|
-
const stakingParams:
|
|
585
|
+
const stakingParams: StakingParamsSP = {
|
|
701
586
|
stakingManagerNFT: toSystemParamsAsset(stakingManagerAsset),
|
|
702
587
|
stakingToken: toSystemParamsAsset(stakingToken),
|
|
703
588
|
versionRecordToken: toSystemParamsAsset(versionRecordToken),
|
|
@@ -705,7 +590,9 @@ export async function init(
|
|
|
705
590
|
indyToken: toSystemParamsAsset(indyAsset),
|
|
706
591
|
collectorValHash: collectorValHash,
|
|
707
592
|
};
|
|
708
|
-
const stakingValHash =
|
|
593
|
+
const stakingValHash = validatorToScriptHash(
|
|
594
|
+
mkStakingValidatorFromSP(stakingParams),
|
|
595
|
+
);
|
|
709
596
|
|
|
710
597
|
await initStakingManager(lucid, stakingParams);
|
|
711
598
|
|
|
@@ -750,14 +637,14 @@ export async function init(
|
|
|
750
637
|
mkStabilityPoolValidatorFromSP(stabilityPoolParams);
|
|
751
638
|
const stabilityPoolValHash = validatorToScriptHash(stabilityPoolValidator);
|
|
752
639
|
|
|
753
|
-
const treasuryParams:
|
|
640
|
+
const treasuryParams: TreasuryParamsSP = {
|
|
754
641
|
upgradeToken: toSystemParamsAsset(upgradeToken),
|
|
755
642
|
versionRecordToken: toSystemParamsAsset(versionRecordToken),
|
|
756
|
-
treasuryUtxosStakeCredential:
|
|
643
|
+
treasuryUtxosStakeCredential: undefined,
|
|
757
644
|
};
|
|
758
645
|
|
|
759
|
-
const treasuryValidator =
|
|
760
|
-
const treasuryValHash =
|
|
646
|
+
const treasuryValidator = mkTreasuryValidatorFromSP(treasuryParams);
|
|
647
|
+
const treasuryValHash = validatorToScriptHash(treasuryValidator);
|
|
761
648
|
|
|
762
649
|
await initTreasury(
|
|
763
650
|
lucid,
|
|
@@ -767,7 +654,7 @@ export async function init(
|
|
|
767
654
|
treasuryIndyAmount,
|
|
768
655
|
);
|
|
769
656
|
|
|
770
|
-
const cdpParams:
|
|
657
|
+
const cdpParams: CdpParamsSP = {
|
|
771
658
|
cdpAuthToken: toSystemParamsAsset(cdpToken),
|
|
772
659
|
cdpAssetSymbol: { unCurrencySymbol: assetSymbol },
|
|
773
660
|
iAssetAuthToken: toSystemParamsAsset(iassetToken),
|
|
@@ -782,7 +669,7 @@ export async function init(
|
|
|
782
669
|
biasTime: 120_000,
|
|
783
670
|
treasuryValHash: treasuryValHash,
|
|
784
671
|
};
|
|
785
|
-
const cdpValHash =
|
|
672
|
+
const cdpValHash = validatorToScriptHash(mkCdpValidatorFromSP(cdpParams));
|
|
786
673
|
|
|
787
674
|
const cdpCreatorParams: CDPCreatorParamsSP = {
|
|
788
675
|
cdpCreatorNft: toSystemParamsAsset(cdpCreatorAsset),
|
|
@@ -801,6 +688,7 @@ export async function init(
|
|
|
801
688
|
await initCDPCreator(lucid, cdpCreatorParams);
|
|
802
689
|
await initCollector(lucid, collectorParams);
|
|
803
690
|
|
|
691
|
+
const assetInfos = [];
|
|
804
692
|
if (initialAssets.length > 0) {
|
|
805
693
|
await mintAuthTokenDirect(lucid, govNftAsset, pollManagerTokenName, 1n);
|
|
806
694
|
await mintAuthTokenDirect(lucid, pollToken, upgradeTokenName, 1n);
|
|
@@ -814,7 +702,7 @@ export async function init(
|
|
|
814
702
|
1n,
|
|
815
703
|
);
|
|
816
704
|
|
|
817
|
-
await initializeAsset(
|
|
705
|
+
const assetInfo = await initializeAsset(
|
|
818
706
|
lucid,
|
|
819
707
|
cdpParams,
|
|
820
708
|
iassetToken,
|
|
@@ -823,6 +711,8 @@ export async function init(
|
|
|
823
711
|
asset,
|
|
824
712
|
now,
|
|
825
713
|
);
|
|
714
|
+
|
|
715
|
+
assetInfos.push(assetInfo);
|
|
826
716
|
}
|
|
827
717
|
|
|
828
718
|
await mintAuthTokenDirect(lucid, pollToken, upgradeTokenName, -1n);
|
|
@@ -881,133 +771,145 @@ export async function init(
|
|
|
881
771
|
const govValidator = mkGovValidatorFromSP(govParams);
|
|
882
772
|
const govValHash = validatorToScriptHash(govValidator);
|
|
883
773
|
|
|
884
|
-
await initGovernance(lucid, govParams, govNftAsset);
|
|
774
|
+
await initGovernance(lucid, govParams, govNftAsset, initialAssets);
|
|
885
775
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
input: await initScriptRef(lucid, CDPContract.validator(cdpParams)),
|
|
914
|
-
},
|
|
915
|
-
collectorValidatorRef: {
|
|
916
|
-
input: await initScriptRef(lucid, collectorValidator),
|
|
917
|
-
},
|
|
918
|
-
executeValidatorRef: {
|
|
919
|
-
input: await initScriptRef(lucid, executeValidator),
|
|
920
|
-
},
|
|
921
|
-
govValidatorRef: {
|
|
922
|
-
input: await initScriptRef(lucid, govValidator),
|
|
923
|
-
},
|
|
924
|
-
pollShardValidatorRef: {
|
|
925
|
-
input: await initScriptRef(lucid, pollShardValidator),
|
|
926
|
-
},
|
|
927
|
-
pollManagerValidatorRef: {
|
|
928
|
-
input: await initScriptRef(lucid, pollManagerValidator),
|
|
929
|
-
},
|
|
930
|
-
iAssetTokenPolicyRef: {
|
|
931
|
-
input: await initScriptRef(lucid, assetSymbolPolicy),
|
|
932
|
-
},
|
|
933
|
-
stakingValidatorRef: {
|
|
934
|
-
input: await initScriptRef(
|
|
935
|
-
lucid,
|
|
936
|
-
StakingContract.validator(stakingParams),
|
|
937
|
-
),
|
|
938
|
-
},
|
|
939
|
-
stabilityPoolValidatorRef: {
|
|
940
|
-
input: await initScriptRef(lucid, stabilityPoolValidator),
|
|
941
|
-
},
|
|
942
|
-
treasuryValidatorRef: {
|
|
943
|
-
input: await initScriptRef(lucid, treasuryValidator),
|
|
944
|
-
},
|
|
945
|
-
governanceValidatorRef: {
|
|
946
|
-
input: await initScriptRef(lucid, govValidator),
|
|
947
|
-
},
|
|
948
|
-
versionRegistryValidatorRef: {
|
|
949
|
-
input: await initScriptRef(lucid, versionRegistryValidator),
|
|
950
|
-
},
|
|
951
|
-
versionRecordTokenPolicyRef: {
|
|
952
|
-
input: await initScriptRef(lucid, versionRecordTokenPolicy),
|
|
953
|
-
},
|
|
954
|
-
liquidityValidatorRef: {
|
|
955
|
-
input: undefined,
|
|
776
|
+
const lrpParams: LrpParamsSP = {
|
|
777
|
+
iassetNft: cdpParams.iAssetAuthToken,
|
|
778
|
+
iassetPolicyId: cdpParams.cdpAssetSymbol,
|
|
779
|
+
minRedemptionLovelacesAmt: 10_000_000n,
|
|
780
|
+
versionRecordToken: cdpParams.versionRecordToken,
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
const lrpValidator = mkLrpValidatorFromSP(lrpParams);
|
|
784
|
+
const lrpValHash = validatorToScriptHash(lrpValidator);
|
|
785
|
+
|
|
786
|
+
return [
|
|
787
|
+
{
|
|
788
|
+
cdpParams: cdpParams,
|
|
789
|
+
cdpCreatorParams: cdpCreatorParams,
|
|
790
|
+
collectorParams: collectorParams,
|
|
791
|
+
executeParams: executeParams,
|
|
792
|
+
govParams: govParams,
|
|
793
|
+
stakingParams: stakingParams,
|
|
794
|
+
stabilityPoolParams: stabilityPoolParams,
|
|
795
|
+
treasuryParams: treasuryParams,
|
|
796
|
+
pollShardParams: pollShardParams,
|
|
797
|
+
pollManagerParams: pollManagerParams,
|
|
798
|
+
indyToken: toSystemParamsAsset(indyAsset),
|
|
799
|
+
distributionParams: {
|
|
800
|
+
treasuryIndyAmount: 1_575_000_000_000,
|
|
801
|
+
totalINDYSupply: 35_000_000_000_000,
|
|
802
|
+
initialIndyDistribution: 1_575_000_000_000,
|
|
956
803
|
},
|
|
957
|
-
|
|
958
|
-
|
|
804
|
+
lrpParams: lrpParams,
|
|
805
|
+
versionRecordParams: versionRecordParams,
|
|
806
|
+
startTime: {
|
|
807
|
+
slot: 0,
|
|
808
|
+
blockHeader: '',
|
|
959
809
|
},
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
input: await initScriptRef(lucid,
|
|
963
|
-
},
|
|
964
|
-
iAssetAuthTokenRef: {
|
|
965
|
-
input: await initScriptRef(lucid, iassetTokenPolicy),
|
|
810
|
+
scriptReferences: {
|
|
811
|
+
lrpValidatorRef: {
|
|
812
|
+
input: await initScriptRef(lucid, lrpValidator),
|
|
966
813
|
},
|
|
967
|
-
|
|
968
|
-
input: await initScriptRef(lucid,
|
|
814
|
+
cdpCreatorValidatorRef: {
|
|
815
|
+
input: await initScriptRef(lucid, cdpCreatorValidator),
|
|
969
816
|
},
|
|
970
|
-
|
|
971
|
-
input: await initScriptRef(lucid,
|
|
817
|
+
cdpValidatorRef: {
|
|
818
|
+
input: await initScriptRef(lucid, mkCdpValidatorFromSP(cdpParams)),
|
|
972
819
|
},
|
|
973
|
-
|
|
974
|
-
input: await initScriptRef(lucid,
|
|
820
|
+
collectorValidatorRef: {
|
|
821
|
+
input: await initScriptRef(lucid, collectorValidator),
|
|
975
822
|
},
|
|
976
|
-
|
|
977
|
-
input: await initScriptRef(lucid,
|
|
823
|
+
executeValidatorRef: {
|
|
824
|
+
input: await initScriptRef(lucid, executeValidator),
|
|
978
825
|
},
|
|
979
|
-
|
|
980
|
-
input: await initScriptRef(lucid,
|
|
826
|
+
govValidatorRef: {
|
|
827
|
+
input: await initScriptRef(lucid, govValidator),
|
|
981
828
|
},
|
|
982
|
-
|
|
983
|
-
input: await initScriptRef(lucid,
|
|
829
|
+
pollShardValidatorRef: {
|
|
830
|
+
input: await initScriptRef(lucid, pollShardValidator),
|
|
984
831
|
},
|
|
985
|
-
|
|
986
|
-
input: await initScriptRef(lucid,
|
|
832
|
+
pollManagerValidatorRef: {
|
|
833
|
+
input: await initScriptRef(lucid, pollManagerValidator),
|
|
987
834
|
},
|
|
988
|
-
|
|
989
|
-
input: await initScriptRef(lucid,
|
|
835
|
+
iAssetTokenPolicyRef: {
|
|
836
|
+
input: await initScriptRef(lucid, assetSymbolPolicy),
|
|
990
837
|
},
|
|
991
|
-
|
|
838
|
+
stakingValidatorRef: {
|
|
992
839
|
input: await initScriptRef(
|
|
993
840
|
lucid,
|
|
994
|
-
|
|
841
|
+
mkStakingValidatorFromSP(stakingParams),
|
|
995
842
|
),
|
|
996
843
|
},
|
|
844
|
+
stabilityPoolValidatorRef: {
|
|
845
|
+
input: await initScriptRef(lucid, stabilityPoolValidator),
|
|
846
|
+
},
|
|
847
|
+
treasuryValidatorRef: {
|
|
848
|
+
input: await initScriptRef(lucid, treasuryValidator),
|
|
849
|
+
},
|
|
850
|
+
governanceValidatorRef: {
|
|
851
|
+
input: await initScriptRef(lucid, govValidator),
|
|
852
|
+
},
|
|
853
|
+
versionRegistryValidatorRef: {
|
|
854
|
+
input: await initScriptRef(lucid, versionRegistryValidator),
|
|
855
|
+
},
|
|
856
|
+
versionRecordTokenPolicyRef: {
|
|
857
|
+
input: await initScriptRef(lucid, versionRecordTokenPolicy),
|
|
858
|
+
},
|
|
859
|
+
authTokenPolicies: {
|
|
860
|
+
cdpAuthTokenRef: {
|
|
861
|
+
input: await initScriptRef(lucid, cdpTokenPolicy),
|
|
862
|
+
},
|
|
863
|
+
iAssetAuthTokenRef: {
|
|
864
|
+
input: await initScriptRef(lucid, iassetTokenPolicy),
|
|
865
|
+
},
|
|
866
|
+
accountTokenRef: {
|
|
867
|
+
input: await initScriptRef(lucid, accountTokenPolicy),
|
|
868
|
+
},
|
|
869
|
+
stabilityPoolAuthTokenRef: {
|
|
870
|
+
input: await initScriptRef(lucid, stabilityPoolTokenPolicy),
|
|
871
|
+
},
|
|
872
|
+
pollManagerTokenRef: {
|
|
873
|
+
input: await initScriptRef(lucid, pollTokenPolicy),
|
|
874
|
+
},
|
|
875
|
+
stakingTokenRef: {
|
|
876
|
+
input: await initScriptRef(lucid, stakingTokenPolicy),
|
|
877
|
+
},
|
|
878
|
+
versionRecordTokenRef: {
|
|
879
|
+
input: await initScriptRef(lucid, versionRecordTokenPolicy),
|
|
880
|
+
},
|
|
881
|
+
iAssetTokenRef: {
|
|
882
|
+
input: await initScriptRef(lucid, assetSymbolPolicy),
|
|
883
|
+
},
|
|
884
|
+
upgradeTokenRef: {
|
|
885
|
+
input: await initScriptRef(lucid, upgradeTokenPolicy),
|
|
886
|
+
},
|
|
887
|
+
stabilityPoolTokenRef: {
|
|
888
|
+
input: await initScriptRef(lucid, stabilityPoolTokenPolicy),
|
|
889
|
+
},
|
|
890
|
+
snapshotEpochToScaleToSumTokenRef: {
|
|
891
|
+
input: await initScriptRef(
|
|
892
|
+
lucid,
|
|
893
|
+
snapshotEpochToScaleToSumTokenPolicy,
|
|
894
|
+
),
|
|
895
|
+
},
|
|
896
|
+
},
|
|
997
897
|
},
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
898
|
+
validatorHashes: {
|
|
899
|
+
cdpCreatorHash: cdpCreatorValHash,
|
|
900
|
+
cdpHash: cdpValHash,
|
|
901
|
+
executeHash: executeValHash,
|
|
902
|
+
govHash: govValHash,
|
|
903
|
+
pollShardHash: pollShardValHash,
|
|
904
|
+
pollManagerHash: pollManagerValHash,
|
|
905
|
+
treasuryHash: treasuryValHash,
|
|
906
|
+
stabilityPoolHash: stabilityPoolValHash,
|
|
907
|
+
stakingHash: stakingValHash,
|
|
908
|
+
collectorHash: collectorValHash,
|
|
909
|
+
versionRegistryHash: versionRegistryValHash,
|
|
910
|
+
lrpHash: lrpValHash,
|
|
911
|
+
},
|
|
912
|
+
} as SystemParams,
|
|
913
|
+
assetInfos,
|
|
914
|
+
];
|
|
1013
915
|
}
|