Skip to content

Commit

Permalink
chore(deps): Upgrade to mangrove.js v2.0.4 and mangrove-deployments v…
Browse files Browse the repository at this point in the history
…2.0.0 (#214)
  • Loading branch information
espendk authored Jan 16, 2024
1 parent 38b8d97 commit d6f29f4
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 85 deletions.
46 changes: 23 additions & 23 deletions docs/developers/SDK/technical-references/code/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Renames and re-exports [Mangrove](classes/Mangrove.md)

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:26
@mangrovedao/mangrove.js/src/configuration.ts:25

___

Expand All @@ -83,7 +83,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:34
@mangrovedao/mangrove.js/src/configuration.ts:33

___

Expand All @@ -93,7 +93,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:35
@mangrovedao/mangrove.js/src/configuration.ts:34

___

Expand All @@ -103,7 +103,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:36
@mangrovedao/mangrove.js/src/configuration.ts:35

___

Expand All @@ -113,7 +113,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:37
@mangrovedao/mangrove.js/src/configuration.ts:36

___

Expand All @@ -123,7 +123,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:39
@mangrovedao/mangrove.js/src/configuration.ts:38

___

Expand All @@ -133,7 +133,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:40
@mangrovedao/mangrove.js/src/configuration.ts:39

___

Expand All @@ -154,7 +154,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:42
@mangrovedao/mangrove.js/src/configuration.ts:41

___

Expand All @@ -171,7 +171,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:50
@mangrovedao/mangrove.js/src/configuration.ts:49

___

Expand All @@ -192,7 +192,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:55
@mangrovedao/mangrove.js/src/configuration.ts:54

___

Expand Down Expand Up @@ -224,7 +224,7 @@ The maximum number of offers to include in a single retract transaction to avoid

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:81
@mangrovedao/mangrove.js/src/configuration.ts:80

___

Expand Down Expand Up @@ -266,7 +266,7 @@ The default baseQuoteTickOffset number of ticks to jump between two price points

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:94
@mangrovedao/mangrove.js/src/configuration.ts:93

___

Expand All @@ -276,7 +276,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:102
@mangrovedao/mangrove.js/src/configuration.ts:101

___

Expand All @@ -286,7 +286,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:113
@mangrovedao/mangrove.js/src/configuration.ts:112

___

Expand All @@ -296,7 +296,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:116
@mangrovedao/mangrove.js/src/configuration.ts:115

___

Expand All @@ -306,7 +306,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:118
@mangrovedao/mangrove.js/src/configuration.ts:117

___

Expand All @@ -316,7 +316,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:119
@mangrovedao/mangrove.js/src/configuration.ts:118

___

Expand All @@ -326,7 +326,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:126
@mangrovedao/mangrove.js/src/configuration.ts:125

___

Expand Down Expand Up @@ -358,7 +358,7 @@ The overhead of making a market order using the take function on MangroveOrder v

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:135
@mangrovedao/mangrove.js/src/configuration.ts:134

___

Expand All @@ -368,7 +368,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:141
@mangrovedao/mangrove.js/src/configuration.ts:140

___

Expand All @@ -390,7 +390,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:146
@mangrovedao/mangrove.js/src/configuration.ts:145

___

Expand All @@ -400,7 +400,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:158
@mangrovedao/mangrove.js/src/configuration.ts:157

___

Expand Down Expand Up @@ -1040,7 +1040,7 @@ ___

#### Defined in

@mangrovedao/mangrove.js/src/configuration.ts:796
@mangrovedao/mangrove.js/src/configuration.ts:771

## Functions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,46 @@

## Core contract addresses

| Contract | Version | Polygon Testnet - Mumbai | Sepolia Testnet |
| --- | :---: | --- | --- |
| Mangrove | 2.0.1 | `0x80cd6Ef14c23dD3957FD5629141a9d7028557c39` | `0x5B2F8058Df0A0b7744FDb4fD0885FbCD2394194C` |
| MgvOracle | 2.0.1 | `0xC0fB136768e4b7725d674B8Bcd366A5dc2b5F976` | `0xF15A2ada64A9C3C14ca11359c8F1d22B063DB2AD` |
| MgvReader | 2.0.1 | `0x26d24Dd4aFcB9D1cD30baf804Fa22aFa643327CD` | `0xE9F139F4D31477E71e746a6744e5314F9d6DB382` |


### Polygon Testnet - Mumbai

| Contract | Deployment name | Version | Address |
| -------- | --------------- | :---: | ------- |
| Mangrove | - | 2.0.1 | `0x80cd6Ef14c23dD3957FD5629141a9d7028557c39` |
| MgvOracle | - | 2.0.1 | `0xC0fB136768e4b7725d674B8Bcd366A5dc2b5F976` |
| MgvReader | - | 2.0.1 | `0x26d24Dd4aFcB9D1cD30baf804Fa22aFa643327CD` |


### Sepolia Testnet

| Contract | Deployment name | Version | Address |
| -------- | --------------- | :---: | ------- |
| Mangrove | - | 2.0.1 | `0x5B2F8058Df0A0b7744FDb4fD0885FbCD2394194C` |
| MgvOracle | - | 2.0.1 | `0xF15A2ada64A9C3C14ca11359c8F1d22B063DB2AD` |
| MgvReader | - | 2.0.1 | `0xE9F139F4D31477E71e746a6744e5314F9d6DB382` |


## Strats contract addresses

| Contract | Version | Polygon Testnet - Mumbai |
| --- | :---: | --- |
| AaveKandelSeeder | 1.0.0 | `0xC56CEc2A5912B49AAacEc0F391471Aeb4eb8D9D2` |
| AavePooledRouter | 1.0.0 | `0xF147995331B1511D5fA7c196fA3466d647142C5e` |
| KandelLib | 1.0.0 | `0x6733a81A505a15eBd2CAB15eE2F978FF74A18dD4` |
| KandelSeeder | 1.0.0 | `0x68A1778E4D08D8f6De35323a9040791CE8E9EF4C` |
| MangroveOrder-Router | 1.0.0 | `0x983d34A6163F00D5DfDCC3f21ff70cECa2a8643D` |
| MangroveOrder | 1.0.0 | `0x6469064C68B1Bd06861dabD20dF835Fa71Dff695` |


### Polygon Testnet - Mumbai

| Contract | Deployment name | Version | Address |
| -------- | --------------- | :---: | ------- |
| AaveKandelSeeder | - | 1.0.0 | `0xC56CEc2A5912B49AAacEc0F391471Aeb4eb8D9D2` |
| AavePooledRouter | - | 1.0.0 | `0xF147995331B1511D5fA7c196fA3466d647142C5e` |
| Kandel | KandelLib | 1.0.0 | `0x6733a81A505a15eBd2CAB15eE2F978FF74A18dD4` |
| KandelSeeder | - | 1.0.0 | `0x68A1778E4D08D8f6De35323a9040791CE8E9EF4C` |
| SimpleRouter | MangroveOrder-Router | 1.0.0 | `0x983d34A6163F00D5DfDCC3f21ff70cECa2a8643D` |
| MangroveOrder | - | 1.0.0 | `0x6469064C68B1Bd06861dabD20dF835Fa71Dff695` |


### Sepolia Testnet

| Contract | Deployment name | Version | Address |
| -------- | --------------- | :---: | ------- |


## Token addresses
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"value":"@mangrovedao/mangrove-deployments@npm:1.0.3","children":{"Version":"1.0.3","Dependencies":[{"descriptor":"semver@npm:^7.5.4","locator":"semver@npm:7.5.4"}]}}
{"value":"@mangrovedao/mangrove-deployments@npm:2.0.0","children":{"Version":"2.0.0","Dependencies":[{"descriptor":"semver@npm:^7.5.4","locator":"semver@npm:7.5.4"}]}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"value":"@mangrovedao/mangrove.js@npm:2.0.3","children":{"Version":"2.0.3","Exported Binaries":["mgv"],"Dependencies":[{"descriptor":"@ethersproject/experimental@npm:^5.7.0","locator":"@ethersproject/experimental@npm:5.7.0"},{"descriptor":"@mangrovedao/context-addresses@npm:^1.0.1","locator":"@mangrovedao/context-addresses@npm:1.0.1"},{"descriptor":"@mangrovedao/mangrove-core@npm:^2.0.3","locator":"@mangrovedao/mangrove-core@npm:2.0.3"},{"descriptor":"@mangrovedao/mangrove-deployments@npm:^1.0.3","locator":"@mangrovedao/mangrove-deployments@npm:1.0.3"},{"descriptor":"@mangrovedao/mangrove-strats@npm:^1.0.2","locator":"@mangrovedao/mangrove-strats@npm:1.0.2"},{"descriptor":"@mangrovedao/reliable-event-subscriber@npm:1.1.29","locator":"@mangrovedao/reliable-event-subscriber@npm:1.1.29"},{"descriptor":"@types/object-inspect@npm:^1.8.1","locator":"@types/object-inspect@npm:1.8.1"},{"descriptor":"@types/triple-beam@npm:^1.3.2","locator":"@types/triple-beam@npm:1.3.2"},{"descriptor":"async-mutex@npm:^0.4.0","locator":"async-mutex@npm:0.4.0"},{"descriptor":"big.js@npm:^6.2.1","locator":"big.js@npm:6.2.1"},{"descriptor":"deepmerge@npm:^4.3.1","locator":"deepmerge@npm:4.3.1"},{"descriptor":"ethers@npm:^5.7.2","locator":"ethers@npm:5.7.2"},{"descriptor":"json-truncate@npm:^3.0.0","locator":"json-truncate@npm:3.0.0"},{"descriptor":"just-clone@npm:^6.2.0","locator":"just-clone@npm:6.2.0"},{"descriptor":"logform@npm:^2.5.1","locator":"logform@npm:2.5.1"},{"descriptor":"loglevel@npm:^1.8.1","locator":"loglevel@npm:1.8.1"},{"descriptor":"node-cleanup@npm:^2.1.2","locator":"node-cleanup@npm:2.1.2"},{"descriptor":"object-inspect@npm:^1.12.3","locator":"object-inspect@npm:1.12.3"},{"descriptor":"semver@npm:^7.5.4","locator":"semver@npm:7.5.4"},{"descriptor":"triple-beam@npm:^1.3.0","locator":"triple-beam@npm:1.3.0"},{"descriptor":"util@npm:^0.12.5","locator":"util@npm:0.12.5"},{"descriptor":"yargs@npm:^17.3.0","locator":"yargs@npm:17.7.1"}]}}
{"value":"@mangrovedao/mangrove.js@npm:2.0.4","children":{"Version":"2.0.4","Exported Binaries":["mgv"],"Dependencies":[{"descriptor":"@ethersproject/experimental@npm:^5.7.0","locator":"@ethersproject/experimental@npm:5.7.0"},{"descriptor":"@mangrovedao/context-addresses@npm:^1.0.1","locator":"@mangrovedao/context-addresses@npm:1.0.1"},{"descriptor":"@mangrovedao/mangrove-core@npm:^2.0.3","locator":"@mangrovedao/mangrove-core@npm:2.0.3"},{"descriptor":"@mangrovedao/mangrove-deployments@npm:^2.0.0","locator":"@mangrovedao/mangrove-deployments@npm:2.0.0"},{"descriptor":"@mangrovedao/mangrove-strats@npm:^1.0.2","locator":"@mangrovedao/mangrove-strats@npm:1.0.2"},{"descriptor":"@mangrovedao/reliable-event-subscriber@npm:1.1.29","locator":"@mangrovedao/reliable-event-subscriber@npm:1.1.29"},{"descriptor":"@types/object-inspect@npm:^1.8.1","locator":"@types/object-inspect@npm:1.8.1"},{"descriptor":"@types/triple-beam@npm:^1.3.2","locator":"@types/triple-beam@npm:1.3.2"},{"descriptor":"async-mutex@npm:^0.4.0","locator":"async-mutex@npm:0.4.0"},{"descriptor":"big.js@npm:^6.2.1","locator":"big.js@npm:6.2.1"},{"descriptor":"deepmerge@npm:^4.3.1","locator":"deepmerge@npm:4.3.1"},{"descriptor":"ethers@npm:^5.7.2","locator":"ethers@npm:5.7.2"},{"descriptor":"json-truncate@npm:^3.0.0","locator":"json-truncate@npm:3.0.0"},{"descriptor":"just-clone@npm:^6.2.0","locator":"just-clone@npm:6.2.0"},{"descriptor":"logform@npm:^2.5.1","locator":"logform@npm:2.5.1"},{"descriptor":"loglevel@npm:^1.8.1","locator":"loglevel@npm:1.8.1"},{"descriptor":"node-cleanup@npm:^2.1.2","locator":"node-cleanup@npm:2.1.2"},{"descriptor":"object-inspect@npm:^1.12.3","locator":"object-inspect@npm:1.12.3"},{"descriptor":"semver@npm:^7.5.4","locator":"semver@npm:7.5.4"},{"descriptor":"triple-beam@npm:^1.3.0","locator":"triple-beam@npm:1.3.0"},{"descriptor":"util@npm:^0.12.5","locator":"util@npm:0.12.5"},{"descriptor":"yargs@npm:^17.3.0","locator":"yargs@npm:17.7.1"}]}}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@docusaurus/theme-mermaid": "^2.2.0",
"@mangrovedao/mangrove-core": "^2.0.3",
"@mangrovedao/mangrove-strats": "^1.0.2",
"@mangrovedao/mangrove.js": "^2.0.3",
"@mangrovedao/mangrove.js": "^2.0.4",
"@mdx-js/react": "^1.6.22",
"@types/big.js": "^6.1.6",
"@types/node-cleanup": "^2.1.2",
Expand Down Expand Up @@ -70,7 +70,7 @@
"@ethersproject/abi": "^5.4.7",
"@ethersproject/providers": "^5.4.7",
"@mangrovedao/context-addresses": "^1.0.1",
"@mangrovedao/mangrove-deployments": "^1.0.3",
"@mangrovedao/mangrove-deployments": "^2.0.0",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
Expand Down
54 changes: 20 additions & 34 deletions scripts/addresses-to-md.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { writeFileSync } = require('fs');
const { getAllErc20s } = require('@mangrovedao/context-addresses');
const { getCoreContractsVersionDeployments, getStratsContractsVersionDeployments } = require('@mangrovedao/mangrove-deployments');
const { getLatestCoreContractsPerNetwork, getLatestStratContractsPerNetwork } = require('@mangrovedao/mangrove-deployments');

