forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add etherium DID registry and universal DID resolver contract to genesis
Signed-off-by: aziz.karabashov <[email protected]>
- Loading branch information
1 parent
a15f6c7
commit 35e785b
Showing
17 changed files
with
149 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
indy-besu/smart_contracts/scripts/genesis/contracts/ethereumDidRegistry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { config } from '../config' | ||
import { ContractConfig } from '../contractConfig' | ||
import { buildSection } from '../helpers' | ||
|
||
export interface EthereumDidRegistryConfig extends ContractConfig {} | ||
|
||
export function ethereumDidRegistry() { | ||
const { name, address, description } = config.ethereumDidRegistry | ||
const storage: any = {} | ||
|
||
return buildSection(name, address, description, storage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
indy-besu/smart_contracts/scripts/genesis/contracts/universalDidResolver.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { padLeft } from 'web3-utils' | ||
import { config } from '../config' | ||
import { ContractConfig } from '../contractConfig' | ||
import { buildProxySection, slots } from '../helpers' | ||
|
||
export interface UniversalDidResolverConfig extends ContractConfig { | ||
data: { | ||
didRegistryAddress: string | ||
etheriumDidRegistryAddress: string | ||
upgradeControlAddress: string | ||
} | ||
} | ||
|
||
export function universalDidResolver() { | ||
const { name, address, description, data } = config.universalDidResolver | ||
const storage: any = {} | ||
|
||
// address of upgrade control contact stored in slot 0 | ||
storage[slots['0']] = padLeft(data.upgradeControlAddress, 64) | ||
// address of DID registry contact stored in slot 1 | ||
storage[slots['1']] = padLeft(data.didRegistryAddress, 64) | ||
// address of etherium DID registry contact stored in slot 2 | ||
storage[slots['2']] = padLeft(data.etheriumDidRegistryAddress, 64) | ||
return buildProxySection(name, address, description, storage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters