Skip to content

Commit

Permalink
feat(chain.config): add EWC config
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhender committed Dec 14, 2021
1 parent 013e2de commit 6353a20
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 105 deletions.
35 changes: 0 additions & 35 deletions docs/api/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@
- [DeletingNamespaceNotPossibleError](index.md#deletingnamespacenotpossibleerror)
- [DidRegistry](index.md#didregistry)
- [DomainsService](index.md#domainsservice)
- [ENERGYWEB](index.md#energyweb)
- [ENERGYWEB\_OWNER\_DID](index.md#energyweb_owner_did)
- [ENERGYWEB\_ROOT](index.md#energyweb_root)
- [ENSOwnerNotValidAddressError](index.md#ensownernotvalidaddresserror)
- [ENSTypeNotSupportedError](index.md#enstypenotsupportederror)
- [ERROR\_MESSAGES](index.md#error_messages)
- [EWC](index.md#ewc)
- [EkcSigner](index.md#ekcsigner)
- [ExecutionEnvironment](index.md#executionenvironment)
- [IAM](index.md#iam)
- [IApp](index.md#iapp)
- [ICacheClient](index.md#icacheclient)
- [IClaimIssuance](index.md#iclaimissuance)
Expand Down Expand Up @@ -234,24 +229,6 @@ Re-exports: [DomainsService](../classes/modules_domains_domains_service.DomainsS

___

### ENERGYWEB

Re-exports: [ENERGYWEB](utils_constants.md#energyweb)

___

### ENERGYWEB\_OWNER\_DID

Re-exports: [ENERGYWEB\_OWNER\_DID](utils_constants.md#energyweb_owner_did)

___

### ENERGYWEB\_ROOT

Re-exports: [ENERGYWEB\_ROOT](utils_constants.md#energyweb_root)

___

### ENSOwnerNotValidAddressError

Re-exports: [ENSOwnerNotValidAddressError](../classes/errors_ENSOwnerNotValidAddressError.ENSOwnerNotValidAddressError.md)
Expand All @@ -270,12 +247,6 @@ Re-exports: [ERROR\_MESSAGES](../enums/errors_ErrorMessages.ERROR_MESSAGES.md)

___

### EWC

Re-exports: [EWC](utils_constants.md#ewc)

___

### EkcSigner

Re-exports: [EkcSigner](../classes/modules_signer_ekcSigner.EkcSigner.md)
Expand All @@ -288,12 +259,6 @@ Re-exports: [ExecutionEnvironment](../enums/utils_detectEnvironment.ExecutionEnv

___

### IAM

Re-exports: [IAM](utils_constants.md#iam)

___

### IApp

Re-exports: [IApp](../interfaces/modules_domains_domains_types.IApp.md)
Expand Down
35 changes: 0 additions & 35 deletions docs/api/modules/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

### References

- [ENERGYWEB](utils.md#energyweb)
- [ENERGYWEB\_OWNER\_DID](utils.md#energyweb_owner_did)
- [ENERGYWEB\_ROOT](utils.md#energyweb_root)
- [EWC](utils.md#ewc)
- [ExecutionEnvironment](utils.md#executionenvironment)
- [IAM](utils.md#iam)
- [VOLTA\_CHAIN\_ID](utils.md#volta_chain_id)
- [addSupportedDID](utils.md#addsupporteddid)
- [defaultAzureProxyUrl](utils.md#defaultazureproxyurl)
Expand All @@ -22,42 +17,12 @@

## References

### ENERGYWEB

Re-exports: [ENERGYWEB](utils_constants.md#energyweb)

___

### ENERGYWEB\_OWNER\_DID

Re-exports: [ENERGYWEB\_OWNER\_DID](utils_constants.md#energyweb_owner_did)

___

### ENERGYWEB\_ROOT

Re-exports: [ENERGYWEB\_ROOT](utils_constants.md#energyweb_root)

___

### EWC

Re-exports: [EWC](utils_constants.md#ewc)

___

### ExecutionEnvironment

Re-exports: [ExecutionEnvironment](../enums/utils_detectEnvironment.ExecutionEnvironment.md)

___

### IAM

Re-exports: [IAM](utils_constants.md#iam)

___

### VOLTA\_CHAIN\_ID

Re-exports: [VOLTA\_CHAIN\_ID](utils_constants.md#volta_chain_id)
Expand Down
35 changes: 0 additions & 35 deletions docs/api/modules/utils_constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

### Variables

- [ENERGYWEB](utils_constants.md#energyweb)
- [ENERGYWEB\_OWNER\_DID](utils_constants.md#energyweb_owner_did)
- [ENERGYWEB\_ROOT](utils_constants.md#energyweb_root)
- [EWC](utils_constants.md#ewc)
- [IAM](utils_constants.md#iam)
- [VOLTA\_CHAIN\_ID](utils_constants.md#volta_chain_id)
- [defaultAzureProxyUrl](utils_constants.md#defaultazureproxyurl)
- [defaultBridgeUrl](utils_constants.md#defaultbridgeurl)
Expand All @@ -17,36 +12,6 @@

## Variables

### ENERGYWEB

`Const` **ENERGYWEB**: ``"energyweb"``

___

### ENERGYWEB\_OWNER\_DID

`Const` **ENERGYWEB\_OWNER\_DID**: ``"did:ethr:volta:0xc56e810fE6715C6c6F0818bb16DAF1fE6A0121e2"``

___

### ENERGYWEB\_ROOT

`Const` **ENERGYWEB\_ROOT**: ``"dmitryfesenko.iam.ewc"``

___

### EWC

`Const` **EWC**: ``"ewc"``

___

### IAM

`Const` **IAM**: ``"iam"``

___

### VOLTA\_CHAIN\_ID

`Const` **VOLTA\_CHAIN\_ID**: ``73799``
Expand Down
23 changes: 23 additions & 0 deletions src/config/chain.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
VOLTA_IDENTITY_MANAGER_ADDRESS,
VOLTA_CLAIM_MANAGER_ADDRESS,
VOLTA_STAKING_POOL_FACTORY_ADDRESS,
EWC_CHAIN_ID,
} from "@energyweb/iam-contracts";
import { VOLTA_CHAIN_ID } from "../utils/constants";

Expand All @@ -27,6 +28,15 @@ export interface ChainConfig {

export type ChainId = number;

// TODO: Would be better if some of these were in @energyweb/iam-contracts
const EWC_CLAIM_MANAGER_ADDRESS = "0x23b026631A6f265d17CFee8aa6ced1B244f3920C";
const EWC_ENS_REGISTRY_ADDRESS = "0x0A6d64413c07E10E890220BBE1c49170080C6Ca0";
const EWC_RESOLVER_V1_ADDRESS = "0x70ad37DfeB1C05290F4bBd22188FA19Bc154A0ea";
const EWC_PUBLIC_RESOLVER_ADDRESS = "0xA517983Bd4Af4DF0Ed9b52DA4BC405d0A95eE7E2";
const EWC_DOMAIN_NOTIFER_ADDRESS = "0x5491Db3cC1f3AFf6C229e061735F92936004da3c";
const EWC_IDENTITY_MANAGER_ADDRESS = "0x2d1569f3a2006d21c0dc60eb13c8557b63ce5a8d";
const EwcAddress1056 = "0xE29672f34e92b56C9169f9D485fFc8b9A136BCE4";

/**
* Set of parameters to configure connection to chain with id received from wallet.
* If configuration for some chain is missing or should be reconfigured use `setChainConfig` before class instantiation
Expand All @@ -45,6 +55,19 @@ const chainConfig: Record<number, ChainConfig> = {
claimManagerAddress: VOLTA_CLAIM_MANAGER_ADDRESS,
stakingPoolFactoryAddress: VOLTA_STAKING_POOL_FACTORY_ADDRESS,
},
[EWC_CHAIN_ID]: {
chainName: Chain.EWC,
chainDisplayName: "Energy Web Chain",
rpcUrl: "https://rpc.energyweb.org/",
ensRegistryAddress: EWC_ENS_REGISTRY_ADDRESS,
ensResolverAddress: EWC_RESOLVER_V1_ADDRESS,
ensPublicResolverAddress: EWC_PUBLIC_RESOLVER_ADDRESS,
domainNotifierAddress: EWC_DOMAIN_NOTIFER_ADDRESS,
assetManagerAddress: EWC_IDENTITY_MANAGER_ADDRESS,
didRegistryAddress: EwcAddress1056,
claimManagerAddress: EWC_CLAIM_MANAGER_ADDRESS,
stakingPoolFactoryAddress: "", // This is not deployed on EWC
},
};

export const chainConfigs = () => ({ ...chainConfig });
Expand Down

0 comments on commit 6353a20

Please sign in to comment.