From 1c21b7c470403d71d25a8a7109a2ab2f3b5222d2 Mon Sep 17 00:00:00 2001 From: SuperBatata Date: Sat, 12 Aug 2023 19:53:55 +0100 Subject: [PATCH 1/3] update nftkit version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 116e9dc..1e80619 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { testImplementation("io.kotest:kotest-assertions-json:5.5.5") // NftKit - implementation("id.walt:waltid-nftkit:1.2308101426.0") + implementation("id.walt:waltid-nftkit:1.2308121419.0") // HTTP / Client: ktor implementation("io.ktor:ktor-client-core:2.2.4") From e1eb87633a51f61cd1ffc651d96a9f55307a19bd Mon Sep 17 00:00:00 2001 From: SuperBatata Date: Sat, 12 Aug 2023 19:54:17 +0100 Subject: [PATCH 2/3] add creator address to idpconfig --- config/idp-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/idp-config.json b/config/idp-config.json index 6a9299d..5ad0234 100644 --- a/config/idp-config.json +++ b/config/idp-config.json @@ -109,7 +109,7 @@ "ALGORAND": { "chain": "TESTNET", "factorySmartContractAddress": "", - "smartContractAddress": "266553681", + "smartContractAddress": "GYFVJLKGSWQDHFBHBLABUXYHHSU544RV3WH4ZCF3S6HONSDP73TK4VGY3Y", "collectionPath": "" } } From a6cd1c14dd2eb1690d7be74e28cbb2684af0d2c1 Mon Sep 17 00:00:00 2001 From: SuperBatata Date: Sat, 12 Aug 2023 19:54:45 +0100 Subject: [PATCH 3/3] change nft verification function to verifyOwnerShipBasedOnCreatorAddress --- src/main/kotlin/id/walt/idp/nfts/NFTManager.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/id/walt/idp/nfts/NFTManager.kt b/src/main/kotlin/id/walt/idp/nfts/NFTManager.kt index 5823e65..417c9d1 100644 --- a/src/main/kotlin/id/walt/idp/nfts/NFTManager.kt +++ b/src/main/kotlin/id/walt/idp/nfts/NFTManager.kt @@ -86,9 +86,16 @@ object NFTManager { ChainEcosystem.FLOW -> VerificationService.verifyNftOwnershipInCollectionFlow(tokenConstraint.chain!!, tokenConstraint.smartContractAddress!!,account ,tokenConstraint.collectionPath!!) - ChainEcosystem.ALGORAND -> VerificationService.NFTsAlgorandOwnershipVerification(AlgorandChain.valueOf( - tokenConstraint.chain!!.toString() - ),account,tokenConstraint.smartContractAddress!!) +// ChainEcosystem.ALGORAND -> VerificationService.NFTsAlgorandOwnershipVerification(AlgorandChain.valueOf( +// tokenConstraint.chain!!.toString() +// ),account,tokenConstraint.smartContractAddress!!) + ChainEcosystem.ALGORAND-> AlgorandNftService.verifyOwnerShipBasedOnCreator( + account, + AlgorandChain.valueOf(tokenConstraint.chain!!.toString()), + tokenConstraint.smartContractAddress!!) + else -> false.also { + logger.error { "Collection ownership verification not supported for $ecosystem ecosystem" } + } } } else { println("data nft verification")