diff --git a/docs/design/legacy-identifiers-support.md b/docs/design/legacy-identifiers-support.md index 296569b8..5b51ede1 100644 --- a/docs/design/legacy-identifiers-support.md +++ b/docs/design/legacy-identifiers-support.md @@ -4,68 +4,92 @@ The idea is using of a basic mapping between legacy DIDs identifiers and ethereu `did:indy2` DID method. So that legacy DID can be associated with a new `did:ethr` and we can only use `did:ethr` in the network. -* Create a new `LegacyIdMappingRegistry` smart contract which will be holding mapping of legacy identifiers to ethereum accounts/new ids: +* Create a new `LegacyMappingRegistry` smart contract which will be holding mapping of legacy identifiers to ethereum accounts/new ids: ``` - contract LegacyIdMappingRegistry { - // did:sov: -> ethr account address - mapping(string => address) public didMappings; + contract LegacyMappingRegistry { + // Mapping storing indy/sov DID identifiers to the corresponding account address + mapping(bytes16 legacyIdentifier => address account) public didMapping; - // legacy formated ids of schemas and cred defs -> new id - mapping(string => string) public clMappings; + // Mapping storing indy/sov formatted identifiers of schema/credential-definition to the corresponding new form + mapping(string legacyId => string newId) public resourceMapping; - function createDidMapping(string legacyDid, bytes32 key, bytes32 ed25518Signature) { + function createDidMapping( + address identity, + string calldata identifier, + bytes32 ed25519Key, + bytes calldata ed25519Signature + ) // check signature // check legacyDid is derived from key - didMappings[legacyDid] = msg.sender; + didMapping[identifier] = msg.sender; } - function endorseDidMapping(address identity, string legacyDid, bytes32 key, bytes32 ed25518Signature, bytes32 ecdsaSignature) { + function createDidMappingSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + string calldata identifier, + bytes32 ed25519Key, + bytes calldata ed25518Signature + ) // check signatures - didMappings[legacyDid] = identity; + didMapping[identifier] = identity; } - // resolve mapping done through `didMappings(string)` function available after contract compilation + // resolve mapping done through `didMapping(bytes16 identifier)` function available after contract compilation - function createClMapping(string legacyId, string id, bytes32 key, bytes32 signature) { + function createResourceMapping( + address identity, + string calldata legacyIssuerIdentifier, + string calldata legacyIdentifier, + string calldata newIdentifier + ) // fetch issuer did from legacy schema/credDef id // check issuer did is derived from key // check msg.sender is owner of issuer did // check identity is owner of schema / cred def // check signature - clMappings[legacyId] = id; + resourceMapping[legacyIdentifier] = newIdentifier; } - function endorseClMapping(address identity, string legacyId, string id, bytes32 key, bytes32 ed25518Signature, bytes32 ecdsaSignature) { + function createResourceMappingSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + string calldata legacyIssuerIdentifier, + string calldata legacyIdentifier, + string calldata newIdentifier + ) // fetch issuer did from legacy schema/credDef id // check issuer did is derived from key // check identity is owner of issuer did // check identity is owner of schema / cred def // check signatures - clMappings[legacyId] = id; + resourceMapping[legacyIdentifier] = newIdentifier; } - // resolve mapping done through `clMappings(string)` function available after contract compilation + // resolve mapping done through `resourceMapping(string legacyIdentifier)` function available after contract compilation } ``` * Note, that user must pass signature over identifier to prove ownership * On migration, DID owners willing to preserve resolving of legacy formatted DIDs and id's must do: * add mapping between legacy identifier and ethereum account representing `did:ethr` identifier by - executing `LegacyIdMappingRegistry.createDidMapping(...)` method where he must pass: + executing `LegacyMappingRegistry.createDidMapping(...)` method where he must pass: * DID identifier itself * Associated public key * Ed25519 signature owner identifier proving ownership - * Signature must be done over the following hash value: `keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), msg.sender, "createDidMapping", legacyDid, identity, key))` - * add mapping between legacy schema/credDef id's and new ones executing `LegacyIdMappingRegistry.createClMapping()` method he must pass: + * Signature must be done over `legacyDid` bytes + * add mapping between legacy schema/credDef id's and new ones executing `LegacyMappingRegistry.createResourceMapping()` method he must pass: + * Legacy DID * Legacy schema/credDef id * New id of corresponding schema/credDef - * Associated public key - * Ed25519 signature owner identifier proving ownership - * Signature must be done over the following hash value: `keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), msg.sender, "createClMapping", legacyId, id, key))` * After migration, clients in order to resolve legacy identifiers: * for DID document firstly must resolve ethereum account - using `LegacyIdMappingRegistry.didMappings(identifier)`, and next resolve DID ether document as it described in the + using `LegacyMappingRegistry.didMapping(legacyIdentifier)`, and next resolve DID ether document as it described in the corresponding specification. * for Schema/Credential Definition firstly must resolve new identifier - using `LegacyIdMappingRegistry.clMappings(identifier)`, and next resolve Schema/Credential Definition as it described in the + using `LegacyMappingRegistry.resourceMapping(legacyIdentifier)`, and next resolve Schema/Credential Definition as it described in the corresponding specification. diff --git a/examples/migration/Cargo.lock b/examples/migration/Cargo.lock index cb37de8d..bf39404b 100644 --- a/examples/migration/Cargo.lock +++ b/examples/migration/Cargo.lock @@ -1924,7 +1924,7 @@ dependencies = [ "ethers-core", "futures 0.3.30", "hex", - "indy-data-types 0.7.1", + "indy-data-types", "log", "log-derive", "once_cell", @@ -1959,7 +1959,7 @@ checksum = "ba445ec807f219abb5ea41c20c753aaa4aa90494d3d1d2900b2f2703205d04e2" dependencies = [ "env_logger", "ffi-support", - "indy-data-types 0.7.1", + "indy-data-types", "log", "once_cell", "rand", @@ -1970,23 +1970,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "indy-data-types" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc9972c657fd152d394f61b00d677aa8a700abd8c39137164e399a1d9fd0c6d" -dependencies = [ - "anoncreds-clsignatures", - "hex", - "indy-utils", - "once_cell", - "regex", - "serde", - "serde_json", - "sha2", - "zeroize", -] - [[package]] name = "indy-data-types" version = "0.7.1" @@ -2009,20 +1992,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "indy-utils" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d7e0cdcece8d97982e82aba5b0cb8c7e87ffb5f4fa48b935a3647d24db5439" -dependencies = [ - "bs58", - "once_cell", - "regex", - "serde", - "thiserror", - "zeroize", -] - [[package]] name = "indy-vdr" version = "0.4.1" @@ -2038,7 +2007,7 @@ dependencies = [ "futures-util", "hex", "indy-blssignatures", - "indy-data-types 0.7.1", + "indy-data-types", "log", "once_cell", "percent-encoding", @@ -2298,7 +2267,7 @@ dependencies = [ "futures 0.1.31", "indy-besu-vdr", "indy-credx", - "indy-data-types 0.6.1", + "indy-data-types", "indy-vdr", "serde", "serde_json", diff --git a/examples/migration/Cargo.toml b/examples/migration/Cargo.toml index b5c2b542..35fe42dd 100644 --- a/examples/migration/Cargo.toml +++ b/examples/migration/Cargo.toml @@ -12,7 +12,7 @@ async-trait = "0.1.73" indy-credx = "1.1.1" bs58 = "0.5.0" futures = "0.1.23" -indy-data-types = "0.6.1" +indy-data-types = "0.7.1" indy-besu-vdr = { path = "../../vdr", features = ["migration", "basic_signer"] } indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git" } serde = "1.0.188" diff --git a/examples/migration/besu-config.json b/examples/migration/besu-config.json index 8ea82bf3..69a6e224 100644 --- a/examples/migration/besu-config.json +++ b/examples/migration/besu-config.json @@ -3,7 +3,7 @@ "nodeAddress": "http://127.0.0.1:8545", "contracts": { "didRegistry": { - "address": "0x0000000000000000000000000000000000018888", + "address": "0x0000000000000000000000000000000000003333", "path": "../../smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json" }, "schemaRegistry": { @@ -17,6 +17,10 @@ "roleControl": { "address": "0x0000000000000000000000000000000000006666", "path": "../../smart_contracts/artifacts/contracts/auth/RoleControl.sol/RoleControl.json" + }, + "legacyMappingRegistry": { + "address": "0x0000000000000000000000000000000000019999", + "path": "../../smart_contracts/artifacts/contracts/migration/LegacyMappingRegistry.sol/LegacyMappingRegistry.json" } } -} \ No newline at end of file +} diff --git a/examples/migration/src/issuer.rs b/examples/migration/src/issuer.rs index 7d998f4b..f7f9aeb3 100644 --- a/examples/migration/src/issuer.rs +++ b/examples/migration/src/issuer.rs @@ -2,7 +2,7 @@ use crate::{ ledger::{BesuLedger, IndyLedger, Ledgers}, wallet::{BesuWallet, IndyWallet}, }; -use indy_besu_vdr::{Address, DidDocAttribute, DID}; +use indy_besu_vdr::{Address, DidDocAttribute, ResourceIdentifier, DID}; use indy_credx::types::{ AttributeNames, AttributeValues, Credential, CredentialDefinition, CredentialDefinitionConfig, CredentialDefinitionId, CredentialDefinitionPrivate, CredentialKeyCorrectnessProof, @@ -190,6 +190,18 @@ impl Issuer { .publish_did_attribute(&self.account, &self.besu_did, attribute, &self.besu_wallet) .await } + pub async fn publish_did_mapping_to_besu(&self) { + self.besu_ledger + .publish_did_mapping( + &self.account, + &self.besu_did, + &self.indy_did, + &self.edkey, + &vec![1, 2, 3, 4, 5, 6, 7, 8, 9], + &self.besu_wallet, + ) + .await + } pub async fn publish_schema_to_besu( &self, @@ -200,6 +212,24 @@ impl Issuer { .await } + pub async fn publish_schema_id_mapping_to_besu( + &self, + legacy_did: &str, + legacy_schema_id: &SchemaId, + new_schema_id: &indy_besu_vdr::SchemaId, + ) { + self.besu_ledger + .publish_resource_mapping( + &self.account, + &indy_besu_vdr::DID::from(self.besu_did.as_str()), + &indy_data_types::did::DidValue(legacy_did.to_string()), + &ResourceIdentifier::from(legacy_schema_id.0.as_str()), + &ResourceIdentifier::from(new_schema_id.as_ref()), + &self.besu_wallet, + ) + .await + } + pub async fn publish_cred_def_to_besu( &self, cred_def: &indy_besu_vdr::CredentialDefinition, @@ -209,6 +239,24 @@ impl Issuer { .await } + pub async fn publish_cred_def_id_mapping_to_besu( + &self, + legacy_did: &str, + legacy_cred_def_id: &CredentialDefinitionId, + new_cred_def_id: &indy_besu_vdr::CredentialDefinitionId, + ) { + self.besu_ledger + .publish_resource_mapping( + &self.account, + &indy_besu_vdr::DID::from(self.besu_did.as_str()), + &indy_data_types::did::DidValue(legacy_did.to_string()), + &ResourceIdentifier::from(legacy_cred_def_id.0.as_str()), + &ResourceIdentifier::from(new_cred_def_id.as_ref()), + &self.besu_wallet, + ) + .await + } + pub fn use_indy_ledger(&mut self) { self.used_ledger = Ledgers::Indy } diff --git a/examples/migration/src/ledger.rs b/examples/migration/src/ledger.rs index 83736989..028c5407 100644 --- a/examples/migration/src/ledger.rs +++ b/examples/migration/src/ledger.rs @@ -4,9 +4,15 @@ use indy_besu_vdr::{ build_create_credential_definition_transaction, resolve_credential_definition, }, did_ethr_registry::build_did_set_attribute_transaction, + legacy_mapping_registry::{ + build_create_did_mapping_transaction, build_create_resource_mapping_transaction, + build_get_resource_mapping_transaction, + parse_resource_mapping_result, + }, role_control::build_assign_role_transaction, schema_registry::{build_create_schema_transaction, resolve_schema}, - Address, ContractConfig, DidDocAttribute, LedgerClient, Role, Status, Transaction, Validity, + Address, ContractConfig, DidDocAttribute, Ed25519Signature, LedgerClient, LegacyDid, + LegacyVerkey, ResourceIdentifier, Role, Status, Transaction, Validity, }; use indy_credx::types::{AttributeNames, CredentialDefinition, Schema}; use indy_data_types::{CredentialDefinitionId, SchemaId}; @@ -206,6 +212,7 @@ struct BesuContracts { schema_registry: BesuContractConfig, credential_definition_registry: BesuContractConfig, role_control: BesuContractConfig, + legacy_mapping_registry: BesuContractConfig, } #[derive(Serialize, Deserialize)] @@ -237,6 +244,11 @@ impl BesuLedger { spec_path: Some(contracts.role_control.path.to_string()), spec: None, }, + ContractConfig { + address: contracts.legacy_mapping_registry.address.to_string(), + spec_path: Some(contracts.legacy_mapping_registry.path.to_string()), + spec: None, + }, ] } @@ -300,6 +312,29 @@ impl BesuLedger { .await; } + pub async fn publish_did_mapping( + &self, + account: &Address, + did: &str, + legacy_did: &str, + legacy_verkey: &str, + legacy_signature: &[u8], + wallet: &BesuWallet, + ) { + let transaction = build_create_did_mapping_transaction( + &self.client, + account, + &indy_besu_vdr::DID::from(did), + &LegacyDid::from(legacy_did), + &LegacyVerkey::from(legacy_verkey), + &Ed25519Signature::from(legacy_signature), + ) + .await + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + } + pub async fn publish_schema( &self, account: &Address, @@ -317,6 +352,29 @@ impl BesuLedger { schema_id } + pub async fn publish_resource_mapping( + &self, + account: &Address, + did: &indy_besu_vdr::DID, + legacy_did: &indy_data_types::did::DidValue, + legacy_id: &ResourceIdentifier, + new_id: &ResourceIdentifier, + wallet: &BesuWallet, + ) { + let transaction = build_create_resource_mapping_transaction( + &self.client, + account, + did, + &LegacyDid::from(legacy_did.0.as_str()), + legacy_id, + new_id, + ) + .await + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + } + pub async fn publish_cred_def( &self, account: &Address, @@ -325,7 +383,7 @@ impl BesuLedger { ) -> indy_besu_vdr::CredentialDefinitionId { let cred_def_id = indy_besu_vdr::CredentialDefinitionId::build( &cred_def.issuer_id, - cred_def.schema_id.as_ref(), + &cred_def.schema_id, &cred_def.tag, ); let transaction = build_create_credential_definition_transaction( @@ -357,16 +415,33 @@ impl BesuLedger { } pub async fn get_schema(&self, id: &str) -> Schema { - let id = indy_besu_vdr::SchemaId::from_indy_format(id).unwrap(); - let schema = resolve_schema(&self.client, &id).await.unwrap(); + let schema_id = self.get_resource_mapping(id).await; + let schema = resolve_schema( + &self.client, + &indy_besu_vdr::SchemaId::from(schema_id.as_ref()), + ) + .await + .unwrap(); (&schema).into() } pub async fn get_cred_def(&self, id: &str) -> CredentialDefinition { - let id = indy_besu_vdr::CredentialDefinitionId::from_indy_format(id).unwrap(); - let cred_def = resolve_credential_definition(&self.client, &id) - .await - .unwrap(); + let cred_def_id = self.get_resource_mapping(id).await; + let cred_def = resolve_credential_definition( + &self.client, + &&indy_besu_vdr::CredentialDefinitionId::from(cred_def_id.as_ref()), + ) + .await + .unwrap(); (&cred_def).into() } + + pub async fn get_resource_mapping(&self, id: &str) -> indy_besu_vdr::ResourceIdentifier { + let transaction = + build_get_resource_mapping_transaction(&self.client, &ResourceIdentifier::from(id)) + .await + .unwrap(); + let response = self.client.submit_transaction(&transaction).await.unwrap(); + parse_resource_mapping_result(&self.client, &response).unwrap() + } } diff --git a/examples/migration/src/main.rs b/examples/migration/src/main.rs index 5d790e38..05c64033 100644 --- a/examples/migration/src/main.rs +++ b/examples/migration/src/main.rs @@ -9,6 +9,7 @@ use indy_besu_vdr::{ CredentialDefinition, DidDocAttribute, PublicKeyAttribute, PublicKeyPurpose, PublicKeyType, Role, Schema, ServiceAttribute, ServiceEndpoint, }; +use serde_json::json; use crate::{holder::Holder, issuer::Issuer, trustee::Trustee, verifier::Verifier}; @@ -52,11 +53,13 @@ async fn main() { let (schema_id, schema) = issuer.create_schema().await; issuer.publish_schema_to_indy(&schema).await; println!(" 2.4 Issuer publish Cred Def"); - let (_, cred_def) = issuer.create_cred_def(&schema_id).await; + let (cred_def_id, cred_def) = issuer.create_cred_def(&schema_id).await; issuer.publish_cred_def_to_indy(&cred_def).await; println!(" DID: {}", issuer.indy_did); - println!(" Schema: {:?}", schema); - println!(" Credential Definition: {:?}", cred_def); + println!(" Schema: {}", json!(schema).to_string()); + println!(" SchemaId: {}", schema_id.to_string()); + println!(" Credential Definition: {}", json!(cred_def).to_string()); + println!(" Credential Definition Id: {}", cred_def_id.to_string()); /* * Step 3: Before Ledger migration (use Indy) issue credential to Holder and verify Proof using Indy Ledger @@ -107,7 +110,11 @@ async fn main() { holder.use_besu_ledger(); verifier.use_besu_ledger(); - println!(" 4.2 Issuer publish DID Service and Public Key"); + // publish DID mapping + println!(" 4.2 Issuer publish DID mapping"); + issuer.publish_did_mapping_to_besu().await; + + println!(" 4.3 Issuer publish DID Service and Public Key"); let service = DidDocAttribute::Service(ServiceAttribute { type_: "IndyService".to_string(), service_endpoint: ServiceEndpoint::String(issuer.service.to_string()), @@ -124,15 +131,28 @@ async fn main() { }); issuer.publish_did_attribute_to_besu(&key).await; - println!(" 4.3 Issuer publish Schema"); + println!(" 4.4 Issuer publish Schema"); let schema = Schema::from_indy_format(&schema, &issuer.besu_did).unwrap(); - let schema_id = issuer.publish_schema_to_besu(&schema).await; + let new_schema_id = issuer.publish_schema_to_besu(&schema).await; + println!(" New SchemaId: {:?}", new_schema_id.as_ref()); + println!(" 4.5 Issuer publish Schema ID mapping"); + issuer + .publish_schema_id_mapping_to_besu(&issuer.indy_did, &schema_id, &new_schema_id) + .await; - println!(" 4.4 Issuer publish Credential Definition"); + println!(" 4.6 Issuer publish Credential Definition"); let cred_def = - CredentialDefinition::from_indy_format(&cred_def, &issuer.besu_did, schema_id.as_ref()) + CredentialDefinition::from_indy_format(&cred_def, &issuer.besu_did, new_schema_id.as_ref()) .unwrap(); - issuer.publish_cred_def_to_besu(&cred_def).await; + let new_cred_def_id = issuer.publish_cred_def_to_besu(&cred_def).await; + println!( + " New Credential Definition Id: {:?}", + new_cred_def_id.as_ref() + ); + println!(" 4.7 Issuer publish Credential Definition ID mapping"); + issuer + .publish_cred_def_id_mapping_to_besu(&issuer.indy_did, &cred_def_id, &new_cred_def_id) + .await; /* * Step 5: Verify existing credential using Besu Ledger diff --git a/network/config/besu/genesis.json b/network/config/besu/genesis.json index adca91b3..1a7ce526 100644 --- a/network/config/besu/genesis.json +++ b/network/config/besu/genesis.json @@ -102,12 +102,12 @@ "88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3": "0000000000000000000000000000000000000000000000000000000000000001", "a15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c": "0000000000000000000000000000000000000000000000000000000000000005", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000244159227abfc0e3e942344836c26ed291e2d34d" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000b916cf0bdb279c2d91fa7ab4b11d364ddaa8ae15" } }, - "0x244159227abfc0e3e942344836c26ed291e2d34d": { + "0xb916cf0bdb279c2d91fa7ab4b11d364ddaa8ae15": { "comment": "Implementation: Smart contract to manage account roles", - "code": "0x6080604052600436106100865760003560e01c806388a5bf6e1161005957806388a5bf6e146101425780639e97b8f614610162578063ad3cb1cc14610182578063c4d66de8146101c0578063d02971ca146101e057600080fd5b8063442767331461008b5780634cbb87d3146100da5780634f1ef2861461010a57806352d1902d1461011f575b600080fd5b34801561009757600080fd5b506100c46100a6366004610bc5565b6001600160a01b031660009081526001602052604090205460ff1690565b6040516100d19190610bf6565b60405180910390f35b3480156100e657600080fd5b506100fa6100f5366004610c2d565b610215565b60405190151581526020016100d1565b61011d610118366004610c76565b61037d565b005b34801561012b57600080fd5b5061013461039c565b6040519081526020016100d1565b34801561014e57600080fd5b506100c461015d366004610c2d565b6103b9565b34801561016e57600080fd5b506100fa61017d366004610c2d565b61052e565b34801561018e57600080fd5b506101b3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100d19190610d5c565b3480156101cc57600080fd5b5061011d6101db366004610bc5565b610577565b3480156101ec57600080fd5b506102006101fb366004610d8f565b6106f2565b60405163ffffffff90911681526020016100d1565b60008260006002600083600381111561023057610230610be0565b600381111561024157610241610be0565b815260208101919091526040016000205460ff169050610261813361052e565b6102855760405163472511eb60e11b81523360048201526024015b60405180910390fd5b61028f858561052e565b15610370576001600160a01b0384166000908152600160205260408120805460ff1916905560039086828111156102c8576102c8610be0565b60038111156102d9576102d9610be0565b815260208101919091526040016000908120805463ffffffff16916102fd83610dc0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f5a8379f4a3380f87fd5924475f76a3471ac8d775668601653e3f9ef69a3dd2718760405161035f9190610bf6565b60405180910390a360019250610375565b600092505b505092915050565b610385610738565b61038e826107df565b6103988282610845565b5050565b60006103a6610907565b50600080516020610e3983398151915290565b6000826000600260008360038111156103d4576103d4610be0565b60038111156103e5576103e5610be0565b815260208101919091526040016000205460ff169050610405813361052e565b6104245760405163472511eb60e11b815233600482015260240161027c565b61042e858561052e565b610525576001600160a01b03841660009081526001602081905260409091208054879260ff199091169083600381111561046a5761046a610be0565b02179055506003600086600381111561048557610485610be0565b600381111561049657610496610be0565b815260208101919091526040016000908120805463ffffffff16916104ba83610de0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f47307e88f3e82b4e8cdffde5a264aa53a2ee17636fd8df7effe0a098da4956568760405161051c9190610bf6565b60405180910390a35b50929392505050565b600082600381111561054257610542610be0565b6001600160a01b03831660009081526001602052604090205460ff16600381111561056f5761056f610be0565b149392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806105c15750805467ffffffffffffffff808416911610155b156105df5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155610609610950565b60026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e08054600160ff1991821681179092557f679795a0195a1b76cdebb7c51d74e058aee92919b8c3389af86ef24535e8a28c805482168317905560036000527f88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3805490911690911790556106a08361095e565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b60006003600083600381111561070a5761070a610be0565b600381111561071b5761071b610be0565b815260208101919091526040016000205463ffffffff1692915050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806107bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107b3600080516020610e39833981519152546001600160a01b031690565b6001600160a01b031614155b156107dd5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561082a57600080fd5b505afa15801561083e573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e03565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b038316600482015260240161027c565b600080516020610e3983398151915281146108f857604051632a87526960e21b81526004810182905260240161027c565b6109028383610988565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107dd5760405163703e46dd60e11b815260040160405180910390fd5b61095b6001336103b9565b50565b6109666109de565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b61099182610a27565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156109d6576109028282610a8c565b610398610b02565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107dd57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610a5d57604051634c9c8ce360e01b81526001600160a01b038216600482015260240161027c565b600080516020610e3983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610aa99190610e1c565b600060405180830381855af49150503d8060008114610ae4576040519150601f19603f3d011682016040523d82523d6000602084013e610ae9565b606091505b5091509150610af9858383610b21565b95945050505050565b34156107dd5760405163b398979f60e01b815260040160405180910390fd5b606082610b3657610b3182610b80565b610b79565b8151158015610b4d57506001600160a01b0384163b155b15610b7657604051639996b31560e01b81526001600160a01b038516600482015260240161027c565b50805b9392505050565b805115610b905780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610bc057600080fd5b919050565b600060208284031215610bd757600080fd5b610b7982610ba9565b634e487b7160e01b600052602160045260246000fd5b6020810160048310610c1857634e487b7160e01b600052602160045260246000fd5b91905290565b803560048110610bc057600080fd5b60008060408385031215610c4057600080fd5b610c4983610c1e565b9150610c5760208401610ba9565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c8957600080fd5b610c9283610ba9565b9150602083013567ffffffffffffffff80821115610caf57600080fd5b818501915085601f830112610cc357600080fd5b813581811115610cd557610cd5610c60565b604051601f8201601f19908116603f01168101908382118183101715610cfd57610cfd610c60565b81604052828152886020848701011115610d1657600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610d53578181015183820152602001610d3b565b50506000910152565b6020815260008251806020840152610d7b816040850160208701610d38565b601f01601f19169190910160400192915050565b600060208284031215610da157600080fd5b610b7982610c1e565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff821680610dd657610dd6610daa565b6000190192915050565b600063ffffffff808316818103610df957610df9610daa565b6001019392505050565b600060208284031215610e1557600080fd5b5051919050565b60008251610e2e818460208701610d38565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a0c38807b4a7e5fbd63e4aaff9699d309ee858f593987344d8e0c28b6f67c06f64736f6c63430008170033" + "code": "0x6080604052600436106100865760003560e01c806388a5bf6e1161005957806388a5bf6e146101425780639e97b8f614610162578063ad3cb1cc14610182578063c4d66de8146101c0578063d02971ca146101e057600080fd5b8063442767331461008b5780634cbb87d3146100da5780634f1ef2861461010a57806352d1902d1461011f575b600080fd5b34801561009757600080fd5b506100c46100a6366004610bc5565b6001600160a01b031660009081526001602052604090205460ff1690565b6040516100d19190610bf6565b60405180910390f35b3480156100e657600080fd5b506100fa6100f5366004610c2d565b610215565b60405190151581526020016100d1565b61011d610118366004610c76565b61037d565b005b34801561012b57600080fd5b5061013461039c565b6040519081526020016100d1565b34801561014e57600080fd5b506100c461015d366004610c2d565b6103b9565b34801561016e57600080fd5b506100fa61017d366004610c2d565b61052e565b34801561018e57600080fd5b506101b3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100d19190610d5c565b3480156101cc57600080fd5b5061011d6101db366004610bc5565b610577565b3480156101ec57600080fd5b506102006101fb366004610d8f565b6106f2565b60405163ffffffff90911681526020016100d1565b60008260006002600083600381111561023057610230610be0565b600381111561024157610241610be0565b815260208101919091526040016000205460ff169050610261813361052e565b6102855760405163472511eb60e11b81523360048201526024015b60405180910390fd5b61028f858561052e565b15610370576001600160a01b0384166000908152600160205260408120805460ff1916905560039086828111156102c8576102c8610be0565b60038111156102d9576102d9610be0565b815260208101919091526040016000908120805463ffffffff16916102fd83610dc0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f5a8379f4a3380f87fd5924475f76a3471ac8d775668601653e3f9ef69a3dd2718760405161035f9190610bf6565b60405180910390a360019250610375565b600092505b505092915050565b610385610738565b61038e826107df565b6103988282610845565b5050565b60006103a6610907565b50600080516020610e3983398151915290565b6000826000600260008360038111156103d4576103d4610be0565b60038111156103e5576103e5610be0565b815260208101919091526040016000205460ff169050610405813361052e565b6104245760405163472511eb60e11b815233600482015260240161027c565b61042e858561052e565b610525576001600160a01b03841660009081526001602081905260409091208054879260ff199091169083600381111561046a5761046a610be0565b02179055506003600086600381111561048557610485610be0565b600381111561049657610496610be0565b815260208101919091526040016000908120805463ffffffff16916104ba83610de0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f47307e88f3e82b4e8cdffde5a264aa53a2ee17636fd8df7effe0a098da4956568760405161051c9190610bf6565b60405180910390a35b50929392505050565b600082600381111561054257610542610be0565b6001600160a01b03831660009081526001602052604090205460ff16600381111561056f5761056f610be0565b149392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806105c15750805467ffffffffffffffff808416911610155b156105df5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155610609610950565b60026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e08054600160ff1991821681179092557f679795a0195a1b76cdebb7c51d74e058aee92919b8c3389af86ef24535e8a28c805482168317905560036000527f88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3805490911690911790556106a08361095e565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b60006003600083600381111561070a5761070a610be0565b600381111561071b5761071b610be0565b815260208101919091526040016000205463ffffffff1692915050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806107bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107b3600080516020610e39833981519152546001600160a01b031690565b6001600160a01b031614155b156107dd5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561082a57600080fd5b505afa15801561083e573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e03565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b038316600482015260240161027c565b600080516020610e3983398151915281146108f857604051632a87526960e21b81526004810182905260240161027c565b6109028383610988565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107dd5760405163703e46dd60e11b815260040160405180910390fd5b61095b6001336103b9565b50565b6109666109de565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b61099182610a27565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156109d6576109028282610a8c565b610398610b02565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107dd57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610a5d57604051634c9c8ce360e01b81526001600160a01b038216600482015260240161027c565b600080516020610e3983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610aa99190610e1c565b600060405180830381855af49150503d8060008114610ae4576040519150601f19603f3d011682016040523d82523d6000602084013e610ae9565b606091505b5091509150610af9858383610b21565b95945050505050565b34156107dd5760405163b398979f60e01b815260040160405180910390fd5b606082610b3657610b3182610b80565b610b79565b8151158015610b4d57506001600160a01b0384163b155b15610b7657604051639996b31560e01b81526001600160a01b038516600482015260240161027c565b50805b9392505050565b805115610b905780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610bc057600080fd5b919050565b600060208284031215610bd757600080fd5b610b7982610ba9565b634e487b7160e01b600052602160045260246000fd5b6020810160048310610c1857634e487b7160e01b600052602160045260246000fd5b91905290565b803560048110610bc057600080fd5b60008060408385031215610c4057600080fd5b610c4983610c1e565b9150610c5760208401610ba9565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c8957600080fd5b610c9283610ba9565b9150602083013567ffffffffffffffff80821115610caf57600080fd5b818501915085601f830112610cc357600080fd5b813581811115610cd557610cd5610c60565b604051601f8201601f19908116603f01168101908382118183101715610cfd57610cfd610c60565b81604052828152886020848701011115610d1657600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610d53578181015183820152602001610d3b565b50506000910152565b6020815260008251806020840152610d7b816040850160208701610d38565b601f01601f19169190910160400192915050565b600060208284031215610da157600080fd5b610b7982610c1e565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff821680610dd657610dd6610daa565b6000190192915050565b600063ffffffff808316818103610df957610df9610daa565b6001019392505050565b600060208284031215610e1557600080fd5b5051919050565b60008251610e2e818460208701610d38565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201732ba2607bd323ad6b9ab7eaab6517fb63fd8cc432dcc9caa62384d439517ce64736f6c63430008170033" }, "0x0000000000000000000000000000000000007777": { "comment": "Proxy: Smart contract to manage validator nodes", @@ -125,12 +125,12 @@ "149d22bf3f008a1407770ecbdb723975d92c5073caa510ba413c1db0f8063ed8": "0000000000000000000000886328869e4e1f401e1052a5f4aae8b45f42610201", "7f33ce678224e207038746a5939df116c5dff1ccc6e79de84c95388c521e898c": "000000000000000000000f48de4a0c2939e62891f3c6aca68982975477e45301", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000009d7ec0e1e7e6320f9b381e91260ae334b514364c" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000005ba18f9ac09815e3e955999bf8962f49bcaaba2c" } }, - "0x9d7ec0e1e7e6320f9b381e91260ae334b514364c": { + "0x5ba18f9ac09815e3e955999bf8962f49bcaaba2c": { "comment": "Implementation: Smart contract to manage validator nodes", - "code": "0x6080604052600436106100705760003560e01c806352d1902d1161004e57806352d1902d146100ca57806398772d88146100f2578063ad3cb1cc14610112578063b7ab4db51461015057600080fd5b806340a141ff146100755780634d238c8e146100975780634f1ef286146100b7575b600080fd5b34801561008157600080fd5b50610095610090366004610eff565b610172565b005b3480156100a357600080fd5b506100956100b2366004610eff565b610430565b6100956100c5366004610f8a565b610718565b3480156100d657600080fd5b506100df610737565b6040519081526020015b60405180910390f35b3480156100fe57600080fd5b5061009561010d366004611030565b610754565b34801561011e57600080fd5b50610143604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100e99190611151565b34801561015c57600080fd5b50610165610a1c565b6040516100e99190611184565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906101a59060039033906004016111d1565b602060405180830381865afa1580156101c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e6919061120b565b61020a5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b806001600160a01b0381166102325760405163713ce51160e01b815260040160405180910390fd5b6002546001036102555760405163f1a1929360e01b815260040160405180910390fd5b6001600160a01b03828116600090815260036020908152604091829020825180840190935254928316808352600160a01b90930460ff1690820152906102b957604051635a4887e160e01b81526001600160a01b0384166004820152602401610201565b600081602001519050600060028260ff16815481106102da576102da61122d565b6000918252602082200154600280546001600160a01b0390921693509061030390600190611243565b815481106103135761031361122d565b600091825260209091200154600280546001600160a01b039092169250829160ff86169081106103455761034561122d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600390915260409020805460ff60a01b1916600160a01b60ff86160217905560028054806103a2576103a2611264565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b0384168083526003825260409283902080546001600160a81b0319169055600254925160ff9093168352339290917fb10fc4fba5b5eb2a6e82796887299220653537d6a5fc8a3fb60937bd2442ea29910160405180910390a3505050505050565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906104639060039033906004016111d1565b602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a4919061120b565b6104c35760405163472511eb60e11b8152336004820152602401610201565b806001600160a01b0381166104eb5760405163713ce51160e01b815260040160405180910390fd5b6002546101001161051357604051635dd7a94360e11b81526101006004820152602401610201565b60025460005b8160ff168160ff16101561063f5760006003600060028460ff16815481106105435761054361122d565b60009182526020808320909101546001600160a01b039081168452838201949094526040928301909120825180840190935254928316825260ff600160a01b909304831690820152600280549193509184169081106105a4576105a461122d565b6000918252602090912001546001600160a01b039081169086160361060a5760028260ff16815481106105d9576105d961122d565b60009182526020909120015460405163164688df60e21b81526001600160a01b039091166004820152602401610201565b80516001600160a01b0316330361063657604051635154e66760e11b8152336004820152602401610201565b50600101610519565b506040805180820182523380825260ff84811660208085019182526001600160a01b038981166000818152600384528881209751885495518716600160a01b026001600160a81b03199096169316929092179390931790955560028054600181018255958190527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90950180546001600160a01b0319168317905593549451949091168452909290917f4583e1f70afe5f9f38886187732a4b1336bad46fc758cdd6ad86815931d6f6c2910160405180910390a3505050565b610720610a7e565b61072982610b25565b6107338282610b8b565b5050565b6000610741610c4d565b506000805160206112b083398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061079e5750805467ffffffffffffffff808416911610155b156107bc5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155825160000361080057604051635a7582eb60e11b815260040160405180910390fd5b82516101001161082757604051635dd7a94360e11b81526101006004820152602401610201565b60005b83518110156109a35760006001600160a01b03168482815181106108505761085061122d565b6020026020010151602001516001600160a01b0316036108835760405163d4c3bd5160e01b815260040160405180910390fd5b60006001600160a01b03168482815181106108a0576108a061122d565b6020026020010151600001516001600160a01b0316036108d35760405163713ce51160e01b815260040160405180910390fd5b60008482815181106108e7576108e761122d565b6020908102919091018101518051600280546001818101835560009283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b039485166001600160a01b0319909116179055604080518082018252858701518516815260ff808a1682890190815296518616855260039097529220915182549451909516600160a01b026001600160a81b031990941694909216939093179190911790915591909101905061082a565b50600180546001600160a01b0319166001600160a01b0387161790556109c884610c96565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020018280548015610a7457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a56575b5050505050905090565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610b0557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610af96000805160206112b0833981519152546001600160a01b031690565b6001600160a01b031614155b15610b235760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610be5575060408051601f3d908101601f19168201909252610be29181019061127a565b60015b610c0d57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610201565b6000805160206112b08339815191528114610c3e57604051632a87526960e21b815260048101829052602401610201565b610c488383610cc0565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b235760405163703e46dd60e11b815260040160405180910390fd5b610c9e610d16565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610cc982610d5f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610d0e57610c488282610dc4565b610733610e3c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b2357604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610d9557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610201565b6000805160206112b083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610de19190611293565b600060405180830381855af49150503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5091509150610e31858383610e5b565b925050505b92915050565b3415610b235760405163b398979f60e01b815260040160405180910390fd5b606082610e7057610e6b82610eba565b610eb3565b8151158015610e8757506001600160a01b0384163b155b15610eb057604051639996b31560e01b81526001600160a01b0385166004820152602401610201565b50805b9392505050565b805115610eca5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610efa57600080fd5b919050565b600060208284031215610f1157600080fd5b610eb382610ee3565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f5357610f53610f1a565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f8257610f82610f1a565b604052919050565b60008060408385031215610f9d57600080fd5b610fa683610ee3565b915060208084013567ffffffffffffffff80821115610fc457600080fd5b818601915086601f830112610fd857600080fd5b813581811115610fea57610fea610f1a565b610ffc601f8201601f19168501610f59565b9150808252878482850101111561101257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561104557600080fd5b61104e84610ee3565b9250602061105d818601610ee3565b925060408086013567ffffffffffffffff8082111561107b57600080fd5b818801915088601f83011261108f57600080fd5b8135818111156110a1576110a1610f1a565b6110af858260051b01610f59565b818152858101925060069190911b83018501908a8211156110cf57600080fd5b928501925b8184101561111d5784848c0312156110ec5760008081fd5b6110f4610f30565b6110fd85610ee3565b815261110a878601610ee3565b81880152835292840192918501916110d4565b8096505050505050509250925092565b60005b83811015611148578181015183820152602001611130565b50506000910152565b602081526000825180602084015261117081604085016020870161112d565b601f01601f19169190910160400192915050565b6020808252825182820181905260009190848201906040850190845b818110156111c55783516001600160a01b0316835292840192918401916001016111a0565b50909695505050505050565b60408101600484106111f357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b60006020828403121561121d57600080fd5b81518015158114610eb357600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e3657634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561128c57600080fd5b5051919050565b600082516112a581846020870161112d565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122040250b101e1368dcd050c857b769a0b34afd2b22c7cef1e1373622f8c767a9fc64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c806352d1902d1161004e57806352d1902d146100ca57806398772d88146100f2578063ad3cb1cc14610112578063b7ab4db51461015057600080fd5b806340a141ff146100755780634d238c8e146100975780634f1ef286146100b7575b600080fd5b34801561008157600080fd5b50610095610090366004610eff565b610172565b005b3480156100a357600080fd5b506100956100b2366004610eff565b610430565b6100956100c5366004610f8a565b610718565b3480156100d657600080fd5b506100df610737565b6040519081526020015b60405180910390f35b3480156100fe57600080fd5b5061009561010d366004611030565b610754565b34801561011e57600080fd5b50610143604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100e99190611151565b34801561015c57600080fd5b50610165610a1c565b6040516100e99190611184565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906101a59060039033906004016111d1565b602060405180830381865afa1580156101c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e6919061120b565b61020a5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b806001600160a01b0381166102325760405163713ce51160e01b815260040160405180910390fd5b6002546001036102555760405163f1a1929360e01b815260040160405180910390fd5b6001600160a01b03828116600090815260036020908152604091829020825180840190935254928316808352600160a01b90930460ff1690820152906102b957604051635a4887e160e01b81526001600160a01b0384166004820152602401610201565b600081602001519050600060028260ff16815481106102da576102da61122d565b6000918252602082200154600280546001600160a01b0390921693509061030390600190611243565b815481106103135761031361122d565b600091825260209091200154600280546001600160a01b039092169250829160ff86169081106103455761034561122d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600390915260409020805460ff60a01b1916600160a01b60ff86160217905560028054806103a2576103a2611264565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b0384168083526003825260409283902080546001600160a81b0319169055600254925160ff9093168352339290917fb10fc4fba5b5eb2a6e82796887299220653537d6a5fc8a3fb60937bd2442ea29910160405180910390a3505050505050565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906104639060039033906004016111d1565b602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a4919061120b565b6104c35760405163472511eb60e11b8152336004820152602401610201565b806001600160a01b0381166104eb5760405163713ce51160e01b815260040160405180910390fd5b6002546101001161051357604051635dd7a94360e11b81526101006004820152602401610201565b60025460005b8160ff168160ff16101561063f5760006003600060028460ff16815481106105435761054361122d565b60009182526020808320909101546001600160a01b039081168452838201949094526040928301909120825180840190935254928316825260ff600160a01b909304831690820152600280549193509184169081106105a4576105a461122d565b6000918252602090912001546001600160a01b039081169086160361060a5760028260ff16815481106105d9576105d961122d565b60009182526020909120015460405163164688df60e21b81526001600160a01b039091166004820152602401610201565b80516001600160a01b0316330361063657604051635154e66760e11b8152336004820152602401610201565b50600101610519565b506040805180820182523380825260ff84811660208085019182526001600160a01b038981166000818152600384528881209751885495518716600160a01b026001600160a81b03199096169316929092179390931790955560028054600181018255958190527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90950180546001600160a01b0319168317905593549451949091168452909290917f4583e1f70afe5f9f38886187732a4b1336bad46fc758cdd6ad86815931d6f6c2910160405180910390a3505050565b610720610a7e565b61072982610b25565b6107338282610b8b565b5050565b6000610741610c4d565b506000805160206112b083398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061079e5750805467ffffffffffffffff808416911610155b156107bc5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155825160000361080057604051635a7582eb60e11b815260040160405180910390fd5b82516101001161082757604051635dd7a94360e11b81526101006004820152602401610201565b60005b83518110156109a35760006001600160a01b03168482815181106108505761085061122d565b6020026020010151602001516001600160a01b0316036108835760405163d4c3bd5160e01b815260040160405180910390fd5b60006001600160a01b03168482815181106108a0576108a061122d565b6020026020010151600001516001600160a01b0316036108d35760405163713ce51160e01b815260040160405180910390fd5b60008482815181106108e7576108e761122d565b6020908102919091018101518051600280546001818101835560009283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b039485166001600160a01b0319909116179055604080518082018252858701518516815260ff808a1682890190815296518616855260039097529220915182549451909516600160a01b026001600160a81b031990941694909216939093179190911790915591909101905061082a565b50600180546001600160a01b0319166001600160a01b0387161790556109c884610c96565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020018280548015610a7457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a56575b5050505050905090565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610b0557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610af96000805160206112b0833981519152546001600160a01b031690565b6001600160a01b031614155b15610b235760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610be5575060408051601f3d908101601f19168201909252610be29181019061127a565b60015b610c0d57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610201565b6000805160206112b08339815191528114610c3e57604051632a87526960e21b815260048101829052602401610201565b610c488383610cc0565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b235760405163703e46dd60e11b815260040160405180910390fd5b610c9e610d16565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610cc982610d5f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610d0e57610c488282610dc4565b610733610e3c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b2357604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610d9557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610201565b6000805160206112b083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610de19190611293565b600060405180830381855af49150503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5091509150610e31858383610e5b565b925050505b92915050565b3415610b235760405163b398979f60e01b815260040160405180910390fd5b606082610e7057610e6b82610eba565b610eb3565b8151158015610e8757506001600160a01b0384163b155b15610eb057604051639996b31560e01b81526001600160a01b0385166004820152602401610201565b50805b9392505050565b805115610eca5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610efa57600080fd5b919050565b600060208284031215610f1157600080fd5b610eb382610ee3565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f5357610f53610f1a565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f8257610f82610f1a565b604052919050565b60008060408385031215610f9d57600080fd5b610fa683610ee3565b915060208084013567ffffffffffffffff80821115610fc457600080fd5b818601915086601f830112610fd857600080fd5b813581811115610fea57610fea610f1a565b610ffc601f8201601f19168501610f59565b9150808252878482850101111561101257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561104557600080fd5b61104e84610ee3565b9250602061105d818601610ee3565b925060408086013567ffffffffffffffff8082111561107b57600080fd5b818801915088601f83011261108f57600080fd5b8135818111156110a1576110a1610f1a565b6110af858260051b01610f59565b818152858101925060069190911b83018501908a8211156110cf57600080fd5b928501925b8184101561111d5784848c0312156110ec5760008081fd5b6110f4610f30565b6110fd85610ee3565b815261110a878601610ee3565b81880152835292840192918501916110d4565b8096505050505050509250925092565b60005b83811015611148578181015183820152602001611130565b50506000910152565b602081526000825180602084015261117081604085016020870161112d565b601f01601f19169190910160400192915050565b6020808252825182820181905260009190848201906040850190845b818110156111c55783516001600160a01b0316835292840192918401916001016111a0565b50909695505050505050565b60408101600484106111f357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b60006020828403121561121d57600080fd5b81518015158114610eb357600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e3657634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561128c57600080fd5b5051919050565b600082516112a581846020870161112d565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220bcbd3b9c450d49e9afc43b6469dd3f2303a44f81e42def0b1bb1e8d14ce15af464736f6c63430008170033" }, "0x0000000000000000000000000000000000009999": { "comment": "Proxy: Smart contract to manage proxy contract upgrades", @@ -138,12 +138,12 @@ "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000006666", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000d762620a599579f35c9f821c52d0d06e7b1a95f7" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000b194eabbb2d2cc4180093e0df47bb231658c407e" } }, - "0xd762620a599579f35c9f821c52d0d06e7b1a95f7": { + "0xb194eabbb2d2cc4180093e0df47bb231658c407e": { "comment": "Implementation: Smart contract to manage proxy contract upgrades", - "code": "0x6080604052600436106100705760003560e01c80637e5465ba1161004e5780637e5465ba146100d2578063ad3cb1cc146100f2578063c4d66de814610130578063e8f158641461015057600080fd5b80634f1ef2861461007557806352d1902d1461008a578063574a81d7146100b2575b600080fd5b610088610083366004610c59565b610170565b005b34801561009657600080fd5b5061009f61018f565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100886100cd366004610d1b565b6101ac565b3480156100de57600080fd5b506100886100ed366004610d1b565b6101d3565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610d72565b34801561013c57600080fd5b5061008861014b366004610da5565b610475565b34801561015c57600080fd5b5061008861016b366004610d1b565b610565565b610178610791565b61018182610838565b61018b8282610845565b5050565b6000610199610902565b50600080516020610f6083398151915290565b6101b6828261094b565b61018b57604051638af69cf160e01b815260040160405180910390fd5b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610206906001903390600401610de2565b602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102479190610e08565b61026b5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6001600160a01b0380831660009081526001602090815260408083209385168352929052908120600201548391839190036102cc57604051633af3b55760e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b0380851660009081526001602090815260408083209387168352928152828220338352905220548490849060ff1615610332576040516316d5788b60e31b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038087166000908152600160208181526040808420948a16808552858352818520338652808452918520805460ff191685179055845293905291909101805463ffffffff169161038883610e40565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316856001600160a01b0316876001600160a01b03167fc42e62d9f6b29d37599fcb472a6f30bc6e8c8d6fbbcb774ac585c02b314bd2ad60405160405180910390a46103fb868661094b565b1561046d576040805163278f794360e11b81526001600160a01b03878116600483015260248201929092526000604482015290871690634f1ef28690606401600060405180830381600087803b15801561045457600080fd5b505af1158015610468573d6000803e3d6000fd5b505050505b505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104bf5750805467ffffffffffffffff808416911610155b156104dd5760405163f92ee8a960e01b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610598906001903390600401610de2565b602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190610e08565b6105f85760405163472511eb60e11b8152336004820152602401610262565b80806001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610653575060408051601f3d908101601f1916820190925261065091810190610e63565b60015b61067b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915281146106ac57604051632a87526960e21b815260048101829052602401610262565b6001600160a01b03808516600090815260016020908152604080832093871683529290522060020154849084901561070a57604051634cc571cf60e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038681166000818152600160208181526040808420958b16808552959091528083209182018054640100000000600160c01b031916336401000000008102919091179091554260029093019290925551909392917fe33956f8d60ae2b38d9860e46ec9b53d8fb58aa99a9404b1195b7ce35d2941dc91a45050505b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061081857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661080c600080516020610f60833981519152546001600160a01b031690565b6001600160a01b031614155b156108365760405163703e46dd60e11b815260040160405180910390fd5b565b61084230826101ac565b50565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e63565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610262565b600080516020610f6083398151915281146108f857604051632a87526960e21b815260048101829052602401610262565b61078c8383610a28565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108365760405163703e46dd60e11b815260040160405180910390fd5b60008054604051636814b8e560e11b815282916001600160a01b03169063d02971ca9061097d90600190600401610e7c565b602060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190610e8a565b6001600160a01b03808616600090815260016020818152604080842094891684529390529181209091015491925063ffffffff90911690610a0a610a03846006610eb0565b600a610a7e565b90508063ffffffff168263ffffffff16101593505050505b92915050565b610a3182610aa8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610a765761078c8282610b0d565b61018b610b83565b600081610a8c600185610ed8565b610a969190610ef5565b610aa1906001610f26565b9392505050565b806001600160a01b03163b600003610ade57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610b2a9190610f43565b600060405180830381855af49150503d8060008114610b65576040519150601f19603f3d011682016040523d82523d6000602084013e610b6a565b606091505b5091509150610b7a858383610ba2565b95945050505050565b34156108365760405163b398979f60e01b815260040160405180910390fd5b606082610bb757610bb282610bfe565b610aa1565b8151158015610bce57506001600160a01b0384163b155b15610bf757604051639996b31560e01b81526001600160a01b0385166004820152602401610262565b5092915050565b805115610c0e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610c3e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c6c57600080fd5b610c7583610c27565b9150602083013567ffffffffffffffff80821115610c9257600080fd5b818501915085601f830112610ca657600080fd5b813581811115610cb857610cb8610c43565b604051601f8201601f19908116603f01168101908382118183101715610ce057610ce0610c43565b81604052828152886020848701011115610cf957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060408385031215610d2e57600080fd5b610d3783610c27565b9150610d4560208401610c27565b90509250929050565b60005b83811015610d69578181015183820152602001610d51565b50506000910152565b6020815260008251806020840152610d91816040850160208701610d4e565b601f01601f19169190910160400192915050565b600060208284031215610db757600080fd5b610aa182610c27565b60048110610dde57634e487b7160e01b600052602160045260246000fd5b9052565b60408101610df08285610dc0565b6001600160a01b039290921660209190910152919050565b600060208284031215610e1a57600080fd5b81518015158114610aa157600080fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818103610e5957610e59610e2a565b6001019392505050565b600060208284031215610e7557600080fd5b5051919050565b60208101610a228284610dc0565b600060208284031215610e9c57600080fd5b815163ffffffff81168114610aa157600080fd5b63ffffffff818116838216028082169190828114610ed057610ed0610e2a565b505092915050565b63ffffffff828116828216039080821115610bf757610bf7610e2a565b600063ffffffff80841680610f1a57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115610bf757610bf7610e2a565b60008251610f55818460208701610d4e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122079e9e2317aebe7af4395ee59b6584e1961eeb180014680389b7a34b22d341d7f64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c80637e5465ba1161004e5780637e5465ba146100d2578063ad3cb1cc146100f2578063c4d66de814610130578063e8f158641461015057600080fd5b80634f1ef2861461007557806352d1902d1461008a578063574a81d7146100b2575b600080fd5b610088610083366004610c59565b610170565b005b34801561009657600080fd5b5061009f61018f565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100886100cd366004610d1b565b6101ac565b3480156100de57600080fd5b506100886100ed366004610d1b565b6101d3565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610d72565b34801561013c57600080fd5b5061008861014b366004610da5565b610475565b34801561015c57600080fd5b5061008861016b366004610d1b565b610565565b610178610791565b61018182610838565b61018b8282610845565b5050565b6000610199610902565b50600080516020610f6083398151915290565b6101b6828261094b565b61018b57604051638af69cf160e01b815260040160405180910390fd5b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610206906001903390600401610de2565b602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102479190610e08565b61026b5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6001600160a01b0380831660009081526001602090815260408083209385168352929052908120600201548391839190036102cc57604051633af3b55760e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b0380851660009081526001602090815260408083209387168352928152828220338352905220548490849060ff1615610332576040516316d5788b60e31b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038087166000908152600160208181526040808420948a16808552858352818520338652808452918520805460ff191685179055845293905291909101805463ffffffff169161038883610e40565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316856001600160a01b0316876001600160a01b03167fc42e62d9f6b29d37599fcb472a6f30bc6e8c8d6fbbcb774ac585c02b314bd2ad60405160405180910390a46103fb868661094b565b1561046d576040805163278f794360e11b81526001600160a01b03878116600483015260248201929092526000604482015290871690634f1ef28690606401600060405180830381600087803b15801561045457600080fd5b505af1158015610468573d6000803e3d6000fd5b505050505b505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104bf5750805467ffffffffffffffff808416911610155b156104dd5760405163f92ee8a960e01b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610598906001903390600401610de2565b602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190610e08565b6105f85760405163472511eb60e11b8152336004820152602401610262565b80806001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610653575060408051601f3d908101601f1916820190925261065091810190610e63565b60015b61067b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915281146106ac57604051632a87526960e21b815260048101829052602401610262565b6001600160a01b03808516600090815260016020908152604080832093871683529290522060020154849084901561070a57604051634cc571cf60e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038681166000818152600160208181526040808420958b16808552959091528083209182018054640100000000600160c01b031916336401000000008102919091179091554260029093019290925551909392917fe33956f8d60ae2b38d9860e46ec9b53d8fb58aa99a9404b1195b7ce35d2941dc91a45050505b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061081857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661080c600080516020610f60833981519152546001600160a01b031690565b6001600160a01b031614155b156108365760405163703e46dd60e11b815260040160405180910390fd5b565b61084230826101ac565b50565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e63565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610262565b600080516020610f6083398151915281146108f857604051632a87526960e21b815260048101829052602401610262565b61078c8383610a28565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108365760405163703e46dd60e11b815260040160405180910390fd5b60008054604051636814b8e560e11b815282916001600160a01b03169063d02971ca9061097d90600190600401610e7c565b602060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190610e8a565b6001600160a01b03808616600090815260016020818152604080842094891684529390529181209091015491925063ffffffff90911690610a0a610a03846006610eb0565b600a610a7e565b90508063ffffffff168263ffffffff16101593505050505b92915050565b610a3182610aa8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610a765761078c8282610b0d565b61018b610b83565b600081610a8c600185610ed8565b610a969190610ef5565b610aa1906001610f26565b9392505050565b806001600160a01b03163b600003610ade57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610b2a9190610f43565b600060405180830381855af49150503d8060008114610b65576040519150601f19603f3d011682016040523d82523d6000602084013e610b6a565b606091505b5091509150610b7a858383610ba2565b95945050505050565b34156108365760405163b398979f60e01b815260040160405180910390fd5b606082610bb757610bb282610bfe565b610aa1565b8151158015610bce57506001600160a01b0384163b155b15610bf757604051639996b31560e01b81526001600160a01b0385166004820152602401610262565b5092915050565b805115610c0e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610c3e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c6c57600080fd5b610c7583610c27565b9150602083013567ffffffffffffffff80821115610c9257600080fd5b818501915085601f830112610ca657600080fd5b813581811115610cb857610cb8610c43565b604051601f8201601f19908116603f01168101908382118183101715610ce057610ce0610c43565b81604052828152886020848701011115610cf957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060408385031215610d2e57600080fd5b610d3783610c27565b9150610d4560208401610c27565b90509250929050565b60005b83811015610d69578181015183820152602001610d51565b50506000910152565b6020815260008251806020840152610d91816040850160208701610d4e565b601f01601f19169190910160400192915050565b600060208284031215610db757600080fd5b610aa182610c27565b60048110610dde57634e487b7160e01b600052602160045260246000fd5b9052565b60408101610df08285610dc0565b6001600160a01b039290921660209190910152919050565b600060208284031215610e1a57600080fd5b81518015158114610aa157600080fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818103610e5957610e59610e2a565b6001019392505050565b600060208284031215610e7557600080fd5b5051919050565b60208101610a228284610dc0565b600060208284031215610e9c57600080fd5b815163ffffffff81168114610aa157600080fd5b63ffffffff818116838216028082169190828114610ed057610ed0610e2a565b505092915050565b63ffffffff828116828216039080821115610bf757610bf7610e2a565b600063ffffffff80841680610f1a57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115610bf757610bf7610e2a565b60008251610f55818460208701610d4e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220e2a4e2c158ec7d38443cf09da5dacb8f5d2cef32752a3b7a150d8d9a0a5dc4f264736f6c63430008170033" }, "0x0000000000000000000000000000000000003333": { "comment": "Proxy: Ethereum registry for ERC-1056 ethr did methods", @@ -164,12 +164,12 @@ "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000003333", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000f315b3f9555201540945bba7a4d9ac77d5c1e74d" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000006fffd846c8ca69a6464ff22d960f18de175cbdd5" } }, - "0xf315b3f9555201540945bba7a4d9ac77d5c1e74d": { + "0x6fffd846c8ca69a6464ff22d960f18de175cbdd5": { "comment": "Implementation: Smart contract to manage schemas", - "code": "0x6080604052600436106100705760003560e01c80635915b7681161004e5780635915b768146100d2578063ad3cb1cc146100f2578063bdd23ccb14610130578063eaa760c21461015057600080fd5b8063485cc955146100755780634f1ef2861461009757806352d1902d146100aa575b600080fd5b34801561008157600080fd5b5061009561009036600461099d565b61017d565b005b6100956100a53660046109ec565b61027e565b3480156100b657600080fd5b506100bf61029d565b6040519081526020015b60405180910390f35b3480156100de57600080fd5b506100956100ed366004610af9565b6102ba565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100c99190610b79565b34801561013c57600080fd5b5061009561014b366004610bac565b6102cd565b34801561015c57600080fd5b506100bf61016b366004610c38565b60026020526000908152604090205481565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806101c75750805467ffffffffffffffff808416911610155b156101e55760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102108461032c565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610286610356565b61028f826103fd565b6102998282610463565b5050565b60006102a761052a565b50600080516020610d5683398151915290565b6102c78433858585610573565b50505050565b6040516000906102f190601960f81b90839030908c90899089908990602001610c51565b6040516020818303038152906040528051906020012090506103228861031a8a848b8b8b6106b3565b868686610573565b5050505050505050565b610334610764565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103dd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103d1600080516020610d56833981519152546001600160a01b031690565b6001600160a01b031614155b156103fb5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104bd575060408051601f3d908101601f191682019092526104ba91810190610cc3565b60015b6104ea57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610d56833981519152811461051b57604051632a87526960e21b8152600481018290526024016104e1565b61052583836107ad565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103fb5760405163703e46dd60e11b815260040160405180910390fd5b6000838152600260205260409020548390156105a5576040516347f6332960e11b8152600481018290526024016104e1565b6001546040516310e67a9d60e31b81526001600160a01b03808916600483015288928892911690638733d4e890602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190610cdc565b6001600160a01b0316816001600160a01b03161461065a576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016104e1565b600086815260026020526040908190204390555186907f3e21fe65ee16f151c8cda6e871883b2e0550f9c8511b4ea1d75c9c9e8d489f67906106a1908a9089908990610cf9565b60405180910390a25050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610709573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b03161461075a576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016104e1565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103fb57604051631afcd79f60e31b815260040160405180910390fd5b6107b682610803565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156107fb576105258282610868565b6102996108de565b806001600160a01b03163b60000361083957604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104e1565b600080516020610d5683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516108859190610d39565b600060405180830381855af49150503d80600081146108c0576040519150601f19603f3d011682016040523d82523d6000602084013e6108c5565b606091505b50915091506108d58583836108fd565b95945050505050565b34156103fb5760405163b398979f60e01b815260040160405180910390fd5b6060826109125761090d8261095c565b610955565b815115801561092957506001600160a01b0384163b155b1561095257604051639996b31560e01b81526001600160a01b03851660048201526024016104e1565b50805b9392505050565b80511561096c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b038116811461098557600080fd5b600080604083850312156109b057600080fd5b82356109bb81610988565b915060208301356109cb81610988565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156109ff57600080fd5b8235610a0a81610988565b9150602083013567ffffffffffffffff80821115610a2757600080fd5b818501915085601f830112610a3b57600080fd5b813581811115610a4d57610a4d6109d6565b604051601f8201601f19908116603f01168101908382118183101715610a7557610a756109d6565b81604052828152886020848701011115610a8e57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f840112610ac257600080fd5b50813567ffffffffffffffff811115610ada57600080fd5b602083019150836020828501011115610af257600080fd5b9250929050565b60008060008060608587031215610b0f57600080fd5b8435610b1a81610988565b935060208501359250604085013567ffffffffffffffff811115610b3d57600080fd5b610b4987828801610ab0565b95989497509550505050565b60005b83811015610b70578181015183820152602001610b58565b50506000910152565b6020815260008251806020840152610b98816040850160208701610b55565b601f01601f19169190910160400192915050565b600080600080600080600060c0888a031215610bc757600080fd5b8735610bd281610988565b9650602088013560ff81168114610be857600080fd5b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115610c1957600080fd5b610c258a828b01610ab0565b989b979a50959850939692959293505050565b600060208284031215610c4a57600080fd5b5035919050565b6001600160f81b03198881168252871660018201526bffffffffffffffffffffffff19606087811b8216600284015286901b1660168201526b637265617465536368656d6160a01b602a8201526036810184905260008284605684013750600091016056019081529695505050505050565b600060208284031215610cd557600080fd5b5051919050565b600060208284031215610cee57600080fd5b815161095581610988565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610d4b818460208701610b55565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209a7d08dba8f2166617ba13259e572954ae9307a7b3a6f0b135cdfdd8790b117964736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c80635915b7681161004e5780635915b768146100d2578063ad3cb1cc146100f2578063bdd23ccb14610130578063eaa760c21461015057600080fd5b8063485cc955146100755780634f1ef2861461009757806352d1902d146100aa575b600080fd5b34801561008157600080fd5b5061009561009036600461099d565b61017d565b005b6100956100a53660046109ec565b61027e565b3480156100b657600080fd5b506100bf61029d565b6040519081526020015b60405180910390f35b3480156100de57600080fd5b506100956100ed366004610af9565b6102ba565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100c99190610b79565b34801561013c57600080fd5b5061009561014b366004610bac565b6102cd565b34801561015c57600080fd5b506100bf61016b366004610c38565b60026020526000908152604090205481565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806101c75750805467ffffffffffffffff808416911610155b156101e55760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102108461032c565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610286610356565b61028f826103fd565b6102998282610463565b5050565b60006102a761052a565b50600080516020610d5683398151915290565b6102c78433858585610573565b50505050565b6040516000906102f190601960f81b90839030908c90899089908990602001610c51565b6040516020818303038152906040528051906020012090506103228861031a8a848b8b8b6106b3565b868686610573565b5050505050505050565b610334610764565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103dd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103d1600080516020610d56833981519152546001600160a01b031690565b6001600160a01b031614155b156103fb5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104bd575060408051601f3d908101601f191682019092526104ba91810190610cc3565b60015b6104ea57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610d56833981519152811461051b57604051632a87526960e21b8152600481018290526024016104e1565b61052583836107ad565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103fb5760405163703e46dd60e11b815260040160405180910390fd5b6000838152600260205260409020548390156105a5576040516347f6332960e11b8152600481018290526024016104e1565b6001546040516310e67a9d60e31b81526001600160a01b03808916600483015288928892911690638733d4e890602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190610cdc565b6001600160a01b0316816001600160a01b03161461065a576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016104e1565b600086815260026020526040908190204390555186907f3e21fe65ee16f151c8cda6e871883b2e0550f9c8511b4ea1d75c9c9e8d489f67906106a1908a9089908990610cf9565b60405180910390a25050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610709573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b03161461075a576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016104e1565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103fb57604051631afcd79f60e31b815260040160405180910390fd5b6107b682610803565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156107fb576105258282610868565b6102996108de565b806001600160a01b03163b60000361083957604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104e1565b600080516020610d5683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516108859190610d39565b600060405180830381855af49150503d80600081146108c0576040519150601f19603f3d011682016040523d82523d6000602084013e6108c5565b606091505b50915091506108d58583836108fd565b95945050505050565b34156103fb5760405163b398979f60e01b815260040160405180910390fd5b6060826109125761090d8261095c565b610955565b815115801561092957506001600160a01b0384163b155b1561095257604051639996b31560e01b81526001600160a01b03851660048201526024016104e1565b50805b9392505050565b80511561096c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b038116811461098557600080fd5b600080604083850312156109b057600080fd5b82356109bb81610988565b915060208301356109cb81610988565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156109ff57600080fd5b8235610a0a81610988565b9150602083013567ffffffffffffffff80821115610a2757600080fd5b818501915085601f830112610a3b57600080fd5b813581811115610a4d57610a4d6109d6565b604051601f8201601f19908116603f01168101908382118183101715610a7557610a756109d6565b81604052828152886020848701011115610a8e57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f840112610ac257600080fd5b50813567ffffffffffffffff811115610ada57600080fd5b602083019150836020828501011115610af257600080fd5b9250929050565b60008060008060608587031215610b0f57600080fd5b8435610b1a81610988565b935060208501359250604085013567ffffffffffffffff811115610b3d57600080fd5b610b4987828801610ab0565b95989497509550505050565b60005b83811015610b70578181015183820152602001610b58565b50506000910152565b6020815260008251806020840152610b98816040850160208701610b55565b601f01601f19169190910160400192915050565b600080600080600080600060c0888a031215610bc757600080fd5b8735610bd281610988565b9650602088013560ff81168114610be857600080fd5b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115610c1957600080fd5b610c258a828b01610ab0565b989b979a50959850939692959293505050565b600060208284031215610c4a57600080fd5b5035919050565b6001600160f81b03198881168252871660018201526bffffffffffffffffffffffff19606087811b8216600284015286901b1660168201526b637265617465536368656d6160a01b602a8201526036810184905260008284605684013750600091016056019081529695505050505050565b600060208284031215610cd557600080fd5b5051919050565b600060208284031215610cee57600080fd5b815161095581610988565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610d4b818460208701610b55565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209fee647b72c073b0a0e885a7e46d131e5619fd223821fee2030e3aed0b0afc7c64736f6c63430008170033" }, "0x0000000000000000000000000000000000004444": { "comment": "Proxy: Smart contract to manage credential definitions", @@ -179,12 +179,12 @@ "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000003333", "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000005555", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000007247f5b287a9be3d05ba412c38f38e71b330ea03" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000e704f22861159484745a4056d4ccdec39f0d8b31" } }, - "0x7247f5b287a9be3d05ba412c38f38e71b330ea03": { + "0xe704f22861159484745a4056d4ccdec39f0d8b31": { "comment": "Implementation: Smart contract to manage credential definitions", - "code": "0x6080604052600436106100705760003560e01c8063bbc742411161004e578063bbc74241146100f0578063c0c53b8b14610110578063eaa760c214610130578063f062236b1461015d57600080fd5b80634f1ef2861461007557806352d1902d1461008a578063ad3cb1cc146100b2575b600080fd5b610088610083366004610a5c565b61017d565b005b34801561009657600080fd5b5061009f61019c565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100e3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610b44565b3480156100fc57600080fd5b5061008861010b366004610bc0565b6101b9565b34801561011c57600080fd5b5061008861012b366004610c2a565b6101ce565b34801561013c57600080fd5b5061009f61014b366004610c75565b60036020526000908152604090205481565b34801561016957600080fd5b50610088610178366004610c8e565b6102e5565b610185610348565b61018e826103ef565b610198828261044e565b5050565b60006101a6610515565b50600080516020610e4183398151915290565b6101c785338686868661055e565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102185750805467ffffffffffffffff808416911610155b156102365760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561026185610732565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60405160009061030b90601960f81b90839030908d908a908a908a908a90602001610d23565b60405160208183030381529060405280519060200120905061033d896103348b848c8c8c61075c565b8787878761055e565b505050505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103cf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103c3600080516020610e41833981519152546001600160a01b031690565b6001600160a01b031614155b156103ed5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561043a57600080fd5b505afa1580156101c7573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104a8575060408051601f3d908101601f191682019092526104a591810190610dae565b60015b6104d557604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610e41833981519152811461050657604051632a87526960e21b8152600481018290526024016104cc565b610510838361080d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ed5760405163703e46dd60e11b815260040160405180910390fd5b6000848152600360205260409020548490156105905760405163b1a7a2af60e01b8152600481018290526024016104cc565b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610dc7565b6001600160a01b0316816001600160a01b031614610645576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016104cc565b600254604051637553b06160e11b81526004810188905287916001600160a01b03169063eaa760c2906024016020604051808303816000875af1158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610dae565b6000036106d75760405163063de83560e21b8152600481018290526024016104cc565b600088815260036020526040908190204390555188907fb244582b6218e1202021c674f5f9ba330f9393f8359101bb96445efeedff3db39061071e908c908a908a90610de4565b60405180910390a250505050505050505050565b61073a610863565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156107b2573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b031614610803576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016104cc565b9695505050505050565b610816826108ac565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561085b576105108282610911565b610198610987565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103ed57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036108e257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104cc565b600080516020610e4183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161092e9190610e24565b600060405180830381855af49150503d8060008114610969576040519150601f19603f3d011682016040523d82523d6000602084013e61096e565b606091505b509150915061097e8583836109a6565b95945050505050565b34156103ed5760405163b398979f60e01b815260040160405180910390fd5b6060826109bb576109b682610a05565b6109fe565b81511580156109d257506001600160a01b0384163b155b156109fb57604051639996b31560e01b81526001600160a01b03851660048201526024016104cc565b50805b9392505050565b805115610a155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610a2e57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a6f57600080fd5b8235610a7a81610a31565b9150602083013567ffffffffffffffff80821115610a9757600080fd5b818501915085601f830112610aab57600080fd5b813581811115610abd57610abd610a46565b604051601f8201601f19908116603f01168101908382118183101715610ae557610ae5610a46565b81604052828152886020848701011115610afe57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610b3b578181015183820152602001610b23565b50506000910152565b6020815260008251806020840152610b63816040850160208701610b20565b601f01601f19169190910160400192915050565b60008083601f840112610b8957600080fd5b50813567ffffffffffffffff811115610ba157600080fd5b602083019150836020828501011115610bb957600080fd5b9250929050565b600080600080600060808688031215610bd857600080fd5b8535610be381610a31565b94506020860135935060408601359250606086013567ffffffffffffffff811115610c0d57600080fd5b610c1988828901610b77565b969995985093965092949392505050565b600080600060608486031215610c3f57600080fd5b8335610c4a81610a31565b92506020840135610c5a81610a31565b91506040840135610c6a81610a31565b809150509250925092565b600060208284031215610c8757600080fd5b5035919050565b60008060008060008060008060e0898b031215610caa57600080fd5b8835610cb581610a31565b9750602089013560ff81168114610ccb57600080fd5b965060408901359550606089013594506080890135935060a0890135925060c089013567ffffffffffffffff811115610d0357600080fd5b610d0f8b828c01610b77565b999c989b5096995094979396929594505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201527f63726561746543726564656e7469616c446566696e6974696f6e000000000000602a82015260448101859052606481018490526000828460848401375060009101608401908152979650505050505050565b600060208284031215610dc057600080fd5b5051919050565b600060208284031215610dd957600080fd5b81516109fe81610a31565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610e36818460208701610b20565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200902f7951b96b4edf4e8158f7c55449afb1301b51794764084a2f61dc871711a64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c8063bbc742411161004e578063bbc74241146100f0578063c0c53b8b14610110578063eaa760c214610130578063f062236b1461015d57600080fd5b80634f1ef2861461007557806352d1902d1461008a578063ad3cb1cc146100b2575b600080fd5b610088610083366004610a5c565b61017d565b005b34801561009657600080fd5b5061009f61019c565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100e3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610b44565b3480156100fc57600080fd5b5061008861010b366004610bc0565b6101b9565b34801561011c57600080fd5b5061008861012b366004610c2a565b6101ce565b34801561013c57600080fd5b5061009f61014b366004610c75565b60036020526000908152604090205481565b34801561016957600080fd5b50610088610178366004610c8e565b6102e5565b610185610348565b61018e826103ef565b610198828261044e565b5050565b60006101a6610515565b50600080516020610e4183398151915290565b6101c785338686868661055e565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102185750805467ffffffffffffffff808416911610155b156102365760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561026185610732565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60405160009061030b90601960f81b90839030908d908a908a908a908a90602001610d23565b60405160208183030381529060405280519060200120905061033d896103348b848c8c8c61075c565b8787878761055e565b505050505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103cf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103c3600080516020610e41833981519152546001600160a01b031690565b6001600160a01b031614155b156103ed5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561043a57600080fd5b505afa1580156101c7573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104a8575060408051601f3d908101601f191682019092526104a591810190610dae565b60015b6104d557604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610e41833981519152811461050657604051632a87526960e21b8152600481018290526024016104cc565b610510838361080d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ed5760405163703e46dd60e11b815260040160405180910390fd5b6000848152600360205260409020548490156105905760405163b1a7a2af60e01b8152600481018290526024016104cc565b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610dc7565b6001600160a01b0316816001600160a01b031614610645576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016104cc565b600254604051637553b06160e11b81526004810188905287916001600160a01b03169063eaa760c2906024016020604051808303816000875af1158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610dae565b6000036106d75760405163063de83560e21b8152600481018290526024016104cc565b600088815260036020526040908190204390555188907fb244582b6218e1202021c674f5f9ba330f9393f8359101bb96445efeedff3db39061071e908c908a908a90610de4565b60405180910390a250505050505050505050565b61073a610863565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156107b2573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b031614610803576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016104cc565b9695505050505050565b610816826108ac565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561085b576105108282610911565b610198610987565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103ed57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036108e257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104cc565b600080516020610e4183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161092e9190610e24565b600060405180830381855af49150503d8060008114610969576040519150601f19603f3d011682016040523d82523d6000602084013e61096e565b606091505b509150915061097e8583836109a6565b95945050505050565b34156103ed5760405163b398979f60e01b815260040160405180910390fd5b6060826109bb576109b682610a05565b6109fe565b81511580156109d257506001600160a01b0384163b155b156109fb57604051639996b31560e01b81526001600160a01b03851660048201526024016104cc565b50805b9392505050565b805115610a155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610a2e57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a6f57600080fd5b8235610a7a81610a31565b9150602083013567ffffffffffffffff80821115610a9757600080fd5b818501915085601f830112610aab57600080fd5b813581811115610abd57610abd610a46565b604051601f8201601f19908116603f01168101908382118183101715610ae557610ae5610a46565b81604052828152886020848701011115610afe57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610b3b578181015183820152602001610b23565b50506000910152565b6020815260008251806020840152610b63816040850160208701610b20565b601f01601f19169190910160400192915050565b60008083601f840112610b8957600080fd5b50813567ffffffffffffffff811115610ba157600080fd5b602083019150836020828501011115610bb957600080fd5b9250929050565b600080600080600060808688031215610bd857600080fd5b8535610be381610a31565b94506020860135935060408601359250606086013567ffffffffffffffff811115610c0d57600080fd5b610c1988828901610b77565b969995985093965092949392505050565b600080600060608486031215610c3f57600080fd5b8335610c4a81610a31565b92506020840135610c5a81610a31565b91506040840135610c6a81610a31565b809150509250925092565b600060208284031215610c8757600080fd5b5035919050565b60008060008060008060008060e0898b031215610caa57600080fd5b8835610cb581610a31565b9750602089013560ff81168114610ccb57600080fd5b965060408901359550606089013594506080890135935060a0890135925060c089013567ffffffffffffffff811115610d0357600080fd5b610d0f8b828c01610b77565b999c989b5096995094979396929594505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201527f63726561746543726564656e7469616c446566696e6974696f6e000000000000602a82015260448101859052606481018490526000828460848401375060009101608401908152979650505050505050565b600060208284031215610dc057600080fd5b5051919050565b600060208284031215610dd957600080fd5b81516109fe81610a31565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610e36818460208701610b20565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ef96dab0a835a4d7a17f0d35c990c7e3aee002fb89c77edde27a6fc55d77a89264736f6c63430008170033" }, "0x0000000000000000000000000000000000019999": { "comment": "Proxy: Smart contract to store mapping of legacy identifiers to new one", @@ -193,12 +193,12 @@ "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000003333", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000081283bd1b361f1164274d49b8b0d21538c87743a" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000207bac0004357ecb471397a4ecade4bdef4ab32e" } }, - "0x81283bd1b361f1164274d49b8b0d21538c87743a": { + "0x207bac0004357ecb471397a4ecade4bdef4ab32e": { "comment": "Implementation: Smart contract to store mapping of legacy identifiers to new one", - "code": "0x6080604052600436106100915760003560e01c8063ad3cb1cc11610059578063ad3cb1cc14610133578063d81dacea14610171578063f66e53b814610191578063f9015640146101b1578063fadb3caa146101d157600080fd5b8063485cc955146100965780634f1ef286146100b857806351dbd9ba146100cb57806352d1902d146100eb5780637a06495d14610113575b600080fd5b3480156100a257600080fd5b506100b66100b1366004610dfa565b61021f565b005b6100b66100c6366004610ebf565b610320565b3480156100d757600080fd5b506100b66100e6366004610f89565b61033f565b3480156100f757600080fd5b50610100610354565b6040519081526020015b60405180910390f35b34801561011f57600080fd5b506100b661012e366004610ffa565b610371565b34801561013f57600080fd5b50610164604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161010a91906110b1565b34801561017d57600080fd5b506100b661018c3660046110f5565b610388565b34801561019d57600080fd5b506100b66101ac3660046111ae565b6103ef565b3480156101bd57600080fd5b506101646101cc366004611242565b610452565b3480156101dd57600080fd5b506102076101ec366004611293565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161010a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102695750805467ffffffffffffffff808416911610155b156102875760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102b2846104f7565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610328610521565b610331826105c8565b61033b8282610627565b5050565b61034d8533868686866106ee565b5050505050565b600061035e6108cd565b506000805160206115db83398151915290565b61038086338787878787610916565b505050505050565b6040516000906103b090601960f81b90839030908e908b908b908b908b908b906020016112ae565b6040516020818303038152906040528051906020012090506103e38a6103d98c848d8d8d610b10565b8888888888610916565b50505050505050505050565b60405160009061041590601960f81b90839030908d908a908a908a908a90602001611340565b6040516020818303038152906040528051906020012090506104478961043e8b848c8c8c610b10565b878787876106ee565b505050505050505050565b805160208183018101805160038252928201919093012091528054610476906113c7565b80601f01602080910402602001604051908101604052809291908181526020018280546104a2906113c7565b80156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b6104ff610bc1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806105a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661059c6000805160206115db833981519152546001600160a01b031690565b6001600160a01b031614155b156105c65760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561061357600080fd5b505afa15801561034d573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610681575060408051601f3d908101601f1916820190925261067e91810190611401565b60015b6106ae57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b6000805160206115db83398151915281146106df57604051632a87526960e21b8152600481018290526024016106a5565b6106e98383610c0a565b505050565b6001600160801b0319841660009081526002602052604090205484906001600160a01b03161561073d5760405163ef5d84db60e01b81526001600160801b0319821660048201526024016106a5565b84846001600160801b03198083169082161461077f5760405163e8e071a360e01b8152600481018290526001600160801b0319831660248201526044016106a5565b6001546040516310e67a9d60e31b81526001600160a01b03808c1660048301528b928b92911690638733d4e890602401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f0919061141a565b6001600160a01b0316816001600160a01b031614610834576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016106a5565b6001600160801b031989166000908152600260205260409081902080546001600160a01b038e166001600160a01b0319909116179055517f927a965f3682a77d42361eb5e6a97f674e0298be7371e5196a5a1d0d9e822d49906108b8908b908e906001600160801b03199290921682526001600160a01b0316602082015260400190565b60405180910390a15050505050505050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105c65760405163703e46dd60e11b815260040160405180910390fd5b83836003828260405161092a929190611437565b90815260200160405180910390208054610943906113c7565b159050610967578181604051632b71465d60e21b81526004016106a5929190611470565b6001600160801b03198716600090815260026020526040902054879089906001600160a01b038083169116146109df576001600160801b03198216600090815260026020526040908190205490516316343f1760e31b81526001600160a01b03808416600483015290911660248201526044016106a5565b6001546040516310e67a9d60e31b81526001600160a01b03808e1660048301528d928d92911690638733d4e890602401602060405180830381865afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a50919061141a565b6001600160a01b0316816001600160a01b031614610a94576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016106a5565b878760038c8c604051610aa8929190611437565b90815260200160405180910390209182610ac39291906114cc565b507f840cf502414cbda0f573a023e7698810f34c50cb03b6b3c8d0e96ef402d2af0b8a8a8a8a604051610af9949392919061158c565b60405180910390a150505050505050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610b66573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b031614610bb7576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016106a5565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166105c657604051631afcd79f60e31b815260040160405180910390fd5b610c1382610c60565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610c58576106e98282610cc5565b61033b610d3b565b806001600160a01b03163b600003610c9657604051634c9c8ce360e01b81526001600160a01b03821660048201526024016106a5565b6000805160206115db83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610ce291906115be565b600060405180830381855af49150503d8060008114610d1d576040519150601f19603f3d011682016040523d82523d6000602084013e610d22565b606091505b5091509150610d32858383610d5a565b95945050505050565b34156105c65760405163b398979f60e01b815260040160405180910390fd5b606082610d6f57610d6a82610db9565b610db2565b8151158015610d8657506001600160a01b0384163b155b15610daf57604051639996b31560e01b81526001600160a01b03851660048201526024016106a5565b50805b9392505050565b805115610dc95780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610de257600080fd5b60008060408385031215610e0d57600080fd5b8235610e1881610de5565b91506020830135610e2881610de5565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610e6457610e64610e33565b604051601f8501601f19908116603f01168101908282118183101715610e8c57610e8c610e33565b81604052809350858152868686011115610ea557600080fd5b858560208301376000602087830101525050509392505050565b60008060408385031215610ed257600080fd5b8235610edd81610de5565b9150602083013567ffffffffffffffff811115610ef957600080fd5b8301601f81018513610f0a57600080fd5b610f1985823560208401610e49565b9150509250929050565b80356001600160801b031981168114610f3b57600080fd5b919050565b60008083601f840112610f5257600080fd5b50813567ffffffffffffffff811115610f6a57600080fd5b602083019150836020828501011115610f8257600080fd5b9250929050565b600080600080600060808688031215610fa157600080fd5b8535610fac81610de5565b9450610fba60208701610f23565b935060408601359250606086013567ffffffffffffffff811115610fdd57600080fd5b610fe988828901610f40565b969995985093965092949392505050565b6000806000806000806080878903121561101357600080fd5b863561101e81610de5565b955061102c60208801610f23565b9450604087013567ffffffffffffffff8082111561104957600080fd5b6110558a838b01610f40565b9096509450606089013591508082111561106e57600080fd5b5061107b89828a01610f40565b979a9699509497509295939492505050565b60005b838110156110a8578181015183820152602001611090565b50506000910152565b60208152600082518060208401526110d081604085016020870161108d565b601f01601f19169190910160400192915050565b803560ff81168114610f3b57600080fd5b600080600080600080600080600060e08a8c03121561111357600080fd5b893561111e81610de5565b985061112c60208b016110e4565b975060408a0135965060608a0135955061114860808b01610f23565b945060a08a013567ffffffffffffffff8082111561116557600080fd5b6111718d838e01610f40565b909650945060c08c013591508082111561118a57600080fd5b506111978c828d01610f40565b915080935050809150509295985092959850929598565b60008060008060008060008060e0898b0312156111ca57600080fd5b88356111d581610de5565b97506111e360208a016110e4565b965060408901359550606089013594506111ff60808a01610f23565b935060a0890135925060c089013567ffffffffffffffff81111561122257600080fd5b61122e8b828c01610f40565b999c989b5096995094979396929594505050565b60006020828403121561125457600080fd5b813567ffffffffffffffff81111561126b57600080fd5b8201601f8101841361127c57600080fd5b61128b84823560208401610e49565b949350505050565b6000602082840312156112a557600080fd5b610db282610f23565b6001600160f81b03198a81168252891660018201526bffffffffffffffffffffffff19606089811b8216600284015288901b1660168201526e637265617465436c4d617070696e6760881b602a8201526001600160801b031986166039820152600084866049840137848201604981016000815284868237506000930160490192835250909998505050505050505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201526f6372656174654469644d617070696e6760801b602a8201526001600160801b03198516603a820152604a810184905260008284606a8401375060009101606a01908152979650505050505050565b600181811c908216806113db57607f821691505b6020821081036113fb57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561141357600080fd5b5051919050565b60006020828403121561142c57600080fd5b8151610db281610de5565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061128b602083018486611447565b601f8211156106e9576000816000526020600020601f850160051c810160208610156114ad5750805b601f850160051c820191505b81811015610380578281556001016114b9565b67ffffffffffffffff8311156114e4576114e4610e33565b6114f8836114f283546113c7565b83611484565b6000601f84116001811461152c57600085156115145750838201355b600019600387901b1c1916600186901b17835561034d565b600083815260209020601f19861690835b8281101561155d578685013582556020948501946001909201910161153d565b508682101561157a5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6040815260006115a0604083018688611447565b82810360208401526115b3818587611447565b979650505050505050565b600082516115d081846020870161108d565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f3a4f9210b7a5c2016e68c96559318442087197a32edbb508175f6179c9d240e64736f6c63430008170033" + "code": "0x6080604052600436106100915760003560e01c806393a8c7421161005957806393a8c74214610133578063ad3cb1cc1461018c578063ae3d4da7146101ca578063c612ab58146101ea578063d924aedb1461020a57600080fd5b8063485cc955146100965780634f1ef286146100b857806352d1902d146100cb57806363de77a2146100f35780637223460a14610113575b600080fd5b3480156100a257600080fd5b506100b66100b1366004611794565b61022a565b005b6100b66100c6366004611858565b610328565b3480156100d757600080fd5b506100e0610347565b6040519081526020015b60405180910390f35b3480156100ff57600080fd5b506100b661010e3660046118fc565b610364565b34801561011f57600080fd5b506100b661012e36600461199d565b61037b565b34801561013f57600080fd5b5061017461014e366004611a6f565b80516020818301810180516002825292820191909301209152546001600160a01b031681565b6040516001600160a01b0390911681526020016100ea565b34801561019857600080fd5b506101bd604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ea9190611ae3565b3480156101d657600080fd5b506100b66101e5366004611b16565b6103e6565b3480156101f657600080fd5b506101bd610205366004611a6f565b61044d565b34801561021657600080fd5b506100b6610225366004611bc7565b6104f2565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff1680610273575080546001600160401b03808416911610155b156102915760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556102bb8461050b565b600180546001600160a01b0319166001600160a01b038516179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610330610535565b610339826105dc565b6103438282610642565b5050565b6000610351610709565b5060008051602061205883398151915290565b61037386338787878787610752565b505050505050565b6040516000906103a590601960f81b90839030908f908c908c908c908c908c908c90602001611c73565b6040516020818303038152906040528051906020012090506103d98b6103ce8d848e8e8e610967565b898989898989610a18565b5050505050505050505050565b60405160009061040e90601960f81b90839030908e908b908b908b908b908b90602001611d0e565b6040516020818303038152906040528051906020012090506104418a6104378c848d8d8d610967565b8888888888610752565b50505050505050505050565b80516020818301810180516003825292820191909301209152805461047190611d91565b80601f016020809104026020016040519081016040528092919081815260200182805461049d90611d91565b80156104ea5780601f106104bf576101008083540402835291602001916104ea565b820191906000526020600020905b8154815290600101906020018083116104cd57829003601f168201915b505050505081565b6105028733888888888888610a18565b50505050505050565b610513610cc3565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806105bc57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166105b0600080516020612058833981519152546001600160a01b031690565b6001600160a01b031614155b156105da5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561062757600080fd5b505afa15801561063b573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561069c575060408051601f3d908101601f1916820190925261069991810190611dcb565b60015b6106c957604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b60008051602061205883398151915281146106fa57604051632a87526960e21b8152600481018290526024016106c0565b6107048383610d0c565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105da5760405163703e46dd60e11b815260040160405180910390fd5b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c39190611de4565b6001600160a01b0316816001600160a01b031614610807576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016106c0565b60006001600160a01b031660028888604051610824929190611e01565b908152604051908190036020019020546001600160a01b03161461085f578686604051630ab7bdc760e21b81526004016106c0929190611e3a565b846001600160801b0319166108a988888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d6292505050565b6108b290611e4e565b6001600160801b031916146108e057848787604051630876c99d60e21b81526004016106c093929190611e85565b88600288886040516108f3929190611e01565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557f701a83f8a2a9633e0e6442d096d21203cf8f4b735a8a7298e13cefc208e0f75a9061095490899089908d90611e9f565b60405180910390a1505050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156109bd573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b031614610a0e576040516316343f1760e31b81526001600160a01b038089166004830152821660248201526044016106c0565b9695505050505050565b6001546040516310e67a9d60e31b81526001600160a01b03808b1660048301528a928a92911690638733d4e890602401602060405180830381865afa158015610a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a899190611de4565b6001600160a01b0316816001600160a01b031614610acd576040516316343f1760e31b81526001600160a01b038084166004830152821660248201526044016106c0565b60038686604051610adf929190611e01565b90815260200160405180910390208054610af890611d91565b159050610b1c5785856040516327ef3c3d60e01b81526004016106c0929190611e3a565b60028888604051610b2e929190611e01565b908152604051908190036020019020546001600160a01b038b8116911614610b9e578960028989604051610b63929190611e01565b908152604051908190036020018120546316343f1760e31b82526001600160a01b0392831660048301529190911660248201526044016106c0565b610c25610be089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d7392505050565b610c1f88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d7392505050565b90610d7e565b610c4a578585898960405163998f70a160e01b81526004016106c09493929190611ecb565b838360038888604051610c5e929190611e01565b90815260200160405180910390209182610c79929190611f45565b507f87526cc0385862de920bf8b05560b5c9eb58f8af45be9f917801198166655f8886868686604051610caf9493929190611ecb565b60405180910390a150505050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166105da57604051631afcd79f60e31b815260040160405180910390fd5b610d1582610d91565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610d5a576107048282610df6565b610343610e6c565b6060610d6d82610e8b565b92915050565b6000610d6d826111d5565b6000610d8a83836111e9565b9392505050565b806001600160a01b03163b600003610dc757604051634c9c8ce360e01b81526001600160a01b03821660048201526024016106c0565b60008051602061205883398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610e139190612004565b600060405180830381855af49150503d8060008114610e4e576040519150601f19603f3d011682016040523d82523d6000602084013e610e53565b606091505b5091509150610e63858383611201565b95945050505050565b34156105da5760405163b398979f60e01b815260040160405180910390fd5b80516060906031906000805b8281108015610ebe575083868281518110610eb457610eb4612020565b016020015160f81c145b15610ecf5760019182019101610e97565b5060008080806117e361209f8702046001016002026001600160401b03811115610efb57610efb6117cd565b6040519080825280601f01601f191660200182016040528015610f25576020820181803683370190505b5090506000600460038801046001600160401b03811115610f4857610f486117cd565b604051908082528060200260200182016040528015610f71578160200160208202803683370190505b50905060005b8a518110156110935760008b8281518110610f9457610f94612020565b602001015160f81c60f81b9050610fc36040518060600160405280603a8152602001612078603a91398261125d565b90965094508461100c5760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a590818985cd94d4e08191a59da5d60621b60448201526064016106c0565b8251600019015b60008112611089578684828151811061102e5761102e612020565b602002602001015163ffffffff16603a026001600160401b0316019750602088901c96508763ffffffff1684828151811061106b5761106b612020565b63ffffffff9092166020928302919091019091015260001901611013565b5050600101610f77565b50600860038816026001600160401b0381166000036110b0575060205b600719016000805b835181101561115a575b6020836001600160401b0316101561114e57826001600160401b03168482815181106110f0576110f0612020565b602002602001015163ffffffff16901c60f81b85838151811061111557611115612020565b60200101906001600160f81b031916908160001a90535060019091019060086001600160401b0384161061114e576008830392506110c2565b601892506001016110b8565b50875b84518110156111b857600060f81b85828151811061117d5761117d612020565b01602001516001600160f81b03191611156111b05761119f858a8303846112c0565b9d9c50505050505050505050505050565b60010161115d565b506111c5846000836112c0565b9c9b505050505050505050505050565b600080602083019050610d8a818451611371565b60006000196111f8848461137d565b14159392505050565b6060826112165761121182611488565b610d8a565b815115801561122d57506001600160a01b0384163b155b1561125657604051639996b31560e01b81526001600160a01b03851660048201526024016106c0565b5092915050565b60008060005b84518110156112b057836001600160f81b03191685828151811061128957611289612020565b01602001516001600160f81b031916036112a8579150600190506112b9565b600101611263565b50600080915091505b9250929050565b606060008383036001600160401b038111156112de576112de6117cd565b6040519080825280601f01601f191660200182016040528015611308576020820181803683370190505b50905060005b84840381101561136857858582018151811061132c5761132c612020565b602001015160f81c60f81b82828151811061134957611349612020565b60200101906001600160f81b031916908160001a90535060010161130e565b50949350505050565b6000610d8a83836114b4565b60006001600160801b0383811690831680830361139f57600092505050610d6d565b8115806113ab57508181115b156113bc5760001992505050610d6d565b60006113c88660801c90565b905060006113d68660801c90565b905060006113e5825160001a90565b90505b60006113f58487846114c0565b90506000198103611410576000199650505050505050610d6d565b94859003949283019285851115611431576000199650505050505050610d6d565b8483208585200361145d576114468960801c90565b6114509085612036565b9650505050505050610d6d565b85600103611475576000199650505050505050610d6d565b60001990950194600190930192506113e8565b8051156114985780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6000610d8a8383611599565b6000602083116114dc576114d58484846115ff565b9050610d8a565b83601f8416808503820160ff85167f0101010101010101010101010101010101010101010101010101010101010101025b8188101561154f578751811861152281611734565b15611543578489036115368a60208a6115ff565b0195505050505050610d8a565b6020890198505061150d565b8260000361156557600019945050505050610d8a565b6115708284886115ff565b9450600019850361158957600019945050505050610d8a565b8382038501945050505050610d8a565b60006001600160801b038311156115c35760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b038211156115eb57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b825160009081602085111561161357602094505b601285106116af5760ff84167f01010101010101010101010101010101010101010101010101010101010101010282186116556001600160801b038217611734565b60000361168b5760109150601a86106116865761167a6001600160401b038217611734565b60000361168657601891505b6116a9565b61169d6001600160c01b038217611734565b6000036116a957600891505b506116ff565b600a85106116ff5760ff84167f01010101010101010101010101010101010101010101010101010101010101010282186116f16001600160c01b038217611734565b6000036116fd57600891505b505b848110156117275781811a60ff8516810361171e57509150610d8a9050565b506001016116ff565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b6001600160a01b03811681146114b157600080fd5b600080604083850312156117a757600080fd5b82356117b28161177f565b915060208301356117c28161177f565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156117fd576117fd6117cd565b604051601f8501601f19908116603f01168101908282118183101715611825576118256117cd565b8160405280935085815286868601111561183e57600080fd5b858560208301376000602087830101525050509392505050565b6000806040838503121561186b57600080fd5b82356118768161177f565b915060208301356001600160401b0381111561189157600080fd5b8301601f810185136118a257600080fd5b6118b1858235602084016117e3565b9150509250929050565b60008083601f8401126118cd57600080fd5b5081356001600160401b038111156118e457600080fd5b6020830191508360208285010111156112b957600080fd5b6000806000806000806080878903121561191557600080fd5b86356119208161177f565b955060208701356001600160401b038082111561193c57600080fd5b6119488a838b016118bb565b909750955060408901359450606089013591508082111561196857600080fd5b5061197589828a016118bb565b979a9699509497509295939492505050565b803560ff8116811461199857600080fd5b919050565b60008060008060008060008060008060e08b8d0312156119bc57600080fd5b8a356119c78161177f565b99506119d560208c01611987565b985060408b0135975060608b0135965060808b01356001600160401b03808211156119ff57600080fd5b611a0b8e838f016118bb565b909850965060a08d0135915080821115611a2457600080fd5b611a308e838f016118bb565b909650945060c08d0135915080821115611a4957600080fd5b50611a568d828e016118bb565b915080935050809150509295989b9194979a5092959850565b600060208284031215611a8157600080fd5b81356001600160401b03811115611a9757600080fd5b8201601f81018413611aa857600080fd5b611ab7848235602084016117e3565b949350505050565b60005b83811015611ada578181015183820152602001611ac2565b50506000910152565b6020815260008251806020840152611b02816040850160208701611abf565b601f01601f19169190910160400192915050565b600080600080600080600080600060e08a8c031215611b3457600080fd5b8935611b3f8161177f565b9850611b4d60208b01611987565b975060408a0135965060608a0135955060808a01356001600160401b0380821115611b7757600080fd5b611b838d838e016118bb565b909750955060a08c0135945060c08c0135915080821115611ba357600080fd5b50611bb08c828d016118bb565b915080935050809150509295985092959850929598565b60008060008060008060006080888a031215611be257600080fd5b8735611bed8161177f565b965060208801356001600160401b0380821115611c0957600080fd5b611c158b838c016118bb565b909850965060408a0135915080821115611c2e57600080fd5b611c3a8b838c016118bb565b909650945060608a0135915080821115611c5357600080fd5b50611c608a828b016118bb565b989b979a50959850939692959293505050565b6001600160f81b03198b811682528a1660018201526bffffffffffffffffffffffff1960608a811b8216600284015289901b166016820152746372656174655265736f757263654d617070696e6760581b602a82015260008688603f840137868201603f81016000815286888237508581019050603f810160008152848682375060009301603f0192835250909a9950505050505050505050565b6001600160f81b03198a81168252891660018201526bffffffffffffffffffffffff19606089811b8216600284015288901b1660168201526f6372656174654469644d617070696e6760801b602a82015260008587603a84013785820185603a8201528385605a83013760009301605a0192835250909998505050505050505050565b600181811c90821680611da557607f821691505b602082108103611dc557634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611ddd57600080fd5b5051919050565b600060208284031215611df657600080fd5b8151610d8a8161177f565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081526000611ab7602083018486611e11565b805160208201516001600160801b03198082169291906010831015611e7d5780818460100360031b1b83161693505b505050919050565b838152604060208201526000610e63604083018486611e11565b604081526000611eb3604083018587611e11565b905060018060a01b0383166020830152949350505050565b604081526000611edf604083018688611e11565b8281036020840152611ef2818587611e11565b979650505050505050565b601f821115610704576000816000526020600020601f850160051c81016020861015611f265750805b601f850160051c820191505b8181101561037357828155600101611f32565b6001600160401b03831115611f5c57611f5c6117cd565b611f7083611f6a8354611d91565b83611efd565b6000601f841160018114611fa45760008515611f8c5750838201355b600019600387901b1c1916600186901b17835561063b565b600083815260209020601f19861690835b82811015611fd55786850135825560209485019460019092019101611fb5565b5086821015611ff25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008251612016818460208701611abf565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b81810381811115610d6d57634e487b7160e01b600052601160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc31323334353637383941424344454647484a4b4c4d4e505152535455565758595a6162636465666768696a6b6d6e6f707172737475767778797aa26469706673582212204ff8af5b7bb292f88c6b1b4ae9c64793351b67ad1e5ac4db89bf2a17485db25264736f6c63430008170033" } } } diff --git a/network/config/nodes/validator5/key b/network/config/nodes/validator5/key index 60d1b7cc..e78e9867 100644 --- a/network/config/nodes/validator5/key +++ b/network/config/nodes/validator5/key @@ -1 +1 @@ -0x9654417b260ebfa36bff6168ab19fcdba04d857e446005f7802794f5ed130c78 \ No newline at end of file +0x6eaa86f5d6f812de7858a8856ce497330927c034e832442a68244247fe875a0e \ No newline at end of file diff --git a/smart_contracts/contracts-ts/LegacyIdentifiersRegistry.ts b/smart_contracts/contracts-ts/LegacyMappingRegistry.ts similarity index 62% rename from smart_contracts/contracts-ts/LegacyIdentifiersRegistry.ts rename to smart_contracts/contracts-ts/LegacyMappingRegistry.ts index db36f7ea..76b63170 100644 --- a/smart_contracts/contracts-ts/LegacyIdentifiersRegistry.ts +++ b/smart_contracts/contracts-ts/LegacyMappingRegistry.ts @@ -1,12 +1,11 @@ -import bs58 from 'bs58' import { Signature } from 'ethers' import { Contract } from '../utils/contract' -export class LegacyIdentifiersRegistry extends Contract { +export class LegacyMappingRegistry extends Contract { public static readonly defaultAddress = '0x0000000000000000000000000000000000019999' constructor(sender?: any) { - super(LegacyIdentifiersRegistry.name, sender) + super(LegacyMappingRegistry.name, sender) } public async createDidMapping( @@ -15,7 +14,7 @@ export class LegacyIdentifiersRegistry extends Contract { ed25519Key: Uint8Array, ed25519Signature: Uint8Array, ) { - const tx = await this.instance.createDidMapping(identity, bs58.decode(identifier), ed25519Key, ed25519Signature) + const tx = await this.instance.createDidMapping(identity, identifier, ed25519Key, ed25519Signature) return tx.wait() } @@ -31,52 +30,52 @@ export class LegacyIdentifiersRegistry extends Contract { signature.v, signature.r, signature.s, - bs58.decode(identifier), + identifier, ed25519Key, ed25519Signature, ) return tx.wait() } - public async resolveNewDid(id: string): Promise { - return this.instance.didMapping(bs58.decode(id)) + public async didMapping(id: string): Promise { + return this.instance.didMapping(id) } - public async createClMapping( + public async createResourceMapping( identity: string, legacyIssuerIdentifier: string, legacyIdentifier: string, newIdentifier: string, ) { - const tx = await this.instance.createClMapping( + const tx = await this.instance.createResourceMapping( identity, - bs58.decode(legacyIssuerIdentifier), + legacyIssuerIdentifier, legacyIdentifier, newIdentifier, ) return tx.wait() } - public async createClMappingSigned( + public async createResourceMappingSigned( identity: string, legacyIssuerIdentifier: string, legacyIdentifier: string, newIdentifier: string, signature: Signature, ) { - const tx = await this.instance.createClMappingSigned( + const tx = await this.instance.createResourceMappingSigned( identity, signature.v, signature.r, signature.s, - bs58.decode(legacyIssuerIdentifier), + legacyIssuerIdentifier, legacyIdentifier, newIdentifier, ) return tx.wait() } - public async resolveNewId(id: string): Promise { - return this.instance.clMapping(id) + public async resourceMapping(id: string): Promise { + return this.instance.resourceMapping(id) } } diff --git a/smart_contracts/contracts-ts/index.ts b/smart_contracts/contracts-ts/index.ts index 479e4141..2878f5a6 100644 --- a/smart_contracts/contracts-ts/index.ts +++ b/smart_contracts/contracts-ts/index.ts @@ -5,4 +5,4 @@ export * from './RoleControl' export * from './SchemaRegistry' export * from './UpgradeControl' export * from './ValidatorControl' -export * from './LegacyIdentifiersRegistry' +export * from './LegacyMappingRegistry' diff --git a/smart_contracts/contracts/auth/AuthErrors.sol b/smart_contracts/contracts/auth/AuthErrors.sol new file mode 100644 index 00000000..485e7e8f --- /dev/null +++ b/smart_contracts/contracts/auth/AuthErrors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +error Unauthorized(address sender); diff --git a/smart_contracts/contracts/auth/RoleControl.sol b/smart_contracts/contracts/auth/RoleControl.sol index f4465905..5ffaa1f9 100644 --- a/smart_contracts/contracts/auth/RoleControl.sol +++ b/smart_contracts/contracts/auth/RoleControl.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.20; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; -import { Unauthorized } from "../utils/Errors.sol"; +import { Unauthorized } from "./AuthErrors.sol"; import { RoleControlInterface } from "./RoleControlInterface.sol"; contract RoleControl is RoleControlInterface, ControlledUpgradeable { diff --git a/smart_contracts/contracts/cl/ClErrors.sol b/smart_contracts/contracts/cl/ClErrors.sol new file mode 100644 index 00000000..223dbe37 --- /dev/null +++ b/smart_contracts/contracts/cl/ClErrors.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +// Schema errors + +/** + * @notice Error that occurs when trying to create an already existing schema. + * @param id Schema ID. + */ +error SchemaAlreadyExist(bytes32 id); + +/** + * @notice Error that occurs when the specified schema is not found. + * @param id Schema ID. + */ +error SchemaNotFound(bytes32 id); + +// CredDef errors + +/** + * @notice Error that occurs when trying to create an existing credential definition. + * @param id Credential definition ID. + */ +error CredentialDefinitionAlreadyExist(bytes32 id); + +/** + * @notice Error that occurs when the specified credential definition is not found. + * @param id Credential definition ID. + */ +error CredentialDefinitionNotFound(bytes32 id); diff --git a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol index 237ac9a7..0278bec9 100644 --- a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol +++ b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; import { CredentialDefinitionRegistryInterface } from "./CredentialDefinitionRegistryInterface.sol"; -import { CredentialDefinitionAlreadyExist, SchemaNotFound } from "../utils/Errors.sol"; +import { CredentialDefinitionAlreadyExist, SchemaNotFound } from "./ClErrors.sol"; import { DidValidator } from "../did/DidValidator.sol"; import { SchemaRegistryInterface } from "./SchemaRegistryInterface.sol"; import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; diff --git a/smart_contracts/contracts/cl/SchemaRegistry.sol b/smart_contracts/contracts/cl/SchemaRegistry.sol index 0e7ca662..f17fee31 100644 --- a/smart_contracts/contracts/cl/SchemaRegistry.sol +++ b/smart_contracts/contracts/cl/SchemaRegistry.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.20; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; -import { SchemaAlreadyExist } from "../utils/Errors.sol"; +import { SchemaAlreadyExist } from "./ClErrors.sol"; import { SchemaRegistryInterface } from "./SchemaRegistryInterface.sol"; import { DidValidator } from "../did/DidValidator.sol"; import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; diff --git a/smart_contracts/contracts/did/DidErrors.sol b/smart_contracts/contracts/did/DidErrors.sol new file mode 100644 index 00000000..be7ab97a --- /dev/null +++ b/smart_contracts/contracts/did/DidErrors.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +/** + * @notice Error that occurs when performed identity operation by not owned account. + * @param sender Sender account address. + * @param owner Owner account address. + */ +error NotIdentityOwner(address sender, address owner); diff --git a/smart_contracts/contracts/did/DidValidator.sol b/smart_contracts/contracts/did/DidValidator.sol index e0901370..7cdf1e56 100644 --- a/smart_contracts/contracts/did/DidValidator.sol +++ b/smart_contracts/contracts/did/DidValidator.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { NotIdentityOwner } from "../utils/Errors.sol"; -import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; +import { NotIdentityOwner } from "./DidErrors.sol"; +import { EthereumExtDidRegistry } from "./EthereumExtDidRegistry.sol"; contract DidValidator { /** diff --git a/smart_contracts/contracts/migration/LegacyMappingErrors.sol b/smart_contracts/contracts/migration/LegacyMappingErrors.sol new file mode 100644 index 00000000..74f03d3f --- /dev/null +++ b/smart_contracts/contracts/migration/LegacyMappingErrors.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +/** + * @notice Error that occurs when trying to add a duplicating mapping for a legacy identifier. + * @param identifier Legacy DID identifier. + */ +error DidMappingAlreadyExist(string identifier); + +/** + * @notice Error that occurs when trying to add a duplicating mapping for a legacy resource identifier. + * @param identifier Legacy Schema/CredDef identifier. + */ +error ResourceMappingAlreadyExist(string identifier); + +/** + * @notice Error that occurs when provided ed25519Key key does not match to the provided legacy DID identifier. + * @param ed25519Key verification key matching to the DID. + * @param identifier legacy DID identifier. + */ +error InvalidEd25519Key(bytes32 ed25519Key, string identifier); + +/** + * @notice Error that occurs when provided resource id does not contain controller legacy DID identifier. + * @param identifier legacy resource identifier. + * @param legacyDid legacy did. + */ +error InvalidResourceId(string identifier, string legacyDid); diff --git a/smart_contracts/contracts/migration/LegacyIdentifiersRegistry.sol b/smart_contracts/contracts/migration/LegacyMappingRegistry.sol similarity index 53% rename from smart_contracts/contracts/migration/LegacyIdentifiersRegistry.sol rename to smart_contracts/contracts/migration/LegacyMappingRegistry.sol index 5f226a5b..4602d3a9 100644 --- a/smart_contracts/contracts/migration/LegacyIdentifiersRegistry.sol +++ b/smart_contracts/contracts/migration/LegacyMappingRegistry.sol @@ -2,78 +2,50 @@ pragma solidity ^0.8.20; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; - -import { DidMappingAlreadyExist, ClMappingAlreadyExist, NotIdentityOwner, InvalidEd25519Key } from "../utils/Errors.sol"; +import { DidMappingAlreadyExist, ResourceMappingAlreadyExist, InvalidEd25519Key, InvalidResourceId } from "./LegacyMappingErrors.sol"; +import { NotIdentityOwner } from "../did/DidErrors.sol"; import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; -import { LegacyIdentifiersRegistryInterface } from "./LegacyIdentifiersRegistryInterface.sol"; +import { LegacyMappingRegistryInterface } from "./LegacyMappingRegistryInterface.sol"; import { DidValidator } from "../did/DidValidator.sol"; -contract LegacyIdentifiersRegistry is LegacyIdentifiersRegistryInterface, ControlledUpgradeable, DidValidator { +import { Base58 } from "../utils/Base58.sol"; +import { toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; + +using { toSlice } for string; + +contract LegacyMappingRegistry is LegacyMappingRegistryInterface, ControlledUpgradeable, DidValidator { /* * Mapping storing indy/sov DID identifiers to the corresponding account address */ - mapping(bytes16 => address) public didMapping; + mapping(string legacyDid => address account) public didMapping; /* - * Mapping storing indy/sov formatted identifiers of schema/credential definition to the corresponding new form - */ - mapping(string => string) public clMapping; - - /** - * Checks the uniqueness of the DID mapping - */ - modifier _uniqueDidMapping(bytes16 identifier) { - if (didMapping[identifier] != address(0x00)) revert DidMappingAlreadyExist(identifier); - _; - } - - /** - * Checks the uniqueness of the CL mapping - */ - modifier _uniqueClMapping(string calldata identifier) { - if (bytes(clMapping[identifier]).length != 0) revert ClMappingAlreadyExist(identifier); - _; - } - - /** - * Checks that Ed25519 matches to the legacy DID identifier - */ - modifier _validEd25518Key(bytes16 identifier, bytes32 ed25519Key) { - if (identifier != bytes16(ed25519Key)) revert InvalidEd25519Key(ed25519Key, identifier); - _; - } - - /** - * Checks that owner of legacy DID controlled by actor + * Mapping storing indy/sov formatted identifiers of schema/credential-definition to the corresponding new form */ - modifier _legacyDidOwner(bytes16 legacyIssuerIdentifier, address actor) { - if (actor != didMapping[legacyIssuerIdentifier]) - revert NotIdentityOwner(actor, didMapping[legacyIssuerIdentifier]); - _; - } + mapping(string legacyId => string newId) public resourceMapping; function initialize(address upgradeControlAddress, address ethereumExtDidRegistry) public reinitializer(1) { _initializeUpgradeControl(upgradeControlAddress); _didRegistry = EthereumExtDidRegistry(ethereumExtDidRegistry); } - /// @inheritdoc LegacyIdentifiersRegistryInterface + /// @inheritdoc LegacyMappingRegistryInterface function createDidMapping( address identity, - bytes16 identifier, + string calldata identifier, bytes32 ed25519Key, bytes calldata ed25519Signature ) public virtual { _createDidMapping(identity, msg.sender, identifier, ed25519Key, ed25519Signature); } - /// @inheritdoc LegacyIdentifiersRegistryInterface + /// @inheritdoc LegacyMappingRegistryInterface function createDidMappingSigned( address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, - bytes16 identifier, + string calldata identifier, bytes32 ed25519Key, bytes calldata ed25518Signature ) public virtual { @@ -98,35 +70,23 @@ contract LegacyIdentifiersRegistry is LegacyIdentifiersRegistryInterface, Contro ); } - function _createDidMapping( - address identity, - address actor, - bytes16 identifier, - bytes32 ed25519Key, - bytes calldata ed25518Signature - ) internal _uniqueDidMapping(identifier) _validEd25518Key(identifier, ed25519Key) identityOwner(identity, actor) { - // check ed25519 signature validity - didMapping[identifier] = identity; - emit DidMappingCreated(identifier, identity); - } - - /// @inheritdoc LegacyIdentifiersRegistryInterface - function createClMapping( + /// @inheritdoc LegacyMappingRegistryInterface + function createResourceMapping( address identity, - bytes16 legacyIssuerIdentifier, + string calldata legacyIssuerIdentifier, string calldata legacyIdentifier, string calldata newIdentifier ) public virtual { - _createClMapping(identity, msg.sender, legacyIssuerIdentifier, legacyIdentifier, newIdentifier); + _createResourceMapping(identity, msg.sender, legacyIssuerIdentifier, legacyIdentifier, newIdentifier); } - /// @inheritdoc LegacyIdentifiersRegistryInterface - function createClMappingSigned( + /// @inheritdoc LegacyMappingRegistryInterface + function createResourceMappingSigned( address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, - bytes16 legacyIssuerIdentifier, + string calldata legacyIssuerIdentifier, string calldata legacyIdentifier, string calldata newIdentifier ) public virtual { @@ -136,13 +96,13 @@ contract LegacyIdentifiersRegistry is LegacyIdentifiersRegistryInterface, Contro bytes1(0), address(this), identity, - "createClMapping", + "createResourceMapping", legacyIssuerIdentifier, legacyIdentifier, newIdentifier ) ); - _createClMapping( + _createResourceMapping( identity, _checkSignature(identity, hash, sigV, sigR, sigS), legacyIssuerIdentifier, @@ -151,19 +111,44 @@ contract LegacyIdentifiersRegistry is LegacyIdentifiersRegistryInterface, Contro ); } - function _createClMapping( + function _createDidMapping( + address identity, + address actor, + string calldata identifier, + bytes32 ed25519Key, + bytes calldata ed25518Signature + ) internal identityOwner(identity, actor) { + // Checks the uniqueness of the DID mapping + if (didMapping[identifier] != address(0x00)) revert DidMappingAlreadyExist(identifier); + + // Checks that Ed25519 key matches to the legacy DID identifier + if (bytes16(Base58.decodeFromString(identifier)) != bytes16(ed25519Key)) + revert InvalidEd25519Key(ed25519Key, identifier); + + // TODO: check ed25519 signature validity + didMapping[identifier] = identity; + emit DidMappingCreated(identifier, identity); + } + + function _createResourceMapping( address identity, address actor, - bytes16 legacyIssuerIdentifier, + string calldata legacyIssuerIdentifier, string calldata legacyIdentifier, string calldata newIdentifier - ) - internal - _uniqueClMapping(legacyIdentifier) - _legacyDidOwner(legacyIssuerIdentifier, actor) - identityOwner(identity, actor) - { - clMapping[legacyIdentifier] = newIdentifier; - emit ClMappingCreated(legacyIdentifier, newIdentifier); + ) internal identityOwner(identity, actor) { + // Checks the uniqueness of the Resource mapping + if (bytes(resourceMapping[legacyIdentifier]).length != 0) revert ResourceMappingAlreadyExist(legacyIdentifier); + + // Checks that owner of legacy DID controlled by identity account + if (identity != didMapping[legacyIssuerIdentifier]) + revert NotIdentityOwner(identity, didMapping[legacyIssuerIdentifier]); + + // Checks that legacy issuer identifier is included into resource identifier + if (!legacyIdentifier.toSlice().contains(legacyIssuerIdentifier.toSlice())) + revert InvalidResourceId(legacyIdentifier, legacyIssuerIdentifier); + + resourceMapping[legacyIdentifier] = newIdentifier; + emit ResourceMappingCreated(legacyIdentifier, newIdentifier); } } diff --git a/smart_contracts/contracts/migration/LegacyIdentifiersRegistryInterface.sol b/smart_contracts/contracts/migration/LegacyMappingRegistryInterface.sol similarity index 63% rename from smart_contracts/contracts/migration/LegacyIdentifiersRegistryInterface.sol rename to smart_contracts/contracts/migration/LegacyMappingRegistryInterface.sol index a9acfb36..663b97f9 100644 --- a/smart_contracts/contracts/migration/LegacyIdentifiersRegistryInterface.sol +++ b/smart_contracts/contracts/migration/LegacyMappingRegistryInterface.sol @@ -1,15 +1,22 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -interface LegacyIdentifiersRegistryInterface { +interface LegacyMappingRegistryInterface { /** * @dev Event that is sent when a DID mapping is created. * - * @param identifier KECCAK256 hash of legacy DID identifier. + * @param identifier legacy DID identifier. * @param identity Corresponding account address of DID owner. */ - event DidMappingCreated(bytes16 identifier, address identity); - event ClMappingCreated(string legacyIdentifier, string newIdentifier); + event DidMappingCreated(string identifier, address identity); + + /** + * @dev Event that is sent when a new Resource (SchemaId/CredentialDefinitionId) mapping is created. + * + * @param legacyIdentifier Legacy ID of resource. + * @param newIdentifier New ID of resource. + */ + event ResourceMappingCreated(string legacyIdentifier, string newIdentifier); /** * @dev Creates a new mapping of legacy indy/sov DID identifier to account address. @@ -20,6 +27,7 @@ interface LegacyIdentifiersRegistryInterface { * This function can revert with following errors: * - `MappingAlreadyExist`: Raised if DID mapping with provided identifier already exist. * - `InvalidEd25519Key`: Raised if provided ED25519 verification key does not match to the DID identifier. + * - `NotIdentityOwner`: Raised if sender account is not owner of the provided identity * * @param identity Account address of the DID's owner. * @param identifier legacy DID identifier. @@ -28,7 +36,7 @@ interface LegacyIdentifiersRegistryInterface { */ function createDidMapping( address identity, - bytes16 identifier, + string calldata identifier, bytes32 ed25519Key, bytes calldata ed25519Signature ) external; @@ -42,7 +50,7 @@ interface LegacyIdentifiersRegistryInterface { * This function can revert with following errors: * - `MappingAlreadyExist`: Raised if DID mapping with provided identifier already exist. * - `InvalidEd25519Key`: Raised if provided ED25519 verification key does not match to the DID identifier. - * - `NotIdentityOwner`: Raised when an issuer DID specified in the mapping is not owned by sender + * - `NotIdentityOwner`: Raised if signer account is not owner of the provided identity * * @param identity Account address of the DID's owner. * @param sigV Part of EcDSA signature. @@ -57,7 +65,7 @@ interface LegacyIdentifiersRegistryInterface { uint8 sigV, bytes32 sigR, bytes32 sigS, - bytes16 identifier, + string calldata identifier, bytes32 ed25519Key, bytes calldata ed25519Signature ) external; @@ -65,20 +73,22 @@ interface LegacyIdentifiersRegistryInterface { /** * @dev Creates a new mapping of legacy schema/credential definition identifier to new one. * - * Once the mapping is created, this function emits a `ClMappingCreated` event + * Once the mapping is created, this function emits a `ResourceMappingCreated` event * with the legacy identifier and new one. * * This function can revert with following errors: - * - `MappingAlreadyExist`: Raised if DID mapping with provided identifier already exist. + * - `MappingAlreadyExist`: Raised if resource mapping with provided identifier already exist. + * - `NotIdentityOwner`: Raised if identity account is not owner of the legacy Issuer DID + * - `NotIdentityOwner`: Raised if sender account is not owner of provided identity * * @param identity Account address of the issuer. - * @param legacyIssuerIdentifier legacy issuer identifier. - * @param legacyIdentifier legacy identifier. - * @param newIdentifier new identifier. + * @param legacyIssuerIdentifier Legacy issuer identifier. + * @param legacyIdentifier Legacy identifier. + * @param newIdentifier New identifier. */ - function createClMapping( + function createResourceMapping( address identity, - bytes16 legacyIssuerIdentifier, + string calldata legacyIssuerIdentifier, string calldata legacyIdentifier, string calldata newIdentifier ) external; @@ -86,27 +96,28 @@ interface LegacyIdentifiersRegistryInterface { /** * @dev Endorse a new mapping of legacy schema/credential definition identifier to new one. * - * Once the mapping is created, this function emits a `ClMappingCreated` event + * Once the mapping is created, this function emits a `ResourceMappingCreated` event * with the legacy identifier and new one. * * This function can revert with following errors: - * - `MappingAlreadyExist`: Raised if DID mapping with provided identifier already exist. - * - `NotIdentityOwner`: Raised when an issuer DID specified in the mapping is not owned by sender + * - `MappingAlreadyExist`: Raised if resource mapping with provided identifier already exist. + * - `NotIdentityOwner`: Raised if identity account is not owner of the legacy Issuer DID + * - `NotIdentityOwner`: Raised if signer account is not owner of the provided identity * - * @param identity Account address of the issuer DID's owner. + * @param identity Account address of the issuer. * @param sigV Part of EcDSA signature. * @param sigR Part of EcDSA signature. * @param sigS Part of EcDSA signature. - * @param legacyIssuerIdentifier legacy issuer identifier. - * @param legacyIdentifier legacy identifier. - * @param newIdentifier new identifier. + * @param legacyIssuerIdentifier Legacy issuer identifier. + * @param legacyIdentifier Legacy identifier. + * @param newIdentifier New identifier. */ - function createClMappingSigned( + function createResourceMappingSigned( address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, - bytes16 legacyIssuerIdentifier, + string calldata legacyIssuerIdentifier, string calldata legacyIdentifier, string calldata newIdentifier ) external; diff --git a/smart_contracts/contracts/network/ValidatorControl.sol b/smart_contracts/contracts/network/ValidatorControl.sol index 6fb71ae4..4baa4896 100644 --- a/smart_contracts/contracts/network/ValidatorControl.sol +++ b/smart_contracts/contracts/network/ValidatorControl.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { Unauthorized } from "../utils/Errors.sol"; +import { Unauthorized } from "../auth/AuthErrors.sol"; +import { InitialValidatorsRequired, InvalidValidatorAddress, InvalidValidatorAccountAddress, ExceedsValidatorLimit, ValidatorAlreadyExists, SenderHasActiveValidator, CannotDeactivateLastValidator, ValidatorNotFound } from "./ValidatorErrors.sol"; import { RoleControlInterface } from "../auth/RoleControl.sol"; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; diff --git a/smart_contracts/contracts/network/ValidatorControlInterface.sol b/smart_contracts/contracts/network/ValidatorControlInterface.sol index 89d54aa3..d6a0fc70 100644 --- a/smart_contracts/contracts/network/ValidatorControlInterface.sol +++ b/smart_contracts/contracts/network/ValidatorControlInterface.sol @@ -22,50 +22,6 @@ interface ValidatorControlInterface { */ event ValidatorRemoved(address indexed validator, address indexed byAccount, uint8 numValidators); - /** - * @dev Error that occurs when initial validators are required but not provided. - */ - error InitialValidatorsRequired(); - - /** - * @dev Error that occurs when an invalid validator address is provided. - */ - error InvalidValidatorAddress(); - - /** - * @dev Error that occurs when an invalid account address is provided. - */ - error InvalidValidatorAccountAddress(); - - /** - * @dev Error that occurs when attempting to add more validators than the allowed limit. - * @param limit The maximum number of validators allowed. - */ - error ExceedsValidatorLimit(uint16 limit); - - /** - * @dev Error that occurs when trying to add a validator that already exists. - * @param validator The address of the validator. - */ - error ValidatorAlreadyExists(address validator); - - /** - * @dev Error that occurs when the sender already has an active validator. - * @param sender The address of the sender. - */ - error SenderHasActiveValidator(address sender); - - /** - * @dev Error that occurs when trying to deactivate the last remaining validator. - */ - error CannotDeactivateLastValidator(); - - /** - * @dev Error that occurs when the specified validator is not found. - * @param validator The address of the validator. - */ - error ValidatorNotFound(address validator); - /** * @dev Adds a new validator to the list. * diff --git a/smart_contracts/contracts/network/ValidatorErrors.sol b/smart_contracts/contracts/network/ValidatorErrors.sol new file mode 100644 index 00000000..9f08328f --- /dev/null +++ b/smart_contracts/contracts/network/ValidatorErrors.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +/** + * @dev Error that occurs when initial validators are required but not provided. + */ +error InitialValidatorsRequired(); + +/** + * @dev Error that occurs when an invalid validator address is provided. + */ +error InvalidValidatorAddress(); + +/** + * @dev Error that occurs when an invalid account address is provided. + */ +error InvalidValidatorAccountAddress(); + +/** + * @dev Error that occurs when attempting to add more validators than the allowed limit. + * @param limit The maximum number of validators allowed. + */ +error ExceedsValidatorLimit(uint16 limit); + +/** + * @dev Error that occurs when trying to add a validator that already exists. + * @param validator The address of the validator. + */ +error ValidatorAlreadyExists(address validator); + +/** + * @dev Error that occurs when the sender already has an active validator. + * @param sender The address of the sender. + */ +error SenderHasActiveValidator(address sender); + +/** + * @dev Error that occurs when trying to deactivate the last remaining validator. + */ +error CannotDeactivateLastValidator(); + +/** + * @dev Error that occurs when the specified validator is not found. + * @param validator The address of the validator. + */ +error ValidatorNotFound(address validator); diff --git a/smart_contracts/contracts/upgrade/UpgradeControl.sol b/smart_contracts/contracts/upgrade/UpgradeControl.sol index 67f4b11c..7585e88e 100644 --- a/smart_contracts/contracts/upgrade/UpgradeControl.sol +++ b/smart_contracts/contracts/upgrade/UpgradeControl.sol @@ -6,7 +6,7 @@ import { ERC1967Utils } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { UUPSUpgradeable } from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; -import { Unauthorized } from "../utils/Errors.sol"; +import { Unauthorized } from "../auth/AuthErrors.sol"; import { RoleControlInterface } from "../auth/RoleControlInterface.sol"; import { UpgradeControlInterface } from "./UpgradeControlInterface.sol"; diff --git a/smart_contracts/contracts/utils/Base58.sol b/smart_contracts/contracts/utils/Base58.sol new file mode 100644 index 00000000..c853da5a --- /dev/null +++ b/smart_contracts/contracts/utils/Base58.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +/* + * This contract is taken from https://github.com/storyicon/base58-solidity.git with following modilfications: + * * deleted encode functionality + * * turning all methods into internal + */ + +/** + * @title Base58 + * @author storyicon@foxmail.com + * @notice This algorithm was migrated from github.com/mr-tron/base58 to solidity. + * Note that it is not yet optimized for gas, so it is recommended to use it only in the view/pure function. + */ +library Base58 { + bytes constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + + /** + * @notice decode is used to decode the given string in base58 standard. + * @param data_ data encoded with base58, passed in as bytes. + * @return raw data, returned as bytes. + */ + function decode(bytes memory data_) internal pure returns (bytes memory) { + unchecked { + uint256 zero = 49; + uint256 b58sz = data_.length; + uint256 zcount = 0; + for (uint256 i = 0; i < b58sz && uint8(data_[i]) == zero; i++) { + zcount++; + } + uint256 t; + uint256 c; + bool f; + bytes memory binu = new bytes(2 * (((b58sz * 8351) / 6115) + 1)); + uint32[] memory outi = new uint32[]((b58sz + 3) / 4); + for (uint256 i = 0; i < data_.length; i++) { + bytes1 r = data_[i]; + (c, f) = indexOf(ALPHABET, r); + require(f, "invalid base58 digit"); + for (int256 k = int256(outi.length) - 1; k >= 0; k--) { + t = uint64(outi[uint256(k)]) * 58 + c; + c = t >> 32; + outi[uint256(k)] = uint32(t & 0xffffffff); + } + } + uint64 mask = uint64(b58sz % 4) * 8; + if (mask == 0) { + mask = 32; + } + mask -= 8; + uint256 outLen = 0; + for (uint256 j = 0; j < outi.length; j++) { + while (mask < 32) { + binu[outLen] = bytes1(uint8(outi[j] >> mask)); + outLen++; + if (mask < 8) { + break; + } + mask -= 8; + } + mask = 24; + } + for (uint256 msb = zcount; msb < binu.length; msb++) { + if (binu[msb] > 0) { + return slice(binu, msb - zcount, outLen); + } + } + return slice(binu, 0, outLen); + } + } + + /** + * @notice decode is used to decode the given string in base58 standard. + * @param data_ data encoded with base58, passed in as string. + * @return raw data, returned as bytes. + */ + function decodeFromString(string memory data_) internal pure returns (bytes memory) { + return decode(bytes(data_)); + } + + /** + * @notice slice is used to slice the given byte, returns the bytes in the range of [start_, end_) + * @param data_ raw data, passed in as bytes. + * @param start_ start index. + * @param end_ end index. + * @return slice data + */ + function slice(bytes memory data_, uint256 start_, uint256 end_) internal pure returns (bytes memory) { + unchecked { + bytes memory ret = new bytes(end_ - start_); + for (uint256 i = 0; i < end_ - start_; i++) { + ret[i] = data_[i + start_]; + } + return ret; + } + } + + /** + * @notice indexOf is used to find where char_ appears in data_. + * @param data_ raw data, passed in as bytes. + * @param char_ target byte. + * @return index, and whether the search was successful. + */ + function indexOf(bytes memory data_, bytes1 char_) internal pure returns (uint256, bool) { + unchecked { + for (uint256 i = 0; i < data_.length; i++) { + if (data_[i] == char_) { + return (i, true); + } + } + return (0, false); + } + } +} diff --git a/smart_contracts/contracts/utils/Errors.sol b/smart_contracts/contracts/utils/Errors.sol index 6fc5fa2b..2fbb5bc7 100644 --- a/smart_contracts/contracts/utils/Errors.sol +++ b/smart_contracts/contracts/utils/Errors.sol @@ -1,66 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -// General - -error Unauthorized(address sender); - -/** - * @notice Error that occurs when performed identity operation by not owned account. - * @param sender Sender account address. - * @param owner Owner account address. - */ -error NotIdentityOwner(address sender, address owner); - -// Schema related errors - -/** - * @notice Error that occurs when trying to create an already existing schema. - * @param id Schema ID. - */ -error SchemaAlreadyExist(bytes32 id); - -/** - * @notice Error that occurs when the specified schema is not found. - * @param id Schema ID. - */ -error SchemaNotFound(bytes32 id); - -// Credential Definition related errors - -/** - * @notice Error that occurs when trying to create an existing credential definition. - * @param id Credential definition ID. - */ -error CredentialDefinitionAlreadyExist(bytes32 id); - -/** - * @notice Error that occurs when the specified credential definition is not found. - * @param id Credential definition ID. - */ -error CredentialDefinitionNotFound(bytes32 id); - -// Legacy identifiers mapping related errors - -/** - * @notice Error that occurs when trying to add a duplicating mapping for a legacy identifier. - * @param identifier Legacy DID identifier. - */ -error DidMappingAlreadyExist(bytes16 identifier); - -/** - * @notice Error that occurs when trying to add a duplicating mapping for a legacy CL entity identifier. - * @param identifier Legacy Schema/CredDef identifier. - */ -error ClMappingAlreadyExist(string identifier); - -/** - * @notice Error that occurs when provided ed25519Key key does not match to the provided legacy DID identifier. - * @param ed25519Key verification key matching to the DID. - * @param identifier KECCAK256 hash of legacy DID identifier. - */ -error InvalidEd25519Key(bytes32 ed25519Key, bytes16 identifier); - /** * @title Errors * @dev A library that provides utility functions for error handling. diff --git a/smart_contracts/package.json b/smart_contracts/package.json index 6e3899e0..fd1da1db 100644 --- a/smart_contracts/package.json +++ b/smart_contracts/package.json @@ -35,6 +35,7 @@ "@nomicfoundation/hardhat-verify": "^1.0.0", "@openzeppelin/contracts": "^5.0.0", "async-promise-pool": "^1.0.6", + "base58-solidity": "^1.0.2", "ethers": "6.8.0", "ethr-did-registry": "^1.2.0", "fs-extra": "^10.0.0", diff --git a/smart_contracts/scripts/genesis/config.ts b/smart_contracts/scripts/genesis/config.ts index ebf363fc..94e602d8 100644 --- a/smart_contracts/scripts/genesis/config.ts +++ b/smart_contracts/scripts/genesis/config.ts @@ -2,7 +2,7 @@ import { AccountControlConfig, CredentialDefinitionsConfig, EthereumDidRegistryConfig, - LegacyIdentifiersRegistryConfig, + LegacyMappingRegistryConfig, RolesConfig, SchemasConfig, ValidatorsConfig, @@ -21,7 +21,7 @@ export interface Config { schemaRegistry: SchemasConfig upgradeControl: UpgradeControlConfig validatorControl: ValidatorsConfig - legacyIdentifiers: LegacyIdentifiersRegistryConfig + legacyMapping: LegacyMappingRegistryConfig } const contractsAddresses = { @@ -32,7 +32,7 @@ const contractsAddresses = { validators: '0x0000000000000000000000000000000000007777', accountControl: '0x0000000000000000000000000000000000008888', upgradeControl: '0x0000000000000000000000000000000000009999', - legacyIdentifiersRegistry: '0x0000000000000000000000000000000000019999', + legacyMappingRegistry: '0x0000000000000000000000000000000000019999', } export const config: Config = { @@ -141,9 +141,9 @@ export const config: Config = { upgradeControlAddress: contractsAddresses.upgradeControl, }, }, - legacyIdentifiers: { - name: 'LegacyIdentifiersRegistry', - address: contractsAddresses.legacyIdentifiersRegistry, + legacyMapping: { + name: 'LegacyMappingRegistry', + address: contractsAddresses.legacyMappingRegistry, description: 'Smart contract to store mapping of legacy identifiers to new one', data: { ethereumDidRegistry: contractsAddresses.ethereumDidRegistry, diff --git a/smart_contracts/scripts/genesis/contracts/index.ts b/smart_contracts/scripts/genesis/contracts/index.ts index e9936ac3..0814e0e9 100644 --- a/smart_contracts/scripts/genesis/contracts/index.ts +++ b/smart_contracts/scripts/genesis/contracts/index.ts @@ -5,4 +5,4 @@ export * from './roleControl' export * from './schemaRegistry' export * from './upgradeControl' export * from './validatorControl' -export * from './legacyIdentifiersRegistry' +export * from './legacyMappingRegistry' diff --git a/smart_contracts/scripts/genesis/contracts/legacyIdentifiersRegistry.ts b/smart_contracts/scripts/genesis/contracts/legacyMappingRegistry.ts similarity index 75% rename from smart_contracts/scripts/genesis/contracts/legacyIdentifiersRegistry.ts rename to smart_contracts/scripts/genesis/contracts/legacyMappingRegistry.ts index 22e6a13b..e0b72a78 100644 --- a/smart_contracts/scripts/genesis/contracts/legacyIdentifiersRegistry.ts +++ b/smart_contracts/scripts/genesis/contracts/legacyMappingRegistry.ts @@ -3,15 +3,15 @@ import { config } from '../config' import { ContractConfig } from '../contractConfig' import { buildProxySection, slots } from '../helpers' -export interface LegacyIdentifiersRegistryConfig extends ContractConfig { +export interface LegacyMappingRegistryConfig extends ContractConfig { data: { ethereumDidRegistry: string upgradeControlAddress: string } } -export function legacyIdentifiersRegistry() { - const { name, address, description, data } = config.legacyIdentifiers +export function legacyMappingRegistry() { + const { name, address, description, data } = config.legacyMapping const storage: any = {} // address of upgrade control contact stored in slot 0 diff --git a/smart_contracts/scripts/genesis/generate.ts b/smart_contracts/scripts/genesis/generate.ts index 9c8f9401..990664dd 100644 --- a/smart_contracts/scripts/genesis/generate.ts +++ b/smart_contracts/scripts/genesis/generate.ts @@ -4,7 +4,7 @@ import { accountControl, credentialDefinitionRegistry, ethereumDidRegistry, - legacyIdentifiersRegistry, + legacyMappingRegistry, roleControl, schemaRegistry, upgradeControl, @@ -20,7 +20,7 @@ function main() { ...ethereumDidRegistry(), ...schemaRegistry(), ...credentialDefinitionRegistry(), - ...legacyIdentifiersRegistry(), + ...legacyMappingRegistry(), } writeJson(contracts, outFile) } diff --git a/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts b/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts index 7faeb5b8..7b964967 100644 --- a/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts +++ b/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts @@ -13,7 +13,7 @@ import { testActorAddress, testActorPrivateKey, } from '../utils/contract-helpers' -import { ClErrors } from '../utils/errors' +import { ClErrors, DidErrors } from '../utils/errors' import { TestAccounts } from '../utils/test-entities' describe('CredentialDefinitionRegistry', function () { @@ -100,7 +100,7 @@ describe('CredentialDefinitionRegistry', function () { credDef, ), ) - .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, DidErrors.NotIdentityOwner) .withArgs(testAccounts.trustee2.account.address, testAccounts.trustee.account.address) }) }) @@ -152,7 +152,7 @@ describe('CredentialDefinitionRegistry', function () { signature, ), ) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + .to.be.revertedWithCustomError(schemaRegistry.baseInstance, DidErrors.NotIdentityOwner) .withArgs(testAccounts.trustee2.account.address, testActorAddress) }) @@ -176,7 +176,7 @@ describe('CredentialDefinitionRegistry', function () { credDef, signature, ), - ).to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + ).to.be.revertedWithCustomError(schemaRegistry.baseInstance, DidErrors.NotIdentityOwner) }) }) }) diff --git a/smart_contracts/test/cl/SchemaRegistry.spec.ts b/smart_contracts/test/cl/SchemaRegistry.spec.ts index 9a11f2a7..a52e15c8 100644 --- a/smart_contracts/test/cl/SchemaRegistry.spec.ts +++ b/smart_contracts/test/cl/SchemaRegistry.spec.ts @@ -10,7 +10,7 @@ import { testActorAddress, testActorPrivateKey, } from '../utils/contract-helpers' -import { ClErrors } from '../utils/errors' +import { ClErrors, DidErrors } from '../utils/errors' import { TestAccounts } from '../utils/test-entities' describe('SchemaRegistry', function () { @@ -69,7 +69,7 @@ describe('SchemaRegistry', function () { const { id, schema } = createSchemaObject({ issuer }) await expect(schemaRegistry.createSchema(testAccounts.trustee2.account.address, id, schema)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + .to.be.revertedWithCustomError(schemaRegistry.baseInstance, DidErrors.NotIdentityOwner) .withArgs(testAccounts.trustee2.account.address, testAccounts.trustee.account.address) }) }) @@ -96,7 +96,7 @@ describe('SchemaRegistry', function () { schema, ) await expect(schemaRegistry.createSchemaSigned(testAccounts.trustee2.account.address, id, schema, sig)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + .to.be.revertedWithCustomError(schemaRegistry.baseInstance, DidErrors.NotIdentityOwner) .withArgs(testAccounts.trustee2.account.address, testActorAddress) }) @@ -112,7 +112,7 @@ describe('SchemaRegistry', function () { ) await expect(schemaRegistry.createSchemaSigned(testActorAddress, id, schema, sig)).to.be.revertedWithCustomError( schemaRegistry.baseInstance, - ClErrors.UnauthorizedIssuer, + DidErrors.NotIdentityOwner, ) }) }) diff --git a/smart_contracts/test/migration/LegacyIdentifiersRegistry.spec.ts b/smart_contracts/test/migration/LegacyIdentifiersRegistry.spec.ts deleted file mode 100644 index ce43140b..00000000 --- a/smart_contracts/test/migration/LegacyIdentifiersRegistry.spec.ts +++ /dev/null @@ -1,292 +0,0 @@ -import { expect } from 'chai' -import { EthereumExtDidRegistry, LegacyIdentifiersRegistry } from '../../contracts-ts' -import { - createDid, - deployLegacyIdentifiersRegistry, - signClMappingEndorsementData, - signDidMappingEndorsementData, - TestableLegacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, -} from '../utils/contract-helpers' -import { MigrationErrors } from '../utils/errors' -import { TestAccounts } from '../utils/test-entities' - -describe('LegacyIdentifiersRegistry', function () { - let didRegistry: EthereumExtDidRegistry - let legacyIdentifiersRegistry: TestableLegacyIdentifiersRegistry - let testAccounts: TestAccounts - let issuer: string - - const legacyDid = '2vZAi1riCVGnQMfQAjbThG' - const legacyVerkey = Uint8Array.from([ - 15, 147, 97, 223, 64, 179, 188, 70, 162, 110, 219, 163, 185, 25, 180, 23, 224, 175, 15, 188, 235, 170, 233, 240, - 145, 111, 204, 153, 108, 117, 188, 145, - ]) - const legacySignature = Uint8Array.from([]) - const legacySchemaId = '2vZAi1riCVGnQMfQAjbThG:2:test_credential:1.0.0' - const schemaId = 'did:ethr:0xcb799c9bca0d1ce7385726ccbd40b9fc4313e5b1/anoncreds/v0/SCHEMA/test_credential/1.0.0' - - beforeEach(async function () { - const { - didRegistry: didRegistryInit, - legacyIdentifiersRegistry: legacyIdentifiersRegistryInit, - testAccounts: testAccountsInit, - } = await deployLegacyIdentifiersRegistry() - - issuer = testAccountsInit.trustee.account.address - legacyIdentifiersRegistryInit.connect(testAccountsInit.trustee.account) - - const issuerId = `did:ethr:${issuer}` - await createDid(didRegistryInit, testAccountsInit.trustee.account.address, issuerId) - - legacyIdentifiersRegistry = legacyIdentifiersRegistryInit - didRegistry = didRegistryInit - testAccounts = testAccountsInit - }) - - describe('Add/Resolve DID mapping', function () { - it('Should create DID mapping', async function () { - await legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) - - const address = await legacyIdentifiersRegistry.resolveNewDid(legacyDid) - expect(address).to.be.equal(issuer) - }) - - it('Should fail if mapping is being created already exists', async function () { - await legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) - - await expect( - legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.DidMappingAlreadyExist) - }) - - it('Should fail if mapping is being created with not matching ed25518 key', async function () { - const ed25519Key = Uint8Array.from([ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 180, 23, 224, 175, 15, 188, 235, 170, 233, 240, 145, 111, 204, 153, - 108, 117, 188, 145, - ]) - - await expect( - legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, ed25519Key, legacySignature), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.InvalidEd25519Key) - }) - - it('Should fail if mapping is being created with not owned account', async function () { - legacyIdentifiersRegistry.connect(testAccounts.trustee2.account) - - await expect( - legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - }) - - describe('Endorse/Resolve DID mapping', function () { - it('Should endorse DID mapping', async function () { - const sig = await signDidMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - legacyDid, - legacyVerkey, - legacySignature, - ) - await legacyIdentifiersRegistry.createDidMappingSigned( - testActorAddress, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ) - - const address = await legacyIdentifiersRegistry.resolveNewDid(legacyDid) - expect(address).to.be.not.equal(issuer) - }) - - it('Should fail if endorsing duplicate mapping', async function () { - // private key does not match to address - const sig = await signDidMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - legacyDid, - legacyVerkey, - legacySignature, - ) - - await legacyIdentifiersRegistry.createDidMappingSigned( - testActorAddress, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ) - - await expect( - legacyIdentifiersRegistry.createDidMappingSigned( - testActorAddress, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.DidMappingAlreadyExist) - }) - - it('Should fail if endorsing with not owned DID', async function () { - // private key does not match to address - const sig = await signDidMappingEndorsementData( - legacyIdentifiersRegistry, - testAccounts.trustee2.account.address, - testActorPrivateKey, - legacyDid, - legacyVerkey, - legacySignature, - ) - - await expect( - legacyIdentifiersRegistry.createDidMappingSigned( - testAccounts.trustee2.account.address, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - - it('Should fail if endorsing invalid signature', async function () { - const sig = await signDidMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - '356FbajrLCJxbQbn8GSb3B', - legacyVerkey, - legacySignature, - ) - - await expect( - legacyIdentifiersRegistry.createDidMappingSigned( - testActorAddress, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - }) - - describe('Add/Resolve CL mapping', function () { - beforeEach(async function () { - await legacyIdentifiersRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) - }) - - it('Should create CL mapping', async function () { - await legacyIdentifiersRegistry.createClMapping(issuer, legacyDid, legacySchemaId, schemaId) - - const resolvedSchemaId = await legacyIdentifiersRegistry.resolveNewId(legacySchemaId) - expect(resolvedSchemaId).to.be.equal(schemaId) - }) - - it('Should fail if mapping is being created already exists', async function () { - await legacyIdentifiersRegistry.createClMapping(issuer, legacyDid, legacySchemaId, schemaId) - - await expect(legacyIdentifiersRegistry.createClMapping(issuer, legacyDid, legacySchemaId, schemaId)) - .to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.ClMappingAlreadyExist) - .withArgs(legacySchemaId) - }) - - it('Should fail if mapping is being created with not existing DID mapping', async function () { - await expect( - legacyIdentifiersRegistry.createClMapping(issuer, '356FbajrLCJxbQbn8GSb3B', legacySchemaId, schemaId), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - - it('Should fail if mapping is being created with not owned DID mapping', async function () { - await expect( - legacyIdentifiersRegistry.createClMapping( - testAccounts.trustee2.account.address, - legacyDid, - legacySchemaId, - schemaId, - ), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - }) - - describe('Endorse/Resolve CL mapping', function () { - beforeEach(async function () { - const sig = await signDidMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - legacyDid, - legacyVerkey, - legacySignature, - ) - await legacyIdentifiersRegistry.createDidMappingSigned( - testActorAddress, - legacyDid, - legacyVerkey, - legacySignature, - sig, - ) - }) - - it('Should endorse CL mapping', async function () { - const sig = await signClMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - legacyDid, - legacySchemaId, - schemaId, - ) - await legacyIdentifiersRegistry.createClMappingSigned(testActorAddress, legacyDid, legacySchemaId, schemaId, sig) - - const identifier = await legacyIdentifiersRegistry.resolveNewId(legacySchemaId) - expect(identifier).to.be.equal(schemaId) - }) - - it('Should fail if endorsing duplicate mapping', async function () { - // private key does not match to address - const sig = await signClMappingEndorsementData( - legacyIdentifiersRegistry, - testActorAddress, - testActorPrivateKey, - legacyDid, - legacySchemaId, - schemaId, - ) - - await legacyIdentifiersRegistry.createClMappingSigned(testActorAddress, legacyDid, legacySchemaId, schemaId, sig) - - await expect( - legacyIdentifiersRegistry.createClMappingSigned(testActorAddress, legacyDid, legacySchemaId, schemaId, sig), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.ClMappingAlreadyExist) - }) - - it('Should fail if endorsing with not owned DID', async function () { - // private key does not match to address - const sig = await signClMappingEndorsementData( - legacyIdentifiersRegistry, - testAccounts.trustee2.account.address, - testActorPrivateKey, - legacyDid, - legacySchemaId, - schemaId, - ) - - await expect( - legacyIdentifiersRegistry.createClMappingSigned( - testAccounts.trustee2.account.address, - legacyDid, - legacySchemaId, - schemaId, - sig, - ), - ).to.be.revertedWithCustomError(legacyIdentifiersRegistry.baseInstance, MigrationErrors.UnauthorizedSender) - }) - }) -}) diff --git a/smart_contracts/test/migration/LegacyMappingRegistry.spec.ts b/smart_contracts/test/migration/LegacyMappingRegistry.spec.ts new file mode 100644 index 00000000..a3d45af6 --- /dev/null +++ b/smart_contracts/test/migration/LegacyMappingRegistry.spec.ts @@ -0,0 +1,292 @@ +import { expect } from 'chai' +import { EthereumExtDidRegistry, LegacyMappingRegistry } from '../../contracts-ts' +import { + createDid, + deployLegacyMappingRegistry, + signDidMappingEndorsementData, + signResourceMappingEndorsementData, + TestableLegacyMappingRegistry, + testActorAddress, + testActorPrivateKey, +} from '../utils/contract-helpers' +import { DidErrors, MigrationErrors } from '../utils/errors' +import { TestAccounts } from '../utils/test-entities' + +describe('LegacyMappingRegistry', function () { + let didRegistry: EthereumExtDidRegistry + let legacyMappingRegistry: TestableLegacyMappingRegistry + let testAccounts: TestAccounts + let issuer: string + + const legacyDid = '2vZAi1riCVGnQMfQAjbThG' + const legacyVerkey = Uint8Array.from([ + 15, 147, 97, 223, 64, 179, 188, 70, 162, 110, 219, 163, 185, 25, 180, 23, 224, 175, 15, 188, 235, 170, 233, 240, + 145, 111, 204, 153, 108, 117, 188, 145, + ]) + const legacySignature = Uint8Array.from([]) + const legacySchemaId = '2vZAi1riCVGnQMfQAjbThG:2:test_credential:1.0.0' + const schemaId = 'did:ethr:0xcb799c9bca0d1ce7385726ccbd40b9fc4313e5b1/anoncreds/v0/SCHEMA/test_credential/1.0.0' + + beforeEach(async function () { + const { + didRegistry: didRegistryInit, + legacyMappingRegistry: legacyMappingRegistryInit, + testAccounts: testAccountsInit, + } = await deployLegacyMappingRegistry() + + issuer = testAccountsInit.trustee.account.address + legacyMappingRegistryInit.connect(testAccountsInit.trustee.account) + + const issuerId = `did:ethr:${issuer}` + await createDid(didRegistryInit, testAccountsInit.trustee.account.address, issuerId) + + legacyMappingRegistry = legacyMappingRegistryInit + didRegistry = didRegistryInit + testAccounts = testAccountsInit + }) + + describe('Add/Resolve DID mapping', function () { + it('Should create DID mapping', async function () { + await legacyMappingRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) + + const address = await legacyMappingRegistry.didMapping(legacyDid) + expect(address).to.be.equal(issuer) + }) + + it('Should fail if DID mapping is being created already exists', async function () { + await legacyMappingRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) + + await expect( + legacyMappingRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, MigrationErrors.DidMappingAlreadyExist) + }) + + it('Should fail if DID mapping is being created with not matching ed25518 key', async function () { + const ed25519Key = Uint8Array.from([ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 180, 23, 224, 175, 15, 188, 235, 170, 233, 240, 145, 111, 204, 153, + 108, 117, 188, 145, + ]) + + await expect( + legacyMappingRegistry.createDidMapping(issuer, legacyDid, ed25519Key, legacySignature), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, MigrationErrors.InvalidEd25519Key) + }) + + it('Should fail if DID mapping is being created with not owned account', async function () { + legacyMappingRegistry.connect(testAccounts.trustee2.account) + + await expect( + legacyMappingRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + }) + + describe('Endorse/Resolve DID mapping', function () { + it('Should endorse DID mapping', async function () { + const sig = await signDidMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + legacyDid, + legacyVerkey, + legacySignature, + ) + await legacyMappingRegistry.createDidMappingSigned( + testActorAddress, + legacyDid, + legacyVerkey, + legacySignature, + sig, + ) + + const address = await legacyMappingRegistry.didMapping(legacyDid) + expect(address).to.be.not.equal(issuer) + }) + + it('Should fail if endorsing duplicate DID mapping', async function () { + // private key does not match to address + const sig = await signDidMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + legacyDid, + legacyVerkey, + legacySignature, + ) + + await legacyMappingRegistry.createDidMappingSigned( + testActorAddress, + legacyDid, + legacyVerkey, + legacySignature, + sig, + ) + + await expect( + legacyMappingRegistry.createDidMappingSigned(testActorAddress, legacyDid, legacyVerkey, legacySignature, sig), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, MigrationErrors.DidMappingAlreadyExist) + }) + + it('Should fail if endorsing with not owned DID', async function () { + // private key does not match to address + const sig = await signDidMappingEndorsementData( + legacyMappingRegistry, + testAccounts.trustee2.account.address, + testActorPrivateKey, + legacyDid, + legacyVerkey, + legacySignature, + ) + + await expect( + legacyMappingRegistry.createDidMappingSigned( + testAccounts.trustee2.account.address, + legacyDid, + legacyVerkey, + legacySignature, + sig, + ), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + + it('Should fail if endorsing invalid signature', async function () { + const sig = await signDidMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + '356FbajrLCJxbQbn8GSb3B', + legacyVerkey, + legacySignature, + ) + + await expect( + legacyMappingRegistry.createDidMappingSigned(testActorAddress, legacyDid, legacyVerkey, legacySignature, sig), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + }) + + describe('Add/Resolve Resource mapping', function () { + beforeEach(async function () { + await legacyMappingRegistry.createDidMapping(issuer, legacyDid, legacyVerkey, legacySignature) + }) + + it('Should create Resource mapping', async function () { + await legacyMappingRegistry.createResourceMapping(issuer, legacyDid, legacySchemaId, schemaId) + + const resolvedSchemaId = await legacyMappingRegistry.resourceMapping(legacySchemaId) + expect(resolvedSchemaId).to.be.equal(schemaId) + }) + + it('Should fail if mapping is being created already exists', async function () { + await legacyMappingRegistry.createResourceMapping(issuer, legacyDid, legacySchemaId, schemaId) + + await expect(legacyMappingRegistry.createResourceMapping(issuer, legacyDid, legacySchemaId, schemaId)) + .to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, MigrationErrors.ResourceMappingAlreadyExist) + .withArgs(legacySchemaId) + }) + + it('Should fail if mapping is being created with not existing DID mapping', async function () { + await expect( + legacyMappingRegistry.createResourceMapping(issuer, '356FbajrLCJxbQbn8GSb3B', legacySchemaId, schemaId), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + + it('Should fail if mapping is being created with not owned DID mapping', async function () { + await expect( + legacyMappingRegistry.createResourceMapping( + testAccounts.trustee2.account.address, + legacyDid, + legacySchemaId, + schemaId, + ), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + }) + + describe('Endorse/Resolve Resource mapping', function () { + beforeEach(async function () { + const sig = await signDidMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + legacyDid, + legacyVerkey, + legacySignature, + ) + await legacyMappingRegistry.createDidMappingSigned( + testActorAddress, + legacyDid, + legacyVerkey, + legacySignature, + sig, + ) + }) + + it('Should endorse Resource mapping', async function () { + const sig = await signResourceMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + legacyDid, + legacySchemaId, + schemaId, + ) + await legacyMappingRegistry.createResourceMappingSigned( + testActorAddress, + legacyDid, + legacySchemaId, + schemaId, + sig, + ) + + const identifier = await legacyMappingRegistry.resourceMapping(legacySchemaId) + expect(identifier).to.be.equal(schemaId) + }) + + it('Should fail if endorsing duplicate mapping', async function () { + // private key does not match to address + const sig = await signResourceMappingEndorsementData( + legacyMappingRegistry, + testActorAddress, + testActorPrivateKey, + legacyDid, + legacySchemaId, + schemaId, + ) + + await legacyMappingRegistry.createResourceMappingSigned( + testActorAddress, + legacyDid, + legacySchemaId, + schemaId, + sig, + ) + + await expect( + legacyMappingRegistry.createResourceMappingSigned(testActorAddress, legacyDid, legacySchemaId, schemaId, sig), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, MigrationErrors.ResourceMappingAlreadyExist) + }) + + it('Should fail if endorsing with not owned DID', async function () { + // private key does not match to address + const sig = await signResourceMappingEndorsementData( + legacyMappingRegistry, + testAccounts.trustee2.account.address, + testActorPrivateKey, + legacyDid, + legacySchemaId, + schemaId, + ) + + await expect( + legacyMappingRegistry.createResourceMappingSigned( + testAccounts.trustee2.account.address, + legacyDid, + legacySchemaId, + schemaId, + sig, + ), + ).to.be.revertedWithCustomError(legacyMappingRegistry.baseInstance, DidErrors.NotIdentityOwner) + }) + }) +}) diff --git a/smart_contracts/test/utils/contract-helpers.ts b/smart_contracts/test/utils/contract-helpers.ts index 0efaf1b4..64006268 100644 --- a/smart_contracts/test/utils/contract-helpers.ts +++ b/smart_contracts/test/utils/contract-helpers.ts @@ -8,7 +8,7 @@ import { UpgradeControl, ValidatorControl, } from '../../contracts-ts' -import { LegacyIdentifiersRegistry } from '../../contracts-ts/LegacyIdentifiersRegistry' +import { LegacyMappingRegistry } from '../../contracts-ts/LegacyMappingRegistry' import { Contract, createSchemaObject } from '../../utils' import { getTestAccounts, ZERO_ADDRESS } from './test-entities' @@ -33,7 +33,7 @@ export class TestableValidatorControl extends testableContractMixin(ValidatorCon export class TestableUpgradeControl extends testableContractMixin(UpgradeControl) {} -export class TestableLegacyIdentifiersRegistry extends testableContractMixin(LegacyIdentifiersRegistry) {} +export class TestableLegacyMappingRegistry extends testableContractMixin(LegacyMappingRegistry) {} function testableContractMixin Contract>(Base: T) { return class extends Base { @@ -78,13 +78,13 @@ export async function deployCredentialDefinitionRegistry() { return { credentialDefinitionRegistry, didRegistry, schemaRegistry, testAccounts } } -export async function deployLegacyIdentifiersRegistry() { +export async function deployLegacyMappingRegistry() { const { didRegistry, testAccounts } = await deployDidRegistry() - const legacyIdentifiersRegistry = await new TestableLegacyIdentifiersRegistry().deployProxy({ + const legacyMappingRegistry = await new TestableLegacyMappingRegistry().deployProxy({ params: [ZERO_ADDRESS, didRegistry.address], }) - return { didRegistry, legacyIdentifiersRegistry, testAccounts } + return { didRegistry, legacyMappingRegistry, testAccounts } } export async function createDid(didRegistry: EthereumExtDidRegistry, identity: string, did: string) { @@ -146,7 +146,7 @@ export async function signCredDefEndorsementData( } export async function signDidMappingEndorsementData( - legacyIdentifiersRegistry: LegacyIdentifiersRegistry, + legacyMappingRegistry: LegacyMappingRegistry, identity: string, privateKey: Uint8Array, identifier: string, @@ -155,13 +155,13 @@ export async function signDidMappingEndorsementData( ) { return signEndorsementData( privateKey, - legacyIdentifiersRegistry.address!, - concat([identity, toUtf8Bytes('createDidMapping'), bs58.decode(identifier), ed25519Key, ed25519Signature]), + legacyMappingRegistry.address!, + concat([identity, toUtf8Bytes('createDidMapping'), toUtf8Bytes(identifier), ed25519Key, ed25519Signature]), ) } -export async function signClMappingEndorsementData( - legacyIdentifiersRegistry: LegacyIdentifiersRegistry, +export async function signResourceMappingEndorsementData( + legacyMappingRegistry: LegacyMappingRegistry, identity: string, privateKey: Uint8Array, legacyIssuerIdentifier: string, @@ -170,11 +170,11 @@ export async function signClMappingEndorsementData( ) { return signEndorsementData( privateKey, - legacyIdentifiersRegistry.address!, + legacyMappingRegistry.address!, concat([ identity, - toUtf8Bytes('createClMapping'), - bs58.decode(legacyIssuerIdentifier), + toUtf8Bytes('createResourceMapping'), + toUtf8Bytes(legacyIssuerIdentifier), toUtf8Bytes(legacyIdentifier), toUtf8Bytes(newIdentifier), ]), diff --git a/smart_contracts/test/utils/errors.ts b/smart_contracts/test/utils/errors.ts index 0323b413..2903df83 100644 --- a/smart_contracts/test/utils/errors.ts +++ b/smart_contracts/test/utils/errors.ts @@ -7,9 +7,11 @@ export namespace AuthErrors { export const Unauthorized = 'Unauthorized' } -export namespace ClErrors { - export const UnauthorizedIssuer = 'UnauthorizedIssuer' +export namespace DidErrors { + export const NotIdentityOwner = 'NotIdentityOwner' +} +export namespace ClErrors { // Schema errors export const SchemaAlreadyExist = 'SchemaAlreadyExist' export const SchemaNotFound = 'SchemaNotFound' @@ -42,7 +44,6 @@ export namespace ValidatorControlErrors { export namespace MigrationErrors { export const DidMappingAlreadyExist = 'DidMappingAlreadyExist' - export const ClMappingAlreadyExist = 'ClMappingAlreadyExist' - export const UnauthorizedSender = 'UnauthorizedSender' + export const ResourceMappingAlreadyExist = 'ResourceMappingAlreadyExist' export const InvalidEd25519Key = 'InvalidEd25519Key' } diff --git a/smart_contracts/yarn.lock b/smart_contracts/yarn.lock index e2c909dc..5e16d95a 100644 --- a/smart_contracts/yarn.lock +++ b/smart_contracts/yarn.lock @@ -1408,6 +1408,13 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg== +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -1656,6 +1663,14 @@ base-x@^4.0.0: resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a" integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== +base58-solidity@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/base58-solidity/-/base58-solidity-1.0.2.tgz#b9ee001bf4e21970abb958242117ac4293faafc8" + integrity sha512-0rT2+pkNm6n5eSY+y1RimIvPF1rVAhl2rIrtG0+o8rHPk6LEVK/ZNclcwSjcaS7tc1vr7vo7hjI+sKLEvn3OKw== + dependencies: + chai "^4.3.6" + hardhat "^2.9.3" + base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -1749,6 +1764,20 @@ body-parser@^1.16.0: type-is "~1.6.18" unpipe "1.0.0" +boxen@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1919,7 +1948,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^6.0.0: +camelcase@^6.0.0, camelcase@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -1973,6 +2002,19 @@ chai@^4.3.0: pathval "^1.1.1" type-detect "^4.0.5" +chai@^4.3.6: + version "4.4.1" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" + integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.0.8" + chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -2000,6 +2042,13 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" + chokidar@3.5.3, chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -2065,6 +2114,11 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + cli-table3@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" @@ -2376,7 +2430,7 @@ decompress-response@^6.0.0: dependencies: mimic-response "^3.1.0" -deep-eql@^4.0.1, deep-eql@^4.1.2: +deep-eql@^4.0.1, deep-eql@^4.1.2, deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== @@ -3238,7 +3292,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: +get-func-name@^2.0.0, get-func-name@^2.0.1, get-func-name@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== @@ -3551,6 +3605,61 @@ hardhat@^2.19.4: uuid "^8.3.2" ws "^7.4.6" +hardhat@^2.9.3: + version "2.19.5" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.5.tgz#6017c35ae2844b669e9bcc84c3d05346d4ef031c" + integrity sha512-vx8R7zWCYVgM56vA6o0Wqx2bIIptkN4TMs9QwDqZVNGRhMzBfzqUeEYbp+69gxWp1neg2V2nYQUaaUv7aom1kw== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@nomicfoundation/ethereumjs-vm" "7.0.2" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + boxen "^5.1.2" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -4245,6 +4354,13 @@ loupe@^2.3.1: dependencies: get-func-name "^2.0.0" +loupe@^2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== + dependencies: + get-func-name "^2.0.1" + lowercase-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" @@ -5644,7 +5760,7 @@ string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -6002,11 +6118,16 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" @@ -6543,6 +6664,13 @@ which@^1.1.1, which@^1.3.1: dependencies: isexe "^2.0.0" +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" diff --git a/vdr/Cargo.lock b/vdr/Cargo.lock index 50fb851b..60b3c203 100644 --- a/vdr/Cargo.lock +++ b/vdr/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "arrayvec" @@ -95,36 +95,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.5.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1da3ae8dabd9c00f453a329dfe1fb28da3c0a72e2478cdcd93171740c20499" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite", + "futures-lite 2.2.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.1.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.1", + "async-lock 3.3.0", "blocking", - "futures-lite", + "futures-lite 2.2.0", "once_cell", "tokio", ] @@ -135,27 +148,57 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", + "polling 2.8.0", "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.4.0", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -165,15 +208,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -187,19 +230,19 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -210,14 +253,13 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -273,9 +315,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -309,16 +351,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c4ef1f913d78636d78d538eec1f18de81e481f44b1be0a81060090530846e1" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.1", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite", + "futures-lite 2.2.0", "piper", "tracing", ] @@ -346,9 +388,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -376,9 +418,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -390,18 +432,18 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] [[package]] name = "const-hex" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" dependencies = [ "cfg-if", "cpufeatures", @@ -449,21 +491,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -495,9 +534,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", @@ -518,7 +557,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -632,9 +671,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", @@ -645,12 +684,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - [[package]] name = "elliptic-curve" version = "0.13.8" @@ -681,9 +714,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -776,9 +809,9 @@ dependencies = [ [[package]] name = "ethers-core" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737" +checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" dependencies = [ "arrayvec", "bytes", @@ -807,6 +840,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -894,9 +948,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -909,9 +963,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -919,15 +973,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -936,9 +990,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -955,40 +1009,57 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +dependencies = [ + "gloo-timers", + "send_wrapper", +] [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1015,20 +1086,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glass_pumpkin" @@ -1103,9 +1176,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "headers" @@ -1139,9 +1212,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -1237,9 +1310,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1324,9 +1397,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -1355,43 +1428,35 @@ dependencies = [ "mockall", "once_cell", "rand", - "secp256k1 0.28.0", + "secp256k1 0.28.2", "serde", "serde_derive", "serde_json", "sha3", "thiserror", + "web-sys", "web3", ] [[package]] name = "indy-data-types" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc9972c657fd152d394f61b00d677aa8a700abd8c39137164e399a1d9fd0c6d" +checksum = "d3c213857cd6ff5ad634276bcbdcc5e911b32dcbd7127357776468016fef852c" dependencies = [ "anoncreds-clsignatures", + "bs58", + "curve25519-dalek", + "ed25519-dalek", "hex", - "indy-utils", "once_cell", + "rand", "regex", "serde", "serde_json", "sha2", - "zeroize", -] - -[[package]] -name = "indy-utils" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d7e0cdcece8d97982e82aba5b0cb8c7e87ffb5f4fa48b935a3647d24db5439" -dependencies = [ - "bs58", - "once_cell", - "regex", - "serde", "thiserror", + "x25519-dalek", "zeroize", ] @@ -1423,35 +1488,26 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", - "rustix 0.38.30", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", + "rustix 0.38.31", + "windows-sys 0.52.0", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1473,9 +1529,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -1486,9 +1542,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -1510,9 +1566,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -1565,9 +1621,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1577,9 +1633,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -1619,7 +1675,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -1697,26 +1753,26 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1751,11 +1807,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.62" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -1772,7 +1828,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -1783,9 +1839,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.98" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1795,9 +1851,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -1809,11 +1865,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -1821,9 +1877,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1856,22 +1912,22 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -1935,6 +1991,20 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1943,12 +2013,11 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", - "itertools", "predicates-core", ] @@ -1970,9 +2039,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -1989,38 +2058,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-crate" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", + "toml_edit 0.20.7", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit 0.21.1", ] [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2031,21 +2094,21 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax", "unarray", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2106,33 +2169,27 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.5", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -2141,9 +2198,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64 0.21.7", "bytes", @@ -2163,9 +2220,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -2246,17 +2305,26 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -2265,9 +2333,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scale-info" @@ -2288,7 +2356,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2334,12 +2402,12 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.0" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "rand", - "secp256k1-sys 0.9.0", + "secp256k1-sys 0.9.2", ] [[package]] @@ -2353,9 +2421,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] @@ -2389,31 +2457,48 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + [[package]] name = "serde" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2507,15 +2592,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2587,7 +2672,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2609,15 +2694,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -2647,22 +2738,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall", - "rustix 0.38.30", + "rustix 0.38.31", "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -2675,22 +2765,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2719,9 +2809,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2744,7 +2834,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2785,9 +2875,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -2800,6 +2890,28 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -2808,20 +2920,19 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2905,9 +3016,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" [[package]] name = "vcpkg" @@ -2944,9 +3055,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2954,24 +3065,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -2981,9 +3092,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2991,28 +3102,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -3032,18 +3143,22 @@ dependencies = [ "ethereum-types", "futures", "futures-timer", + "getrandom", "headers", "hex", "idna 0.4.0", + "js-sys", "jsonrpc-core", "log", "once_cell", "parking_lot", "pin-project", + "rand", "reqwest", "rlp", "secp256k1 0.27.0", "serde", + "serde-wasm-bindgen", "serde_json", "soketto", "tiny-keccak", @@ -3051,6 +3166,8 @@ dependencies = [ "tokio-stream", "tokio-util", "url", + "wasm-bindgen", + "wasm-bindgen-futures", "web3-async-native-tls", ] @@ -3240,9 +3357,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -3266,6 +3383,17 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core", + "zeroize", +] + [[package]] name = "zeroize" version = "1.7.0" @@ -3283,5 +3411,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] diff --git a/vdr/Cargo.toml b/vdr/Cargo.toml index 95ced6d8..34c30f74 100644 --- a/vdr/Cargo.toml +++ b/vdr/Cargo.toml @@ -14,7 +14,7 @@ crate-type = ["rlib", "cdylib"] [features] default = ["web3"] -wasm = [] +wasm = ["web-sys", "web3-wasm"] ledger_test = ["basic_signer"] basic_signer = ["secp256k1", "rand"] migration = [] @@ -43,9 +43,8 @@ serde_derive = "1.0.188" serde_json = "1.0.107" thiserror = "1.0.49" web3 = { version = "0.19.0", optional = true } -#web-sys = { version = "0.3.64", optional = true, features = ["Window"] } -#web3-wasm = { package = "web3", version = "0.19.0", default-features = false, features = ["wasm", "http", "http-tls"], optional = true } -indy-data-types = "0.6.1" +web-sys = { version = "0.3.64", optional = true, features = ["Window"] } +web3-wasm = { package = "web3", version = "0.19.0", default-features = false, features = ["wasm", "http", "http-tls"], optional = true } [dev-dependencies] mockall = "0.12.0" diff --git a/vdr/src/client/client.rs b/vdr/src/client/client.rs index e63b1449..7b035e34 100644 --- a/vdr/src/client/client.rs +++ b/vdr/src/client/client.rs @@ -227,8 +227,8 @@ pub mod test { pub const ROLE_CONTROL_PATH: &str = "auth/RoleControl.sol/RoleControl.json"; pub const ETHR_DID_REGISTRY_PATH: &str = "did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json"; - pub const LEGACY_IDENTIFIERS_REGISTRY_PATH: &str = - "migration/LegacyIdentifiersRegistry.sol/LegacyIdentifiersRegistry.json"; + pub const LEGACY_MAPPING_REGISTRY_PATH: &str = + "migration/LegacyMappingRegistry.sol/LegacyMappingRegistry.json"; pub const RPC_NODE_ADDRESS: &str = "http://127.0.0.1:8545"; pub const CLIENT_NODE_ADDRESSES: [&str; 4] = [ "http://127.0.0.1:21001", @@ -253,7 +253,7 @@ pub mod test { pub static ETHR_DID_REGISTRY_ADDRESS: Lazy
= Lazy::new(|| Address::from("0x0000000000000000000000000000000000003333")); - pub static LEGACY_IDENTIFIERS_REGISTRY_ADDRESS: Lazy
= + pub static LEGACY_MAPPING_REGISTRY_ADDRESS: Lazy
= Lazy::new(|| Address::from("0x0000000000000000000000000000000000019999")); pub static TRUSTEE_ACC: Lazy
= @@ -301,8 +301,8 @@ pub mod test { spec: None, }, ContractConfig { - address: LEGACY_IDENTIFIERS_REGISTRY_ADDRESS.to_string(), - spec_path: Some(build_contract_path(LEGACY_IDENTIFIERS_REGISTRY_PATH)), + address: LEGACY_MAPPING_REGISTRY_ADDRESS.to_string(), + spec_path: Some(build_contract_path(LEGACY_MAPPING_REGISTRY_PATH)), spec: None, }, ] diff --git a/vdr/src/contracts/cl/types/credential_definition.rs b/vdr/src/contracts/cl/types/credential_definition.rs index f64fcd95..44b1d5ba 100644 --- a/vdr/src/contracts/cl/types/credential_definition.rs +++ b/vdr/src/contracts/cl/types/credential_definition.rs @@ -81,7 +81,7 @@ pub mod test { schema_id: &SchemaId, tag: &str, ) -> CredentialDefinitionId { - CredentialDefinitionId::build(issuer_id, schema_id.as_ref(), tag) + CredentialDefinitionId::build(issuer_id, schema_id, tag) } fn credential_definition_value() -> serde_json::Value { diff --git a/vdr/src/contracts/cl/types/credential_definition_id.rs b/vdr/src/contracts/cl/types/credential_definition_id.rs index 6c95e9fd..8431d148 100644 --- a/vdr/src/contracts/cl/types/credential_definition_id.rs +++ b/vdr/src/contracts/cl/types/credential_definition_id.rs @@ -1,4 +1,4 @@ -use crate::{contracts::did::types::did::DID, types::ContractParam, VdrError}; +use crate::{contracts::did::types::did::DID, types::ContractParam, SchemaId, VdrError}; use serde_derive::{Deserialize, Serialize}; use sha3::Digest; @@ -9,13 +9,13 @@ pub struct CredentialDefinitionId(String); impl CredentialDefinitionId { const ID_PATH: &'static str = "anoncreds/v0/CLAIM_DEF"; - pub fn build(issuer_id: &DID, schema_id: &str, tag: &str) -> CredentialDefinitionId { + pub fn build(issuer_id: &DID, schema_id: &SchemaId, tag: &str) -> CredentialDefinitionId { CredentialDefinitionId::from( format!( "{}/{}/{}/{}", issuer_id.as_ref(), Self::ID_PATH, - schema_id, + schema_id.unique_id(), tag ) .as_str(), diff --git a/vdr/src/contracts/cl/types/schema_id.rs b/vdr/src/contracts/cl/types/schema_id.rs index 0a1dfc48..419e7862 100644 --- a/vdr/src/contracts/cl/types/schema_id.rs +++ b/vdr/src/contracts/cl/types/schema_id.rs @@ -7,12 +7,12 @@ use sha3::Digest; pub struct SchemaId(String); impl SchemaId { - const ID_PATH: &'static str = "anoncreds/v0/SCHEMA"; + const ID_PATH: &'static str = "/anoncreds/v0/SCHEMA"; pub fn build(issuer_id: &DID, name: &str, version: &str) -> SchemaId { SchemaId::from( format!( - "{}/{}/{}/{}", + "{}{}/{}/{}", issuer_id.as_ref(), Self::ID_PATH, name, @@ -22,6 +22,12 @@ impl SchemaId { ) } + // A unique identifier for the schema needed for cred def + // referencing to https://hyperledger.github.io/indy-did-method/#cred-def + pub fn unique_id(&self) -> String { + self.0.replace(Self::ID_PATH, "").replace('/', ":") + } + pub fn hash(&self) -> Vec { sha3::Keccak256::digest(self.0.as_bytes()).to_vec() } diff --git a/vdr/src/contracts/did/did_ethr_resolver.rs b/vdr/src/contracts/did/did_ethr_resolver.rs index 5f438ab2..bedf86df 100644 --- a/vdr/src/contracts/did/did_ethr_resolver.rs +++ b/vdr/src/contracts/did/did_ethr_resolver.rs @@ -58,7 +58,7 @@ pub(crate) async fn resolve_did( let block_tag = options.and_then(|options| options.block_tag.as_ref()); let accept = options.and_then(|options| options.accept.as_deref()); - match accept.as_deref() { + match accept { Some(DID_RESOLUTION_FORMAT) | None => { // ok } diff --git a/vdr/src/contracts/did/types/did.rs b/vdr/src/contracts/did/types/did.rs index fa4eefe6..d10227d9 100644 --- a/vdr/src/contracts/did/types/did.rs +++ b/vdr/src/contracts/did/types/did.rs @@ -75,61 +75,3 @@ impl TryFrom<&DID> for ParsedDid { } } } - -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] -pub struct LegacyDid(String); - -impl AsRef for LegacyDid { - fn as_ref(&self) -> &str { - &self.0 - } -} - -impl ToString for LegacyDid { - fn to_string(&self) -> String { - self.0.to_string() - } -} - -impl From<&str> for LegacyDid { - fn from(value: &str) -> Self { - LegacyDid(value.to_string()) - } -} - -impl TryFrom<&LegacyDid> for ContractParam { - type Error = VdrError; - - fn try_from(value: &LegacyDid) -> Result { - let legacy_identifier = bs58::decode(&value.0).into_vec().map_err(|err| { - VdrError::CommonInvalidData(format!( - "Unable to decode base58 identifier key. Err: {:?}", - err - )) - })?; - Ok(ContractParam::FixedBytes(legacy_identifier)) - } -} - -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] -pub struct LegacyVerkey(String); - -impl From<&str> for LegacyVerkey { - fn from(value: &str) -> Self { - LegacyVerkey(value.to_string()) - } -} - -impl TryFrom<&LegacyVerkey> for ContractParam { - type Error = VdrError; - - fn try_from(value: &LegacyVerkey) -> Result { - let legacy_identifier = bs58::decode(&value.0).into_vec().map_err(|err| { - VdrError::CommonInvalidData(format!( - "Unable to decode base58 verkey key. Err: {:?}", - err - )) - })?; - Ok(ContractParam::FixedBytes(legacy_identifier)) - } -} diff --git a/vdr/src/contracts/did/types/did_doc_builder.rs b/vdr/src/contracts/did/types/did_doc_builder.rs index 34860cb6..57c09299 100644 --- a/vdr/src/contracts/did/types/did_doc_builder.rs +++ b/vdr/src/contracts/did/types/did_doc_builder.rs @@ -389,7 +389,6 @@ pub mod test { use crate::contracts::types::did_doc::test::{ default_ethr_did_document, SERVICE_ENDPOINT, SERVICE_TYPE, TEST_DID_ETHR, }; - use serde_json::json; const KEY_1_INDEX: &str = "KEY_1"; const KEY_2_INDEX: &str = "KEY_2"; @@ -446,7 +445,6 @@ pub mod test { &ServiceEndpoint::String(SERVICE_ENDPOINT.to_string()), ); let did_document = builder.build(); - println!("{}", json!(did_document).to_string()); assert_eq!(4, did_document.verification_method.len()); assert_eq!(3, did_document.assertion_method.len()); diff --git a/vdr/src/contracts/migration/legacy_identifiers_registry.rs b/vdr/src/contracts/migration/legacy_mapping_registry.rs similarity index 72% rename from vdr/src/contracts/migration/legacy_identifiers_registry.rs rename to vdr/src/contracts/migration/legacy_mapping_registry.rs index 09dbd88a..71172775 100644 --- a/vdr/src/contracts/migration/legacy_identifiers_registry.rs +++ b/vdr/src/contracts/migration/legacy_mapping_registry.rs @@ -2,9 +2,10 @@ use log_derive::{logfn, logfn_inputs}; use crate::{ client::LedgerClient, - contracts::{ - migration::types::{ed25519_signature::Ed25519Signature, identifier::Identifier}, - types::did::{LegacyDid, LegacyVerkey}, + contracts::migration::types::{ + did::{LegacyDid, LegacyVerkey}, + ed25519_signature::Ed25519Signature, + resource_identifier::ResourceIdentifier, }, did_ethr_registry::ETHR_DID_METHOD, error::VdrResult, @@ -15,20 +16,21 @@ use crate::{ SignatureData, TransactionEndorsingData, DID, }; -const CONTRACT_NAME: &str = "LegacyIdentifiersRegistry"; +const CONTRACT_NAME: &str = "LegacyMappingRegistry"; const METHOD_CREATE_DID_MAPPING: &str = "createDidMapping"; const METHOD_CREATE_DID_MAPPING_SIGNED: &str = "createDidMappingSigned"; -const METHOD_CREATE_CL_MAPPING: &str = "createClMapping"; -const METHOD_CREATE_CL_MAPPING_SIGNED: &str = "createClMappingSigned"; +const METHOD_CREATE_RESOURCE_MAPPING: &str = "createResourceMapping"; +const METHOD_CREATE_RESOURCE_MAPPING_SIGNED: &str = "createResourceMappingSigned"; const METHOD_DID_MAPPING: &str = "didMapping"; -const METHOD_CL_MAPPING: &str = "clMapping"; +const METHOD_RESOURCE_MAPPING: &str = "resourceMapping"; -/// Build transaction to execute LegacyIdentifiersRegistry.createDidMapping contract method to +/// Build transaction to execute LegacyMappingRegistry.createDidMapping contract method to /// create a legacy DID identifier mapping /// /// # Params /// - `client` client connected to the network where contract will be executed -/// - `identity` transaction sender account address (new account) +/// - `from` transaction sender account address (new account) +/// - `did` new DID /// - `legacy_identifier` identifier of legacy sov/indy DID /// - `legacy_verkey` Ed25519 verification key of the legacy DID identifier. /// - `ed25519_signature` ED25519 signature to prove key possession. @@ -39,15 +41,13 @@ const METHOD_CL_MAPPING: &str = "clMapping"; #[logfn_inputs(Debug)] pub async fn build_create_did_mapping_transaction( client: &LedgerClient, - sender: &Address, + from: &Address, did: &DID, legacy_identifier: &LegacyDid, legacy_verkey: &LegacyVerkey, ed25519_signature: &Ed25519Signature, ) -> VdrResult { let identity = Address::try_from(did)?; - println!("identity {:?}", identity); - println!("sender {:?}", sender); TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_CREATE_DID_MAPPING) @@ -56,16 +56,16 @@ pub async fn build_create_did_mapping_transaction( .add_param(legacy_verkey)? .add_param(ed25519_signature)? .set_type(TransactionType::Write) - .set_from(sender) + .set_from(from) .build(client) .await } -/// Prepared data for execution of LegacyIdentifiersRegistry.createDidMapping contract method to endorse a new DID mapping +/// Prepared data for execution of LegacyMappingRegistry.createDidMapping contract method to endorse a new DID mapping /// /// #Params /// - `client` client connected to the network where contract will be executed -/// - `identity` transaction sender account address (new account) +/// - `did` new DID /// - `legacy_identifier` identifier of legacy sov/indy DID /// - `legacy_verkey` Ed25519 verification key of the legacy DID identifier. /// - `ed25519_signature` ED25519 signature to prove key possession. @@ -76,11 +76,12 @@ pub async fn build_create_did_mapping_transaction( #[logfn_inputs(Debug)] pub async fn build_create_did_mapping_endorsing_data( client: &LedgerClient, - identity: &Address, + did: &DID, legacy_identifier: &LegacyDid, legacy_verkey: &LegacyVerkey, ed25519_signature: &Ed25519Signature, ) -> VdrResult { + let identity = Address::try_from(did)?; TransactionEndorsingDataBuilder::new() .set_contract(CONTRACT_NAME) .set_identity(&identity) @@ -92,13 +93,14 @@ pub async fn build_create_did_mapping_endorsing_data( .await } -/// Build transaction to execute LegacyIdentifiersRegistry.createDidMappingSigned contract method to +/// Build transaction to execute LegacyMappingRegistry.createDidMappingSigned contract method to /// endorse a legacy DID identifier mapping /// Endorsing version of the method - sender is not identity owner /// /// #Params /// - `client` client connected to the network where contract will be executed -/// - `identity` transaction sender account address (new account) +/// - `sender` transaction sender account address (new account) +/// - `did` new DID /// - `legacy_identifier` identifier of legacy sov/indy DID /// - `legacy_verkey` Ed25519 verification key of the legacy DID identifier. /// - `ed25519_signature` ED25519 signature to prove key possession. @@ -111,16 +113,17 @@ pub async fn build_create_did_mapping_endorsing_data( pub async fn build_create_did_mapping_signed_transaction( client: &LedgerClient, from: &Address, - identity: &Address, + did: &DID, legacy_identifier: &LegacyDid, legacy_verkey: &LegacyVerkey, ed25519_signature: &Ed25519Signature, signature: &SignatureData, ) -> VdrResult { + let identity = Address::try_from(did)?; TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_CREATE_DID_MAPPING_SIGNED) - .add_param(identity)? + .add_param(&identity)? .add_param(signature.v())? .add_param(signature.r())? .add_param(signature.s())? @@ -133,7 +136,7 @@ pub async fn build_create_did_mapping_signed_transaction( .await } -/// Build transaction to execute SchemaRegistry.didMappings contract method to get +/// Build transaction to execute LegacyMappingRegistry.didMapping contract method to get /// new identity DID for legacy DID identifier /// /// #Params @@ -157,7 +160,7 @@ pub async fn build_get_did_mapping_transaction( .await } -/// Parse the result of execution SchemaRegistry.didMappings contract method to receive +/// Parse the result of execution LegacyMappingRegistry.didMapping contract method to receive /// new identity DID for legacy DID identifier /// /// # Params @@ -169,19 +172,20 @@ pub async fn build_get_did_mapping_transaction( #[logfn(Info)] #[logfn_inputs(Debug)] pub fn parse_did_mapping_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { - let address = TransactionParser::new() + TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_DID_MAPPING) - .parse::
(client, bytes)?; - Ok(DID::build(ETHR_DID_METHOD, None, address.as_ref())) + .parse::
(client, bytes) + .map(|address| DID::build(ETHR_DID_METHOD, None, address.as_ref())) } -/// Build transaction to execute LegacyIdentifiersRegistry.createClMapping contract method to +/// Build transaction to execute LegacyMappingRegistry.createResourceMapping contract method to /// create mapping of legacy schema/credential definition identifier to new one. /// /// # Params /// - `client` client connected to the network where contract will be executed -/// - `identity` transaction sender account address (new account) +/// - `from` transaction sender account address (new account) +/// - `did` new DID /// - `legacy_issuer_identifier` identifier of legacy sov/indy DID /// - `legacy_identifier` legacy identifier. /// - `new_identifier` new identifier. @@ -190,32 +194,34 @@ pub fn parse_did_mapping_result(client: &LedgerClient, bytes: &[u8]) -> VdrResul /// Write transaction to sign and submit #[logfn(Info)] #[logfn_inputs(Debug)] -pub async fn build_create_cl_mapping_transaction( +pub async fn build_create_resource_mapping_transaction( client: &LedgerClient, - identity: &Address, + from: &Address, + did: &DID, legacy_issuer_identifier: &LegacyDid, - legacy_identifier: &Identifier, - new_identifier: &Identifier, + legacy_identifier: &ResourceIdentifier, + new_identifier: &ResourceIdentifier, ) -> VdrResult { + let identity = Address::try_from(did)?; TransactionBuilder::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_CREATE_CL_MAPPING) - .add_param(identity)? + .set_method(METHOD_CREATE_RESOURCE_MAPPING) + .add_param(&identity)? .add_param(legacy_issuer_identifier)? .add_param(legacy_identifier)? .add_param(new_identifier)? .set_type(TransactionType::Write) - .set_from(identity) + .set_from(from) .build(client) .await } -/// Prepared data for execution of LegacyIdentifiersRegistry.createClMapping contract method to +/// Prepared data for execution of LegacyMappingRegistry.createResourceMapping contract method to /// endorse a new CL mapping. /// /// #Params /// - `client` client connected to the network where contract will be executed -/// - `identity` transaction sender account address (new account) +/// - `did` new DID /// - `legacy_issuer_identifier` identifier of legacy sov/indy DID /// - `legacy_identifier` legacy identifier. /// - `new_identifier` new identifier. @@ -224,17 +230,18 @@ pub async fn build_create_cl_mapping_transaction( /// data: TransactionEndorsingData - transaction endorsement data to sign #[logfn(Info)] #[logfn_inputs(Debug)] -pub async fn build_create_cl_mapping_endorsing_data( +pub async fn build_create_resource_mapping_endorsing_data( client: &LedgerClient, - identity: &Address, + did: &DID, legacy_issuer_identifier: &LegacyDid, - legacy_identifier: &Identifier, - new_identifier: &Identifier, + legacy_identifier: &ResourceIdentifier, + new_identifier: &ResourceIdentifier, ) -> VdrResult { + let identity = Address::try_from(did)?; TransactionEndorsingDataBuilder::new() .set_contract(CONTRACT_NAME) .set_identity(&identity) - .add_param(MethodStringParam::from(METHOD_CREATE_CL_MAPPING))? + .add_param(MethodStringParam::from(METHOD_CREATE_RESOURCE_MAPPING))? .add_param(legacy_issuer_identifier)? .add_param(legacy_identifier)? .add_param(new_identifier)? @@ -242,7 +249,7 @@ pub async fn build_create_cl_mapping_endorsing_data( .await } -/// Build transaction to execute LegacyIdentifiersRegistry.createDidMappingSigned contract method to +/// Build transaction to execute LegacyMappingRegistry.createResourceMappingSigned contract method to /// endorse a legacy DID identifier mapping /// Endorsing version of the method - sender is not identity owner /// @@ -258,19 +265,20 @@ pub async fn build_create_cl_mapping_endorsing_data( /// transaction: Transaction - prepared write transaction object to sign and submit #[logfn(Info)] #[logfn_inputs(Debug)] -pub async fn build_create_cl_mapping_signed_transaction( +pub async fn build_create_resource_mapping_signed_transaction( client: &LedgerClient, from: &Address, - identity: &Address, + did: &DID, legacy_issuer_identifier: &LegacyDid, - legacy_identifier: &Identifier, - new_identifier: &Identifier, + legacy_identifier: &ResourceIdentifier, + new_identifier: &ResourceIdentifier, signature: &SignatureData, ) -> VdrResult { + let identity = Address::try_from(did)?; TransactionBuilder::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_CREATE_CL_MAPPING_SIGNED) - .add_param(identity)? + .set_method(METHOD_CREATE_RESOURCE_MAPPING_SIGNED) + .add_param(&identity)? .add_param(signature.v())? .add_param(signature.r())? .add_param(signature.s())? @@ -283,7 +291,7 @@ pub async fn build_create_cl_mapping_signed_transaction( .await } -/// Build transaction to execute LegacyIdentifiersRegistry.clMappings contract method to get +/// Build transaction to execute LegacyMappingRegistry.resourceMapping contract method to get /// new identifier for a legacy Schema/CredentialDefinition /// /// #Params @@ -294,20 +302,20 @@ pub async fn build_create_cl_mapping_signed_transaction( /// transaction: Transaction - prepared read transaction object to submit #[logfn(Info)] #[logfn_inputs(Debug)] -pub async fn build_get_cl_mapping_transaction( +pub async fn build_get_resource_mapping_transaction( client: &LedgerClient, - legacy_identifier: &Identifier, + legacy_identifier: &ResourceIdentifier, ) -> VdrResult { TransactionBuilder::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_CL_MAPPING) + .set_method(METHOD_RESOURCE_MAPPING) .add_param(legacy_identifier)? .set_type(TransactionType::Read) .build(client) .await } -/// Parse the result of execution SchemaRegistry.clMappings contract method to receive +/// Parse the result of execution LegacyMappingRegistry.resourceMapping contract method to receive /// new identifier for a legacy Schema/CredentialDefinition /// /// # Params @@ -318,9 +326,12 @@ pub async fn build_get_cl_mapping_transaction( /// New identifier #[logfn(Info)] #[logfn_inputs(Debug)] -pub fn parse_cl_mapping_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { +pub fn parse_resource_mapping_result( + client: &LedgerClient, + bytes: &[u8], +) -> VdrResult { TransactionParser::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_CL_MAPPING) - .parse::(client, bytes) -} \ No newline at end of file + .set_method(METHOD_RESOURCE_MAPPING) + .parse::(client, bytes) +} diff --git a/vdr/src/contracts/migration/mod.rs b/vdr/src/contracts/migration/mod.rs index f44c7bef..f203951d 100644 --- a/vdr/src/contracts/migration/mod.rs +++ b/vdr/src/contracts/migration/mod.rs @@ -1,4 +1,4 @@ -pub mod legacy_identifiers_registry; +pub mod legacy_mapping_registry; pub mod types; pub use types::*; diff --git a/vdr/src/contracts/migration/types/did.rs b/vdr/src/contracts/migration/types/did.rs new file mode 100644 index 00000000..bf674e22 --- /dev/null +++ b/vdr/src/contracts/migration/types/did.rs @@ -0,0 +1,54 @@ +use crate::{types::ContractParam, VdrError}; +use serde_derive::{Deserialize, Serialize}; + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub struct LegacyDid(String); + +impl AsRef for LegacyDid { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl ToString for LegacyDid { + fn to_string(&self) -> String { + self.0.to_string() + } +} + +impl From<&str> for LegacyDid { + fn from(value: &str) -> Self { + LegacyDid(value.to_string()) + } +} + +impl TryFrom<&LegacyDid> for ContractParam { + type Error = VdrError; + + fn try_from(value: &LegacyDid) -> Result { + Ok(ContractParam::String(value.as_ref().to_string())) + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub struct LegacyVerkey(String); + +impl From<&str> for LegacyVerkey { + fn from(value: &str) -> Self { + LegacyVerkey(value.to_string()) + } +} + +impl TryFrom<&LegacyVerkey> for ContractParam { + type Error = VdrError; + + fn try_from(value: &LegacyVerkey) -> Result { + let legacy_identifier = bs58::decode(&value.0).into_vec().map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to decode base58 verkey key. Err: {:?}", + err + )) + })?; + Ok(ContractParam::FixedBytes(legacy_identifier)) + } +} diff --git a/vdr/src/contracts/migration/types/identifier.rs b/vdr/src/contracts/migration/types/identifier.rs deleted file mode 100644 index f1d604b0..00000000 --- a/vdr/src/contracts/migration/types/identifier.rs +++ /dev/null @@ -1,58 +0,0 @@ -use crate::{SchemaId, types::{ContractOutput, ContractParam}, VdrError}; -use serde::{Serialize, Deserialize}; - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct Identifier(String); - -impl Identifier { - pub fn value(&self) -> &str { - self.0.as_str() - } -} - -impl AsRef for Identifier { - fn as_ref(&self) -> &str { - &self.0 - } -} - -impl ToString for Identifier { - fn to_string(&self) -> String { - self.0.to_string() - } -} - -impl From<&str> for Identifier { - fn from(value: &str) -> Self { - Identifier(value.to_string()) - } -} - -impl From<&SchemaId> for Identifier { - fn from(value: &SchemaId) -> Self { - Identifier::from(value.as_ref()) - } -} - -impl From<&indy_data_types::SchemaId> for Identifier { - fn from(value: &indy_data_types::SchemaId) -> Self { - Identifier::from(value.0.as_str()) - } -} - -impl TryFrom<&Identifier> for ContractParam { - type Error = VdrError; - - fn try_from(value: &Identifier) -> Result { - Ok(ContractParam::String(value.0.to_string())) - } -} - -impl TryFrom for Identifier { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - let string = value.get_string(0)?; - Ok(Identifier(string)) - } -} diff --git a/vdr/src/contracts/migration/types/mod.rs b/vdr/src/contracts/migration/types/mod.rs index 15ea1916..2973fdc8 100644 --- a/vdr/src/contracts/migration/types/mod.rs +++ b/vdr/src/contracts/migration/types/mod.rs @@ -1,2 +1,3 @@ +pub mod did; pub mod ed25519_signature; -pub mod identifier; +pub mod resource_identifier; diff --git a/vdr/src/contracts/migration/types/resource_identifier.rs b/vdr/src/contracts/migration/types/resource_identifier.rs new file mode 100644 index 00000000..5799ca7a --- /dev/null +++ b/vdr/src/contracts/migration/types/resource_identifier.rs @@ -0,0 +1,61 @@ +use crate::{ + types::{ContractOutput, ContractParam}, + SchemaId, VdrError, +}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ResourceIdentifier(String); + +impl ResourceIdentifier { + pub fn value(&self) -> &str { + self.0.as_str() + } +} + +impl AsRef for ResourceIdentifier { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl ToString for ResourceIdentifier { + fn to_string(&self) -> String { + self.0.to_string() + } +} + +impl From<&str> for ResourceIdentifier { + fn from(value: &str) -> Self { + ResourceIdentifier(value.to_string()) + } +} + +impl From<&SchemaId> for ResourceIdentifier { + fn from(value: &SchemaId) -> Self { + ResourceIdentifier::from(value.as_ref()) + } +} + +impl From<&indy_data_types::SchemaId> for ResourceIdentifier { + fn from(value: &indy_data_types::SchemaId) -> Self { + ResourceIdentifier::from(value.0.as_str()) + } +} + +impl TryFrom<&ResourceIdentifier> for ContractParam { + type Error = VdrError; + + fn try_from(value: &ResourceIdentifier) -> Result { + Ok(ContractParam::String(value.0.to_string())) + } +} + +impl TryFrom for ResourceIdentifier { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + let string = value.get_string(0)?; + Ok(ResourceIdentifier(string)) + } +} diff --git a/vdr/src/contracts/mod.rs b/vdr/src/contracts/mod.rs index 422e62cb..d2750022 100644 --- a/vdr/src/contracts/mod.rs +++ b/vdr/src/contracts/mod.rs @@ -7,5 +7,5 @@ pub mod network; pub use auth::{role_control, Role}; pub use cl::{credential_definition_registry, schema_registry, CredentialDefinition, Schema}; pub use did::*; -pub use migration::legacy_identifiers_registry; +pub use migration::legacy_mapping_registry; pub use network::validator_control; diff --git a/vdr/src/lib.rs b/vdr/src/lib.rs index 5c6e2098..00bb7d66 100644 --- a/vdr/src/lib.rs +++ b/vdr/src/lib.rs @@ -44,8 +44,12 @@ pub use contracts::{ }, }, migration::{ - legacy_identifiers_registry, - types::{ed25519_signature::Ed25519Signature, identifier::Identifier}, + legacy_mapping_registry, + types::{ + did::{LegacyDid, LegacyVerkey}, + ed25519_signature::Ed25519Signature, + resource_identifier::ResourceIdentifier, + }, }, network::validator_control, StringOrVector, diff --git a/vdr/src/migration/credential_definition.rs b/vdr/src/migration/credential_definition.rs index 3952167c..8b5e226a 100644 --- a/vdr/src/migration/credential_definition.rs +++ b/vdr/src/migration/credential_definition.rs @@ -1,10 +1,8 @@ use crate::{ contracts::did::types::did::DID, error::{VdrError, VdrResult}, - migration::{DID_METHOD, NETWORK}, - CredentialDefinition, CredentialDefinitionId, SchemaId, + CredentialDefinition, SchemaId, }; -use log::warn; use log_derive::{logfn, logfn_inputs}; use serde_json::json; @@ -17,49 +15,6 @@ use indy_data_types::{ CredentialDefinitionId as IndyCredentialDefinitionId, SchemaId as IndySchemaId, }; -impl CredentialDefinitionId { - #[logfn(Trace)] - #[logfn_inputs(Trace)] - pub fn from_indy_format(id: &str) -> VdrResult { - let parts: Vec<&str> = id.split(':').collect(); - let id = parts.get(0).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def id".to_string()); - - warn!( - "Error: {:?} during converting CredentialDefinitionId from indy format", - vdr_error - ); - - vdr_error - })?; - let schema_id = parts.get(3).ok_or_else(|| { - let vdr_error = - VdrError::CommonInvalidData("Invalid indy cred def schema id".to_string()); - - warn!( - "Error: {:?} during converting CredentialDefinitionId from indy format", - vdr_error - ); - - vdr_error - })?; - let tag = parts.get(4).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def tag".to_string()); - - warn!( - "Error: {:?} during converting CredentialDefinitionId from indy format", - vdr_error - ); - - vdr_error - })?; - let issuer_did = DID::build(DID_METHOD, Some(NETWORK), id); - - let cred_def_id = CredentialDefinitionId::build(&issuer_did, schema_id, tag); - Ok(cred_def_id) - } -} - impl CredentialDefinition { #[logfn(Trace)] #[logfn_inputs(Trace)] diff --git a/vdr/src/migration/schema.rs b/vdr/src/migration/schema.rs index f85a3cc4..f4b9a6c2 100644 --- a/vdr/src/migration/schema.rs +++ b/vdr/src/migration/schema.rs @@ -1,59 +1,15 @@ use crate::{ contracts::did::types::did::DID, error::{VdrError, VdrResult}, - migration::{DID_METHOD, NETWORK}, - Schema, SchemaId, + Schema, }; use indy_data_types::{ anoncreds::schema::{AttributeNames, Schema as IndySchema, SchemaV1 as IndySchemaV1}, did::DidValue, SchemaId as IndySchemaId, }; -use log::warn; use log_derive::{logfn, logfn_inputs}; -impl SchemaId { - #[logfn(Trace)] - #[logfn_inputs(Trace)] - pub fn from_indy_format(id: &str) -> VdrResult { - let parts: Vec<&str> = id.split(':').collect(); - let id = parts.get(0).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy schema id".to_string()); - - warn!( - "Error: {:?} during converting SchemaId from indy format", - vdr_error - ); - - vdr_error - })?; - let name = parts.get(2).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy schema name".to_string()); - - warn!( - "Error: {:?} during converting SchemaId from indy format", - vdr_error - ); - - vdr_error - })?; - let version = parts.get(3).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy schema version".to_string()); - - warn!( - "Error: {:?} during converting SchemaId from indy format", - vdr_error - ); - - vdr_error - })?; - let issuer_did = DID::build(DID_METHOD, Some(NETWORK), id); - - let besu_schema_id = SchemaId::build(&issuer_did, name, version); - Ok(besu_schema_id) - } -} - impl Schema { #[logfn(Trace)] #[logfn_inputs(Trace)] diff --git a/vdr/src/test.rs b/vdr/src/test.rs index 56e83a8e..8b588204 100644 --- a/vdr/src/test.rs +++ b/vdr/src/test.rs @@ -24,7 +24,9 @@ async fn sign_and_submit_transaction( signer: &BasicSigner, ) -> String { let sign_bytes = transaction.get_signing_bytes().unwrap(); - let signature = signer.sign(&sign_bytes, transaction.from.as_ref().unwrap().as_ref()).unwrap(); + let signature = signer + .sign(&sign_bytes, transaction.from.as_ref().unwrap().as_ref()) + .unwrap(); transaction.set_signature(signature); let block_hash = client.submit_transaction(&transaction).await.unwrap(); client.get_receipt(&block_hash).await.unwrap() @@ -65,8 +67,8 @@ mod did { let transaction_endorsing_data = did_ethr_registry::build_did_set_attribute_endorsing_data( client, did, attribute, validity, ) - .await - .unwrap(); + .await + .unwrap(); let signature = sign_endorsing_data(&transaction_endorsing_data, signer); @@ -78,8 +80,8 @@ mod did { validity, &signature, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; } @@ -104,8 +106,8 @@ mod did { attribute, &signature, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await } @@ -132,8 +134,8 @@ mod did { &service(), &validity(), ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // Read DID events @@ -161,8 +163,8 @@ mod did { &public_key(), &validity(), ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // resolve DID document @@ -234,8 +236,8 @@ mod did { &new_owner, &signature, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // Resole DID document @@ -369,8 +371,8 @@ mod schema { &schema, &signature, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(client, transaction, signer).await; (schema_id, schema) } @@ -391,8 +393,8 @@ mod schema { &schema_id, &schema, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // read @@ -446,8 +448,8 @@ mod credential_definition { &schema_id, &schema, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // write @@ -460,8 +462,8 @@ mod credential_definition { &credential_definition_id, &credential_definition, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // read @@ -470,8 +472,8 @@ mod credential_definition { &client, &credential_definition_id, ) - .await - .unwrap(); + .await + .unwrap(); assert_eq!(credential_definition, resolved_credential_definition); Ok(()) @@ -498,8 +500,8 @@ mod credential_definition { &credential_definition_id, &credential_definition, ) - .await - .unwrap(); + .await + .unwrap(); let signature = sign_endorsing_data(&transaction_endorsing_data, &signer); @@ -511,8 +513,8 @@ mod credential_definition { &credential_definition, &signature, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // read @@ -521,8 +523,8 @@ mod credential_definition { &client, &credential_definition_id, ) - .await - .unwrap(); + .await + .unwrap(); assert_eq!(credential_definition, resolved_credential_definition); Ok(()) @@ -545,8 +547,8 @@ mod role { role_to_assign, assignee_account, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(client, transaction, signer).await } @@ -562,8 +564,8 @@ mod role { role_to_revoke, revokee_account, ) - .await - .unwrap(); + .await + .unwrap(); let sign_bytes = transaction.get_signing_bytes().unwrap(); let signature = signer.sign(&sign_bytes, TRUSTEE_ACC.as_ref()).unwrap(); @@ -610,7 +612,7 @@ mod role { &role_to_assign, &signer, ) - .await; + .await; let assigned_role = build_and_submit_get_role_transaction(&client, &assignee_account).await; assert_eq!(role_to_assign, assigned_role); @@ -621,7 +623,7 @@ mod role { &role_to_assign, &signer, ) - .await; + .await; let has_role = build_and_submit_has_role_transaction(&client, &role_to_assign, &assignee_account) @@ -661,8 +663,8 @@ mod validator { &TRUSTEE_ACC, new_validator_address, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(client, transaction, signer).await } @@ -677,8 +679,8 @@ mod validator { &TRUSTEE_ACC, validator_address, ) - .await - .unwrap(); + .await + .unwrap(); sign_and_submit_transaction(client, transaction, signer).await } @@ -693,7 +695,7 @@ mod validator { &Role::Steward, &signer, ) - .await; + .await; build_and_submit_add_validator_transaction(&client, &new_validator_address, &signer).await; @@ -713,14 +715,18 @@ mod validator { } mod mapping { + use super::*; + use crate::{ + client::client::test::client, + contracts::{ + cl::types::schema::test::{SCHEMA_NAME, SCHEMA_VERSION}, + migration::types::did::{LegacyDid, LegacyVerkey}, + }, + legacy_mapping_registry, Ed25519Signature, ResourceIdentifier, SchemaId, + }; + use ed25519_dalek::{SigningKey, VerifyingKey}; use indy_data_types::did::DidValue; - use crate::{Ed25519Signature, Identifier, legacy_identifiers_registry, SchemaId}; - use crate::client::client::test::client; - use crate::contracts::types::did::{LegacyDid, LegacyVerkey}; - use crate::contracts::cl::types::schema::test::{SCHEMA_NAME, SCHEMA_VERSION}; use rand::rngs::OsRng; - use ed25519_dalek::{SigningKey, VerifyingKey}; - use super::*; fn generate_legacy_did() -> (LegacyDid, LegacyVerkey, SigningKey) { let mut csprng = OsRng; @@ -728,7 +734,11 @@ mod mapping { let verifying_key: VerifyingKey = signing_key.verifying_key(); let did = bs58::encode(&verifying_key.as_bytes()[..16]).into_string(); let verkey = bs58::encode(&verifying_key).into_string(); - (LegacyDid::from(did.as_str()), LegacyVerkey::from(verkey.as_str()), signing_key) + ( + LegacyDid::from(did.as_str()), + LegacyVerkey::from(verkey.as_str()), + signing_key, + ) } #[async_std::test] @@ -738,46 +748,65 @@ mod mapping { let did = super::did(&TRUSTEE_ACC.clone()); let (legacy_did, legacy_verkey, _) = generate_legacy_did(); - let legacy_signature = Ed25519Signature::from(vec![1,2,3,4,5,6].as_slice()); + let legacy_signature = Ed25519Signature::from(vec![1, 2, 3, 4, 5, 6].as_slice()); // create DID mapping - let transaction = legacy_identifiers_registry::build_create_did_mapping_transaction( + let transaction = legacy_mapping_registry::build_create_did_mapping_transaction( &client, &TRUSTEE_ACC.clone(), &did, &legacy_did, &legacy_verkey, &legacy_signature, - ).await.unwrap(); + ) + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // read DID mapping - let transaction = legacy_identifiers_registry::build_get_did_mapping_transaction(&client, &legacy_did).await.unwrap(); + let transaction = + legacy_mapping_registry::build_get_did_mapping_transaction(&client, &legacy_did) + .await + .unwrap(); let response = client.submit_transaction(&transaction).await.unwrap(); - let resolved_did = legacy_identifiers_registry::parse_did_mapping_result(&client, &response).unwrap(); + let resolved_did = + legacy_mapping_registry::parse_did_mapping_result(&client, &response).unwrap(); assert_eq!(did, resolved_did); // create mapping for schema id - let legacy_schema_id = indy_data_types::SchemaId::new(&DidValue(legacy_did.to_string()), SCHEMA_NAME, SCHEMA_VERSION); - let legacy_schema_id = Identifier::from(&legacy_schema_id); + let legacy_schema_id = indy_data_types::SchemaId::new( + &DidValue(legacy_did.to_string()), + SCHEMA_NAME, + SCHEMA_VERSION, + ); + let legacy_schema_id = ResourceIdentifier::from(&legacy_schema_id); let schema_id = SchemaId::build(&did, SCHEMA_NAME, SCHEMA_VERSION); - let schema_id = Identifier::from(&schema_id); + let schema_id = ResourceIdentifier::from(&schema_id); - let transaction = legacy_identifiers_registry::build_create_cl_mapping_transaction( + let transaction = legacy_mapping_registry::build_create_resource_mapping_transaction( &client, &TRUSTEE_ACC.clone(), + &did, &legacy_did, &legacy_schema_id, &schema_id, - ).await.unwrap(); + ) + .await + .unwrap(); sign_and_submit_transaction(&client, transaction, &signer).await; // read schema mapping - let transaction = legacy_identifiers_registry::build_get_cl_mapping_transaction(&client, &legacy_schema_id).await.unwrap(); + let transaction = legacy_mapping_registry::build_get_resource_mapping_transaction( + &client, + &legacy_schema_id, + ) + .await + .unwrap(); let response = client.submit_transaction(&transaction).await.unwrap(); - let resolved_schema_id = legacy_identifiers_registry::parse_cl_mapping_result(&client, &response).unwrap(); + let resolved_schema_id = + legacy_mapping_registry::parse_resource_mapping_result(&client, &response).unwrap(); assert_eq!(schema_id, resolved_schema_id); Ok(()) } -} \ No newline at end of file +} diff --git a/vdr/src/types/contract.rs b/vdr/src/types/contract.rs index e320d994..385ed8cc 100644 --- a/vdr/src/types/contract.rs +++ b/vdr/src/types/contract.rs @@ -239,6 +239,6 @@ impl TryFrom for ContractParam { type Error = VdrError; fn try_from(value: MethodStringParam) -> Result { - Ok(ContractParam::String(value.0.to_string())) + Ok(ContractParam::String(value.0)) } } diff --git a/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs index 2710bb1e..b2485ee6 100644 --- a/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs @@ -8,8 +8,8 @@ use crate::ffi::{ use indy_besu_vdr::{ did_ethr_registry, Address, Block, DelegateType, DidAttributeChanged as DidAttributeChanged_, DidDelegateChanged as DidDelegateChanged_, DidDocAttribute, DidEvents as DidEvents_, - DidOwnerChanged as DidOwnerChanged_, - DidResolutionOptions as DidResolutionOptions_, Validity, DID, + DidOwnerChanged as DidOwnerChanged_, DidResolutionOptions as DidResolutionOptions_, Validity, + DID, }; use serde_json::json; diff --git a/vdr/uniffi/src/ffi/contracts/legacy_mapping_registry.rs b/vdr/uniffi/src/ffi/contracts/legacy_mapping_registry.rs new file mode 100644 index 00000000..a44eef78 --- /dev/null +++ b/vdr/uniffi/src/ffi/contracts/legacy_mapping_registry.rs @@ -0,0 +1,181 @@ +use crate::ffi::{ + client::LedgerClient, + error::{VdrError, VdrResult}, + transaction::{Transaction, TransactionEndorsingData}, + types::SignatureData, +}; +use indy_besu_vdr::{ + legacy_mapping_registry, Address, Ed25519Signature, LegacyDid, LegacyVerkey, + ResourceIdentifier, DID, +}; + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_did_mapping_transaction( + client: &LedgerClient, + from: &str, + did: &str, + legacy_identifier: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], +) -> VdrResult { + let transaction = legacy_mapping_registry::build_create_did_mapping_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &LegacyDid::from(legacy_identifier), + &LegacyVerkey::from(legacy_verkey), + &Ed25519Signature::from(ed25519_signature), + ) + .await?; + Ok(Transaction { transaction }) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_did_mapping_endorsing_data( + client: &LedgerClient, + did: &str, + legacy_identifier: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], +) -> VdrResult { + legacy_mapping_registry::build_create_did_mapping_endorsing_data( + &client.client, + &DID::from(did), + &LegacyDid::from(legacy_identifier), + &LegacyVerkey::from(legacy_verkey), + &Ed25519Signature::from(ed25519_signature), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_did_mapping_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + legacy_identifier: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], + signature: SignatureData, +) -> VdrResult { + legacy_mapping_registry::build_create_did_mapping_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &LegacyDid::from(legacy_identifier), + &LegacyVerkey::from(legacy_verkey), + &Ed25519Signature::from(ed25519_signature), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_did_mapping_transaction( + client: &LedgerClient, + legacy_identifier: &str, +) -> VdrResult { + legacy_mapping_registry::build_get_did_mapping_transaction( + &client.client, + &LegacyDid::from(legacy_identifier), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_did_mapping_result(client: &LedgerClient, bytes: Vec) -> VdrResult { + let did = legacy_mapping_registry::parse_did_mapping_result(&client.client, &bytes)?; + Ok(did.to_string()) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_resource_mapping_transaction( + client: &LedgerClient, + from: &str, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, +) -> VdrResult { + let transaction = legacy_mapping_registry::build_create_resource_mapping_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &LegacyDid::from(legacy_issuer_identifier), + &ResourceIdentifier::from(legacy_identifier), + &ResourceIdentifier::from(new_identifier), + ) + .await?; + Ok(Transaction { transaction }) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_resource_mapping_endorsing_data( + client: &LedgerClient, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, +) -> VdrResult { + legacy_mapping_registry::build_create_resource_mapping_endorsing_data( + &client.client, + &DID::from(did), + &LegacyDid::from(legacy_issuer_identifier), + &ResourceIdentifier::from(legacy_identifier), + &ResourceIdentifier::from(new_identifier), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_resource_mapping_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, + signature: SignatureData, +) -> VdrResult { + legacy_mapping_registry::build_create_resource_mapping_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &LegacyDid::from(legacy_issuer_identifier), + &ResourceIdentifier::from(legacy_identifier), + &ResourceIdentifier::from(new_identifier), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_resource_mapping_transaction( + client: &LedgerClient, + legacy_identifier: &str, +) -> VdrResult { + legacy_mapping_registry::build_get_resource_mapping_transaction( + &client.client, + &ResourceIdentifier::from(legacy_identifier), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_resource_mapping_result(client: &LedgerClient, bytes: Vec) -> VdrResult { + let identifier = + legacy_mapping_registry::parse_resource_mapping_result(&client.client, &bytes)?; + Ok(identifier.to_string()) +} diff --git a/vdr/uniffi/src/ffi/contracts/mod.rs b/vdr/uniffi/src/ffi/contracts/mod.rs index f7e7e433..394a35e3 100644 --- a/vdr/uniffi/src/ffi/contracts/mod.rs +++ b/vdr/uniffi/src/ffi/contracts/mod.rs @@ -1,5 +1,6 @@ pub mod credential_definition_registry; pub mod did_ethr_registry; +pub mod legacy_mapping_registry; pub mod role_control; pub mod schema_registry; pub mod validator_control; diff --git a/vdr/wasm/demo/node/src/main.ts b/vdr/wasm/demo/node/src/main.ts index 993598dd..841e80ef 100644 --- a/vdr/wasm/demo/node/src/main.ts +++ b/vdr/wasm/demo/node/src/main.ts @@ -7,7 +7,7 @@ const chainId = 1337 const nodeAddress = 'http://127.0.0.1:8545' // set path to the compiled contract const didEthrRegistryConfig = { - address: '0x0000000000000000000000000000000000018888', + address: '0x0000000000000000000000000000000000003333', specPath: '/Users/indy-besu/smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json' } const schemaRegistryConfig = { diff --git a/vdr/wasm/src/contracts/legacy_mapping_registry.rs b/vdr/wasm/src/contracts/legacy_mapping_registry.rs new file mode 100644 index 00000000..7f397a82 --- /dev/null +++ b/vdr/wasm/src/contracts/legacy_mapping_registry.rs @@ -0,0 +1,230 @@ +use indy_besu_vdr::{ + legacy_mapping_registry, Address, Ed25519Signature, LegacyDid, LegacyVerkey, + ResourceIdentifier, SignatureData, DID, +}; +use std::rc::Rc; +use wasm_bindgen::prelude::*; + +use crate::{ + client::LedgerClientWrapper, + error::{JsResult, Result}, + transaction::{TransactionEndorsingDataWrapper, TransactionWrapper}, +}; + +#[wasm_bindgen(js_name = LegacyMappingRegistry)] +pub struct LegacyMappingRegistry; + +#[wasm_bindgen(js_class = LegacyMappingRegistry)] +impl LegacyMappingRegistry { + #[wasm_bindgen(js_name = buildCreateDidMappingTransaction)] + pub async fn build_create_did_mapping_transaction( + client: &LedgerClientWrapper, + from: &str, + did: &str, + legacy_did: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], + ) -> Result { + let from = Address::from(from); + let did = DID::from(did); + let legacy_did = LegacyDid::from(legacy_did); + let legacy_verkey = LegacyVerkey::from(legacy_verkey); + let ed25519_signature = Ed25519Signature::from(ed25519_signature); + let transaction = legacy_mapping_registry::build_create_did_mapping_transaction( + &client.0, + &from, + &did, + &legacy_did, + &legacy_verkey, + &ed25519_signature, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildCreateDidMappingEndorsingData)] + pub async fn build_create_did_mapping_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + legacy_did: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], + ) -> Result { + let did = DID::from(did); + let legacy_did = LegacyDid::from(legacy_did); + let legacy_verkey = LegacyVerkey::from(legacy_verkey); + let ed25519_signature = Ed25519Signature::from(ed25519_signature); + let data = legacy_mapping_registry::build_create_did_mapping_endorsing_data( + &client.0, + &did, + &legacy_did, + &legacy_verkey, + &ed25519_signature, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildCreateDidMappingSignedTransaction)] + pub async fn build_create_did_mapping_signed_transaction( + client: &LedgerClientWrapper, + from: &str, + did: &str, + legacy_did: &str, + legacy_verkey: &str, + ed25519_signature: &[u8], + signature_data: JsValue, + ) -> Result { + let address = Address::from(from); + let did = DID::from(did); + let legacy_did = LegacyDid::from(legacy_did); + let legacy_verkey = LegacyVerkey::from(legacy_verkey); + let ed25519_signature = Ed25519Signature::from(ed25519_signature); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = legacy_mapping_registry::build_create_did_mapping_signed_transaction( + &client.0, + &address, + &did, + &legacy_did, + &legacy_verkey, + &ed25519_signature, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetDidMappingTransaction)] + pub async fn build_get_did_mapping_transaction( + client: &LedgerClientWrapper, + legacy_identifier: &str, + ) -> Result { + let legacy_identifier = LegacyDid::from(legacy_identifier); + let transaction = legacy_mapping_registry::build_get_did_mapping_transaction( + &client.0, + &legacy_identifier, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = parseDidMappingResult)] + pub fn parse_did_mapping_result( + client: &LedgerClientWrapper, + bytes: Vec, + ) -> Result { + let did = legacy_mapping_registry::parse_did_mapping_result(&client.0, &bytes).as_js()?; + Ok(did.to_string()) + } + + #[wasm_bindgen(js_name = buildCreateResourceMappingTransaction)] + pub async fn build_create_resource_mapping_transaction( + client: &LedgerClientWrapper, + from: &str, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, + ) -> Result { + let from = Address::from(from); + let did = DID::from(did); + let legacy_issuer_identifier = LegacyDid::from(legacy_issuer_identifier); + let legacy_identifier = ResourceIdentifier::from(legacy_identifier); + let new_identifier = ResourceIdentifier::from(new_identifier); + let transaction = legacy_mapping_registry::build_create_resource_mapping_transaction( + &client.0, + &from, + &did, + &legacy_issuer_identifier, + &legacy_identifier, + &new_identifier, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildCreateResourceMappingEndorsingData)] + pub async fn build_create_resource_mapping_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, + ) -> Result { + let did = DID::from(did); + let legacy_issuer_identifier = LegacyDid::from(legacy_issuer_identifier); + let legacy_identifier = ResourceIdentifier::from(legacy_identifier); + let new_identifier = ResourceIdentifier::from(new_identifier); + let data = legacy_mapping_registry::build_create_resource_mapping_endorsing_data( + &client.0, + &did, + &legacy_issuer_identifier, + &legacy_identifier, + &new_identifier, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildCreateResourceMappingSignedTransaction)] + pub async fn build_create_resource_mapping_signed_transaction( + client: &LedgerClientWrapper, + from: &str, + did: &str, + legacy_issuer_identifier: &str, + legacy_identifier: &str, + new_identifier: &str, + signature_data: JsValue, + ) -> Result { + let from = Address::from(from); + let did = DID::from(did); + let legacy_issuer_identifier = LegacyDid::from(legacy_issuer_identifier); + let legacy_identifier = ResourceIdentifier::from(legacy_identifier); + let new_identifier = ResourceIdentifier::from(new_identifier); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = + legacy_mapping_registry::build_create_resource_mapping_signed_transaction( + &client.0, + &from, + &did, + &legacy_issuer_identifier, + &legacy_identifier, + &new_identifier, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetResourceMappingTransaction)] + pub async fn build_get_resource_mapping_transaction( + client: &LedgerClientWrapper, + legacy_identifier: &str, + ) -> Result { + let legacy_identifier = ResourceIdentifier::from(legacy_identifier); + let transaction = legacy_mapping_registry::build_get_resource_mapping_transaction( + &client.0, + &legacy_identifier, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = parseResourceMappingResult)] + pub fn parse_resource_mapping_result( + client: &LedgerClientWrapper, + bytes: Vec, + ) -> Result { + let resource = + legacy_mapping_registry::parse_resource_mapping_result(&client.0, &bytes).as_js()?; + Ok(resource.to_string()) + } +} diff --git a/vdr/wasm/src/contracts/mod.rs b/vdr/wasm/src/contracts/mod.rs index f7e7e433..394a35e3 100644 --- a/vdr/wasm/src/contracts/mod.rs +++ b/vdr/wasm/src/contracts/mod.rs @@ -1,5 +1,6 @@ pub mod credential_definition_registry; pub mod did_ethr_registry; +pub mod legacy_mapping_registry; pub mod role_control; pub mod schema_registry; pub mod validator_control; diff --git a/vdr/wrappers/python/demo/test.py b/vdr/wrappers/python/demo/test.py index d41a0abd..afd7b6e5 100644 --- a/vdr/wrappers/python/demo/test.py +++ b/vdr/wrappers/python/demo/test.py @@ -11,7 +11,7 @@ # address of an RPC node connected to the network node_address = 'http://127.0.0.1:8545' # address of deployed IndyDidRegistry smart contract -did_contact_address = '0x0000000000000000000000000000000000018888' +did_contact_address = '0x0000000000000000000000000000000000003333' schema_contact_address = '0x0000000000000000000000000000000000005555' # Path to the compiled IndyDidRegistry smart contract did_contact_spec_path = '/Users/indy-besu/smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json'