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