From 66859f13131e7deef99e99c8179b51f1a5180430 Mon Sep 17 00:00:00 2001 From: Magicred-1 Date: Sun, 21 Jan 2024 16:09:10 +0100 Subject: [PATCH 1/2] add ERC20ABI --- src/app/components/abis/index.ts | 289 +++++++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) diff --git a/src/app/components/abis/index.ts b/src/app/components/abis/index.ts index d33ffed..5f7624d 100644 --- a/src/app/components/abis/index.ts +++ b/src/app/components/abis/index.ts @@ -1541,4 +1541,293 @@ export const EventsFactoryABI = [ "stateMutability": "view", "type": "function" } +] as const; + +export const ERC20ABI = [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } ] as const; \ No newline at end of file From 05524b456d7fe4d12e7a05bb7648795041be0065 Mon Sep 17 00:00:00 2001 From: Magicred-1 Date: Sun, 21 Jan 2024 16:20:54 +0100 Subject: [PATCH 2/2] Adding the right abis --- src/app/components/abis/index.ts | 146 ++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 31 deletions(-) diff --git a/src/app/components/abis/index.ts b/src/app/components/abis/index.ts index 5f7624d..0fc74d7 100644 --- a/src/app/components/abis/index.ts +++ b/src/app/components/abis/index.ts @@ -1318,52 +1318,76 @@ export const EventsFactoryABI = [ "type": "function" }, { - "inputs": [], - "name": "getAllEvents", - "outputs": [ + "inputs": [ { - "internalType": "address[]", + "internalType": "address", "name": "", - "type": "address[]" + "type": "address" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAllEventsDetails", + "name": "eventDetails", "outputs": [ { - "internalType": "address[]", - "name": "", - "type": "address[]" + "internalType": "string", + "name": "eventName", + "type": "string" }, { - "internalType": "string[]", - "name": "", - "type": "string[]" + "internalType": "string", + "name": "eventDescription", + "type": "string" }, { - "internalType": "string[]", - "name": "", - "type": "string[]" + "internalType": "uint256", + "name": "eventStartDate", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "uint256", + "name": "eventEndDate", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "int256", + "name": "latitude", + "type": "int256" }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "int256", + "name": "longitude", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "eventRadius", + "type": "uint256" }, + { + "internalType": "string", + "name": "eventRadiusColor", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllEventManagers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllEvents", + "outputs": [ { "internalType": "address[]", "name": "", @@ -1373,15 +1397,75 @@ export const EventsFactoryABI = [ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getAllEventsDetails", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "eventName", + "type": "string" + }, + { + "internalType": "string", + "name": "eventDescription", + "type": "string" + }, + { + "internalType": "uint256", + "name": "eventStartDate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "eventEndDate", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "latitude", + "type": "int256" + }, + { + "internalType": "int256", + "name": "longitude", + "type": "int256" + }, + { + "internalType": "address[]", + "name": "eventManagers", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "eventRadius", + "type": "uint256" + }, + { + "internalType": "string", + "name": "eventRadiusColor", + "type": "string" + } + ], + "internalType": "struct EventFactory.EventDetails[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", - "name": "_user", + "name": "_eventAddress", "type": "address" } ], - "name": "getEventsCreatedByUserDetails", + "name": "getEventManagers", "outputs": [ { "internalType": "address[]",