From f19ced2d32504a9bf420ce7e80a46316d948530f Mon Sep 17 00:00:00 2001
From: Serkan Reis <serkanreis@gmail.com>
Date: Thu, 16 Nov 2023 17:40:56 +0300
Subject: [PATCH] Blacklist minter & sg721 contract addresses for royalty
 payments

---
 components/collections/actions/Action.tsx           | 4 ++--
 components/openEdition/OpenEditionMinterCreator.tsx | 4 ++--
 pages/collections/create.tsx                        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/components/collections/actions/Action.tsx b/components/collections/actions/Action.tsx
index ac32de0..8ddda56 100644
--- a/components/collections/actions/Action.tsx
+++ b/components/collections/actions/Action.tsx
@@ -432,8 +432,8 @@ export const CollectionActions = ({
         if (contractInfoResponse !== undefined) {
           const contractInfo = JSON.parse(new TextDecoder().decode(contractInfoResponse as Uint8Array))
           // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-          if (contractInfo && !contractInfo.contract.includes('splits'))
-            throw new Error('The provided royalty payment address does not belong to a splits contract.')
+          if (contractInfo && (contractInfo.contract.includes('minter') || contractInfo.contract.includes('sg721')))
+            throw new Error('The provided royalty payment address does not belong to a compatible contract.')
           else console.log(contractInfo)
         }
       }
diff --git a/components/openEdition/OpenEditionMinterCreator.tsx b/components/openEdition/OpenEditionMinterCreator.tsx
index 9a1a9d5..81a3c0e 100644
--- a/components/openEdition/OpenEditionMinterCreator.tsx
+++ b/components/openEdition/OpenEditionMinterCreator.tsx
@@ -352,8 +352,8 @@ export const OpenEditionMinterCreator = ({
       if (contractInfoResponse !== undefined) {
         const contractInfo = JSON.parse(new TextDecoder().decode(contractInfoResponse as Uint8Array))
         // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-        if (contractInfo && !contractInfo.contract.includes('splits'))
-          throw new Error('The provided royalty payment address does not belong to a splits contract.')
+        if (contractInfo && (contractInfo.contract.includes('minter') || contractInfo.contract.includes('sg721')))
+          throw new Error('The provided royalty payment address does not belong to a compatible contract.')
         else console.log(contractInfo)
       }
     }
diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx
index 22544f7..b7d96c0 100644
--- a/pages/collections/create.tsx
+++ b/pages/collections/create.tsx
@@ -1121,8 +1121,8 @@ const CollectionCreationPage: NextPage = () => {
       if (contractInfoResponse !== undefined) {
         const contractInfo = JSON.parse(new TextDecoder().decode(contractInfoResponse as Uint8Array))
         // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-        if (contractInfo && !contractInfo.contract.includes('splits'))
-          throw new Error('The provided royalty payment address does not belong to a splits contract.')
+        if (contractInfo && (contractInfo.contract.includes('minter') || contractInfo.contract.includes('sg721')))
+          throw new Error('The provided royalty payment address does not belong to a compatible contract.')
         else console.log(contractInfo)
       }
     }