const chainNames = {
1: "Ethereum Mainnet",
Expand All @@ -11,41 +11,27 @@ const chainNames = {
11155111: "Sepolia Testnet",
};

function contractsVersionDeploymentsToTable(contractsVersionDeployments) {
// contract -> versionDeployments
const contracts = {};

const chainIds = new Set();
for (const versionDeployments of contractsVersionDeployments) {
contracts[versionDeployments.deploymentName ?? versionDeployments.contractName] = versionDeployments;
for (const [chainId, addresses] of Object.entries(versionDeployments.networkAddresses)) {
if (!chainNames[chainId]) {
throw new Error(`Chain ID ${chainId} not found in chainNames`);
}
chainIds.add(chainId);
function contractsVersionDeploymentsToTable(contractsNetworkDeplloymentPerNetwork, skipMangrove = false) {
let md = "";
for (const [chainId, contractsNetworkDeployment] of Object.entries(contractsNetworkDeplloymentPerNetwork)) {
if (!chainNames[chainId]) {
throw new Error(`Chain ID ${chainId} not found in chainNames`);
}
}

let headerSeparator = "| --- | :---: ";
let md = `| Contract | Version `;
for (const chainId of chainIds) {
md += `| ${chainNames[chainId]} `;
headerSeparator += `| --- `;
}
md += `|\n`;
md += headerSeparator + `|\n`;
for (const [contractName, versionDeployments] of Object.entries(contracts)) {
md += `| ${contractName} | ${versionDeployments.version} `;
for (const chainId of chainIds) {
const addresses = versionDeployments.networkAddresses[chainId];
if (addresses) {
md += `| \`${addresses.primaryAddress}\` `;
} else {
md += `| `;
md += `\n\n### ${chainNames[chainId]}\n\n`;

md += `| Contract | Deployment name | Version | Address |\n`;
md += "| -------- | --------------- | :---: | ------- |\n";

for (const contractNetworkDeployment of Object.values(contractsNetworkDeployment)) {
if (contractNetworkDeployment === undefined) {
continue;
}
if (skipMangrove && contractNetworkDeployment.contractName === "Mangrove") {
continue;
}
md += `| ${contractNetworkDeployment.contractName} | ${contractNetworkDeployment.deploymentName ?? '-'} | ${contractNetworkDeployment.version} | \`${contractNetworkDeployment.address}\` |\n`;
}
md += `|`;
md += "\n";
}

return md;
Expand All @@ -55,10 +41,10 @@ const main = async () => {
let md = "<!-- GENERATED DO NOT EDIT - see addresses-to-md.js -->";

md += "\n\n## Core contract addresses\n\n";
md += contractsVersionDeploymentsToTable(getCoreContractsVersionDeployments());
md += contractsVersionDeploymentsToTable(getLatestCoreContractsPerNetwork(), false);

md += "\n\n## Strats contract addresses\n\n";
md += contractsVersionDeploymentsToTable(getStratsContractsVersionDeployments());
md += contractsVersionDeploymentsToTable(getLatestStratContractsPerNetwork(), true);

md += "\n\n## Token addresses";
md += "\nMangrove's web app and other tools use the following token addresses which are pulled from `@mangrovedao/context-addresses`.";
Expand Down
Loading

0 comments on commit d6f29f4

Please sign in to comment.