Skip to content

Commit

Permalink
feat: add deployments JSON and use an index for the module
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Jul 7, 2022
1 parent bd6f1b7 commit ae9f393
Show file tree
Hide file tree
Showing 7 changed files with 2,454 additions and 64 deletions.
17 changes: 17 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}],
"@semantic-release/npm",
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "docs", "package.json", "yarn.lock"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
],
"branches": ["develop", "master"]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ To use the contract, we provide hardhat artifacts. Once you require the `ethr-di
object containing the JSON.

```javascript
const DidRegistryContract = require('ethr-did-registry')
const { EthereumDIDRegistry } = require('ethr-did-registry')
```

You can use [`ethers.js`](https://github.com/ethers-io/ethers.js/) to utilize these artifacts.

```javascript
const { ethers } = require('ethers')
const DidReg = new ethers.Contract(registryAddress, DidRegistryContract.abi)
const DidReg = new ethers.Contract(registryAddress, EthereumDIDRegistry.abi)
DidReg.connect(yourSignerOrProvider)
```

Expand Down
35 changes: 35 additions & 0 deletions deployments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export type EthrDidRegistryDeployment = {
chainId: number
registry: string
name?: string
description?: string
rpcUrl?: string
[x: string]: any
}

export const deployments: EthrDidRegistryDeployment[] = [
{ chainId: 1, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'mainnet' },
{ chainId: 3, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'ropsten' },
{ chainId: 4, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'rinkeby' },
{ chainId: 5, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'goerli' },
{ chainId: 42, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'kovan' },
{ chainId: 30, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'rsk' },
{ chainId: 31, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', description: 'rsk:testnet' },
{
chainId: 246,
registry: '0xE29672f34e92b56C9169f9D485fFc8b9A136BCE4',
name: 'ewc',
description: 'energy web chain',
},
{
chainId: 73799,
registry: '0xC15D5A57A8Eb0e1dCBE5D88B8f9a82017e5Cc4AF',
name: 'volta',
description: 'energy web testnet',
},
{ chainId: 246785, registry: '0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B', description: 'artis:tau1' },
{ chainId: 246529, registry: '0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B', description: 'artis:sigma1' },
{ chainId: 137, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'polygon' },
{ chainId: 80001, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', description: 'polygon:test' },
{ chainId: 1313161554, registry: '0x63eD58B671EeD12Bc1652845ba5b2CDfBff198e0', name: 'aurora' },
]
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// default deployments
export { deployments, EthrDidRegistryDeployment } from './deployments'

// contract ABI
export { default as EthereumDIDRegistry } from './artifacts/contracts/EthereumDIDRegistry.sol/EthereumDIDRegistry.json'
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ethr-did-registry",
"version": "0.0.4",
"description": "A repository storing keys and other data about Ethereum Decentralized Identifiers (DIDs)",
"main": "artifacts/contracts/EthereumDIDRegistry.sol/EthereumDIDRegistry.json",
"main": "./dist/index.js",
"dependencies": {},
"devDependencies": {
"@babel/core": "7.16.0",
Expand All @@ -11,6 +11,8 @@
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^2.1.3",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@typechain/ethers-v5": "^7.0.1",
"@typechain/hardhat": "^2.3.0",
"@types/chai": "^4.2.21",
Expand Down Expand Up @@ -39,6 +41,7 @@
"ls": "^0.2.1",
"prettier": "^2.3.2",
"prettier-plugin-solidity": "^1.0.0-beta.13",
"semantic-release": "19.0.3",
"solhint": "^3.3.6",
"solidity-coverage": "^0.7.16",
"ts-node": "^10.1.0",
Expand All @@ -56,7 +59,7 @@
"lint": "yarn lint:sol && yarn lint:js",
"prettier": "prettier -w '**/*.{ts,js,json,md}'"
},
"author": "Pelle Braendgaard <pelle.braendgaard@consensys.net>",
"author": "Pelle Braendgaard",
"contributors": [
"Mircea Nistor <mirceanis@gmail.com>"
],
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"target": "es2018",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"declaration": true,
"esModuleInterop": true,
"resolveJsonModule": true
}
},
}
Loading

0 comments on commit ae9f393

Please sign in to comment.