Skip to content

Commit d7ce00c

Browse files
feat: add bootstrapPeriod to EthersLiquityConnection
It is the length of time in seconds after deployment during which redemptions are disabled.
1 parent fa9382a commit d7ce00c

10 files changed

+38
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@liquity/lib-ethers](./lib-ethers.md) &gt; [EthersLiquityConnection](./lib-ethers.ethersliquityconnection.md) &gt; [bootstrapPeriod](./lib-ethers.ethersliquityconnection.bootstrapperiod.md)
4+
5+
## EthersLiquityConnection.bootstrapPeriod property
6+
7+
Time period (in seconds) after `deploymentDate` during which redemptions are disabled.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly bootstrapPeriod: number;
13+
```

docs/sdk/lib-ethers.ethersliquityconnection.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Exposed through [ReadableEthersLiquity.connection](./lib-ethers.readableethersli
2424
| Property | Type | Description |
2525
| --- | --- | --- |
2626
| [addresses](./lib-ethers.ethersliquityconnection.addresses.md) | Record&lt;string, string&gt; | A mapping of Liquity contracts' names to their addresses. |
27+
| [bootstrapPeriod](./lib-ethers.ethersliquityconnection.bootstrapperiod.md) | number | Time period (in seconds) after <code>deploymentDate</code> during which redemptions are disabled. |
2728
| [chainId](./lib-ethers.ethersliquityconnection.chainid.md) | number | Chain ID of the connected network. |
2829
| [deploymentDate](./lib-ethers.ethersliquityconnection.deploymentdate.md) | Date | Date when the Liquity contracts were deployed. |
2930
| [provider](./lib-ethers.ethersliquityconnection.provider.md) | [EthersProvider](./lib-ethers.ethersprovider.md) | Ethers <code>Provider</code> used for connecting to the network. |

packages/lib-ethers/deployments/default/goerli.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"chainId": 5,
33
"version": "6201cfd8c83fc3828483e17f5f05ca4168f56c0c",
4-
"deploymentDate": 1616754713895,
4+
"deploymentDate": 1616755061000,
5+
"bootstrapPeriod": 1209600,
56
"_priceFeedIsTestnet": true,
67
"_uniTokenIsMock": false,
78
"_isDev": false,
@@ -25,4 +26,4 @@
2526
"multiTroveGetter": "0x09A7c9E2b0a0A474b4b16819461C3d93a8272397",
2627
"uniToken": "0x6D9FD2eA57A1E566e3A942f1c7d90257Ce5c8d44"
2728
}
28-
}
29+
}

packages/lib-ethers/deployments/default/kovan.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"chainId": 42,
33
"version": "6201cfd8c83fc3828483e17f5f05ca4168f56c0c",
4-
"deploymentDate": 1616753475477,
4+
"deploymentDate": 1616753759000,
5+
"bootstrapPeriod": 1209600,
56
"_priceFeedIsTestnet": false,
67
"_uniTokenIsMock": false,
78
"_isDev": false,

packages/lib-ethers/deployments/default/rinkeby.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"chainId": 4,
33
"version": "6201cfd8c83fc3828483e17f5f05ca4168f56c0c",
4-
"deploymentDate": 1616758093339,
4+
"deploymentDate": 1616758339000,
5+
"bootstrapPeriod": 1209600,
56
"_priceFeedIsTestnet": true,
67
"_uniTokenIsMock": false,
78
"_isDev": false,
@@ -25,4 +26,4 @@
2526
"multiTroveGetter": "0x1B93fb4379cAEFD7ccfd454524550Ac67Af5a1B8",
2627
"uniToken": "0x4B38E7B07a505A02722f3b7C6F167c058c4fCe6D"
2728
}
28-
}
29+
}

packages/lib-ethers/deployments/default/ropsten.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"chainId": 3,
33
"version": "6201cfd8c83fc3828483e17f5f05ca4168f56c0c",
4-
"deploymentDate": 1616754661551,
4+
"deploymentDate": 1616754932000,
5+
"bootstrapPeriod": 1209600,
56
"_priceFeedIsTestnet": true,
67
"_uniTokenIsMock": false,
78
"_isDev": false,
@@ -25,4 +26,4 @@
2526
"multiTroveGetter": "0xE247cE9E107F90d2230236B0C4c31D3601889460",
2627
"uniToken": "0xC780A57F071E38d85eF88074109ce77Aa5b36FD9"
2728
}
28-
}
29+
}

packages/lib-ethers/etc/lib-ethers.api.md

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export interface EthersLiquityConnection extends EthersLiquityConnectionOptional
218218
// @internal (undocumented)
219219
readonly [brand]: unique symbol;
220220
readonly addresses: Record<string, string>;
221+
readonly bootstrapPeriod: number;
221222
readonly chainId: number;
222223
readonly deploymentDate: Date;
223224
// @internal (undocumented)

packages/lib-ethers/src/EthersLiquityConnection.ts

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export interface EthersLiquityConnection extends EthersLiquityConnectionOptional
6262
/** Date when the Liquity contracts were deployed. */
6363
readonly deploymentDate: Date;
6464

65+
/** Time period (in seconds) after `deploymentDate` during which redemptions are disabled. */
66+
readonly bootstrapPeriod: number;
67+
6568
/** A mapping of Liquity contracts' names to their addresses. */
6669
readonly addresses: Record<string, string>;
6770

packages/lib-ethers/src/contracts.ts

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export interface _LiquityDeploymentJSON {
224224
readonly addresses: _LiquityContractAddresses;
225225
readonly version: string;
226226
readonly deploymentDate: number;
227+
readonly bootstrapPeriod: number;
227228
readonly _priceFeedIsTestnet: boolean;
228229
readonly _uniTokenIsMock: boolean;
229230
readonly _isDev: boolean;

packages/lib-ethers/utils/deploy.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ export const deployAndSetupContracts = async (
314314
chainId: await deployer.getChainId(),
315315
version: "unknown",
316316
deploymentDate: new Date().getTime(),
317+
bootstrapPeriod: 0,
317318
_priceFeedIsTestnet,
318319
_uniTokenIsMock: !wethAddress,
319320
_isDev,
@@ -333,10 +334,16 @@ export const deployAndSetupContracts = async (
333334
};
334335

335336
const contracts = _connectToContracts(deployer, deployment);
337+
const lqtyTokenDeploymentTime = await contracts.lqtyToken.getDeploymentStartTime();
338+
const bootstrapPeriod = await contracts.troveManager.BOOTSTRAP_PERIOD();
336339

337340
log("Connecting contracts...");
338341

339342
await connectContracts(contracts, deployer, overrides);
340343

341-
return deployment;
344+
return {
345+
...deployment,
346+
deploymentDate: lqtyTokenDeploymentTime.toNumber(),
347+
bootstrapPeriod: bootstrapPeriod.toNumber()
348+
};
342349
};

0 commit comments

Comments
 (0)