From f8a0d8e4254a76d3a5f2a1d43d7fb55cbdf1f2d1 Mon Sep 17 00:00:00 2001
From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com>
Date: Tue, 28 Nov 2023 00:31:14 +0530
Subject: [PATCH 001/129] add: loading for syncstatus
---
src/components/Collections/SyncStatus.svelte | 26 ++++++++++++++++----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/components/Collections/SyncStatus.svelte b/src/components/Collections/SyncStatus.svelte
index 24dfd6f10..04f564e2b 100644
--- a/src/components/Collections/SyncStatus.svelte
+++ b/src/components/Collections/SyncStatus.svelte
@@ -250,7 +250,7 @@
Memberships just created are not yet published on the blockchain. Submit all
transactions to start offering memberships.
-
diff --git a/src/plugins/collections/SyncModal.svelte b/src/plugins/collections/SyncModal.svelte
index f24731e76..28c481c35 100644
--- a/src/plugins/collections/SyncModal.svelte
+++ b/src/plugins/collections/SyncModal.svelte
@@ -33,7 +33,6 @@
return {
payload: bytes32Hex(mem.payload),
source: mem,
- isTimeLimitedCollection: true,
state: {
src: mem.imageSrc,
name: JSON.stringify(mem.name).slice(1, -1),
@@ -81,17 +80,33 @@
}) => {
// Filter out states with empty payload
const validStates = states.filter(({ payload }) => payload.trim() !== '')
+ console.log({validStates})
const results: TransactionResponse[] = []
if (validStates.length) {
+ try {
+ const args = [
+ propertyAddress,
+ validStates.map(({ state }) => state),
+ validStates.map(({ payload }) => payload),
+ ]
+ console.log({args})
const res = await callSlotCollections(provider, 'setImages', [
propertyAddress,
validStates.map(({ state }) => state),
validStates.map(({ payload }) => payload),
- ])
- results.push(res)
+ ]);
+ // const res2 = await callSlotCollections(provider, 'propertyImages', [
+ // propertyAddress,
+ // "0x4b7f37427bb4f845726fcccf7e25390b25cf9dbfc82846d73dcc1688f93d3e4d",
+ // ]);
+ // console.log({res2})
+ results.push(res);
+ } catch (error) {
+ console.log('Error in callSlotCollections:', error);
}
- return results
+ }
+ return results;
}
diff --git a/src/plugins/collections/index.ts b/src/plugins/collections/index.ts
index b995db26c..c9cceb378 100644
--- a/src/plugins/collections/index.ts
+++ b/src/plugins/collections/index.ts
@@ -194,9 +194,9 @@ export const getAdminPaths = (async (
const presetCollection: Collection = {
id: 'preset-time-collection',
- name: 'My First Time Limited Collection',
+ name: 'My First Slot Collection',
imageSrc: '',
- description: 'This is a time-limited collection.',
+ description: 'This is a slot collection.',
status: 'Draft',
endTime: 0,
memberships: [],
diff --git a/src/plugins/collections/utils/mixSlotABI.ts b/src/plugins/collections/utils/mixSlotABI.ts
index f46fb7964..ffcb4189b 100644
--- a/src/plugins/collections/utils/mixSlotABI.ts
+++ b/src/plugins/collections/utils/mixSlotABI.ts
@@ -1,749 +1,735 @@
-export const mixSlotABI = [
+export const mixSlotABI = [
{
- anonymous: false,
- inputs: [
+ "anonymous": false,
+ "inputs": [
{
- indexed: false,
- internalType: 'uint8',
- name: 'version',
- type: 'uint8',
- },
+ "indexed": false,
+ "internalType": "uint8",
+ "name": "version",
+ "type": "uint8"
+ }
],
- name: 'Initialized',
- type: 'event',
+ "name": "Initialized",
+ "type": "event"
},
{
- anonymous: false,
- inputs: [
+ "anonymous": false,
+ "inputs": [
{
- indexed: true,
- internalType: 'address',
- name: 'previousOwner',
- type: 'address',
+ "indexed": true,
+ "internalType": "address",
+ "name": "previousOwner",
+ "type": "address"
},
{
- indexed: true,
- internalType: 'address',
- name: 'newOwner',
- type: 'address',
- },
+ "indexed": true,
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
],
- name: 'OwnershipTransferred',
- type: 'event',
+ "name": "OwnershipTransferred",
+ "type": "event"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_token',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "_token",
+ "type": "address"
+ }
],
- name: 'allowListToken',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "allowListToken",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
],
- name: 'allowlistedTokens',
- outputs: [
+ "name": "allowlistedTokens",
+ "outputs": [
{
- internalType: 'bool',
- name: '',
- type: 'bool',
- },
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_token',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "_token",
+ "type": "address"
+ }
],
- name: 'denyListToken',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "denyListToken",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'uint256',
- name: 'id',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- components: [
+ "components": [
{
- internalType: 'address',
- name: 'property',
- type: 'address',
+ "internalType": "address",
+ "name": "property",
+ "type": "address"
},
{
- internalType: 'uint256',
- name: 'amount',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'price',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "price",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'pendingReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "pendingReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.StakingPositions',
- name: '_positions',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.StakingPositions",
+ "name": "_positions",
+ "type": "tuple"
},
{
- components: [
+ "components": [
{
- internalType: 'uint256',
- name: 'entireReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "entireReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'withdrawableReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "withdrawableReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.Rewards',
- name: '',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.Rewards",
+ "name": "",
+ "type": "tuple"
},
{
- internalType: 'bytes32',
- name: 'key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "key",
+ "type": "bytes32"
+ }
],
- name: 'description',
- outputs: [
+ "name": "description",
+ "outputs": [
{
- internalType: 'string',
- name: '',
- type: 'string',
- },
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [],
- name: 'dev',
- outputs: [
+ "inputs": [],
+ "name": "dev",
+ "outputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_property',
- type: 'address',
+ "internalType": "address",
+ "name": "_property",
+ "type": "address"
},
{
- internalType: 'bytes32',
- name: '_key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "_key",
+ "type": "bytes32"
+ }
],
- name: 'getSlotsLeft',
- outputs: [
+ "name": "getSlotsLeft",
+ "outputs": [
{
- internalType: 'uint256',
- name: '',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_property',
- type: 'address',
+ "internalType": "address",
+ "name": "_property",
+ "type": "address"
},
{
- internalType: 'bytes32',
- name: '_key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "_key",
+ "type": "bytes32"
+ }
],
- name: 'getTimeLeft',
- outputs: [
+ "name": "getTimeLeft",
+ "outputs": [
{
- internalType: 'uint256',
- name: '',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'uint256',
- name: 'id',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- components: [
+ "components": [
{
- internalType: 'address',
- name: 'property',
- type: 'address',
+ "internalType": "address",
+ "name": "property",
+ "type": "address"
},
{
- internalType: 'uint256',
- name: 'amount',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'price',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "price",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'pendingReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "pendingReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.StakingPositions',
- name: '_positions',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.StakingPositions",
+ "name": "_positions",
+ "type": "tuple"
},
{
- components: [
+ "components": [
{
- internalType: 'uint256',
- name: 'entireReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "entireReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'withdrawableReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "withdrawableReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.Rewards',
- name: '',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.Rewards",
+ "name": "",
+ "type": "tuple"
},
{
- internalType: 'bytes32',
- name: 'key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "key",
+ "type": "bytes32"
+ }
],
- name: 'image',
- outputs: [
+ "name": "image",
+ "outputs": [
{
- internalType: 'string',
- name: '',
- type: 'string',
- },
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_contract',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "_contract",
+ "type": "address"
+ }
],
- name: 'initialize',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "initialize",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'uint256',
- name: 'id',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- components: [
+ "components": [
{
- internalType: 'address',
- name: 'property',
- type: 'address',
+ "internalType": "address",
+ "name": "property",
+ "type": "address"
},
{
- internalType: 'uint256',
- name: 'amount',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'price',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "price",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'pendingReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "pendingReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.StakingPositions',
- name: '_positions',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.StakingPositions",
+ "name": "_positions",
+ "type": "tuple"
},
{
- components: [
+ "components": [
{
- internalType: 'uint256',
- name: 'entireReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "entireReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'withdrawableReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "withdrawableReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.Rewards',
- name: '',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.Rewards",
+ "name": "",
+ "type": "tuple"
},
{
- internalType: 'bytes32',
- name: 'key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "key",
+ "type": "bytes32"
+ }
],
- name: 'name',
- outputs: [
+ "name": "name",
+ "outputs": [
{
- internalType: 'string',
- name: '',
- type: 'string',
- },
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'uint256',
- name: 'id',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- components: [
+ "components": [
{
- internalType: 'address',
- name: 'property',
- type: 'address',
+ "internalType": "address",
+ "name": "property",
+ "type": "address"
},
{
- internalType: 'uint256',
- name: 'amount',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'price',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "price",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'cumulativeReward',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "cumulativeReward",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'pendingReward',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "pendingReward",
+ "type": "uint256"
+ }
],
- internalType: 'struct ISTokensManagerStruct.StakingPositions',
- name: '_positions',
- type: 'tuple',
+ "internalType": "struct ISTokensManagerStruct.StakingPositions",
+ "name": "_positions",
+ "type": "tuple"
},
{
- internalType: 'bytes32',
- name: 'key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "key",
+ "type": "bytes32"
+ }
],
- name: 'onBeforeMint',
- outputs: [
+ "name": "onBeforeMint",
+ "outputs": [
{
- internalType: 'bool',
- name: '',
- type: 'bool',
- },
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
],
- stateMutability: 'nonpayable',
- type: 'function',
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [],
- name: 'owner',
- outputs: [
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- internalType: 'bytes32',
- name: '',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
],
- name: 'propertyImageClaimedSlots',
- outputs: [
+ "name": "propertyImageClaimedSlots",
+ "outputs": [
{
- internalType: 'uint32',
- name: '',
- type: 'uint32',
- },
+ "internalType": "uint32",
+ "name": "",
+ "type": "uint32"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- internalType: 'bytes32',
- name: '',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
],
- name: 'propertyImages',
- outputs: [
+ "name": "propertyImages",
+ "outputs": [
{
- internalType: 'string',
- name: 'src',
- type: 'string',
+ "internalType": "string",
+ "name": "src",
+ "type": "string"
},
{
- internalType: 'string',
- name: 'name',
- type: 'string',
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
},
{
- internalType: 'string',
- name: 'description',
- type: 'string',
+ "internalType": "string",
+ "name": "description",
+ "type": "string"
},
{
- components: [
- {
- internalType: 'uint256',
- name: 'deadline',
- type: 'uint256',
- },
- {
- internalType: 'uint32',
- name: 'members',
- type: 'uint32',
- },
- ],
- internalType: 'struct SlotCollections.SlotType',
- name: 'slot',
- type: 'tuple',
+ "internalType": "uint256",
+ "name": "deadline",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'requiredTokenAmount',
- type: 'uint256',
+ "internalType": "uint32",
+ "name": "members",
+ "type": "uint32"
},
{
- internalType: 'uint256',
- name: 'requiredTokenFee',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "requiredTokenAmount",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: 'token',
- type: 'address',
+ "internalType": "uint256",
+ "name": "requiredTokenFee",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: 'gateway',
- type: 'address',
+ "internalType": "address",
+ "name": "token",
+ "type": "address"
},
+ {
+ "internalType": "address",
+ "name": "gateway",
+ "type": "address"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_propertyAddress',
- type: 'address',
+ "internalType": "address",
+ "name": "_propertyAddress",
+ "type": "address"
},
{
- internalType: 'bytes32',
- name: '_key',
- type: 'bytes32',
- },
+ "internalType": "bytes32",
+ "name": "_key",
+ "type": "bytes32"
+ }
],
- name: 'removeImage',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "removeImage",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [],
- name: 'renounceOwnership',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "inputs": [],
+ "name": "renounceOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_dev',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "_dev",
+ "type": "address"
+ }
],
- name: 'setDevToken',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "setDevToken",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_propertyAddress',
- type: 'address',
+ "internalType": "address",
+ "name": "_propertyAddress",
+ "type": "address"
},
{
- components: [
+ "components": [
{
- internalType: 'string',
- name: 'src',
- type: 'string',
+ "internalType": "string",
+ "name": "src",
+ "type": "string"
},
{
- internalType: 'string',
- name: 'name',
- type: 'string',
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
},
{
- internalType: 'string',
- name: 'description',
- type: 'string',
+ "internalType": "string",
+ "name": "description",
+ "type": "string"
},
{
- components: [
- {
- internalType: 'uint256',
- name: 'deadline',
- type: 'uint256',
- },
- {
- internalType: 'uint32',
- name: 'members',
- type: 'uint32',
- },
- ],
- internalType: 'struct SlotCollections.SlotType',
- name: 'slot',
- type: 'tuple',
+ "internalType": "uint256",
+ "name": "deadline",
+ "type": "uint256"
},
{
- internalType: 'uint256',
- name: 'requiredTokenAmount',
- type: 'uint256',
+ "internalType": "uint32",
+ "name": "members",
+ "type": "uint32"
},
{
- internalType: 'uint256',
- name: 'requiredTokenFee',
- type: 'uint256',
+ "internalType": "uint256",
+ "name": "requiredTokenAmount",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: 'token',
- type: 'address',
+ "internalType": "uint256",
+ "name": "requiredTokenFee",
+ "type": "uint256"
},
{
- internalType: 'address',
- name: 'gateway',
- type: 'address',
+ "internalType": "address",
+ "name": "token",
+ "type": "address"
},
+ {
+ "internalType": "address",
+ "name": "gateway",
+ "type": "address"
+ }
],
- internalType: 'struct SlotCollections.Image[]',
- name: '_images',
- type: 'tuple[]',
+ "internalType": "struct SlotCollections.Image[]",
+ "name": "_images",
+ "type": "tuple[]"
},
{
- internalType: 'bytes32[]',
- name: '_keys',
- type: 'bytes32[]',
- },
+ "internalType": "bytes32[]",
+ "name": "_keys",
+ "type": "bytes32[]"
+ }
],
- name: 'setImages',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "setImages",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '_contract',
- type: 'address',
- },
+ "internalType": "address",
+ "name": "_contract",
+ "type": "address"
+ }
],
- name: 'setSwapAndStake',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
+ "name": "setSwapAndStake",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
},
{
- inputs: [
+ "inputs": [
{
- internalType: 'address',
- name: '',
- type: 'address',
+ "internalType": "address",
+ "name": "",
+ "type": "address"
},
{
- internalType: 'uint256',
- name: '',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
],
- name: 'stakedAmountAtMinted',
- outputs: [
+ "name": "stakedAmountAtMinted",
+ "outputs": [
{
- internalType: 'uint256',
- name: '',
- type: 'uint256',
- },
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [],
- name: 'swapAndStake',
- outputs: [
+ "inputs": [],
+ "name": "swapAndStake",
+ "outputs": [
{
- internalType: 'contract ISwapAndStake',
- name: '',
- type: 'address',
- },
+ "internalType": "contract ISwapAndStake",
+ "name": "",
+ "type": "address"
+ }
],
- stateMutability: 'view',
- type: 'function',
+ "stateMutability": "view",
+ "type": "function"
},
{
- inputs: [
- {
- internalType: 'address',
- name: 'newOwner',
- type: 'address',
- },
- ],
- name: 'transferOwnership',
- outputs: [],
- stateMutability: 'nonpayable',
- type: 'function',
- },
-]
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
\ No newline at end of file
diff --git a/src/plugins/collections/utils/slotCollections.ts b/src/plugins/collections/utils/slotCollections.ts
index 8c0a13990..72d539230 100644
--- a/src/plugins/collections/utils/slotCollections.ts
+++ b/src/plugins/collections/utils/slotCollections.ts
@@ -39,7 +39,7 @@ export const address: Address[] = [
},
{
chainId: 80001,
- address: '0x40be0Bc51523E6eF9b1d7F98B8545859efC708c1',
+ address: '0x1d82F8BA629dDfC1Ca971C38d03E087D64Cfd531',
},
]
@@ -89,6 +89,7 @@ export async function callSlotCollections(
defaultAddress.address
const contract = new ethers.Contract(addressList, mixSlotABI, provider)
+ console.log({contract})
const result: TransactionReceipt = await contract[functionName](...args)
return result
From c35049fde8fa1b8065a80f670fa68d0a92936659 Mon Sep 17 00:00:00 2001
From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:14:49 +0530
Subject: [PATCH 009/129] lint
---
.../Collections/CreateCollections.svelte | 58 +-
src/plugins/collections/SyncModal.svelte | 46 +-
src/plugins/collections/utils/mixSlotABI.ts | 968 +++++++++---------
.../collections/utils/slotCollections.ts | 2 +-
4 files changed, 537 insertions(+), 537 deletions(-)
diff --git a/src/components/Collections/CreateCollections.svelte b/src/components/Collections/CreateCollections.svelte
index 39e4d559c..b857cb3d6 100644
--- a/src/components/Collections/CreateCollections.svelte
+++ b/src/components/Collections/CreateCollections.svelte
@@ -788,22 +788,22 @@
>
-
+
-
+
diff --git a/src/plugins/collections/SyncModal.svelte b/src/plugins/collections/SyncModal.svelte
index 28c481c35..fc591dcf6 100644
--- a/src/plugins/collections/SyncModal.svelte
+++ b/src/plugins/collections/SyncModal.svelte
@@ -80,33 +80,33 @@
}) => {
// Filter out states with empty payload
const validStates = states.filter(({ payload }) => payload.trim() !== '')
- console.log({validStates})
+ console.log({ validStates })
const results: TransactionResponse[] = []
if (validStates.length) {
- try {
- const args = [
- propertyAddress,
- validStates.map(({ state }) => state),
- validStates.map(({ payload }) => payload),
- ]
- console.log({args})
- const res = await callSlotCollections(provider, 'setImages', [
- propertyAddress,
- validStates.map(({ state }) => state),
- validStates.map(({ payload }) => payload),
- ]);
- // const res2 = await callSlotCollections(provider, 'propertyImages', [
- // propertyAddress,
- // "0x4b7f37427bb4f845726fcccf7e25390b25cf9dbfc82846d73dcc1688f93d3e4d",
- // ]);
- // console.log({res2})
- results.push(res);
- } catch (error) {
- console.log('Error in callSlotCollections:', error);
+ try {
+ const args = [
+ propertyAddress,
+ validStates.map(({ state }) => state),
+ validStates.map(({ payload }) => payload),
+ ]
+ console.log({ args })
+ const res = await callSlotCollections(provider, 'setImages', [
+ propertyAddress,
+ validStates.map(({ state }) => state),
+ validStates.map(({ payload }) => payload),
+ ])
+ // const res2 = await callSlotCollections(provider, 'propertyImages', [
+ // propertyAddress,
+ // "0x4b7f37427bb4f845726fcccf7e25390b25cf9dbfc82846d73dcc1688f93d3e4d",
+ // ]);
+ // console.log({res2})
+ results.push(res)
+ } catch (error) {
+ console.log('Error in callSlotCollections:', error)
+ }
}
- }
- return results;
+ return results
}
diff --git a/src/plugins/collections/utils/mixSlotABI.ts b/src/plugins/collections/utils/mixSlotABI.ts
index ffcb4189b..fc23d37b2 100644
--- a/src/plugins/collections/utils/mixSlotABI.ts
+++ b/src/plugins/collections/utils/mixSlotABI.ts
@@ -1,735 +1,735 @@
-export const mixSlotABI = [
+export const mixSlotABI = [
{
- "anonymous": false,
- "inputs": [
+ anonymous: false,
+ inputs: [
{
- "indexed": false,
- "internalType": "uint8",
- "name": "version",
- "type": "uint8"
- }
+ indexed: false,
+ internalType: 'uint8',
+ name: 'version',
+ type: 'uint8',
+ },
],
- "name": "Initialized",
- "type": "event"
+ name: 'Initialized',
+ type: 'event',
},
{
- "anonymous": false,
- "inputs": [
+ anonymous: false,
+ inputs: [
{
- "indexed": true,
- "internalType": "address",
- "name": "previousOwner",
- "type": "address"
+ indexed: true,
+ internalType: 'address',
+ name: 'previousOwner',
+ type: 'address',
},
{
- "indexed": true,
- "internalType": "address",
- "name": "newOwner",
- "type": "address"
- }
+ indexed: true,
+ internalType: 'address',
+ name: 'newOwner',
+ type: 'address',
+ },
],
- "name": "OwnershipTransferred",
- "type": "event"
+ name: 'OwnershipTransferred',
+ type: 'event',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_token",
- "type": "address"
- }
+ internalType: 'address',
+ name: '_token',
+ type: 'address',
+ },
],
- "name": "allowListToken",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'allowListToken',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
- }
+ internalType: 'address',
+ name: '',
+ type: 'address',
+ },
],
- "name": "allowlistedTokens",
- "outputs": [
+ name: 'allowlistedTokens',
+ outputs: [
{
- "internalType": "bool",
- "name": "",
- "type": "bool"
- }
+ internalType: 'bool',
+ name: '',
+ type: 'bool',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_token",
- "type": "address"
- }
+ internalType: 'address',
+ name: '_token',
+ type: 'address',
+ },
],
- "name": "denyListToken",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'denyListToken',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "uint256",
- "name": "id",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'id',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "components": [
+ components: [
{
- "internalType": "address",
- "name": "property",
- "type": "address"
+ internalType: 'address',
+ name: 'property',
+ type: 'address',
},
{
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'amount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "price",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'price',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "pendingReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'pendingReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.StakingPositions",
- "name": "_positions",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.StakingPositions',
+ name: '_positions',
+ type: 'tuple',
},
{
- "components": [
+ components: [
{
- "internalType": "uint256",
- "name": "entireReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'entireReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "withdrawableReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'withdrawableReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.Rewards",
- "name": "",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.Rewards',
+ name: '',
+ type: 'tuple',
},
{
- "internalType": "bytes32",
- "name": "key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: 'key',
+ type: 'bytes32',
+ },
],
- "name": "description",
- "outputs": [
+ name: 'description',
+ outputs: [
{
- "internalType": "string",
- "name": "",
- "type": "string"
- }
+ internalType: 'string',
+ name: '',
+ type: 'string',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [],
- "name": "dev",
- "outputs": [
+ inputs: [],
+ name: 'dev',
+ outputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
- }
+ internalType: 'address',
+ name: '',
+ type: 'address',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_property",
- "type": "address"
+ internalType: 'address',
+ name: '_property',
+ type: 'address',
},
{
- "internalType": "bytes32",
- "name": "_key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: '_key',
+ type: 'bytes32',
+ },
],
- "name": "getSlotsLeft",
- "outputs": [
+ name: 'getSlotsLeft',
+ outputs: [
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: '',
+ type: 'uint256',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_property",
- "type": "address"
+ internalType: 'address',
+ name: '_property',
+ type: 'address',
},
{
- "internalType": "bytes32",
- "name": "_key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: '_key',
+ type: 'bytes32',
+ },
],
- "name": "getTimeLeft",
- "outputs": [
+ name: 'getTimeLeft',
+ outputs: [
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: '',
+ type: 'uint256',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "uint256",
- "name": "id",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'id',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "components": [
+ components: [
{
- "internalType": "address",
- "name": "property",
- "type": "address"
+ internalType: 'address',
+ name: 'property',
+ type: 'address',
},
{
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'amount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "price",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'price',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "pendingReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'pendingReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.StakingPositions",
- "name": "_positions",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.StakingPositions',
+ name: '_positions',
+ type: 'tuple',
},
{
- "components": [
+ components: [
{
- "internalType": "uint256",
- "name": "entireReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'entireReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "withdrawableReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'withdrawableReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.Rewards",
- "name": "",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.Rewards',
+ name: '',
+ type: 'tuple',
},
{
- "internalType": "bytes32",
- "name": "key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: 'key',
+ type: 'bytes32',
+ },
],
- "name": "image",
- "outputs": [
+ name: 'image',
+ outputs: [
{
- "internalType": "string",
- "name": "",
- "type": "string"
- }
+ internalType: 'string',
+ name: '',
+ type: 'string',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_contract",
- "type": "address"
- }
+ internalType: 'address',
+ name: '_contract',
+ type: 'address',
+ },
],
- "name": "initialize",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'initialize',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "uint256",
- "name": "id",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'id',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "components": [
+ components: [
{
- "internalType": "address",
- "name": "property",
- "type": "address"
+ internalType: 'address',
+ name: 'property',
+ type: 'address',
},
{
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'amount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "price",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'price',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "pendingReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'pendingReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.StakingPositions",
- "name": "_positions",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.StakingPositions',
+ name: '_positions',
+ type: 'tuple',
},
{
- "components": [
+ components: [
{
- "internalType": "uint256",
- "name": "entireReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'entireReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "withdrawableReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'withdrawableReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.Rewards",
- "name": "",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.Rewards',
+ name: '',
+ type: 'tuple',
},
{
- "internalType": "bytes32",
- "name": "key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: 'key',
+ type: 'bytes32',
+ },
],
- "name": "name",
- "outputs": [
+ name: 'name',
+ outputs: [
{
- "internalType": "string",
- "name": "",
- "type": "string"
- }
+ internalType: 'string',
+ name: '',
+ type: 'string',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "uint256",
- "name": "id",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'id',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "components": [
+ components: [
{
- "internalType": "address",
- "name": "property",
- "type": "address"
+ internalType: 'address',
+ name: 'property',
+ type: 'address',
},
{
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'amount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "price",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'price',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "cumulativeReward",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'cumulativeReward',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "pendingReward",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: 'pendingReward',
+ type: 'uint256',
+ },
],
- "internalType": "struct ISTokensManagerStruct.StakingPositions",
- "name": "_positions",
- "type": "tuple"
+ internalType: 'struct ISTokensManagerStruct.StakingPositions',
+ name: '_positions',
+ type: 'tuple',
},
{
- "internalType": "bytes32",
- "name": "key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: 'key',
+ type: 'bytes32',
+ },
],
- "name": "onBeforeMint",
- "outputs": [
+ name: 'onBeforeMint',
+ outputs: [
{
- "internalType": "bool",
- "name": "",
- "type": "bool"
- }
+ internalType: 'bool',
+ name: '',
+ type: 'bool',
+ },
],
- "stateMutability": "nonpayable",
- "type": "function"
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [],
- "name": "owner",
- "outputs": [
+ inputs: [],
+ name: 'owner',
+ outputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
- }
+ internalType: 'address',
+ name: '',
+ type: 'address',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "internalType": "bytes32",
- "name": "",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: '',
+ type: 'bytes32',
+ },
],
- "name": "propertyImageClaimedSlots",
- "outputs": [
+ name: 'propertyImageClaimedSlots',
+ outputs: [
{
- "internalType": "uint32",
- "name": "",
- "type": "uint32"
- }
+ internalType: 'uint32',
+ name: '',
+ type: 'uint32',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "internalType": "bytes32",
- "name": "",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: '',
+ type: 'bytes32',
+ },
],
- "name": "propertyImages",
- "outputs": [
+ name: 'propertyImages',
+ outputs: [
{
- "internalType": "string",
- "name": "src",
- "type": "string"
+ internalType: 'string',
+ name: 'src',
+ type: 'string',
},
{
- "internalType": "string",
- "name": "name",
- "type": "string"
+ internalType: 'string',
+ name: 'name',
+ type: 'string',
},
{
- "internalType": "string",
- "name": "description",
- "type": "string"
+ internalType: 'string',
+ name: 'description',
+ type: 'string',
},
{
- "internalType": "uint256",
- "name": "deadline",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'deadline',
+ type: 'uint256',
},
{
- "internalType": "uint32",
- "name": "members",
- "type": "uint32"
+ internalType: 'uint32',
+ name: 'members',
+ type: 'uint32',
},
{
- "internalType": "uint256",
- "name": "requiredTokenAmount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'requiredTokenAmount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "requiredTokenFee",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'requiredTokenFee',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "token",
- "type": "address"
+ internalType: 'address',
+ name: 'token',
+ type: 'address',
},
{
- "internalType": "address",
- "name": "gateway",
- "type": "address"
- }
+ internalType: 'address',
+ name: 'gateway',
+ type: 'address',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_propertyAddress",
- "type": "address"
+ internalType: 'address',
+ name: '_propertyAddress',
+ type: 'address',
},
{
- "internalType": "bytes32",
- "name": "_key",
- "type": "bytes32"
- }
+ internalType: 'bytes32',
+ name: '_key',
+ type: 'bytes32',
+ },
],
- "name": "removeImage",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'removeImage',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [],
- "name": "renounceOwnership",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ inputs: [],
+ name: 'renounceOwnership',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_dev",
- "type": "address"
- }
+ internalType: 'address',
+ name: '_dev',
+ type: 'address',
+ },
],
- "name": "setDevToken",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'setDevToken',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_propertyAddress",
- "type": "address"
+ internalType: 'address',
+ name: '_propertyAddress',
+ type: 'address',
},
{
- "components": [
+ components: [
{
- "internalType": "string",
- "name": "src",
- "type": "string"
+ internalType: 'string',
+ name: 'src',
+ type: 'string',
},
{
- "internalType": "string",
- "name": "name",
- "type": "string"
+ internalType: 'string',
+ name: 'name',
+ type: 'string',
},
{
- "internalType": "string",
- "name": "description",
- "type": "string"
+ internalType: 'string',
+ name: 'description',
+ type: 'string',
},
{
- "internalType": "uint256",
- "name": "deadline",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'deadline',
+ type: 'uint256',
},
{
- "internalType": "uint32",
- "name": "members",
- "type": "uint32"
+ internalType: 'uint32',
+ name: 'members',
+ type: 'uint32',
},
{
- "internalType": "uint256",
- "name": "requiredTokenAmount",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'requiredTokenAmount',
+ type: 'uint256',
},
{
- "internalType": "uint256",
- "name": "requiredTokenFee",
- "type": "uint256"
+ internalType: 'uint256',
+ name: 'requiredTokenFee',
+ type: 'uint256',
},
{
- "internalType": "address",
- "name": "token",
- "type": "address"
+ internalType: 'address',
+ name: 'token',
+ type: 'address',
},
{
- "internalType": "address",
- "name": "gateway",
- "type": "address"
- }
+ internalType: 'address',
+ name: 'gateway',
+ type: 'address',
+ },
],
- "internalType": "struct SlotCollections.Image[]",
- "name": "_images",
- "type": "tuple[]"
+ internalType: 'struct SlotCollections.Image[]',
+ name: '_images',
+ type: 'tuple[]',
},
{
- "internalType": "bytes32[]",
- "name": "_keys",
- "type": "bytes32[]"
- }
+ internalType: 'bytes32[]',
+ name: '_keys',
+ type: 'bytes32[]',
+ },
],
- "name": "setImages",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'setImages',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "_contract",
- "type": "address"
- }
+ internalType: 'address',
+ name: '_contract',
+ type: 'address',
+ },
],
- "name": "setSwapAndStake",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
+ name: 'setSwapAndStake',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "address",
- "name": "",
- "type": "address"
+ internalType: 'address',
+ name: '',
+ type: 'address',
},
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: '',
+ type: 'uint256',
+ },
],
- "name": "stakedAmountAtMinted",
- "outputs": [
+ name: 'stakedAmountAtMinted',
+ outputs: [
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: 'uint256',
+ name: '',
+ type: 'uint256',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [],
- "name": "swapAndStake",
- "outputs": [
+ inputs: [],
+ name: 'swapAndStake',
+ outputs: [
{
- "internalType": "contract ISwapAndStake",
- "name": "",
- "type": "address"
- }
+ internalType: 'contract ISwapAndStake',
+ name: '',
+ type: 'address',
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: 'view',
+ type: 'function',
},
{
- "inputs": [
- {
- "internalType": "address",
- "name": "newOwner",
- "type": "address"
- }
- ],
- "name": "transferOwnership",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }
-]
\ No newline at end of file
+ inputs: [
+ {
+ internalType: 'address',
+ name: 'newOwner',
+ type: 'address',
+ },
+ ],
+ name: 'transferOwnership',
+ outputs: [],
+ stateMutability: 'nonpayable',
+ type: 'function',
+ },
+]
diff --git a/src/plugins/collections/utils/slotCollections.ts b/src/plugins/collections/utils/slotCollections.ts
index 72d539230..a6033975f 100644
--- a/src/plugins/collections/utils/slotCollections.ts
+++ b/src/plugins/collections/utils/slotCollections.ts
@@ -89,7 +89,7 @@ export async function callSlotCollections(
defaultAddress.address
const contract = new ethers.Contract(addressList, mixSlotABI, provider)
- console.log({contract})
+ console.log({ contract })
const result: TransactionReceipt = await contract[functionName](...args)
return result
From b7b777074ab587b2473e0b2a7c9807bbcdfb297d Mon Sep 17 00:00:00 2001
From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:15:52 +0530
Subject: [PATCH 010/129] wip: write bettter code
---
scripts/populate/custom-clubs.mjs | 113 ++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
create mode 100644 scripts/populate/custom-clubs.mjs
diff --git a/scripts/populate/custom-clubs.mjs b/scripts/populate/custom-clubs.mjs
new file mode 100644
index 000000000..108260ec5
--- /dev/null
+++ b/scripts/populate/custom-clubs.mjs
@@ -0,0 +1,113 @@
+import { encode } from '@devprotocol/clubs-core'
+import { db } from './utils/db.mjs'
+import { whenCalledDirectly } from './utils/whenCalledDirectly.mjs'
+
+const KEY = 'clubsname'
+
+const populate = async (client) => {
+ await client.set(
+ KEY,
+ encode({
+ name: 'testing-clubs-on-shubham-machine',
+ twitterHandle: '@doesntmatter',
+ description: '',
+ url: 'https://clubsname.clubs.place',
+ propertyAddress: 'propertyAdd',
+ adminRolePoints: 0,
+ chainId: 80001,
+ rpcUrl:
+ '',
+ options: [
+ {
+ key: 'ogp',
+ value: { image: '' },
+ },
+ {
+ key: 'navigationLinks',
+ value: [
+ {
+ display: 'Join',
+ path: '/join',
+ },
+ {
+ display: 'Collections',
+ path: '/collections',
+ },
+ ],
+ },
+ {
+ key: 'socialLinks',
+ value: [
+ {
+ display: 'YouTube',
+ path: 'https://www.youtube.com/user/suiundo/',
+ },
+ ],
+ },
+ {
+ key: 'avatarImgSrc',
+ value: 'https://i.imgur.com/jDel1t9.png',
+ },
+ ],
+ plugins: [
+ {
+ id: 'clubs-core:admin',
+ name: 'admin',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:theme-1',
+ name: 'defaultTheme',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:plugin:me',
+ name: 'me',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:clubsx:marketplace',
+ name: 'marketplace',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:plugin:members',
+ name: 'members',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:plugin:quests',
+ name: 'quests',
+ enable: true,
+ options: [],
+ },
+ {
+ id: 'devprotocol:clubs:simple-memberships',
+ name: 'memberships',
+ enable: true,
+ options: [
+ {
+ key: 'memberships',
+ value: [],
+ },
+ ],
+ },
+ ],
+ }),
+ )
+
+ console.log('set', KEY)
+}
+
+whenCalledDirectly(async () => {
+ const client = await db()
+ await populate(client)
+ await client.quit()
+})
+
+export default populate
From c8d8607f07a4f23cbcb92d33b215689b39b4ad8e Mon Sep 17 00:00:00 2001
From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:16:03 +0530
Subject: [PATCH 011/129] lint
---
scripts/populate/custom-clubs.mjs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/populate/custom-clubs.mjs b/scripts/populate/custom-clubs.mjs
index 108260ec5..bd04a9fd6 100644
--- a/scripts/populate/custom-clubs.mjs
+++ b/scripts/populate/custom-clubs.mjs
@@ -15,8 +15,7 @@ const populate = async (client) => {
propertyAddress: 'propertyAdd',
adminRolePoints: 0,
chainId: 80001,
- rpcUrl:
- '',
+ rpcUrl: '',
options: [
{
key: 'ogp',
From bca5b39856fca092422e709ee8e294b3bd2bf7e7 Mon Sep 17 00:00:00 2001
From: Yash Agrawal
Date: Thu, 14 Dec 2023 17:17:04 +0530
Subject: [PATCH 012/129] feat: fix dev staking 0 amount issue in ui
---
src/plugins/admin/StakeInfo.tsx | 2 +-
yarn.lock | 18 ------------------
2 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/src/plugins/admin/StakeInfo.tsx b/src/plugins/admin/StakeInfo.tsx
index 4953dd7a1..d480aa72a 100644
--- a/src/plugins/admin/StakeInfo.tsx
+++ b/src/plugins/admin/StakeInfo.tsx
@@ -95,7 +95,7 @@ const CurrencyMembershipInfo = (props: Props) => {
await signer.getAddress(),
)
const fee: bigint = BigInt(response._amount || response[0])
- withdrawableAmt = formatUnits(fee, 36)
+ withdrawableAmt = formatUnits(fee, 18)
} else if (props.fetcherType === 'cumulative') {
const response = await await withdrawContract.calculateRewardAmount(
props.propertyAddress,
diff --git a/yarn.lock b/yarn.lock
index 437fee0f2..08f2f6d11 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -588,17 +588,10 @@
svelte "^4.0.0"
vue "^3.2.0"
-<<<<<<< HEAD
"@devprotocol/clubs-plugin-posts@0.8.1":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@devprotocol/clubs-plugin-posts/-/clubs-plugin-posts-0.8.1.tgz#5b7300c1e2d54e05cad673f60c027faf9b438922"
integrity sha512-Ikd14Qn8aSMB2F+vIQMksGI2uduT0aQS8n7FjzJFVUln7k9rVqKFL7S6J4O71RTirvYg1N2/IksfI2hT+IkI4w==
-=======
-"@devprotocol/clubs-plugin-posts@0.8.0":
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/@devprotocol/clubs-plugin-posts/-/clubs-plugin-posts-0.8.0.tgz#67e882bdeb01ef17d12e875af4cee021ac06dc11"
- integrity sha512-V/BDEmi1XiWttSWOzJczb4MLj4p0t1CsBFD4K2AoILpoXPyiii7DnFIbjqnWehJZ/05kKedbP5w0htt/zkcVQQ==
->>>>>>> main
dependencies:
"@boringer-avatars/vue3" "^0.2.1"
"@devprotocol/dev-kit" "8.6.0"
@@ -607,11 +600,7 @@
dayjs "^1.11.8"
dompurify "^3.0.5"
ethers "^6.6.4"
-<<<<<<< HEAD
marked "11.1.0"
-=======
- marked "11.0.1"
->>>>>>> main
photoswipe "5.4.3"
ramda "0.29.1"
redis "^4.6.7"
@@ -7741,17 +7730,10 @@ marked@10.0.0, marked@^10.0.0:
resolved "https://registry.yarnpkg.com/marked/-/marked-10.0.0.tgz#7fe1805bb908433d760e2de0fcc8841a2b2d745c"
integrity sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA==
-<<<<<<< HEAD
marked@11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-11.1.0.tgz#f2d12323e80ba8a97cc8262fe7e94fcc007476ab"
integrity sha512-fvKJWAPEafVj1dwGwcPI5mBB/0pvViL6NlCbNDG1HOIRwwAU/jeMoFxfbRLuirO1wRH7m4yPvBqD/O1wyWvayw==
-=======
-marked@11.0.1:
- version "11.0.1"
- resolved "https://registry.yarnpkg.com/marked/-/marked-11.0.1.tgz#f8010ec2e358c0f4efedbac1ed3dbac2c7f46cdc"
- integrity sha512-P4kDhFEMlvLePBPRwOcMOv6+lYUbhfbSxJFs3Jb4Qx7v6K7l+k8Dxh9CEGfRvK71tL+qIFz5y7Pe4uzt4+/A3A==
->>>>>>> main
mdast-util-definitions@^6.0.0:
version "6.0.0"
From 84b4dda9e56681f717fed266af650658c3164224 Mon Sep 17 00:00:00 2001
From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com>
Date: Fri, 15 Dec 2023 05:57:25 +0530
Subject: [PATCH 013/129] remove: unused imports
---
src/components/Collections/CreateCollections.svelte | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/components/Collections/CreateCollections.svelte b/src/components/Collections/CreateCollections.svelte
index b857cb3d6..642144c1d 100644
--- a/src/components/Collections/CreateCollections.svelte
+++ b/src/components/Collections/CreateCollections.svelte
@@ -1,6 +1,6 @@
-
+
Date: Mon, 25 Dec 2023 05:19:31 +0000
Subject: [PATCH 115/129] fix(deps): update dependency viem to v1.21.0
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 80bd6bd04..bd3ea26ca 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -11183,9 +11183,9 @@ vfile@^6.0.0, vfile@^6.0.1:
vfile-message "^4.0.0"
viem@^1.0.0, viem@^1.10.8:
- version "1.20.3"
- resolved "https://registry.yarnpkg.com/viem/-/viem-1.20.3.tgz#8b8360daee622295f5385949c02c86d943d14e0f"
- integrity sha512-7CrmeCb2KYkeCgUmUyb1hsf+IX/PLwi+Np+Vm4YUTPeG82y3HRSgGHSaCOp3d0YtR2kXD3nv9y5kE7LBFE+wWw==
+ version "1.21.0"
+ resolved "https://registry.yarnpkg.com/viem/-/viem-1.21.0.tgz#38b78895d750ca51b9f7caed17de3cbfcbdcb4ec"
+ integrity sha512-d5CSflyvoQYT8aeAANX0x7DLuW/GEBs5lh3pZRbNIxTdb/XNLHiEcuB8I262oqAgxfBTA+94kry9ISzAsHKFhA==
dependencies:
"@adraffy/ens-normalize" "1.10.0"
"@noble/curves" "1.2.0"
From 54267fed1adfe80575f59b8c42fe73a2fd5e3627 Mon Sep 17 00:00:00 2001
From: Stuart Kuentzel
Date: Tue, 26 Dec 2023 14:33:36 +0900
Subject: [PATCH 116/129] find plugin by id rather than name
---
package.json | 3 ++-
scripts/upgrade-posts-v2.mjs | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index a2c160cd4..af897c66b 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,8 @@
"flushDb": "node ./scripts/flushDb.mjs",
"upgradeDb": "node ./scripts/upgrade.mjs",
"genApiPaths": "node ./scripts/generate-built-in-api-paths.mjs",
- "copy": "node ./scripts/copy.mjs"
+ "copy": "node ./scripts/copy.mjs",
+ "migratePosts": "node ./scripts/upgrade-posts-v2.mjs"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
diff --git a/scripts/upgrade-posts-v2.mjs b/scripts/upgrade-posts-v2.mjs
index 0f9948a1a..f66ff00c8 100644
--- a/scripts/upgrade-posts-v2.mjs
+++ b/scripts/upgrade-posts-v2.mjs
@@ -66,7 +66,7 @@ const main = async () => {
* Find the posts plugin
*/
const pluginPost = decodedConfig.plugins.find(
- (plugin) => plugin.name === 'devprotocol:clubs:plugin:posts',
+ (plugin) => plugin.id === 'devprotocol:clubs:plugin:posts',
)
/** Club doesn't have Posts installed, continue */
From 552a97f4aa00b4477f1fd72b91fcf4122e32107a Mon Sep 17 00:00:00 2001
From: Stuart Kuentzel
Date: Tue, 26 Dec 2023 14:53:12 +0900
Subject: [PATCH 117/129] fixes script searching for feeds
---
scripts/upgrade-posts-v2.mjs | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/scripts/upgrade-posts-v2.mjs b/scripts/upgrade-posts-v2.mjs
index f66ff00c8..eefe38a98 100644
--- a/scripts/upgrade-posts-v2.mjs
+++ b/scripts/upgrade-posts-v2.mjs
@@ -51,7 +51,7 @@ const main = async () => {
for await (const key of client.scanIterator()) {
if (key.includes(':')) {
// This is not a ClubsConfiguration
- console.log('Skipped:', key)
+ // console.log('Skipped:', key)
continue
}
@@ -78,7 +78,7 @@ const main = async () => {
/**
* Find the feeds option
**/
- const feeds = pluginPost.options.find((option) => option.name === 'feeds')
+ const feeds = pluginPost.options.find((option) => option.key === 'feeds')
/** Club doesn't have Posts installed, continue */
if (!feeds) {
@@ -120,15 +120,18 @@ const main = async () => {
*/
const oldId = 'default'
const newId = 'default-2'
- const res = await fetch(
- `https://${addedFeedValueConfig.url}/api/devprotocol:clubs:plugin:posts/${oldId}/copy/to/${newId}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
+
+ console.log('addedFeedValueConfig: ', addedFeedValueConfig)
+
+ const url = `https://${decodedConfig.url}/api/devprotocol:clubs:plugin:posts/${oldId}/copy/to/${newId}`
+ console.log('url is: ', url)
+
+ const res = await fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
},
- )
+ })
if (res.status !== 200) {
console.log('Failed to copy posts content', key)
From 1e51fdb676ef996b9d73c062ad41c93bbe3fc0c9 Mon Sep 17 00:00:00 2001
From: Stuart Kuentzel
Date: Tue, 26 Dec 2023 14:54:18 +0900
Subject: [PATCH 118/129] :shower: cleanup
---
scripts/upgrade-posts-v2.mjs | 5 -----
1 file changed, 5 deletions(-)
diff --git a/scripts/upgrade-posts-v2.mjs b/scripts/upgrade-posts-v2.mjs
index eefe38a98..9436bff3f 100644
--- a/scripts/upgrade-posts-v2.mjs
+++ b/scripts/upgrade-posts-v2.mjs
@@ -51,7 +51,6 @@ const main = async () => {
for await (const key of client.scanIterator()) {
if (key.includes(':')) {
// This is not a ClubsConfiguration
- // console.log('Skipped:', key)
continue
}
@@ -120,11 +119,7 @@ const main = async () => {
*/
const oldId = 'default'
const newId = 'default-2'
-
- console.log('addedFeedValueConfig: ', addedFeedValueConfig)
-
const url = `https://${decodedConfig.url}/api/devprotocol:clubs:plugin:posts/${oldId}/copy/to/${newId}`
- console.log('url is: ', url)
const res = await fetch(url, {
method: 'POST',
From 0292cc3055b5027d11e8239f50063e7420761c28 Mon Sep 17 00:00:00 2001
From: Stuart Kuentzel
Date: Tue, 26 Dec 2023 15:11:37 +0900
Subject: [PATCH 119/129] updates posts migration script
---
scripts/upgrade-posts-v2.mjs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/upgrade-posts-v2.mjs b/scripts/upgrade-posts-v2.mjs
index 9436bff3f..3a6e85b03 100644
--- a/scripts/upgrade-posts-v2.mjs
+++ b/scripts/upgrade-posts-v2.mjs
@@ -119,7 +119,8 @@ const main = async () => {
*/
const oldId = 'default'
const newId = 'default-2'
- const url = `https://${decodedConfig.url}/api/devprotocol:clubs:plugin:posts/${oldId}/copy/to/${newId}`
+ const url = `${decodedConfig.url}/api/devprotocol:clubs:plugin:posts/${oldId}/copy/to/${newId}`
+ console.log('Copying posts content', key, url)
const res = await fetch(url, {
method: 'POST',
@@ -128,8 +129,11 @@ const main = async () => {
},
})
- if (res.status !== 200) {
+ if (!res.ok) {
+ console.log('status is: ', res.status)
+ console.log('status text is: ', res.statusText)
console.log('Failed to copy posts content', key)
+ console.log('----')
continue
}
From 8f4802bd3991ab4418d9ee61ced7ce4fdfc0ae47 Mon Sep 17 00:00:00 2001
From: aggre
Date: Tue, 26 Dec 2023 17:15:20 +0900
Subject: [PATCH 120/129] Fix some bugs in scripts/upgrade-posts-v2.mjs (#1789)
* fix some bugs
* prevent duplication of the same scope
---
scripts/upgrade-posts-v2.mjs | 60 +++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 15 deletions(-)
diff --git a/scripts/upgrade-posts-v2.mjs b/scripts/upgrade-posts-v2.mjs
index 3a6e85b03..69cf64a44 100644
--- a/scripts/upgrade-posts-v2.mjs
+++ b/scripts/upgrade-posts-v2.mjs
@@ -6,6 +6,8 @@ import { toUtf8Bytes } from 'ethers'
dotenv.config()
+let isIndexCreated = false
+
const upgradeConfig = (decodedConfig, feeds) => {
const upgradedConfig = {
...decodedConfig,
@@ -13,14 +15,14 @@ const upgradeConfig = (decodedConfig, feeds) => {
/**
* Find the posts plugin
*/
- if (plugin.name === 'devprotocol:clubs:plugin:posts') {
+ if (plugin.id === 'devprotocol:clubs:plugin:posts') {
/**
* Find the feeds option and replace it with the new one
*/
const options = plugin.options.map((option) => {
- if (option.name === 'feeds') {
+ if (option.key === 'feeds') {
return {
- name: 'feeds',
+ key: 'feeds',
value: feeds,
}
}
@@ -88,17 +90,18 @@ const main = async () => {
/**
* We add the new feed value for copying the posts content
*/
+ const scope = uuidv5(
+ toUtf8Bytes('default-2'),
+ uuidv5(decodedConfig.url, uuidv5.URL),
+ )
const appendedFeeds = [
- ...feeds.value,
+ ...feeds.value.filter((feed) => feed.database.key !== scope),
{
id: 'default-2',
slug: 'posts',
database: {
type: 'documents:redis',
- key: uuidv5(
- toUtf8Bytes('default-2'), //