diff --git a/README.md b/README.md index 4036852..1a79080 100644 --- a/README.md +++ b/README.md @@ -23,23 +23,6 @@ ___

-
- -> **Disclaimer: Beta Version** -> -> Welcome to the beta version of our client! This software is currently in the beta testing phase, which means it is not the final release version. As a beta version, it may still contain bugs, undergo frequent updates, and have limited features. -Important Points to Note: - -> **Use at Your Own Risk:** While we have made efforts to ensure the stability and reliability of the beta version, there is a possibility of encountering unexpected issues. Please use this software at your own risk. - -> **Limited Support:** As this is a beta release, our support resources may be focused on addressing critical bugs and gathering feedback from users. Therefore, support for beta versions may be limited compared to our stable releases. - -> **Feedback Appreciated:** Your feedback is invaluable to us. If you encounter any issues, have suggestions, or want to share your experiences with the beta version, please let us know. Your feedback will help us improve the software for the final release. - -> **Not for Production Use:** The beta version is intended for testing and evaluation purposes only. It is not recommended for use in a production environment where stability and reliability are crucial. - -
-
Table of Contents @@ -60,17 +43,6 @@ Important Points to Note:
  • Installation
  • -
  • - 📜 Roadmap - -
  • 📄 License
  • 🤝 Contributing
  • ❤️ Contributors
  • @@ -221,117 +193,6 @@ python3 examples/demo.py

    (back to top)

    -## 📜 Roadmap - -This roadmap outlines the goals for the first major release of the `dkg.py`. Each section represents a stage in the development process and the features we plan to implement. - -
    - - -### 1️⃣ Pre-development Phase - - - -- [x] **Requirement Analysis and Planning** - - [x] Define the project's scope - - [x] Identify the core functionalities - -- [x] **Design** - - [x] Plan the library's architecture - - [x] Establish coding standards - -- [ ] **Setup Development Environment** - - [x] Setup development, testing and production environments - - [ ] Add pytest config - - [ ] Add mypy config - - [ ] Add tox config ? - - [ ] Setup Continuous Integration (CI) and Continuous Deployment (CD) pipeline -
    - -
    - - -### 2️⃣ Development Phase - - -| Feature | Status | Tests coverage | -|:-:|:-:|:-:| -| Get Allowance | 🟩 Completed | ❌ | -| Set Allowance | 🟩 Completed | ❌ | -| Increase Allowance | 🟩 Completed | ❌ | -| Decrease Allowance | 🟩 Completed | ❌ | -| Get Bid Suggestion | 🟩 Completed | ❌ | -| Create | 🟩 Completed | ❌ | -| Transfer | 🟩 Completed | ❌ | -| Update | 🟩 Completed | ❌ | -| Wait for finalization | 🟥 Not Started | ❌ | -| Cancel update | 🟩 Completed | ❌ | -| Burn | 🟩 Completed | ❌ | -| Get | 🟩 Completed | ❌ | -| Query | 🟩 Completed | ❌ | -| Extend storing period | 🟩 Completed | ❌ | -| Add tokens | 🟩 Completed | ❌ | -| Add update tokens | 🟩 Completed | ❌ | -| Get owner | 🟩 Completed | ❌ | -| Experimental | 🟥 Not Started | ❌ | -
    - -
    - - -### 3️⃣ Documentation Phase - - -- [ ] Write comprehensive documentation -- [x] Provide examples and use-cases -- [ ] Review and finalize documentation -
    - -
    - - -### 4️⃣ Pre-release Phase - - -- [ ] **Beta Release** - - [X] Release a beta version for testing - - [ ] Gather and address feedback - -- **Bug Fixes** - - Identify and fix bugs - -- [ ] **Final Testing and QA** - - [ ] Perform comprehensive testing - - [ ] Ensure the library meets quality standards -
    - -
    - - -### 5️⃣ Release - - -- [ ] Merge the first version into the main branch -- [ ] Release the v1.0.0 of the `dkg.py` library -
    - -
    - - -### 6️⃣ Post-release - - -- Monitor for any issues -- Plan for next versions based on user feedback and usage -
    - -
    - -**Note:** This roadmap is subject to changes. Each step will be accompanied by appropriate documentation, testing and code review to maintain the quality of the library. - -
    -

    (back to top)

    - ## 📄 License Distributed under the Apache-2.0 License. See `LICENSE` file for more information. diff --git a/dkg/asset.py b/dkg/asset.py index 3ccc1f5..ff7de13 100644 --- a/dkg/asset.py +++ b/dkg/asset.py @@ -69,7 +69,7 @@ from dkg.utils.ual import format_ual, parse_ual -class ContentAsset(Module): +class KnowledgeAsset(Module): def __init__(self, manager: DefaultRequestManager): self.manager = manager @@ -196,6 +196,7 @@ def decrease_allowance( _get_asset_storage_address = Method(BlockchainRequest.get_asset_storage_address) _create = Method(BlockchainRequest.create_asset) + _mint_paranet_knowledge_asset = Method(BlockchainRequest.mint_knowledge_asset) _get_bid_suggestion = Method(NodeRequest.bid_suggestion) _local_store = Method(NodeRequest.local_store) @@ -208,6 +209,7 @@ def create( token_amount: Wei | None = None, immutable: bool = False, content_type: Literal["JSON-LD", "N-Quads"] = "JSON-LD", + paranet_ual: UAL | None = None, ) -> dict[str, UAL | HexStr | dict[str, dict[str, str] | TxReceipt]]: blockchain_id = self.manager.blockchain_provider.blockchain_id assertions = format_content(content, content_type) @@ -242,20 +244,54 @@ def create( result = {"publicAssertionId": public_assertion_id, "operation": {}} try: - receipt: TxReceipt = self._create( - { - "assertionId": Web3.to_bytes(hexstr=public_assertion_id), - "size": public_assertion_metadata["size"], - "triplesNumber": public_assertion_metadata["triples_number"], - "chunksNumber": public_assertion_metadata["chunks_number"], - "tokenAmount": token_amount, - "epochsNumber": epochs_number, - "scoreFunctionId": DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS[ - self.manager.blockchain_provider.environment - ][blockchain_id], - "immutable_": immutable, - } - ) + if paranet_ual is None: + receipt: TxReceipt = self._create( + { + "assertionId": Web3.to_bytes(hexstr=public_assertion_id), + "size": public_assertion_metadata["size"], + "triplesNumber": public_assertion_metadata["triples_number"], + "chunksNumber": public_assertion_metadata["chunks_number"], + "tokenAmount": token_amount, + "epochsNumber": epochs_number, + "scoreFunctionId": DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS[ + self.manager.blockchain_provider.environment + ][blockchain_id], + "immutable_": immutable, + } + ) + else: + parsed_paranet_ual = parse_ual(paranet_ual) + paranet_knowledge_asset_storage, paranet_knowledge_asset_token_id = ( + parsed_paranet_ual["contract_address"], + parsed_paranet_ual["token_id"], + ) + + receipt: TxReceipt = self._mint_paranet_knowledge_asset( + paranet_knowledge_asset_storage, + paranet_knowledge_asset_token_id, + { + "assertionId": Web3.to_bytes(hexstr=public_assertion_id), + "size": public_assertion_metadata["size"], + "triplesNumber": public_assertion_metadata["triples_number"], + "chunksNumber": public_assertion_metadata["chunks_number"], + "tokenAmount": token_amount, + "epochsNumber": epochs_number, + "scoreFunctionId": DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS[ + self.manager.blockchain_provider.environment + ][blockchain_id], + "immutable_": immutable, + }, + ) + + result["paranetId"] = Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [ + paranet_knowledge_asset_storage, + paranet_knowledge_asset_token_id, + ], + ) + ) except ContractLogicError as err: if is_allowance_increased: self.decrease_allowance(token_amount) @@ -280,7 +316,7 @@ def create( "tokenId": token_id, "assertionId": public_assertion_id, "assertion": assertions["public"], - "storeType": StoreTypes.TRIPLE.value, + "storeType": StoreTypes.TRIPLE, } ] @@ -295,7 +331,7 @@ def create( sort_pairs=True, ).root, "assertion": assertions["private"], - "storeType": StoreTypes.TRIPLE.value, + "storeType": StoreTypes.TRIPLE, } ) @@ -325,6 +361,42 @@ def create( return result + _submit_knowledge_asset = Method(BlockchainRequest.submit_knowledge_asset) + + def submit_to_paranet( + self, ual: UAL, paranet_ual: UAL + ) -> dict[str, UAL | Address | TxReceipt]: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + parsed_paranet_ual = parse_ual(paranet_ual) + paranet_knowledge_asset_storage, paranet_knowledge_asset_token_id = ( + parsed_paranet_ual["contract_address"], + parsed_paranet_ual["token_id"], + ) + + receipt: TxReceipt = self._submit_knowledge_asset( + paranet_knowledge_asset_storage, + paranet_knowledge_asset_token_id, + knowledge_asset_storage, + knowledge_asset_token_id, + ) + + return { + "UAL": ual, + "paranetUAL": paranet_ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + _transfer = Method(BlockchainRequest.transfer_asset) def transfer( @@ -430,7 +502,7 @@ def update( "tokenId": token_id, "assertionId": public_assertion_id, "assertion": assertions["public"], - "storeType": StoreTypes.PENDING.value, + "storeType": StoreTypes.PENDING, } ] @@ -445,7 +517,7 @@ def update( sort_pairs=True, ).root, "assertion": assertions["private"], - "storeType": StoreTypes.PENDING.value, + "storeType": StoreTypes.PENDING, } ) @@ -463,7 +535,7 @@ def update( operation_result = self.get_operation_result(operation_id, "update") return { - "UAL": format_ual(blockchain_id, content_asset_storage_address, token_id), + "UAL": ual, "publicAssertionId": public_assertion_id, "operation": { "operationId": operation_id, diff --git a/dkg/constants.py b/dkg/constants.py index afd9071..1f63b46 100644 --- a/dkg/constants.py +++ b/dkg/constants.py @@ -29,10 +29,6 @@ "hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3", "rpc": "http://localhost:9545", }, - "otp:2043": { - "hub": "0x7585a99C5C150a08f5CDeFD16465C6De8D41EbbD", - "rpc": "http://parachain-alphanet-02.origin-trail.network:9933", - }, }, "devnet": { "otp:2160": { @@ -44,6 +40,10 @@ "rpc": "https://rpc.chiadochain.net", "gas_price_oracle": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle", }, + "base:84532": { + "hub": "0x6C861Cb69300C34DfeF674F7C00E734e840C29C0", + "rpc": "https://sepolia.base.org", + } }, "testnet": { "otp:20430": { @@ -55,6 +55,10 @@ "rpc": "https://rpc.chiadochain.net", "gas_price_oracle": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle", }, + "base:84532": { + "hub": "0x144eDa5cbf8926327cb2cceef168A121F0E4A299", + "rpc": "https://sepolia.base.org", + } }, "mainnet": { "otp:2043": { diff --git a/dkg/data/interfaces/Assertion.json b/dkg/data/interfaces/Assertion.json deleted file mode 100644 index a33fbbb..0000000 --- a/dkg/data/interfaces/Assertion.json +++ /dev/null @@ -1,157 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "assertionId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "size", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "triplesNumber", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "chunksNumber", - "type": "uint96" - } - ], - "name": "AssertionCreated", - "type": "event" - }, - { - "inputs": [], - "name": "assertionStorage", - "outputs": [ - { - "internalType": "contract AssertionStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "assertionId", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "size", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "triplesNumber", - "type": "uint32" - }, - { - "internalType": "uint96", - "name": "chunksNumber", - "type": "uint96" - } - ], - "name": "createAssertion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/CommitManagerV1.json b/dkg/data/interfaces/CommitManagerV1.json deleted file mode 100644 index f3d59a8..0000000 --- a/dkg/data/interfaces/CommitManagerV1.json +++ /dev/null @@ -1,549 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "commitWindowOpen", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commitWindowClose", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeNow", - "type": "uint256" - } - ], - "name": "CommitWindowClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "NodeAlreadySubmittedCommit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "rank", - "type": "uint8" - } - ], - "name": "NodeNotAwarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - }, - { - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "name": "NodeNotInShardingTable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "ServiceAgreementDoesntExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - } - ], - "name": "ServiceAgreementHasBeenExpired", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "name": "CommitSubmitted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getTopCommitSubmissions", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitSubmission[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isCommitWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "reqs", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "scoringProxy", - "outputs": [ - { - "internalType": "contract ScoringProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "req", - "type": "bool" - } - ], - "name": "setReq", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "shardingTableStorage", - "outputs": [ - { - "internalType": "contract ShardingTableStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingContract", - "outputs": [ - { - "internalType": "contract Staking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingStorage", - "outputs": [ - { - "internalType": "contract StakingStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "submitCommit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/CommitManagerV1U1.json b/dkg/data/interfaces/CommitManagerV1U1.json deleted file mode 100644 index f169e94..0000000 --- a/dkg/data/interfaces/CommitManagerV1U1.json +++ /dev/null @@ -1,735 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commitWindowOpen", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commitWindowClose", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeNow", - "type": "uint256" - } - ], - "name": "CommitWindowClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetStorage", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "NoPendingUpdate", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "NodeAlreadySubmittedCommit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "rank", - "type": "uint8" - } - ], - "name": "NodeNotAwarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - }, - { - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "name": "NodeNotInShardingTable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "ServiceAgreementDoesntExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - } - ], - "name": "ServiceAgreementHasBeenExpired", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "name": "CommitSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "state", - "type": "bytes32" - } - ], - "name": "StateFinalized", - "type": "event" - }, - { - "inputs": [], - "name": "contentAssetStorage", - "outputs": [ - { - "internalType": "contract ContentAssetStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - } - ], - "name": "getTopCommitSubmissions", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitSubmission[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isCommitWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - } - ], - "name": "isUpdateCommitWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "reqs", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "scoringProxy", - "outputs": [ - { - "internalType": "contract ScoringProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "req", - "type": "bool" - } - ], - "name": "setReq", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "shardingTableStorage", - "outputs": [ - { - "internalType": "contract ShardingTableStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingContract", - "outputs": [ - { - "internalType": "contract Staking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingStorage", - "outputs": [ - { - "internalType": "contract StakingStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "submitCommit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "submitUpdateCommit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unfinalizedStateStorage", - "outputs": [ - { - "internalType": "contract UnfinalizedStateStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ContentAsset.json b/dkg/data/interfaces/ContentAsset.json index 29ef3bd..e9f9770 100644 --- a/dkg/data/interfaces/ContentAsset.json +++ b/dkg/data/interfaces/ContentAsset.json @@ -344,6 +344,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "cancelAssetStateUpdateFromContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "contentAssetStorage", @@ -408,7 +421,79 @@ } ], "name": "createAsset", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "originalSender", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "assertionId", + "type": "bytes32" + }, + { + "internalType": "uint128", + "name": "size", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "triplesNumber", + "type": "uint32" + }, + { + "internalType": "uint96", + "name": "chunksNumber", + "type": "uint96" + }, + { + "internalType": "uint16", + "name": "epochsNumber", + "type": "uint16" + }, + { + "internalType": "uint96", + "name": "tokenAmount", + "type": "uint96" + }, + { + "internalType": "uint8", + "name": "scoreFunctionId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "immutable_", + "type": "bool" + } + ], + "internalType": "struct ContentAssetStructs.AssetInputArgs", + "name": "args", + "type": "tuple" + } + ], + "name": "createAssetFromContract", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -456,7 +541,13 @@ } ], "name": "createAssetWithVariables", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -501,7 +592,7 @@ "name": "hub", "outputs": [ { - "internalType": "contract Hub", + "internalType": "contract HubV2", "name": "", "type": "address" } @@ -578,6 +669,45 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "paranetKnowledgeAssetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetKnowledgeAssetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetKnowledgeMinersRegistry", + "outputs": [ + { + "internalType": "contract ParanetKnowledgeMinersRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "serviceAgreementStorageProxy", diff --git a/dkg/data/interfaces/HashingProxy.json b/dkg/data/interfaces/HashingProxy.json deleted file mode 100644 index 03008aa..0000000 --- a/dkg/data/interfaces/HashingProxy.json +++ /dev/null @@ -1,253 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "address", - "name": "newContractAddress", - "type": "address" - } - ], - "name": "HashFunctionContractChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "address", - "name": "newContractAddress", - "type": "address" - } - ], - "name": "NewHashFunctionContract", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "callHashFunction", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAllHashFunctions", - "outputs": [ - { - "components": [ - { - "internalType": "uint8", - "name": "id", - "type": "uint8" - }, - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "internalType": "struct UnorderedIndexableContractDynamicSetLib.Contract[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - } - ], - "name": "getHashFunctionContractAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - } - ], - "name": "getHashFunctionName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - } - ], - "name": "isHashFunction", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - } - ], - "name": "removeContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "address", - "name": "hashingContractAddress", - "type": "address" - } - ], - "name": "setContractAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/IdentityStorage.json b/dkg/data/interfaces/IdentityStorage.json deleted file mode 100644 index 568fde9..0000000 --- a/dkg/data/interfaces/IdentityStorage.json +++ /dev/null @@ -1,342 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "purpose", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "name": "KeyAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "purpose", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "name": "KeyRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes32", - "name": "_key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_purpose", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_type", - "type": "uint256" - } - ], - "name": "addKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "deleteIdentity", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "generateIdentityId", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operational", - "type": "address" - } - ], - "name": "getIdentityId", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes32", - "name": "_key", - "type": "bytes32" - } - ], - "name": "getKey", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint256", - "name": "_purpose", - "type": "uint256" - } - ], - "name": "getKeysByPurpose", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "identityIds", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes32", - "name": "_key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_purpose", - "type": "uint256" - } - ], - "name": "keyHasPurpose", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes32", - "name": "_key", - "type": "bytes32" - } - ], - "name": "removeKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "operationalKey", - "type": "bytes32" - } - ], - "name": "removeOperationalKeyIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "operationalKey", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "setOperationalKeyIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ParametersStorage.json b/dkg/data/interfaces/ParametersStorage.json deleted file mode 100644 index ad6a7f7..0000000 --- a/dkg/data/interfaces/ParametersStorage.json +++ /dev/null @@ -1,487 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "parameterName", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "parameterValue", - "type": "uint256" - } - ], - "name": "ParameterChanged", - "type": "event" - }, - { - "inputs": [], - "name": "commitWindowDurationPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochLength", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "finalizationCommitsNumber", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxProofWindowOffsetPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumStake", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minProofWindowOffsetPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumStake", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "proofWindowDurationPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "r0", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "r1", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "r2", - "outputs": [ - { - "internalType": "uint48", - "name": "", - "type": "uint48" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "replacementWindowDurationPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardWithdrawalDelay", - "outputs": [ - { - "internalType": "uint24", - "name": "", - "type": "uint24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newCommitWindowDurationPerc", - "type": "uint8" - } - ], - "name": "setCommitWindowDurationPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "newEpochLength", - "type": "uint128" - } - ], - "name": "setEpochLength", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newFinalizationCommitsNumber", - "type": "uint8" - } - ], - "name": "setFinalizationCommitsNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newMaxProofWindowOffsetPerc", - "type": "uint8" - } - ], - "name": "setMaxProofWindowOffsetPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint96", - "name": "newMaximumStake", - "type": "uint96" - } - ], - "name": "setMaximumStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newMinProofWindowOffsetPerc", - "type": "uint8" - } - ], - "name": "setMinProofWindowOffsetPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint96", - "name": "newMinimumStake", - "type": "uint96" - } - ], - "name": "setMinimumStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newProofWindowDurationPerc", - "type": "uint8" - } - ], - "name": "setProofWindowDurationPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "newR0", - "type": "uint32" - } - ], - "name": "setR0", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "newR1", - "type": "uint32" - } - ], - "name": "setR1", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint48", - "name": "newR2", - "type": "uint48" - } - ], - "name": "setR2", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "newReplacementWindowDurationPerc", - "type": "uint8" - } - ], - "name": "setReplacementWindowDurationPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint24", - "name": "newRewardWithdrawalDelay", - "type": "uint24" - } - ], - "name": "setRewardWithdrawalDelay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "newSlashingFreezeDuration", - "type": "uint32" - } - ], - "name": "setSlashingFreezeDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint24", - "name": "newStakeWithdrawalDelay", - "type": "uint24" - } - ], - "name": "setStakeWithdrawalDelay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newUpdateCommitWindowDuration", - "type": "uint16" - } - ], - "name": "setUpdateCommitWindowDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "slashingFreezeDuration", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakeWithdrawalDelay", - "outputs": [ - { - "internalType": "uint24", - "name": "", - "type": "uint24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "updateCommitWindowDuration", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/Paranet.json b/dkg/data/interfaces/Paranet.json new file mode 100644 index 0000000..7eca7ac --- /dev/null +++ b/dkg/data/interfaces/Paranet.json @@ -0,0 +1,821 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "hubAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKnowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetTokenId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "KnowledgeAssetIsAPartOfOtherParanet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ParanetDoesntExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ParanetHasAlreadyBeenRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ParanetServiceDoesntExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "paranetServiceId", + "type": "bytes32" + } + ], + "name": "ParanetServiceHasAlreadyBeenAdded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ParanetServiceHasAlreadyBeenRegistered", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "knowledgeAssetTokenId", + "type": "uint256" + } + ], + "name": "KnowledgeAssetSubmittedToParanet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct ParanetStructs.IncentivesPool", + "name": "incentivesPool", + "type": "tuple" + } + ], + "name": "ParanetIncetivesPoolDeployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "newParanetName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newParanetDescription", + "type": "string" + } + ], + "name": "ParanetMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "paranetName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "paranetDescription", + "type": "string" + } + ], + "name": "ParanetRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "paranetServiceKAStorageContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paranetServiceKATokenId", + "type": "uint256" + } + ], + "name": "ParanetServiceAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetServiceKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetServiceKATokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "newParanetServiceName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newParanetServiceDescription", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "newParanetServiceAddresses", + "type": "address[]" + } + ], + "name": "ParanetServiceMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetServiceKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetServiceKATokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "paranetServiceName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "paranetServiceDescription", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "paranetServiceAddresses", + "type": "address[]" + } + ], + "name": "ParanetServiceRegistered", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.UniversalAssetLocator[]", + "name": "services", + "type": "tuple[]" + } + ], + "name": "addParanetServices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "contentAsset", + "outputs": [ + { + "internalType": "contract ContentAssetV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "contentAssetStorage", + "outputs": [ + { + "internalType": "contract ContentAssetStorageV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hashingProxy", + "outputs": [ + { + "internalType": "contract HashingProxy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hub", + "outputs": [ + { + "internalType": "contract HubV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "assertionId", + "type": "bytes32" + }, + { + "internalType": "uint128", + "name": "size", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "triplesNumber", + "type": "uint32" + }, + { + "internalType": "uint96", + "name": "chunksNumber", + "type": "uint96" + }, + { + "internalType": "uint16", + "name": "epochsNumber", + "type": "uint16" + }, + { + "internalType": "uint96", + "name": "tokenAmount", + "type": "uint96" + }, + { + "internalType": "uint8", + "name": "scoreFunctionId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "immutable_", + "type": "bool" + } + ], + "internalType": "struct ContentAssetStructs.AssetInputArgs", + "name": "knowledgeAssetArgs", + "type": "tuple" + } + ], + "name": "mintKnowledgeAsset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "paranetKnowledgeAssetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetKnowledgeAssetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetKnowledgeMinersRegistry", + "outputs": [ + { + "internalType": "contract ParanetKnowledgeMinersRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetServicesRegistry", + "outputs": [ + { + "internalType": "contract ParanetServicesRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "processUpdatedKnowledgeAssetStatesMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "paranetName", + "type": "string" + }, + { + "internalType": "string", + "name": "paranetDescription", + "type": "string" + } + ], + "name": "registerParanet", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetServiceKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetServiceKATokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "paranetServiceName", + "type": "string" + }, + { + "internalType": "string", + "name": "paranetServiceDescription", + "type": "string" + }, + { + "internalType": "address[]", + "name": "paranetServiceAddresses", + "type": "address[]" + } + ], + "name": "registerParanetService", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "serviceAgreementStorageProxy", + "outputs": [ + { + "internalType": "contract ServiceAgreementStorageProxy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_status", + "type": "bool" + } + ], + "name": "setStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "status", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "knowledgeAssetTokenId", + "type": "uint256" + } + ], + "name": "submitKnowledgeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "paranetName", + "type": "string" + }, + { + "internalType": "string", + "name": "paranetDescription", + "type": "string" + } + ], + "name": "updateParanetMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetServiceKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetServiceKATokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "paranetServiceName", + "type": "string" + }, + { + "internalType": "string", + "name": "paranetServiceDescription", + "type": "string" + }, + { + "internalType": "address[]", + "name": "paranetServiceAddresses", + "type": "address[]" + } + ], + "name": "updateParanetServiceMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + } +] diff --git a/dkg/data/interfaces/Identity.json b/dkg/data/interfaces/ParanetIncentivesPoolFactory.json similarity index 57% rename from dkg/data/interfaces/Identity.json rename to dkg/data/interfaces/ParanetIncentivesPoolFactory.json index 7094201..c276757 100644 --- a/dkg/data/interfaces/Identity.json +++ b/dkg/data/interfaces/ParanetIncentivesPoolFactory.json @@ -11,105 +11,104 @@ "type": "constructor" }, { - "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" }, { - "indexed": true, - "internalType": "bytes32", - "name": "operationalKey", - "type": "bytes32" + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" }, { - "indexed": true, - "internalType": "bytes32", - "name": "adminKey", - "type": "bytes32" + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "address", + "name": "poolAddress", + "type": "address" } ], - "name": "IdentityCreated", - "type": "event" + "name": "ParanetIncentivesPoolAlreadyExists", + "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct ParanetStructs.IncentivesPool", + "name": "incentivesPool", + "type": "tuple" } ], - "name": "IdentityDeleted", + "name": "ParanetIncetivesPoolDeployed", "type": "event" }, { "inputs": [ { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" }, { "internalType": "uint256", - "name": "keyPurpose", + "name": "paranetKATokenId", "type": "uint256" }, { "internalType": "uint256", - "name": "keyType", + "name": "tracToNeuroEmissionMultiplier", "type": "uint256" - } - ], - "name": "addKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + }, { - "internalType": "address", - "name": "operational", - "type": "address" + "internalType": "uint16", + "name": "paranetOperatorRewardPercentage", + "type": "uint16" }, { - "internalType": "address", - "name": "admin", - "type": "address" + "internalType": "uint16", + "name": "paranetIncentivizationProposalVotersRewardPercentage", + "type": "uint16" } ], - "name": "createIdentity", + "name": "deployNeuroIncentivesPool", "outputs": [ { - "internalType": "uint72", + "internalType": "address", "name": "", - "type": "uint72" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" + "type": "address" } ], - "name": "deleteIdentity", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, @@ -118,20 +117,7 @@ "name": "hub", "outputs": [ { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", + "internalType": "contract HubV2", "name": "", "type": "address" } @@ -160,21 +146,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" } ], - "name": "removeKey", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { diff --git a/dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json b/dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json new file mode 100644 index 0000000..e725892 --- /dev/null +++ b/dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json @@ -0,0 +1,919 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "hubAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "addedCumulativeAwardedNeuro", + "type": "uint256" + } + ], + "name": "addCumulativeAwardedNeuro", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "addedTracSpent", + "type": "uint96" + } + ], + "name": "addCumulativeTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" + } + ], + "name": "addSubmittedKnowledgeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "uint96", + "name": "addedTracSpent", + "type": "uint96" + } + ], + "name": "addTotalTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "addedUnrewardedTracSpent", + "type": "uint96" + } + ], + "name": "addUnrewardedTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "assertionId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "updateTokenAmount", + "type": "uint96" + } + ], + "name": "addUpdatingKnowledgeAssetState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetStateId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "addedUpdateTokenAmount", + "type": "uint96" + } + ], + "name": "addUpdatingKnowledgeAssetUpdateTokenAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "decrementTotalSubmittedKnowledgeAssetsCount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "deleteKnowledgeMiner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getCumulativeAwardedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getCumulativeTracSpent", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getKnowledgeMinerMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint96", + "name": "totalTracSpent", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "totalSubmittedKnowledgeAssetsCount", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.KnowledgeMinerMetadata", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getSubmittedKnowledgeAssets", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getSubmittedKnowledgeAssets", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "getTotalSubmittedKnowledgeAssetsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "getTotalTracSpent", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getUnrewardedTracSpent", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getUpdatingKnowledgeAssetStates", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "assertionId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "updateTokenAmount", + "type": "uint96" + } + ], + "internalType": "struct ParanetStructs.UpdatingKnowledgeAssetState[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getUpdatingKnowledgeAssetStates", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "assertionId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "updateTokenAmount", + "type": "uint96" + } + ], + "internalType": "struct ParanetStructs.UpdatingKnowledgeAssetState[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hub", + "outputs": [ + { + "internalType": "contract HubV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "incrementTotalSubmittedKnowledgeAssetsCount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "knowledgeMinerExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "registerKnowledgeMiner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" + } + ], + "name": "removeSubmittedKnowledgeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetStateId", + "type": "bytes32" + } + ], + "name": "removeUpdatingKnowledgeAssetState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "cumulativeAwardedNeuro", + "type": "uint256" + } + ], + "name": "setCumulativeAwardedNeuro", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "cumulativeTracSpent", + "type": "uint96" + } + ], + "name": "setCumulativeTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalSubmittedKnowledgeAssetsCount", + "type": "uint256" + } + ], + "name": "setTotalSubmittedKnowledgeAssetsCount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "uint96", + "name": "totalTracSpent", + "type": "uint96" + } + ], + "name": "setTotalTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "unrewardedTracSpent", + "type": "uint96" + } + ], + "name": "setUnrewardedTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetStateId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "updateTokenAmount", + "type": "uint96" + } + ], + "name": "setUpdatingKnowledgeAssetUpdateTokenAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "subtractedCumulativeAwardedNeuro", + "type": "uint256" + } + ], + "name": "subCumulativeAwardedNeuro", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "subtractedTracSpent", + "type": "uint96" + } + ], + "name": "subCumulativeTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "uint96", + "name": "subtractedTracSpent", + "type": "uint96" + } + ], + "name": "subTotalTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "subtractedUnrewardedTracSpent", + "type": "uint96" + } + ], + "name": "subUnrewardedTracSpent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetStateId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "subtractedUpdateTokenAmount", + "type": "uint96" + } + ], + "name": "subUpdatingKnowledgeAssetUpdateTokenAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + } +] diff --git a/dkg/data/interfaces/ParanetNeurowebIncentivesPool.json b/dkg/data/interfaces/ParanetNeurowebIncentivesPool.json new file mode 100644 index 0000000..288bf3e --- /dev/null +++ b/dkg/data/interfaces/ParanetNeurowebIncentivesPool.json @@ -0,0 +1,1102 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "hubAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "paranetsRegistryAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "knowledgeMinersRegistryAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tracToNeuroEmissionMultiplier", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "paranetOperatorRewardPercentage_", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "paranetIncentivizationProposalVotersRewardPercentage_", + "type": "uint16" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "uint96", + "name": "currentCumulativeWeight", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "targetCumulativeWeight", + "type": "uint96" + } + ], + "name": "InvalidCumulativeVotersWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "claimer", + "type": "address" + } + ], + "name": "NoRewardAvailable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMultiplier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMultiplier", + "type": "uint256" + } + ], + "name": "NeuroEmissionMultiplierUpdateFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMultiplier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMultiplier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "NeuroEmissionMultiplierUpdateInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NeuroRewardDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ParanetIncentivizationProposalVoterRewardClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "miner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ParanetKnowledgeMinerRewardClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ParanetOperatorRewardClaimed", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint96", + "name": "weight", + "type": "uint96" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivizationProposalVoterInput[]", + "name": "voters_", + "type": "tuple[]" + } + ], + "name": "addVoters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimIncentivizationProposalVoterReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimKnowledgeMinerReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimParanetOperatorReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "claimedMinerRewards", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimedMinerRewardsIndexes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "claimedOperatorRewards", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimedOperatorRewardsIndexes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cumulativeVotersWeight", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "finalizeNeuroEmissionMultiplierUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllRewardedMiners", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllRewardedOperators", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableAllKnowledgeMinersRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableAllProposalVotersRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableKnowledgeMinerRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableParanetOperatorRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableProposalVoterRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "getEffectiveNeuroEmissionMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNeuroBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNeuroEmissionMultipliers", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "multiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "finalized", + "type": "bool" + } + ], + "internalType": "struct ParanetStructs.NeuroEmissionMultiplier[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalAllKnowledgeMinersIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalAllProposalVotersIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalKnowledgeMinerIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalParanetOperatorIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalProposalVoterIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voterAddress", + "type": "address" + } + ], + "name": "getVoter", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint96", + "name": "weight", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivizationProposalVoter", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVoters", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint96", + "name": "weight", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivizationProposalVoter[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVotersCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hub", + "outputs": [ + { + "internalType": "contract HubV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMultiplier", + "type": "uint256" + } + ], + "name": "initiateNeuroEmissionMultiplierUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isKnowledgeMiner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isParanetOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isProposalVoter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minerAddress", + "type": "address" + } + ], + "name": "minerClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "neuroEmissionMultiplierUpdateDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "neuroEmissionMultipliers", + "outputs": [ + { + "internalType": "uint256", + "name": "multiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "finalized", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operatorAddress", + "type": "address" + } + ], + "name": "operatorClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetIncentivizationProposalVotersRewardPercentage", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetKnowledgeMinersRegistry", + "outputs": [ + { + "internalType": "contract ParanetKnowledgeMinersRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetOperatorRewardPercentage", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "parentParanetId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "removeVoters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalMinersClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalNeuroReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOperatorsClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalVotersClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newRegistrar", + "type": "address" + } + ], + "name": "transferVotersRegistrarRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newDelay", + "type": "uint256" + } + ], + "name": "updateNeuroEmissionMultiplierUpdateDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voterAddress", + "type": "address" + } + ], + "name": "voterClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "voters", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint96", + "name": "weight", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votersIndexes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votersRegistrar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/dkg/data/interfaces/ServiceAgreementStorageV1.json b/dkg/data/interfaces/ParanetsRegistry.json similarity index 56% rename from dkg/data/interfaces/ServiceAgreementStorageV1.json rename to dkg/data/interfaces/ParanetsRegistry.json index 5bd2c38..bd66bd2 100644 --- a/dkg/data/interfaces/ServiceAgreementStorageV1.json +++ b/dkg/data/interfaces/ParanetsRegistry.json @@ -10,117 +10,38 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedOTPWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedTokensWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferred", - "type": "event" - }, { "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" - } - ], - "name": "commitSubmissionExists", - "outputs": [ + }, { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint96", + "name": "addedKnowledgeValue", + "type": "uint96" } ], - "stateMutability": "view", + "name": "addCumulativeKnowledgeValue", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" } ], - "name": "createCommitSubmissionObject", + "name": "addKnowledgeAsset", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -129,36 +50,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - }, - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "proofWindowOffsetPerc", - "type": "uint8" + "internalType": "address", + "name": "knowledgeMinerAddress", + "type": "address" } ], - "name": "createServiceAgreementObject", + "name": "addKnowledgeMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -167,16 +68,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" + "internalType": "bytes32", + "name": "serviceId", + "type": "bytes32" } ], - "name": "decrementAgreementRewardedNodesNumber", + "name": "addService", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -185,11 +86,11 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" } ], - "name": "deleteCommitSubmissionsObject", + "name": "deleteParanet", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -198,49 +99,47 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "deleteServiceAgreementObject", - "outputs": [], - "stateMutability": "nonpayable", + "name": "getAllIncentivesPools", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "internalType": "struct UnorderedNamedContractDynamicSetStructs.Contract[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementData", + "name": "getCumulativeKnowledgeValue", "outputs": [ - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - }, { "internalType": "uint96", - "name": "tokenAmount", + "name": "", "type": "uint96" - }, - { - "internalType": "uint8[2]", - "name": "scoreFunctionIdAndProofWindowOffsetPerc", - "type": "uint8[2]" } ], "stateMutability": "view", @@ -250,16 +149,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementEpochLength", + "name": "getDescription", "outputs": [ { - "internalType": "uint128", + "internalType": "string", "name": "", - "type": "uint128" + "type": "string" } ], "stateMutability": "view", @@ -269,23 +168,42 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" + "internalType": "string", + "name": "incentivesPoolType", + "type": "string" } ], - "name": "getAgreementEpochSubmissionHead", + "name": "getIncentivesPoolAddress", "outputs": [ { - "internalType": "bytes32", + "internalType": "address", "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "paranetId", "type": "bytes32" } ], + "name": "getKnowledgeAssets", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], "stateMutability": "view", "type": "function" }, @@ -293,16 +211,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementEpochsNumber", + "name": "getKnowledgeAssetsCount", "outputs": [ { - "internalType": "uint16", + "internalType": "uint256", "name": "", - "type": "uint16" + "type": "uint256" } ], "stateMutability": "view", @@ -312,16 +230,26 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" } ], - "name": "getAgreementProofWindowOffsetPerc", + "name": "getKnowledgeAssetsStartingFromKnowledgeAssetId", "outputs": [ { - "internalType": "uint8", + "internalType": "bytes32[]", "name": "", - "type": "uint8" + "type": "bytes32[]" } ], "stateMutability": "view", @@ -331,21 +259,26 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" } ], - "name": "getAgreementRewardedNodesNumber", + "name": "getKnowledgeAssetsWithPagination", "outputs": [ { - "internalType": "uint32", + "internalType": "bytes32[]", "name": "", - "type": "uint32" + "type": "bytes32[]" } ], "stateMutability": "view", @@ -355,16 +288,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementScoreFunctionId", + "name": "getKnowledgeMiners", "outputs": [ { - "internalType": "uint8", + "internalType": "address[]", "name": "", - "type": "uint8" + "type": "address[]" } ], "stateMutability": "view", @@ -374,11 +307,11 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementStartTime", + "name": "getKnowledgeMinersCount", "outputs": [ { "internalType": "uint256", @@ -393,16 +326,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getAgreementTokenAmount", + "name": "getName", "outputs": [ { - "internalType": "uint96", + "internalType": "string", "name": "", - "type": "uint96" + "type": "string" } ], "stateMutability": "view", @@ -412,36 +345,65 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getCommitSubmission", + "name": "getParanetKnowledgeAssetLocator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" + } + ], + "name": "getParanetMetadata", "outputs": [ { "components": [ { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" }, { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" + "internalType": "string", + "name": "name", + "type": "string" }, { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" + "internalType": "string", + "name": "description", + "type": "string" }, { - "internalType": "uint40", - "name": "score", - "type": "uint40" + "internalType": "uint96", + "name": "cumulativeKnowledgeValue", + "type": "uint96" } ], - "internalType": "struct ServiceAgreementStructsV1.CommitSubmission", + "internalType": "struct ParanetStructs.ParanetMetadata", "name": "", "type": "tuple" } @@ -453,16 +415,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getCommitSubmissionIdentityId", + "name": "getServices", "outputs": [ { - "internalType": "uint72", + "internalType": "bytes32[]", "name": "", - "type": "uint72" + "type": "bytes32[]" } ], "stateMutability": "view", @@ -472,16 +434,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" } ], - "name": "getCommitSubmissionNextIdentityId", + "name": "getServicesCount", "outputs": [ { - "internalType": "uint72", + "internalType": "uint256", "name": "", - "type": "uint72" + "type": "uint256" } ], "stateMutability": "view", @@ -491,16 +453,21 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" + }, + { + "internalType": "address", + "name": "incentivesPoolAddress", + "type": "address" } ], - "name": "getCommitSubmissionPrevIdentityId", + "name": "hasIncentivesPoolByAddress", "outputs": [ { - "internalType": "uint72", + "internalType": "bool", "name": "", - "type": "uint72" + "type": "bool" } ], "stateMutability": "view", @@ -510,16 +477,21 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" + }, + { + "internalType": "string", + "name": "incentivesPoolType", + "type": "string" } ], - "name": "getCommitSubmissionScore", + "name": "hasIncentivesPoolByType", "outputs": [ { - "internalType": "uint40", + "internalType": "bool", "name": "", - "type": "uint40" + "type": "bool" } ], "stateMutability": "view", @@ -530,7 +502,7 @@ "name": "hub", "outputs": [ { - "internalType": "contract Hub", + "internalType": "contract HubV2", "name": "", "type": "address" } @@ -542,49 +514,40 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" } ], - "name": "incrementAgreementRewardedNodesNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", + "name": "isKnowledgeAssetRegistered", "outputs": [ { - "internalType": "string", + "internalType": "bool", "name": "", - "type": "string" + "type": "bool" } ], - "stateMutability": "pure", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" + }, + { + "internalType": "address", + "name": "knowledgeMinerAddress", + "type": "address" } ], - "name": "serviceAgreementExists", + "name": "isKnowledgeMinerRegistered", "outputs": [ { "internalType": "bool", @@ -599,40 +562,89 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" + "internalType": "bytes32", + "name": "serviceId", + "type": "bytes32" } ], - "name": "setAgreementEpochLength", - "outputs": [], - "stateMutability": "nonpayable", + "name": "isServiceImplemented", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" + } + ], + "name": "paranetExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageContract", + "type": "address" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" }, + { + "internalType": "string", + "name": "paranetName", + "type": "string" + }, + { + "internalType": "string", + "name": "paranetDescription", + "type": "string" + } + ], + "name": "registerParanet", + "outputs": [ { "internalType": "bytes32", - "name": "headCommitId", + "name": "", "type": "bytes32" } ], - "name": "setAgreementEpochSubmissionHead", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, @@ -640,16 +652,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" + "internalType": "address", + "name": "incentivesPoolAddress", + "type": "address" } ], - "name": "setAgreementEpochsNumber", + "name": "removeIncentivesPool", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -658,16 +670,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint8", - "name": "proofWindowOffsetPerc", - "type": "uint8" + "internalType": "string", + "name": "incentivesPoolType", + "type": "string" } ], - "name": "setAgreementProofWindowOffsetPerc", + "name": "removeIncentivesPool", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -676,21 +688,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "rewardedNodesNumber", - "type": "uint32" + "internalType": "bytes32", + "name": "knowledgeAssetId", + "type": "bytes32" } ], - "name": "setAgreementRewardedNodesNumber", + "name": "removeKnowledgeAsset", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -699,16 +706,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint8", - "name": "newScoreFunctionId", - "type": "uint8" + "internalType": "address", + "name": "knowledgeMinerAddress", + "type": "address" } ], - "name": "setAgreementScoreFunctionId", + "name": "removeKnowledgeMiner", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -717,16 +724,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" + "internalType": "bytes32", + "name": "serviceId", + "type": "bytes32" } ], - "name": "setAgreementStartTime", + "name": "removeService", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -735,16 +742,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "agreementId", + "name": "paranetId", "type": "bytes32" }, { "internalType": "uint96", - "name": "tokenAmount", + "name": "cumulativeKnowledgeValue", "type": "uint96" } ], - "name": "setAgreementTokenAmount", + "name": "setCumulativeKnowledgeValue", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -753,16 +760,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" + "internalType": "string", + "name": "description", + "type": "string" } ], - "name": "setCommitSubmissionIdentityId", + "name": "setDescription", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -771,16 +778,21 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" + "internalType": "string", + "name": "incentivesPoolType", + "type": "string" + }, + { + "internalType": "address", + "name": "incentivesPoolAddress", + "type": "address" } ], - "name": "setCommitSubmissionNextIdentityId", + "name": "setIncentivesPoolAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -789,16 +801,16 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" + "internalType": "string", + "name": "name_", + "type": "string" } ], - "name": "setCommitSubmissionPrevIdentityId", + "name": "setName", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -807,60 +819,39 @@ "inputs": [ { "internalType": "bytes32", - "name": "commitId", + "name": "paranetId", "type": "bytes32" }, { - "internalType": "uint40", - "name": "score", - "type": "uint40" + "internalType": "uint96", + "name": "subtractedKnowledgeValue", + "type": "uint96" } ], - "name": "setCommitSubmissionScore", + "name": "subCumulativeKnowledgeValue", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { - "internalType": "address", - "name": "receiver", - "type": "address" + "internalType": "bytes32", + "name": "paranetId", + "type": "bytes32" }, { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "transferAgreementTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + "internalType": "string", + "name": "incentivesPoolType", + "type": "string" + }, { - "internalType": "address payable", - "name": "custodian", + "internalType": "address", + "name": "incentivesPoolAddress", "type": "address" } ], - "name": "transferTokens", + "name": "updateIncentivesPoolAddress", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -877,25 +868,5 @@ ], "stateMutability": "pure", "type": "function" - }, - { - "inputs": [], - "name": "withdrawMisplacedOTP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenContractAddress", - "type": "address" - } - ], - "name": "withdrawMisplacedTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" } ] diff --git a/dkg/data/interfaces/Profile.json b/dkg/data/interfaces/Profile.json deleted file mode 100644 index 3c599ab..0000000 --- a/dkg/data/interfaces/Profile.json +++ /dev/null @@ -1,318 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "ask", - "type": "uint96" - } - ], - "name": "AskUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "ProfileCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "ProfileDeleted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "adminWallet", - "type": "address" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "string", - "name": "sharesTokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "sharesTokenSymbol", - "type": "string" - } - ], - "name": "createProfile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityContract", - "outputs": [ - { - "internalType": "contract Identity", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - } - ], - "name": "setAsk", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "stakeAccumulatedOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakingContract", - "outputs": [ - { - "internalType": "contract Staking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "startAccumulatedOperatorFeeWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "whitelistStorage", - "outputs": [ - { - "internalType": "contract WhitelistStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "withdrawAccumulatedOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ProfileStorage.json b/dkg/data/interfaces/ProfileStorage.json deleted file mode 100644 index 49cef66..0000000 --- a/dkg/data/interfaces/ProfileStorage.json +++ /dev/null @@ -1,596 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedOTPWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedTokensWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "address", - "name": "sharesContractAddress", - "type": "address" - } - ], - "name": "createProfile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "deleteProfile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getAccumulatedOperatorFee", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getAccumulatedOperatorFeeWithdrawalAmount", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getAccumulatedOperatorFeeWithdrawalTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getAsk", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - } - ], - "name": "getNodeAddress", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getProfile", - "outputs": [ - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint96[2]", - "name": "profileSettings", - "type": "uint96[2]" - }, - { - "internalType": "address", - "name": "sharesContractAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getSharesContractAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "nodeIdsList", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "profileExists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "newOperatorFeeAmount", - "type": "uint96" - } - ], - "name": "setAccumulatedOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "accumulatedOperatorFeeWithdrawalAmount", - "type": "uint96" - } - ], - "name": "setAccumulatedOperatorFeeWithdrawalAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint256", - "name": "operatorFeeWithdrawalTimestamp", - "type": "uint256" - } - ], - "name": "setAccumulatedOperatorFeeWithdrawalTimestamp", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - } - ], - "name": "setAsk", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "nodeAddress", - "type": "bytes32" - } - ], - "name": "setNodeAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "setNodeId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "sharesContractAddress", - "type": "address" - } - ], - "name": "setSharesContractAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "sharesNames", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "sharesSymbols", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint96", - "name": "amount", - "type": "uint96" - } - ], - "name": "transferAccumulatedOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable", - "name": "custodian", - "type": "address" - } - ], - "name": "transferTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawMisplacedOTP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenContractAddress", - "type": "address" - } - ], - "name": "withdrawMisplacedTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ProofManagerV1.json b/dkg/data/interfaces/ProofManagerV1.json deleted file mode 100644 index 81c3e38..0000000 --- a/dkg/data/interfaces/ProofManagerV1.json +++ /dev/null @@ -1,540 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "NodeAlreadyRewarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "rank", - "type": "uint8" - } - ], - "name": "NodeNotAwarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "proofWindowOpen", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofWindowClose", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeNow", - "type": "uint256" - } - ], - "name": "ProofWindowClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "ServiceAgreementDoesntExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - } - ], - "name": "ServiceAgreementHasBeenExpired", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "merkleProof", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "chunkHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "challenge", - "type": "uint256" - } - ], - "name": "WrongMerkleProof", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "ProofSubmitted", - "type": "event" - }, - { - "inputs": [], - "name": "assertionStorage", - "outputs": [ - { - "internalType": "contract AssertionStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "assertionId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "challenge", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isProofWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "reqs", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "chunkHash", - "type": "bytes32" - } - ], - "internalType": "struct ServiceAgreementStructsV1.ProofInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "sendProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "req", - "type": "bool" - } - ], - "name": "setReq", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakingContract", - "outputs": [ - { - "internalType": "contract Staking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ProofManagerV1U1.json b/dkg/data/interfaces/ProofManagerV1U1.json deleted file mode 100644 index 0642bad..0000000 --- a/dkg/data/interfaces/ProofManagerV1U1.json +++ /dev/null @@ -1,561 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "NodeAlreadyRewarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "rank", - "type": "uint8" - } - ], - "name": "NodeNotAwarded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofWindowOpen", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofWindowClose", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeNow", - "type": "uint256" - } - ], - "name": "ProofWindowClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "ServiceAgreementDoesntExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - } - ], - "name": "ServiceAgreementHasBeenExpired", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "merkleProof", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "chunkHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "challenge", - "type": "uint256" - } - ], - "name": "WrongMerkleProof", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "ProofSubmitted", - "type": "event" - }, - { - "inputs": [], - "name": "assertionStorage", - "outputs": [ - { - "internalType": "contract AssertionStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "assertionId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "challenge", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isProofWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "reqs", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "chunkHash", - "type": "bytes32" - } - ], - "internalType": "struct ServiceAgreementStructsV1.ProofInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "sendProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "req", - "type": "bool" - } - ], - "name": "setReq", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakingContract", - "outputs": [ - { - "internalType": "contract Staking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ScoringProxy.json b/dkg/data/interfaces/ScoringProxy.json deleted file mode 100644 index 1d591f7..0000000 --- a/dkg/data/interfaces/ScoringProxy.json +++ /dev/null @@ -1,268 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "address", - "name": "newContractAddress", - "type": "address" - } - ], - "name": "NewScoringFunctionContract", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "address", - "name": "newContractAddress", - "type": "address" - } - ], - "name": "ScoringFunctionContractUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "name": "callScoreFunction", - "outputs": [ - { - "internalType": "uint40", - "name": "", - "type": "uint40" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAllScoreFunctions", - "outputs": [ - { - "components": [ - { - "internalType": "uint8", - "name": "id", - "type": "uint8" - }, - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "internalType": "struct UnorderedIndexableContractDynamicSetLib.Contract[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "name": "getScoreFunctionContractAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "name": "getScoreFunctionName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "name": "isScoreFunction", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "name": "removeContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "internalType": "address", - "name": "scoringContractAddress", - "type": "address" - } - ], - "name": "setContractAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ServiceAgreementStorageV1U1.json b/dkg/data/interfaces/ServiceAgreementStorageV1U1.json deleted file mode 100644 index 30e53d6..0000000 --- a/dkg/data/interfaces/ServiceAgreementStorageV1U1.json +++ /dev/null @@ -1,1097 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedOTPWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedTokensWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "name": "createEpochStateCommitSubmissionObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - }, - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "proofWindowOffsetPerc", - "type": "uint8" - } - ], - "name": "createServiceAgreementObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "decrementAgreementRewardedNodesNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "epochStateId", - "type": "bytes32" - } - ], - "name": "decrementEpochStateCommitsCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "deleteAgreementRewardedNodesNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "deleteEpochStateCommitSubmissionsObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "epochStateId", - "type": "bytes32" - } - ], - "name": "deleteEpochStateCommitsCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "deleteServiceAgreementObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "stateId", - "type": "bytes32" - } - ], - "name": "deleteUpdateCommitsDeadline", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "epochStateCommitSubmissionExists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementData", - "outputs": [ - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - }, - { - "internalType": "uint96[2]", - "name": "tokens", - "type": "uint96[2]" - }, - { - "internalType": "uint8[2]", - "name": "scoreFunctionIdAndProofWindowOffsetPerc", - "type": "uint8[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementEpochLength", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - } - ], - "name": "getAgreementEpochSubmissionHead", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementEpochsNumber", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementProofWindowOffsetPerc", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getAgreementRewardedNodesNumber", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementScoreFunctionId", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementStartTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementTokenAmount", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "getAgreementUpdateTokenAmount", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitSubmission", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitSubmission", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitSubmissionIdentityId", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitSubmissionNextIdentityId", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitSubmissionPrevIdentityId", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitSubmissionScore", - "outputs": [ - { - "internalType": "uint40", - "name": "", - "type": "uint40" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "epochStateId", - "type": "bytes32" - } - ], - "name": "getEpochStateCommitsCount", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "stateId", - "type": "bytes32" - } - ], - "name": "getUpdateCommitsDeadline", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "incrementAgreementRewardedNodesNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "epochStateId", - "type": "bytes32" - } - ], - "name": "incrementEpochStateCommitsCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "serviceAgreementExists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - } - ], - "name": "setAgreementEpochLength", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "stateIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "headCommitId", - "type": "bytes32" - } - ], - "name": "setAgreementEpochSubmissionHead", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - } - ], - "name": "setAgreementEpochsNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "proofWindowOffsetPerc", - "type": "uint8" - } - ], - "name": "setAgreementProofWindowOffsetPerc", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "rewardedNodesNumber", - "type": "uint32" - } - ], - "name": "setAgreementRewardedNodesNumber", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "newScoreFunctionId", - "type": "uint8" - } - ], - "name": "setAgreementScoreFunctionId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - } - ], - "name": "setAgreementStartTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "setAgreementTokenAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "updateTokenAmount", - "type": "uint96" - } - ], - "name": "setAgreementUpdateTokenAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "setEpochStateCommitSubmissionIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - } - ], - "name": "setEpochStateCommitSubmissionNextIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - } - ], - "name": "setEpochStateCommitSubmissionPrevIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "commitId", - "type": "bytes32" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "name": "setEpochStateCommitSubmissionScore", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "epochStateId", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "newEpochStateCommitsCount", - "type": "uint8" - } - ], - "name": "setEpochStateCommitsCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "stateId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "setUpdateCommitsDeadline", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "transferAgreementTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable", - "name": "custodian", - "type": "address" - } - ], - "name": "transferTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawMisplacedOTP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenContractAddress", - "type": "address" - } - ], - "name": "withdrawMisplacedTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ServiceAgreementV1.json b/dkg/data/interfaces/ServiceAgreementV1.json deleted file mode 100644 index a63f7f3..0000000 --- a/dkg/data/interfaces/ServiceAgreementV1.json +++ /dev/null @@ -1,745 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ScoreError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "name": "ScoreFunctionDoesntExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TooLowAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TooLowBalance", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroEpochsNumber", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroTokenAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "epochLength", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "ServiceAgreementV1Created", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - } - ], - "name": "ServiceAgreementV1Extended", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "ServiceAgreementV1RewardRaised", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "ServiceAgreementV1Terminated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "updateTokenAmount", - "type": "uint96" - } - ], - "name": "ServiceAgreementV1UpdateRewardRaised", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "addTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "addUpdateTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "commitManagerV1", - "outputs": [ - { - "internalType": "contract CommitManagerV1", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "commitManagerV1U1", - "outputs": [ - { - "internalType": "contract CommitManagerV1U1", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetCreator", - "type": "address" - }, - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - }, - { - "internalType": "uint8", - "name": "scoreFunctionId", - "type": "uint8" - } - ], - "internalType": "struct ServiceAgreementStructsV1.ServiceAgreementInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "createServiceAgreement", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epochsNumber", - "type": "uint16" - }, - { - "internalType": "uint96", - "name": "tokenAmount", - "type": "uint96" - } - ], - "name": "extendStoringPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "assertionId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "challenge", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "getTopCommitSubmissions", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - }, - { - "internalType": "uint40", - "name": "score", - "type": "uint40" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitSubmission[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hashingProxy", - "outputs": [ - { - "internalType": "contract HashingProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isCommitWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "name": "isProofWindowOpen", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proofManagerV1", - "outputs": [ - { - "internalType": "contract ProofManagerV1", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proofManagerV1U1", - "outputs": [ - { - "internalType": "contract ProofManagerV1U1", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "scoringProxy", - "outputs": [ - { - "internalType": "contract ScoringProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - }, - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "chunkHash", - "type": "bytes32" - } - ], - "internalType": "struct ServiceAgreementStructsV1.ProofInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "sendProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "assetContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "keyword", - "type": "bytes" - }, - { - "internalType": "uint8", - "name": "hashFunctionId", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "epoch", - "type": "uint16" - } - ], - "internalType": "struct ServiceAgreementStructsV1.CommitInputArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "submitCommit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "assetOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - } - ], - "name": "terminateAgreement", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ShardingTable.json b/dkg/data/interfaces/ShardingTable.json deleted file mode 100644 index 28a5cc1..0000000 --- a/dkg/data/interfaces/ShardingTable.json +++ /dev/null @@ -1,294 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "ask", - "type": "uint96" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "name": "NodeAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - } - ], - "name": "NodeRemoved", - "type": "event" - }, - { - "inputs": [], - "name": "getShardingTable", - "outputs": [ - { - "components": [ - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - }, - { - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "internalType": "struct ShardingTableStructs.NodeInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "startingIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nodesNumber", - "type": "uint72" - } - ], - "name": "getShardingTable", - "outputs": [ - { - "components": [ - { - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "ask", - "type": "uint96" - }, - { - "internalType": "uint96", - "name": "stake", - "type": "uint96" - } - ], - "internalType": "struct ShardingTableStructs.NodeInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "pushBack", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "pushFront", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "removeNode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "shardingTableStorage", - "outputs": [ - { - "internalType": "contract ShardingTableStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingStorage", - "outputs": [ - { - "internalType": "contract StakingStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/ShardingTableStorage.json b/dkg/data/interfaces/ShardingTableStorage.json deleted file mode 100644 index 61ac368..0000000 --- a/dkg/data/interfaces/ShardingTableStorage.json +++ /dev/null @@ -1,317 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - } - ], - "name": "createNodeObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decrementNodesCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "deleteNodeObject", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "firstIdentityId", - "type": "uint72" - }, - { - "internalType": "uint16", - "name": "nodesNumber", - "type": "uint16" - } - ], - "name": "getMultipleNodes", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - } - ], - "internalType": "struct ShardingTableStructs.Node[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "prevIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "nextIdentityId", - "type": "uint72" - } - ], - "internalType": "struct ShardingTableStructs.Node", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "head", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "incrementNodesCount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "leftNodeIdentityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "rightNodeIdentityId", - "type": "uint72" - } - ], - "name": "link", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "nodeExists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nodesCount", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "setHead", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "newNextIdentityId", - "type": "uint72" - } - ], - "name": "setNextIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint72", - "name": "newPrevIdentityId", - "type": "uint72" - } - ], - "name": "setPrevIdentityId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "setTail", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tail", - "outputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - } -] diff --git a/dkg/data/interfaces/Staking.json b/dkg/data/interfaces/Staking.json deleted file mode 100644 index f2edd99..0000000 --- a/dkg/data/interfaces/Staking.json +++ /dev/null @@ -1,482 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "oldAccumulatedOperatorFee", - "type": "uint96" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "newAccumulatedOperatorFee", - "type": "uint96" - } - ], - "name": "AccumulatedOperatorFeeIncreased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "operatorFee", - "type": "uint8" - } - ], - "name": "OperatorFeeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "oldStake", - "type": "uint96" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "newStake", - "type": "uint96" - } - ], - "name": "StakeIncreased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "oldStake", - "type": "uint96" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "newStake", - "type": "uint96" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalPeriodEnd", - "type": "uint256" - } - ], - "name": "StakeWithdrawalStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "nodeId", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint96", - "name": "withdrawnStakeAmount", - "type": "uint96" - } - ], - "name": "StakeWithdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "agreementId", - "type": "bytes32" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "rewardAmount", - "type": "uint96" - } - ], - "name": "addReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "stakeAmount", - "type": "uint96" - } - ], - "name": "addStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "stakeAmount", - "type": "uint96" - } - ], - "name": "addStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identityStorage", - "outputs": [ - { - "internalType": "contract IdentityStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "parametersStorage", - "outputs": [ - { - "internalType": "contract ParametersStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "profileStorage", - "outputs": [ - { - "internalType": "contract ProfileStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "serviceAgreementStorageProxy", - "outputs": [ - { - "internalType": "contract ServiceAgreementStorageProxy", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint8", - "name": "operatorFee", - "type": "uint8" - } - ], - "name": "setOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "setStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "shardingTableContract", - "outputs": [ - { - "internalType": "contract ShardingTable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "shardingTableStorage", - "outputs": [ - { - "internalType": "contract ShardingTableStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "slash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakingStorage", - "outputs": [ - { - "internalType": "contract StakingStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "sharesToBurn", - "type": "uint96" - } - ], - "name": "startStakeWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - } - ], - "name": "withdrawStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/dkg/data/interfaces/StakingStorage.json b/dkg/data/interfaces/StakingStorage.json deleted file mode 100644 index 4858c3f..0000000 --- a/dkg/data/interfaces/StakingStorage.json +++ /dev/null @@ -1,407 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedOTPWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MisplacedTokensWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "custodian", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "uint96", - "name": "amount", - "type": "uint96" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "createWithdrawalRequest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "deleteWithdrawalRequest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "getWithdrawalRequestAmount", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "getWithdrawalRequestTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "name": "operatorFees", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "operatorFee", - "type": "uint96" - } - ], - "name": "setOperatorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "uint96", - "name": "newTotalStake", - "type": "uint96" - } - ], - "name": "setTotalStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tokenContract", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - } - ], - "name": "totalStakes", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint96", - "name": "stakeAmount", - "type": "uint96" - } - ], - "name": "transferStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable", - "name": "custodian", - "type": "address" - } - ], - "name": "transferTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawMisplacedOTP", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenContractAddress", - "type": "address" - } - ], - "name": "withdrawMisplacedTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "identityId", - "type": "uint72" - }, - { - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "withdrawalRequestExists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint72", - "name": "", - "type": "uint72" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "withdrawalRequests", - "outputs": [ - { - "internalType": "uint96", - "name": "amount", - "type": "uint96" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/dkg/data/interfaces/WhitelistStorage.json b/dkg/data/interfaces/WhitelistStorage.json deleted file mode 100644 index 7ca351d..0000000 --- a/dkg/data/interfaces/WhitelistStorage.json +++ /dev/null @@ -1,124 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "hubAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "blacklistAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "disableWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "hub", - "outputs": [ - { - "internalType": "contract Hub", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "whitelistAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "whitelisted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "whitelistingEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/dkg/dataclasses.py b/dkg/dataclasses.py index 526b094..7b49ee3 100644 --- a/dkg/dataclasses.py +++ b/dkg/dataclasses.py @@ -15,11 +15,12 @@ # specific language governing permissions and limitations # under the License. +from dataclasses import dataclass from enum import auto, Enum import pandas as pd -from dkg.types import AutoStrEnum, AutoStrEnumUpperCase +from dkg.types import AutoStrEnum, AutoStrEnumCapitalize, AutoStrEnumUpperCase class BlockchainResponseDict(dict): @@ -42,6 +43,7 @@ class BidSuggestionRange(AutoStrEnum): HIGH = auto() ALL = auto() + class KnowledgeAssetEnumStates(AutoStrEnumUpperCase): LATEST = auto() LATEST_FINALIZED = auto() @@ -51,3 +53,13 @@ class KnowledgeAssetContentVisibility(AutoStrEnumUpperCase): ALL = auto() PUBLIC = auto() PRIVATE = auto() + + +class ParanetIncentivizationType(AutoStrEnumCapitalize): + NEUROWEB = auto() + + +@dataclass +class BaseIncentivesPoolParams: + def to_contract_args(self) -> dict: + raise NotImplementedError("This method should be overridden in subclasses") diff --git a/dkg/main.py b/dkg/main.py index cf2392c..c9c14d4 100644 --- a/dkg/main.py +++ b/dkg/main.py @@ -18,12 +18,13 @@ from functools import wraps from dkg.assertion import Assertion -from dkg.asset import ContentAsset +from dkg.asset import KnowledgeAsset from dkg.graph import Graph from dkg.manager import DefaultRequestManager from dkg.module import Module from dkg.network import Network from dkg.node import Node +from dkg.paranet import Paranet from dkg.providers import BlockchainProvider, NodeHTTPProvider from dkg.types import UAL, Address, ChecksumAddress from dkg.utils.ual import format_ual, parse_ual @@ -31,7 +32,8 @@ class DKG(Module): assertion: Assertion - asset: ContentAsset + asset: KnowledgeAsset + paranet: Paranet network: Network node: Node graph: Graph @@ -56,7 +58,8 @@ def __init__( self.manager = DefaultRequestManager(node_provider, blockchain_provider) modules = { "assertion": Assertion(self.manager), - "asset": ContentAsset(self.manager), + "asset": KnowledgeAsset(self.manager), + "paranet": Paranet(self.manager), "network": Network(self.manager), "node": Node(self.manager), "graph": Graph(self.manager), diff --git a/dkg/method.py b/dkg/method.py index c1ab682..b149de8 100644 --- a/dkg/method.py +++ b/dkg/method.py @@ -21,8 +21,11 @@ from dkg.exceptions import ValidationError from dkg.types import TFunc -from dkg.utils.blockchain_request import (ContractInteraction, - ContractTransaction, JSONRPCRequest) +from dkg.utils.blockchain_request import ( + ContractInteraction, + ContractTransaction, + JSONRPCRequest, +) from dkg.utils.node_request import NodeCall from dkg.utils.string_transformations import snake_to_camel @@ -50,48 +53,21 @@ def process_args(self, *args: Any, **kwargs: Any): case JSONRPCRequest(): return {"args": self._validate_and_map(self.action.args, args, kwargs)} case ContractInteraction(): + contract = kwargs.pop("contract", None) + if not self.action.contract: + if contract: + self.action.contract = contract + else: + raise ValidationError( + "ContractInteraction requires a 'contract' to be provided" + ) + return { "args": self._validate_and_map(self.action.args, args, kwargs), "state_changing": isinstance(self.action, ContractTransaction), } case NodeCall(): - path_placeholders = re.findall(r"\{([^{}]+)?\}", self.action.path) - - args_in_path = 0 - path_args = [] - path_kwargs = {} - if len(path_placeholders) > 0: - for placeholder in path_placeholders: - if (placeholder != "") and (placeholder in kwargs.keys()): - path_kwargs[placeholder] = kwargs.pop(placeholder) - else: - if len(args) <= args_in_path: - raise ValidationError( - "Number of given arguments can't be smaller than " - "number of path placeholders" - ) - - if placeholder == "": - path_args.append(args[args_in_path]) - else: - path_kwargs[placeholder] = args[args_in_path] - - args_in_path += 1 - - return { - "path": self.action.path.format(*path_args, **path_kwargs), - "params": self._validate_and_map( - self.action.params, args[args_in_path:], kwargs - ) - if self.action.params - else {}, - "data": self._validate_and_map( - self.action.data, args[args_in_path:], kwargs - ) - if self.action.data - else {}, - } - + return self._process_node_call_args(args, kwargs) case _: return {} @@ -129,3 +105,43 @@ def _validate_and_map( ) return processed_args + + def _process_node_call_args( + self, args: list[Any], kwargs: dict[str, Any] + ) -> dict[str, Any]: + path_placeholders = re.findall(r"\{([^{}]+)?\}", self.action.path) + + args_in_path = 0 + path_args = [] + path_kwargs = {} + if len(path_placeholders) > 0: + for placeholder in path_placeholders: + if (placeholder != "") and (placeholder in kwargs.keys()): + path_kwargs[placeholder] = kwargs.pop(placeholder) + else: + if len(args) <= args_in_path: + raise ValidationError( + "Number of given arguments can't be smaller than " + "number of path placeholders" + ) + + if placeholder == "": + path_args.append(args[args_in_path]) + else: + path_kwargs[placeholder] = args[args_in_path] + + args_in_path += 1 + + return { + "path": self.action.path.format(*path_args, **path_kwargs), + "params": self._validate_and_map( + self.action.params, args[args_in_path:], kwargs + ) + if self.action.params + else {}, + "data": self._validate_and_map( + self.action.data, args[args_in_path:], kwargs + ) + if self.action.data + else {}, + } diff --git a/dkg/module.py b/dkg/module.py index 7775fa8..d215308 100644 --- a/dkg/module.py +++ b/dkg/module.py @@ -34,6 +34,7 @@ def caller(*args: Any, **kwargs: Any) -> TReturn: processed_args = method.process_args(*args, **kwargs) request_params = asdict(method.action) request_params.update(processed_args) + return self.manager.blocking_request(type(method.action), request_params) return caller diff --git a/dkg/network.py b/dkg/network.py index 3be3fda..47f4fbc 100644 --- a/dkg/network.py +++ b/dkg/network.py @@ -38,7 +38,7 @@ def get_bid_suggestion( public_assertion_id: DataHexStr, size_in_bytes: int, epochs_number: int, - range: BidSuggestionRange = BidSuggestionRange.LOW.value, + range: BidSuggestionRange = BidSuggestionRange.LOW, ) -> int: content_asset_storage_address = self._get_asset_storage_address( "ContentAssetStorage" diff --git a/dkg/paranet.py b/dkg/paranet.py new file mode 100644 index 0000000..4389af4 --- /dev/null +++ b/dkg/paranet.py @@ -0,0 +1,477 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import json + +from dataclasses import dataclass +from web3 import Web3 +from web3.contract import Contract +from web3.types import TxReceipt + +from dkg.dataclasses import BaseIncentivesPoolParams, ParanetIncentivizationType +from dkg.manager import DefaultRequestManager +from dkg.method import Method +from dkg.module import Module +from dkg.types import Address, UAL, HexStr +from dkg.utils.blockchain_request import BlockchainRequest +from dkg.utils.ual import parse_ual + + +class Paranet(Module): + @dataclass + class NeuroWebIncentivesPoolParams(BaseIncentivesPoolParams): + neuro_emission_multiplier: float + operator_percentage: float + voters_percentage: float + + def to_contract_args(self) -> dict: + return { + "tracToNeuroEmissionMultiplier": int( + self.neuro_emission_multiplier * (10**12) + ), + "paranetOperatorRewardPercentage": int(self.operator_percentage * 100), + "paranetIncentivizationProposalVotersRewardPercentage": int( + self.voters_percentage * 100 + ), + } + + def __init__(self, manager: DefaultRequestManager): + self.manager = manager + self.incentives_pools_deployment_functions = { + ParanetIncentivizationType.NEUROWEB: self._deploy_neuro_incentives_pool, + } + + _register_paranet = Method(BlockchainRequest.register_paranet) + + def create( + self, ual: UAL, name: str, description: str + ) -> dict[str, str | HexStr | TxReceipt]: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + receipt: TxReceipt = self._register_paranet( + knowledge_asset_storage, + knowledge_asset_token_id, + name, + description, + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _deploy_neuro_incentives_pool = Method( + BlockchainRequest.deploy_neuro_incentives_pool + ) + + def deploy_incentives_contract( + self, + ual: UAL, + incentives_pool_parameters: NeuroWebIncentivesPoolParams, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> dict[str, str | HexStr | TxReceipt]: + deploy_incentives_pool_fn = self.incentives_pools_deployment_functions.get( + incentives_type, + None, + ) + + if deploy_incentives_pool_fn is None: + raise ValueError( + f"{incentives_type} Incentive Type isn't supported. Supported " + f"Incentive Types: {self.incentives_pools_deployment_functions.keys()}" + ) + + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + receipt: TxReceipt = deploy_incentives_pool_fn( + knowledge_asset_storage, + knowledge_asset_token_id, + **incentives_pool_parameters.to_contract_args(), + ) + + events = self.manager.blockchain_provider.decode_logs_event( + receipt, + "ParanetIncentivesPoolFactory", + "ParanetIncetivesPoolDeployed", + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "incentivesPoolAddress": events[0].args["incentivesPool"]["addr"], + "operation": json.loads(Web3.to_json(receipt)), + } + + _get_incentives_pool_address = Method(BlockchainRequest.get_incentives_pool_address) + + def get_incentives_pool_address( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> Address: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + paranet_id = Web3.solidity_keccak( + ["address", "uint256"], [knowledge_asset_storage, knowledge_asset_token_id] + ) + + return self._get_incentives_pool_address(paranet_id, incentives_type) + + _register_paranet_service = Method(BlockchainRequest.register_paranet_service) + + def create_service( + self, ual: UAL, name: str, description: str, addresses: list[Address] + ) -> dict[str, str | HexStr | TxReceipt]: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + receipt: TxReceipt = self._register_paranet_service( + knowledge_asset_storage, + knowledge_asset_token_id, + name, + description, + addresses, + ) + + return { + "paranetServiceUAL": ual, + "paranetServiceId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _add_paranet_services = Method(BlockchainRequest.add_paranet_services) + + def add_services( + self, ual: UAL, services_uals: list[UAL] + ) -> dict[str, str | HexStr | TxReceipt]: + parsed_paranet_ual = parse_ual(ual) + paranet_knowledge_asset_storage, paranet_knowledge_asset_token_id = ( + parsed_paranet_ual["contract_address"], + parsed_paranet_ual["token_id"], + ) + + parsed_service_uals = [] + for service_ual in services_uals: + parsed_service_ual = parse_ual(service_ual) + (service_knowledge_asset_storage, service_knowledge_asset_token_id) = ( + parsed_service_ual["contract_address"], + parsed_service_ual["token_id"], + ) + + parsed_service_uals.append( + { + "knowledgeAssetStorageContract": service_knowledge_asset_storage, + "tokenId": service_knowledge_asset_token_id, + } + ) + + receipt: TxReceipt = self._add_paranet_services( + paranet_knowledge_asset_storage, + paranet_knowledge_asset_token_id, + parsed_service_uals, + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [paranet_knowledge_asset_storage, paranet_knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _is_knowledge_miner_registered = Method( + BlockchainRequest.is_knowledge_miner_registered + ) + + def is_knowledge_miner(self, ual: UAL, address: Address | None = None) -> bool: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + paranet_id = Web3.solidity_keccak( + ["address", "uint256"], [knowledge_asset_storage, knowledge_asset_token_id] + ) + + return self._is_knowledge_miner_registered( + paranet_id, address or self.manager.blockchain_provider.account.address + ) + + _owner_of = Method(BlockchainRequest.owner_of) + + def is_operator(self, ual: UAL, address: Address | None = None) -> bool: + knowledge_asset_token_id = parse_ual(ual)["token_id"] + + return self._owner_of(knowledge_asset_token_id) == ( + address or self.manager.blockchain_provider.account.address + ) + + _is_proposal_voter = Method(BlockchainRequest.is_proposal_voter) + + def is_voter( + self, + ual: UAL, + address: Address | None = None, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> bool: + return self._is_proposal_voter( + contract=self._get_incentives_pool_contract(ual, incentives_type), + addr=address or self.manager.blockchain_provider.account.address, + ) + + _get_claimable_knowledge_miner_reward_amount = Method( + BlockchainRequest.get_claimable_knowledge_miner_reward_amount + ) + + def calculate_claimable_miner_reward_amount( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> int: + return self._get_claimable_knowledge_miner_reward_amount( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + _get_claimable_all_knowledge_miners_reward_amount = Method( + BlockchainRequest.get_claimable_all_knowledge_miners_reward_amount + ) + + def calculate_all_claimable_miner_rewards_amount( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> int: + return self._get_claimable_all_knowledge_miners_reward_amount( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + _claim_knowledge_miner_reward = Method( + BlockchainRequest.claim_knowledge_miner_reward + ) + + def claim_miner_reward( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> dict[str, str | HexStr | TxReceipt]: + receipt: TxReceipt = self._claim_knowledge_miner_reward( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _get_claimable_paranet_operator_reward_amount = Method( + BlockchainRequest.get_claimable_paranet_operator_reward_amount + ) + + def calculate_claimable_operator_reward_amount( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> int: + return self._get_claimable_paranet_operator_reward_amount( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + _claim_paranet_operator_reward = Method( + BlockchainRequest.claim_paranet_operator_reward + ) + + def claim_operator_reward( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> dict[str, str | HexStr | TxReceipt]: + receipt: TxReceipt = self._claim_paranet_operator_reward( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _get_claimable_proposal_voter_reward_amount = Method( + BlockchainRequest.get_claimable_proposal_voter_reward_amount + ) + + def calculate_claimable_voter_reward_amount( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> int: + return self._get_claimable_proposal_voter_reward_amount( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + _get_claimable_all_proposal_voters_reward_amount = Method( + BlockchainRequest.get_claimable_all_proposal_voters_reward_amount + ) + + def calculate_all_claimable_voters_reward_amount( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> int: + return self._get_claimable_all_proposal_voters_reward_amount( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + _claim_incentivization_proposal_voter_reward = Method( + BlockchainRequest.claim_incentivization_proposal_voter_reward + ) + + def claim_voter_reward( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> dict[str, str | HexStr | TxReceipt]: + receipt: TxReceipt = self._claim_incentivization_proposal_voter_reward( + contract=self._get_incentives_pool_contract(ual, incentives_type) + ) + + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + return { + "paranetUAL": ual, + "paranetId": Web3.to_hex( + Web3.solidity_keccak( + ["address", "uint256"], + [knowledge_asset_storage, knowledge_asset_token_id], + ) + ), + "operation": json.loads(Web3.to_json(receipt)), + } + + _get_updating_knowledge_asset_states = Method( + BlockchainRequest.get_updating_knowledge_asset_states + ) + _process_updated_knowledge_asset_states_metadata = Method( + BlockchainRequest.process_updated_knowledge_asset_states_metadata + ) + + def update_claimable_rewards(self, ual: UAL) -> dict[str, str | HexStr | TxReceipt]: + parsed_ual = parse_ual(ual) + knowledge_asset_storage, knowledge_asset_token_id = ( + parsed_ual["contract_address"], + parsed_ual["token_id"], + ) + + paranet_id = Web3.solidity_keccak( + ["address", "uint256"], [knowledge_asset_storage, knowledge_asset_token_id] + ) + + updating_states = self._get_updating_knowledge_asset_states( + self.manager.blockchain_provider.account.address, + paranet_id, + ) + receipt: TxReceipt = self._process_updated_knowledge_asset_states_metadata( + knowledge_asset_storage, + knowledge_asset_token_id, + 0, + len(updating_states), + ) + + return { + "paranetUAL": ual, + "paranetId": paranet_id, + "operation": json.loads(Web3.to_json(receipt)), + } + + def _get_incentives_pool_contract( + self, + ual: UAL, + incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB, + ) -> str | dict[str, str]: + incentives_pool_name = f"Paranet{str(incentives_type)}IncentivesPool" + is_incentives_pool_cached = ( + incentives_pool_name in self.manager.blockchain_provider.contracts.keys() + ) + + return ( + incentives_pool_name + if is_incentives_pool_cached + else { + "name": incentives_pool_name, + "address": self.get_incentives_pool_address(ual, incentives_type), + } + ) diff --git a/dkg/providers/blockchain.py b/dkg/providers/blockchain.py index 7478b7b..7217d15 100644 --- a/dkg/providers/blockchain.py +++ b/dkg/providers/blockchain.py @@ -24,8 +24,12 @@ import requests from dkg.constants import BLOCKCHAINS, DEFAULT_GAS_PRICE_GWEI -from dkg.exceptions import (AccountMissing, EnvironmentNotSupported, - NetworkNotSupported, RPCURINotDefined) +from dkg.exceptions import ( + AccountMissing, + EnvironmentNotSupported, + NetworkNotSupported, + RPCURINotDefined, +) from dkg.types import URI, Address, DataHexStr, Environment, Wei from eth_account.signers.local import LocalAccount from web3 import Web3 @@ -96,13 +100,14 @@ def __init__( "Hub": self.w3.eth.contract( address=hub_address, abi=self.abi["Hub"], + decode_tuples=True, ) } self._init_contracts() if ( - private_key is not None or - (private_key_env := os.environ.get("PRIVATE_KEY", None)) is not None + private_key is not None + or (private_key_env := os.environ.get("PRIVATE_KEY", None)) is not None ): self.set_account(private_key or private_key_env) @@ -125,33 +130,48 @@ def wrapper(self, *args, **kwargs): except Exception as err: if ( contract_name + and isinstance(contract_name, str) and any(msg in str(err) for msg in ["revert", "VM Exception"]) and not self._check_contract_status(contract_name) ): - self._update_contract_instance(contract_name) - return func(self, *args, **kwargs) - raise + is_updated = self._update_contract_instance(contract_name) + if is_updated: + return func(self, *args, **kwargs) + raise err return wrapper @handle_updated_contract def call_function( self, - contract: str, + contract: str | dict[str, str], function: str, args: dict[str, Any] = {}, state_changing: bool = False, gas_price: Wei | None = None, gas_limit: Wei | None = None, ) -> TxReceipt | Any: - contract_instance = self.contracts[contract] + if isinstance(contract, str): + contract_name = contract + contract_instance = self.contracts[contract_name] + else: + contract_name = contract["name"] + contract_instance = self.w3.eth.contract( + address=contract["address"], + abi=self.abi[contract_name], + decode_tuples=True, + ) + self.contracts[contract_name] = contract_instance + contract_function: ContractFunction = getattr( contract_instance.functions, function ) if not state_changing: result = contract_function(**args).call() - if function in (output_named_tuples := self.output_named_tuples[contract]): + if function in ( + output_named_tuples := self.output_named_tuples[contract_name] + ): result = output_named_tuples[function](*result) return result else: @@ -196,8 +216,7 @@ def _get_network_gas_price(self) -> Wei | None: blockchain_name, _ = self.blockchain_id.split(":") default_gas_price = self.w3.to_wei( - DEFAULT_GAS_PRICE_GWEI[blockchain_name], - "gwei" + DEFAULT_GAS_PRICE_GWEI[blockchain_name], "gwei" ) def fetch_gas_price(oracle_url: str) -> Wei | None: @@ -207,9 +226,9 @@ def fetch_gas_price(oracle_url: str) -> Wei | None: data: dict = response.json() if "result" in data: - return int(data['result'], 16) + return int(data["result"], 16) elif "average" in data: - return self.w3.to_wei(data['average'], 'gwei') + return self.w3.to_wei(data["average"], "gwei") else: return None except Exception: @@ -224,7 +243,7 @@ def fetch_gas_price(oracle_url: str) -> Wei | None: gas_price = fetch_gas_price(oracle_url) if gas_price is not None: return gas_price - + return default_gas_price def _init_contracts(self): @@ -234,17 +253,26 @@ def _init_contracts(self): self._update_contract_instance(contract) - def _update_contract_instance(self, contract: str): - self.contracts[contract] = self.w3.eth.contract( - address=( - self.contracts["Hub"] - .functions.getContractAddress(contract).call() - if not contract.endswith("AssetStorage") - else self.contracts["Hub"] - .functions.getAssetStorageAddress(contract).call() - ), - abi=self.abi[contract], - ) + def _update_contract_instance(self, contract: str) -> bool: + if ( + self.contracts["Hub"].functions.isContract(contractName=contract).call() + or self.contracts["Hub"] + .functions.isAssetStorage(assetStorageName=contract) + .call() + ): + self.contracts[contract] = self.w3.eth.contract( + address=( + self.contracts["Hub"].functions.getContractAddress(contract).call() + if not contract.endswith("AssetStorage") + else self.contracts["Hub"] + .functions.getAssetStorageAddress(contract) + .call() + ), + abi=self.abi[contract], + decode_tuples=True, + ) + return True + return False def _check_contract_status(self, contract: str) -> bool: try: diff --git a/dkg/types/__init__.py b/dkg/types/__init__.py index 352396d..7cd005d 100644 --- a/dkg/types/__init__.py +++ b/dkg/types/__init__.py @@ -1,4 +1,4 @@ -from .general import AutoStrEnum, AutoStrEnumUpperCase # NOQA: F401 +from .general import AutoStrEnum, AutoStrEnumCapitalize, AutoStrEnumUpperCase # NOQA: F401 from .blockchain import (ABI, ABIElement, ABIError, ABIEvent, # NOQA: F401 ABIFunction, ABIParameter, AgreementData, Environment) from .dkg_node import UAL # NOQA: F401 diff --git a/dkg/types/general.py b/dkg/types/general.py index 0c19370..7867681 100644 --- a/dkg/types/general.py +++ b/dkg/types/general.py @@ -21,9 +21,24 @@ class AutoStrEnum(str, Enum): @staticmethod def _generate_next_value_(name: str, start: int, count: int, last_values: list) -> str: return name.lower() + + def __str__(self): + return str(self.value) + + +class AutoStrEnumCapitalize(str, Enum): + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: list) -> str: + return name.capitalize() + + def __str__(self): + return str(self.value) class AutoStrEnumUpperCase(str, Enum): @staticmethod def _generate_next_value_(name: str, start: int, count: int, last_values: list) -> str: - return name \ No newline at end of file + return name + + def __str__(self): + return str(self.value) \ No newline at end of file diff --git a/dkg/utils/blockchain_request.py b/dkg/utils/blockchain_request.py index b55b7f9..b684b9b 100644 --- a/dkg/utils/blockchain_request.py +++ b/dkg/utils/blockchain_request.py @@ -18,6 +18,7 @@ from dataclasses import dataclass, field from typing import Type +from dkg.dataclasses import ParanetIncentivizationType from dkg.types import Address, HexStr, Wei @@ -29,10 +30,16 @@ class JSONRPCRequest: @dataclass class ContractInteraction: - contract: str - function: str + contract: str | None = None + function: str = field(default_factory=str) args: dict[str, Type] = field(default_factory=dict) + def __post_init__(self): + if not self.function: + raise ValueError( + "'function' is a required field and cannot be None or empty" + ) + @dataclass class ContractTransaction(ContractInteraction): @@ -154,11 +161,149 @@ class BlockchainRequest: get_service_agreement_data = ContractCall( contract="ServiceAgreementStorageProxy", function="getAgreementData", - args={"agreementId": HexStr}, + args={"agreementId": bytes | HexStr}, ) get_assertion_size = ContractCall( contract="AssertionStorage", function="getAssertionSize", - args={"assertionId": HexStr}, + args={"assertionId": bytes | HexStr}, + ) + + # Paranets + register_paranet = ContractTransaction( + contract="Paranet", + function="registerParanet", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "paranetName": str, + "paranetDescription": str, + }, + ) + add_paranet_services = ContractTransaction( + contract="Paranet", + function="addParanetServices", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "services": dict[str, Address | int], + }, + ) + register_paranet_service = ContractTransaction( + contract="Paranet", + function="registerParanetService", + args={ + "paranetServiceKAStorageContract": Address, + "paranetServiceKATokenId": int, + "paranetServiceName": str, + "paranetServiceDescription": str, + "paranetServiceAddresses": list[Address], + }, + ) + mint_knowledge_asset = ContractTransaction( + contract="Paranet", + function="mintKnowledgeAsset", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "knowledgeAssetArgs": dict[str, bytes | int | Wei | bool], + }, + ) + submit_knowledge_asset = ContractTransaction( + contract="Paranet", + function="submitKnowledgeAsset", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "knowledgeAssetStorageContract": Address, + "knowledgeAssetTokenId": int, + }, + ) + + deploy_neuro_incentives_pool = ContractTransaction( + contract="ParanetIncentivesPoolFactory", + function="deployNeuroIncentivesPool", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "tracToNeuroEmissionMultiplier": float, + "paranetOperatorRewardPercentage": float, + "paranetIncentivizationProposalVotersRewardPercentage": float, + }, + ) + get_incentives_pool_address = ContractCall( + contract="ParanetsRegistry", + function="getIncentivesPoolAddress", + args={ + "paranetId": HexStr, + "incentivesPoolType": ParanetIncentivizationType, + }, + ) + + get_updating_knowledge_asset_states = ContractCall( + contract="ParanetKnowledgeMinersRegistry", + function="getUpdatingKnowledgeAssetStates", + args={ + "miner": Address, + "paranetId": HexStr, + }, + ) + process_updated_knowledge_asset_states_metadata = ContractTransaction( + contract="Paranet", + function="processUpdatedKnowledgeAssetStatesMetadata", + args={ + "paranetKAStorageContract": Address, + "paranetKATokenId": int, + "start": int, + "end": int, + }, + ) + + is_knowledge_miner_registered = ContractCall( + contract="ParanetsRegistry", + function="isKnowledgeMinerRegistered", + args={ + "paranetId": HexStr, + "knowledgeMinerAddress": Address, + }, + ) + is_proposal_voter = ContractCall( + function="isProposalVoter", + args={"addr": Address}, + ) + + get_claimable_knowledge_miner_reward_amount = ContractCall( + function="getClaimableKnowledgeMinerRewardAmount", + args={}, + ) + get_claimable_all_knowledge_miners_reward_amount = ContractCall( + function="getClaimableAllKnowledgeMinersRewardAmount", + args={}, + ) + claim_knowledge_miner_reward = ContractTransaction( + function="claimKnowledgeMinerReward", + args={}, + ) + + get_claimable_paranet_operator_reward_amount = ContractCall( + function="getClaimableParanetOperatorRewardAmount", + args={}, + ) + claim_paranet_operator_reward = ContractTransaction( + function="claimParanetOperatorReward", + args={}, + ) + + get_claimable_proposal_voter_reward_amount = ContractCall( + function="getClaimableProposalVoterRewardAmount", + args={}, + ) + get_claimable_all_proposal_voters_reward_amount = ContractCall( + function="getClaimableAllProposalVotersRewardAmount", + args={}, + ) + claim_incentivization_proposal_voter_reward = ContractTransaction( + function="claimIncentivizationProposalVoterReward", + args={}, ) diff --git a/examples/demo.py b/examples/demo.py index f302584..cdf60d1 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -26,7 +26,7 @@ node_provider = NodeHTTPProvider("http://localhost:8900") blockchain_provider = BlockchainProvider( "development", - "hardhat1:31337", + "hardhat2:31337", private_key="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", ) @@ -174,9 +174,7 @@ def print_json(json_dict: dict): print_json(update_asset_result) divider() -get_latest_asset_result = dkg.asset.get( - create_asset_result["UAL"], "latest", "all" -) +get_latest_asset_result = dkg.asset.get(create_asset_result["UAL"], "latest", "all") print("======================== ASSET LATEST RESOLVED") print_json(get_latest_asset_result) divider() diff --git a/examples/paranets_demo.py b/examples/paranets_demo.py new file mode 100644 index 0000000..6f79faf --- /dev/null +++ b/examples/paranets_demo.py @@ -0,0 +1,345 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import json +import time + +from hexbytes import HexBytes + +from dkg import DKG +from dkg.providers import BlockchainProvider, NodeHTTPProvider + +node_provider = NodeHTTPProvider("http://localhost:8900") +blockchain_provider = BlockchainProvider( + "development", + "hardhat2:31337", + private_key="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", +) + +dkg = DKG(node_provider, blockchain_provider) + + +def divider(): + print("==================================================") + print("==================================================") + print("==================================================") + + +def print_json(json_dict: dict): + def convert_hexbytes(data): + if isinstance(data, dict): + return {k: convert_hexbytes(v) for k, v in data.items()} + elif isinstance(data, list): + return [convert_hexbytes(i) for i in data] + elif isinstance(data, HexBytes): + return data.hex() + else: + return data + + serializable_dict = convert_hexbytes(json_dict) + print(json.dumps(serializable_dict, indent=4)) + + +divider() + +paranet_data = { + "public": { + "@context": ["http://schema.org"], + "@id": "uuid:1", + "company": "OT", + "city": {"@id": "uuid:belgrade"}, + } +} + +create_paranet_knowledge_asset_result = dkg.asset.create(paranet_data, 1) + +print("======================== PARANET KNOWLEDGE ASSET CREATED") +print_json(create_paranet_knowledge_asset_result) + +divider() + +paranet_ual = create_paranet_knowledge_asset_result["UAL"] +create_paranet_result = dkg.paranet.create( + paranet_ual, + "TestParanet", + "TestParanetDescription", +) + +print("======================== PARANET CREATED") +print_json(create_paranet_result) + +divider() + +paranet_service_data = { + "public": { + "@context": ["http://schema.org"], + "@id": "uuid:2", + "service": "AI Agent Bob", + "model": {"@id": "uuid:gpt4"}, + } +} + +create_paranet_service_knowledge_asset_result = dkg.asset.create( + paranet_service_data, 1 +) + +print("======================== PARANET SERVICE KNOWLEDGE ASSET CREATED") +print_json(create_paranet_service_knowledge_asset_result) + +divider() + +paranet_service_ual = create_paranet_service_knowledge_asset_result["UAL"] +create_paranet_service_result = dkg.paranet.create_service( + paranet_service_ual, + "TestParanetService", + "TestParanetServiceDescription", + ["0x03C094044301E082468876634F0b209E11d98452"], +) + +print("======================== PARANET SERVICE CREATED") +print_json(create_paranet_service_result) + +divider() + +add_services_result = dkg.paranet.add_services(paranet_ual, [paranet_service_ual]) + +print("======================== ADDED PARANET SERVICES") +print_json(add_services_result) + +divider() + +incentives_pool_params = dkg.paranet.NeuroWebIncentivesPoolParams( + neuro_emission_multiplier=1.1, + operator_percentage=10.5, + voters_percentage=5.5, +) +deploy_incentives_contract_result = dkg.paranet.deploy_incentives_contract( + paranet_ual, incentives_pool_params +) + +print("======================== PARANET NEURO INCENTIVES POOL DEPLOYED") +print_json(deploy_incentives_contract_result) + +divider() + +incentives_pool_address = dkg.paranet.get_incentives_pool_address(paranet_ual) + +print("======================== GOT PARANET NEURO INCENTIVES POOL ADDRESS") +print(incentives_pool_address) + +divider() + +incentives_amount = blockchain_provider.w3.to_wei(100, "ether") +tx_hash = blockchain_provider.w3.eth.send_transaction( + { + "from": blockchain_provider.account.address, + "to": incentives_pool_address, + "value": incentives_amount, + } +) + +print(f"======================== SENT {incentives_amount} TO THE INCENTIVES POOL") + +divider() + +is_knowledge_miner = dkg.paranet.is_knowledge_miner(paranet_ual) +is_operator = dkg.paranet.is_operator(paranet_ual) +is_voter = dkg.paranet.is_voter(paranet_ual) + +print(f"Is Knowledge Miner? {str(is_knowledge_miner)}") +print(f"Is Operator? {str(is_operator)}") +print(f"Is Voter? {str(is_voter)}") + +divider() + + +def print_reward_stats(is_voter: bool = False): + knowledge_miner_reward = dkg.paranet.calculate_claimable_miner_reward_amount( + paranet_ual + ) + operator_reward = dkg.paranet.calculate_claimable_operator_reward_amount( + paranet_ual + ) + + print( + f"Claimable Knowledge Miner Reward for the Current Wallet: {knowledge_miner_reward}" + ) + print( + f"Claimable Paranet Operator Reward for the Current Wallet: {operator_reward}" + ) + if is_voter: + voter_rewards = dkg.paranet.calculate_claimable_voter_reward_amount(paranet_ual) + print( + f"Claimable Proposal Voter Reward for the Current Wallet: {voter_rewards}" + ) + + divider() + + all_knowledge_miners_reward = ( + dkg.paranet.calculate_all_claimable_miner_rewards_amount(paranet_ual) + ) + all_voters_reward = dkg.paranet.calculate_all_claimable_voters_reward_amount( + paranet_ual + ) + + print(f"Claimable All Knowledge Miners Reward: {all_knowledge_miners_reward}") + print(f"Claimable Paranet Operator Reward: {operator_reward}") + print(f"Claimable All Proposal Voters Reward: {all_voters_reward}") + + +print_reward_stats(is_voter) + +divider() + +ka1 = { + "public": { + "@context": ["http://schema.org"], + "@id": "uuid:3", + "company": "KA1-Company", + "user": {"@id": "uuid:user:1"}, + "city": {"@id": "uuid:belgrade"}, + } +} + +create_submit_ka1_result = dkg.asset.create( + ka1, + 1, + 100000000000000000000, + paranet_ual=paranet_ual, +) + +print( + "======================== KNOWLEDGE ASSET #1 CREATED AND SUBMITTED TO THE PARANET" +) +print_json(create_submit_ka1_result) + +divider() + +ka2 = { + "public": { + "@context": ["http://schema.org"], + "@id": "uuid:4", + "company": "KA2-Company", + "user": {"@id": "uuid:user:2"}, + "city": {"@id": "uuid:madrid"}, + } +} + +create_ka2_result = dkg.asset.create(ka2, 1, 20000000000000000000) + +print("======================== KNOWLEDGE ASSET #2 CREATED") +print_json(create_ka2_result) + +ka2_ual = create_ka2_result["UAL"] +submit_ka2_result = dkg.asset.submit_to_paranet(ka2_ual, paranet_ual) + +print("======================== KNOWLEDGE ASSET #2 SUBMITTED TO THE PARANET") +print_json(submit_ka2_result) + +# divider() + +# federated_query = """ +# PREFIX schema: +# SELECT DISTINCT ?s ?city1 ?user1 ?s2 ?city2 ?user2 ?company1 +# WHERE {{ +# ?s schema:city ?city1 . +# ?s schema:company ?company1 . +# ?s schema:user ?user1; + +# SERVICE <{ual}> {{ +# ?s2 schema:city ?city2 . +# ?s2 schema:user ?user2; +# }} + +# filter(contains(str(?city2), "belgrade")) +# }} +# """ +# query_result = dkg.graph.query( +# federated_query.format(ual=ka2_ual), +# paranet_ual, +# ) + +# print("======================== GOT FEDERATED QUERY RESULT") +# print(query_result) + +divider() + +is_knowledge_miner = dkg.paranet.is_knowledge_miner(paranet_ual) +is_operator = dkg.paranet.is_operator(paranet_ual) +is_voter = dkg.paranet.is_voter(paranet_ual) + +print(f"Is Knowledge Miner? {str(is_knowledge_miner)}") +print(f"Is Operator? {str(is_operator)}") +print(f"Is Voter? {str(is_voter)}") + +divider() + +print_reward_stats(is_voter) + +divider() + +claim_miner_reward_result = dkg.paranet.claim_miner_reward(paranet_ual) + +print("======================== KNOWLEDGE MINER REWARD CLAIMED") +print_json(claim_miner_reward_result) + +divider() + +claim_operator_reward_result = dkg.paranet.claim_operator_reward(paranet_ual) + +print("======================== PARANET OPERATOR REWARD CLAIMED") +print(claim_operator_reward_result) + +divider() + +print_reward_stats() + +divider() + +update_asset_result = dkg.asset.update( + create_submit_ka1_result["UAL"], + { + "private": { + "@context": ["https://schema.org"], + "@graph": [ + { + "@id": "uuid:user:1", + "name": "Adam", + "lastname": "Smith", + }, + ], + }, + }, + 100000000000000000000 +) + +print("======================== KA1 UPDATED") +print_json(update_asset_result) + +print("Waiting 30 seconds for the update finalization...") +time.sleep(30) + +divider() + +update_claimable_rewards_result = dkg.paranet.update_claimable_rewards(paranet_ual) + +print("======================== UPDATED CLAIMABLE REWARDS") +print_json(update_claimable_rewards_result) + +divider() + +print_reward_stats() diff --git a/poetry.lock b/poetry.lock index 677c8aa..48f10da 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohttp" @@ -383,6 +383,100 @@ files = [ {file = "charset_normalizer-3.3.0-py3-none-any.whl", hash = "sha256:e46cd37076971c1040fc8c41273a8b3e2c624ce4f2be3f5dfcb7a430c1d3acc2"}, ] +[[package]] +name = "ckzg" +version = "1.0.2" +description = "Python bindings for C-KZG-4844" +optional = false +python-versions = "*" +files = [ + {file = "ckzg-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bdd082bc0f2a595e3546658ecbe1ff78fe65b0ab7e619a8197a62d94f46b5b46"}, + {file = "ckzg-1.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:50ca4af4e2f1a1e8b0a7e97b3aef39dedbb0d52d90866ece424f13f8df1b5972"}, + {file = "ckzg-1.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e9dc671b0a307ea65d0a216ca496c272dd3c1ed890ddc2a306da49b0d8ffc83"}, + {file = "ckzg-1.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d95e97a0d0f7758119bb905fb5688222b1556de465035614883c42fe4a047d1f"}, + {file = "ckzg-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27261672154cbd477d84d289845b0022fbdbe2ba45b7a2a2051c345fa04c8334"}, + {file = "ckzg-1.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c16d5ee1ddbbbad0367ff970b3ec9f6d1879e9f928023beda59ae9e16ad99e4c"}, + {file = "ckzg-1.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:09043738b029bdf4fdc82041b395cfc6f5b5cf63435e5d4d685d24fd14c834d3"}, + {file = "ckzg-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3c0afa232d2312e3101aaddb6971b486b0038a0f9171500bc23143f5749eff55"}, + {file = "ckzg-1.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:96e8281b6d58cf91b9559e1bd38132161d63467500838753364c68e825df2e2c"}, + {file = "ckzg-1.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b874167de1d6de72890a2ad5bd9aa7adbddc41c3409923b59cf4ef27f83f79da"}, + {file = "ckzg-1.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3d2ccd68b0743e20e853e31a08da490a8d38c7f12b9a0c4ee63ef5afa0dc2427"}, + {file = "ckzg-1.0.2-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e8d534ddbe785c44cf1cd62ee32d78b4310d66dd70e42851f5468af655b81f5"}, + {file = "ckzg-1.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c732cda00c76b326f39ae97edfc6773dd231b7c77288b38282584a7aee77c3a7"}, + {file = "ckzg-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abc5a27284db479ead4c053ff086d6e222914f1b0aa08b80eabfa116dbed4f7a"}, + {file = "ckzg-1.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6bd5006cb3e802744309450183087a6594d50554814eee19065f7064dff7b05"}, + {file = "ckzg-1.0.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3594470134eda7adf2813ad3f1da55ced98c8a393262f47ce3890c5afa05b23e"}, + {file = "ckzg-1.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fea56f39e48b60c1ff6f751c47489e353d1bd95cae65c429cf5f87735d794431"}, + {file = "ckzg-1.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:f769eb2e1056ca396462460079f6849c778f58884bb24b638ff7028dd2120b65"}, + {file = "ckzg-1.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e3cb2f8c767aee57e88944f90848e8689ce43993b9ff21589cfb97a562208fe7"}, + {file = "ckzg-1.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5b29889f5bc5db530f766871c0ff4133e7270ecf63aaa3ca756d3b2731980802"}, + {file = "ckzg-1.0.2-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfcc70fb76b3d36125d646110d5001f2aa89c1c09ff5537a4550cdb7951f44d4"}, + {file = "ckzg-1.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ca8a256cdd56d06bc5ef24caac64845240dbabca402c5a1966d519b2514b4ec"}, + {file = "ckzg-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ea91b0236384f93ad1df01d530672f09e254bd8c3cf097ebf486aebb97f6c8c"}, + {file = "ckzg-1.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:65311e72780105f239d1d66512629a9f468b7c9f2609b8567fc68963ac638ef9"}, + {file = "ckzg-1.0.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:0d7600ce7a73ac41d348712d0c1fe5e4cb6caa329377064cfa3a6fd8fbffb410"}, + {file = "ckzg-1.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:19893ee7bd7da8688382cb134cb9ee7bce5c38e3a9386e3ed99bb010487d2d17"}, + {file = "ckzg-1.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:c3e1a9a72695e777497e95bb2213316a1138f82d1bb5d67b9c029a522d24908e"}, + {file = "ckzg-1.0.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a2f59da9cb82b6a4be615f2561a255731eededa7ecd6ba4b2f2dedfc918ef137"}, + {file = "ckzg-1.0.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c915e1f2ef51657c3255d8b1e2aea6e0b93348ae316b2b79eaadfb17ad8f514e"}, + {file = "ckzg-1.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bcc0d2031fcabc4be37e9e602c926ef9347238d2f58c1b07e0c147f60b9e760b"}, + {file = "ckzg-1.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cdaad2745425d7708e76e8e56a52fdaf5c5cc1cfefd5129d24ff8dbe06a012d"}, + {file = "ckzg-1.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:1ec775649daade1b93041aac9c1660c2ad9828b57ccd2eeb5a3074d8f05e544a"}, + {file = "ckzg-1.0.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:02f9cc3e38b3702ec5895a1ebf927fd02b8f5c2f93c7cb9e438581b5b74472c8"}, + {file = "ckzg-1.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:0e816af31951b5e94e6bc069f21fe783427c190526e0437e16c4488a34ddcacc"}, + {file = "ckzg-1.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:651ba33ee2d7fefff14ca519a72996b733402f8b043fbfef12d5fe2a442d86d8"}, + {file = "ckzg-1.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:489763ad92e2175fb6ab455411f03ec104c630470d483e11578bf2e00608f283"}, + {file = "ckzg-1.0.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69e1376284e9a5094d7c4d3e552202d6b32a67c5acc461b0b35718d8ec5c7363"}, + {file = "ckzg-1.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb9d0b09ca1bdb5955b626d6645f811424ae0fcab47699a1a938a3ce0438c25f"}, + {file = "ckzg-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d87a121ace8feb6c9386f247e7e36ef55e584fc8a6b1bc2c60757a59c1efe364"}, + {file = "ckzg-1.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:97c27153fab853f017fed159333b27beeb2e0da834c92c9ecdc26d0e5c3983b3"}, + {file = "ckzg-1.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b26799907257c39471cb3665f66f7630797140131606085c2c94a7094ab6ddf2"}, + {file = "ckzg-1.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:283a40c625222560fda3dcb912b666f7d50f9502587b73c4358979f519f1c961"}, + {file = "ckzg-1.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:5f029822d27c52b9c3dbe5706408b099da779f10929be0422a09a34aa026a872"}, + {file = "ckzg-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:edaea8fb50b01c6c19768d9305ad365639a8cd804754277d5108dcae4808f00b"}, + {file = "ckzg-1.0.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:27be65c88d5d773a30e6f198719cefede7e25cad807384c3d65a09c11616fc9d"}, + {file = "ckzg-1.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9ac729c5c6f3d2c030c0bc8c9e10edc253e36f002cfe227292035009965d349"}, + {file = "ckzg-1.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1528bc2b95aac6d184a90b023602c40d7b11b577235848c1b5593c00cf51d37"}, + {file = "ckzg-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:071dc7fc179316ce1bfabaa056156e4e84f312c4560ab7b9529a3b9a84019df3"}, + {file = "ckzg-1.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:895044069de7010be6c7ee703f03fd7548267a0823cf60b9dd26ec50267dd9e8"}, + {file = "ckzg-1.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ed8c99cd3d9af596470e0481fd58931007288951719bad026f0dd486dd0ec11"}, + {file = "ckzg-1.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:74d87eafe561d4bfb544a4f3419d26c56ad7de00f39789ef0fdb09515544d12e"}, + {file = "ckzg-1.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:54d71e5ca416bd51c543f9f51e426e6792f8a0280b83aef92faad1b826f401ea"}, + {file = "ckzg-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:da2d9988781a09a4577ee7ea8f51fe4a94b4422789a523164f5ba3118566ad41"}, + {file = "ckzg-1.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d9e030af7d6acdcb356fddfb095048bc8e880fe4cd70ff2206c64f33bf384a0d"}, + {file = "ckzg-1.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:145ae31c3d499d1950567bd636dc5b24292b600296b9deb5523bc20d8f7b51c3"}, + {file = "ckzg-1.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d81e68e84d80084da298471ad5eaddfcc1cf73545cb24e9453550c8186870982"}, + {file = "ckzg-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c67064bbbeba1a6892c9c80b3d0c2a540ff48a5ca5356fdb2a8d998b264e43e6"}, + {file = "ckzg-1.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:99694917eb6decefc0d330d9887a89ea770824b2fa76eb830bab5fe57ea5c20c"}, + {file = "ckzg-1.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:fca227ce0ce3427254a113fdb3aed5ecd99c1fc670cb0c60cc8a2154793678e4"}, + {file = "ckzg-1.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a66a690d3d1801085d11de6825df47a99b465ff32dbe90be4a3c9f43c577da96"}, + {file = "ckzg-1.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:272adfe471380d10e4a0e1639d877e504555079a60233dd82249c799b15be81e"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:f37be0054ebb4b8ac6e6d5267290b239b09e7ddc611776051b4c3c4032d161ba"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:611c03a170f0f746180eeb0cc28cdc6f954561b8eb9013605a046de86520ee6b"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:75b2f0ab341f3c33702ce64e1c101116c7462a25686d0b1a0193ca654ad4f96e"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab29fc61fbd32096b82b02e6b18ae0d7423048d3540b7b90805b16ae10bdb769"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e43741e7453262aa3ba1754623d7864250b33751bd850dd548e3ed6bd1911093"}, + {file = "ckzg-1.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:155eacc237cb28c9eafda1c47a89e6e4550f1c2e711f2eee21e0bb2f4df75546"}, + {file = "ckzg-1.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d31d7fbe396a51f43375e38c31bc3a96c7996882582f95f3fcfd54acfa7b3ce6"}, + {file = "ckzg-1.0.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9d3d049186c9966e9140de39a9979d7adcfe22f8b02d2852c94d3c363235cc18"}, + {file = "ckzg-1.0.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88728fbd410d61bd5d655ac50b842714c38bc34ff717f73592132d28911fc88e"}, + {file = "ckzg-1.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:052d302058d72431acc9dd4a9c76854c8dfce10c698deef5252884e32a1ac7bf"}, + {file = "ckzg-1.0.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:633110a9431231664be2ad32baf10971547f18289d33967654581b9ae9c94a7e"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:f439c9e5297ae29a700f6d55de1525e2e295dbbb7366f0974c8702fca9e536b9"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:94f7eb080c00c0ccbd4fafad69f0b35b624a6a229a28e11d365b60b58a072832"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f876783ec654b7b9525503c2a0a1b086e5d4f52ff65cac7e8747769b0c2e5468"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7e039800e50592580171830e788ef4a1d6bb54300d074ae9f9119e92aefc568"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13a8cccf0070a29bc01493179db2e61220ee1a6cb17f8ea41c68a2f043ace87f"}, + {file = "ckzg-1.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4f86cef801d7b0838e17b6ee2f2c9e747447d91ad1220a701baccdf7ef11a3c8"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2433a89af4158beddebbdd66fae95b34d40f2467bee8dc40df0333de5e616b5f"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c49d5dc0918ad912777720035f9820bdbb6c7e7d1898e12506d44ab3c938d525"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:331d49bc72430a3f85ea6ecb55a0d0d65f66a21d61af5783b465906a741366d5"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86627bc33bc63b8de869d7d5bfa9868619a4f3e4e7082103935c52f56c66b5"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab6a2ba2706b5eaa1ce6bc7c4e72970bf9587e2e0e482e5fb4df1996bccb7a40"}, + {file = "ckzg-1.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8bca5e7c38d913fabc24ad09545f78ba23cfc13e1ac8250644231729ca908549"}, + {file = "ckzg-1.0.2.tar.gz", hash = "sha256:4295acc380f8d42ebea4a4a0a68c424a322bb335a33bad05c72ead8cbb28d118"}, +] + [[package]] name = "cytoolz" version = "0.12.2" @@ -515,17 +609,18 @@ tools = ["hypothesis (>=4.18.2,<5.0.0)"] [[package]] name = "eth-account" -version = "0.11.0" +version = "0.11.2" description = "eth-account: Sign Ethereum transactions and messages with local private keys" optional = false -python-versions = ">=3.8, <4" +python-versions = "<4,>=3.8" files = [ - {file = "eth-account-0.11.0.tar.gz", hash = "sha256:2ffc7a0c7538053a06a7d11495c16c7ad9897dd42be0f64ca7551e9f6e0738c3"}, - {file = "eth_account-0.11.0-py3-none-any.whl", hash = "sha256:76dd261ea096ee09e51455b0a4c99f22185516fdc062f63df0817c28f605e430"}, + {file = "eth-account-0.11.2.tar.gz", hash = "sha256:b43daf2c0ae43f2a24ba754d66889f043fae4d3511559cb26eb0122bae9afbbd"}, + {file = "eth_account-0.11.2-py3-none-any.whl", hash = "sha256:95157c262a9823c1e08be826d4bc304bf32f0c32e80afb38c126a325a64f651a"}, ] [package.dependencies] bitarray = ">=2.4.0" +ckzg = ">=0.4.3" eth-abi = ">=4.0.0-b.2" eth-keyfile = ">=0.6.0" eth-keys = ">=0.4.0" @@ -1868,21 +1963,21 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "web3" -version = "6.15.1" +version = "6.19.0" description = "web3.py" optional = false python-versions = ">=3.7.2" files = [ - {file = "web3-6.15.1-py3-none-any.whl", hash = "sha256:4e4a8313aa4556ecde61c852a62405b853b667498b07da6ff05c29fe8c79096b"}, - {file = "web3-6.15.1.tar.gz", hash = "sha256:f9e7eefc1b3c3d194868a4ef9583b625c18ea3f31a48ebe143183db74898f381"}, + {file = "web3-6.19.0-py3-none-any.whl", hash = "sha256:fb39683d6aa7586ce0ab0be4be392f8acb62c2503958079d61b59f2a0b883718"}, + {file = "web3-6.19.0.tar.gz", hash = "sha256:d27fbd4ac5aa70d0e0c516bd3e3b802fbe74bc159b407c34052d9301b400f757"}, ] [package.dependencies] aiohttp = ">=3.7.4.post0" eth-abi = ">=4.0.0" -eth-account = ">=0.8.0" +eth-account = ">=0.8.0,<0.13" eth-hash = {version = ">=0.5.1", extras = ["pycryptodome"]} -eth-typing = ">=3.0.0" +eth-typing = ">=3.0.0,<4.2.0 || >4.2.0" eth-utils = ">=2.1.0" hexbytes = ">=0.1.0,<0.4.0" jsonschema = ">=4.0.0" @@ -1895,11 +1990,10 @@ typing-extensions = ">=4.0.1" websockets = ">=10.0.0" [package.extras] -dev = ["black (>=22.1.0)", "build (>=0.9.0)", "bumpversion", "eth-tester[py-evm] (==v0.9.1-b.2)", "flake8 (==3.8.3)", "flaky (>=3.7.0)", "hypothesis (>=3.31.2)", "importlib-metadata (<5.0)", "ipfshttpclient (==0.8.0a2)", "isort (>=5.11.0)", "mypy (==1.4.1)", "py-geth (>=3.14.0)", "pytest (>=7.0.0)", "pytest-asyncio (>=0.18.1,<0.23)", "pytest-mock (>=1.10)", "pytest-watch (>=4.2)", "pytest-xdist (>=1.29)", "setuptools (>=38.6.0)", "sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=3.18.0)", "tqdm (>4.32)", "twine (>=1.13)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)", "when-changed (>=0.3.0)"] +dev = ["build (>=0.9.0)", "bumpversion", "eth-tester[py-evm] (>=0.11.0b1,<0.12.0b1)", "eth-tester[py-evm] (>=0.9.0b1,<0.10.0b1)", "flaky (>=3.7.0)", "hypothesis (>=3.31.2)", "importlib-metadata (<5.0)", "ipfshttpclient (==0.8.0a2)", "pre-commit (>=2.21.0)", "py-geth (>=3.14.0)", "pytest (>=7.0.0)", "pytest-asyncio (>=0.21.2,<0.23)", "pytest-mock (>=1.10)", "pytest-watch (>=4.2)", "pytest-xdist (>=1.29)", "setuptools (>=38.6.0)", "sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=3.18.0)", "tqdm (>4.32)", "twine (>=1.13)", "when-changed (>=0.3.0)"] docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] ipfs = ["ipfshttpclient (==0.8.0a2)"] -linter = ["black (>=22.1.0)", "flake8 (==3.8.3)", "isort (>=5.11.0)", "mypy (==1.4.1)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)"] -tester = ["eth-tester[py-evm] (==v0.9.1-b.2)", "py-geth (>=3.14.0)"] +tester = ["eth-tester[py-evm] (>=0.11.0b1,<0.12.0b1)", "eth-tester[py-evm] (>=0.9.0b1,<0.10.0b1)", "py-geth (>=3.14.0)"] [[package]] name = "websockets" @@ -2070,4 +2164,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "e69cc38402d3dc869bdca234d2b905022fbf152f641717910b78d809e89bde98" +content-hash = "97cba916d4b5c154da0cc8f5d42ab2de58ecad56fe22cc68dacd7e0157baf587" diff --git a/pyproject.toml b/pyproject.toml index 3fcb427..65a7476 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dkg" -version = "0.1.0-beta.7" +version = "1.0.0" description = "Python library for interacting with the OriginTrail Decentralized Knowledge Graph" authors = ["Uladzislau Hubar "] license = "Apache-2.0" @@ -9,7 +9,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" pyyaml = "^6.0.1" -web3 = "^6.15.1" +web3 = "^6.19.0" pandas = "^1.5.3" eth-account = "^0.11.0" rdflib = "^6.3.2"