contract address = 0x1075f4BdAd2667041911E2Bd4b986b7a1163A470
const RPC_URL = 'https://rpc.formicarium.memecore.net'
const CONTRACT_ABI = [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "string", "name": "postId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "creator", "type": "address" }, { "indexed": false, "internalType": "string", "name": "contentHash", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" } ], "name": "PostRegistered", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "voter", "type": "address" }, { "indexed": true, "internalType": "string", "name": "postId", "type": "string" }, { "indexed": false, "internalType": "bool", "name": "oldVote", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "newVote", "type": "bool" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" } ], "name": "VoteChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "voter", "type": "address" }, { "indexed": true, "internalType": "string", "name": "postId", "type": "string" }, { "indexed": false, "internalType": "bool", "name": "isFunny", "type": "bool" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" } ], "name": "VoteCast", "type": "event" }, { "inputs": [ { "internalType": "string", "name": "postId", "type": "string" }, { "internalType": "bool", "name": "isFunny", "type": "bool" } ], "name": "castVote", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "postId", "type": "string" }, { "internalType": "bool", "name": "newVote", "type": "bool" } ], "name": "changeVote", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "postId", "type": "string" } ], "name": "getPostStats", "outputs": [ { "components": [ { "internalType": "uint256", "name": "funnyVotes", "type": "uint256" }, { "internalType": "uint256", "name": "notFunnyVotes", "type": "uint256" }, { "internalType": "uint256", "name": "totalVotes", "type": "uint256" }, { "internalType": "bool", "name": "exists", "type": "bool" } ], "internalType": "struct IMemeCourtVoting.PostStats", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "getUserVoteCount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "getUserVotedPosts", "outputs": [ { "internalType": "string[]", "name": "", "type": "string[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "voter", "type": "address" }, { "internalType": "string", "name": "postId", "type": "string" } ], "name": "getVote", "outputs": [ { "internalType": "bool", "name": "isFunny", "type": "bool" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "internalType": "bool", "name": "hasVoted", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "voter", "type": "address" }, { "internalType": "string", "name": "postId", "type": "string" } ], "name": "hasVoted", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "postId", "type": "string" }, { "internalType": "string", "name": "contentHash", "type": "string" } ], "name": "registerPost", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalPosts", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalVotes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ];