diff --git a/frontend/src/contractsABI/ChainvoiceABI.js b/frontend/src/contractsABI/ChainvoiceABI.js index 2639dae6..82203610 100644 --- a/frontend/src/contractsABI/ChainvoiceABI.js +++ b/frontend/src/contractsABI/ChainvoiceABI.js @@ -1,589 +1,1071 @@ export const ChainvoiceABI = [ { - type: "constructor", - inputs: [], - stateMutability: "nonpayable", + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" }, { - type: "function", - name: "accumulatedFees", - inputs: [], - outputs: [ + "type": "function", + "name": "MAX_BATCH", + "inputs": [], + "outputs": [ { - name: "", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - stateMutability: "view", + "stateMutability": "view" + }, + { + "type": "function", + "name": "acceptOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { - type: "function", - name: "cancelInvoice", - inputs: [ + "type": "function", + "name": "accumulatedFees", + "inputs": [], + "outputs": [ { - name: "invoiceId", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - outputs: [], - stateMutability: "nonpayable", + "stateMutability": "view" }, { - type: "function", - name: "createInvoice", - inputs: [ + "type": "function", + "name": "cancelInvoice", + "inputs": [ { - name: "to", - type: "address", - internalType: "address", - }, + "name": "invoiceId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "cancelOwnershipTransfer", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "createInvoice", + "inputs": [ { - name: "amountDue", - type: "uint256", - internalType: "uint256", + "name": "to", + "type": "address", + "internalType": "address" }, { - name: "tokenAddress", - type: "address", - internalType: "address", + "name": "amountDue", + "type": "uint256", + "internalType": "uint256" }, { - name: "encryptedInvoiceData", - type: "string", - internalType: "string", + "name": "tokenAddress", + "type": "address", + "internalType": "address" }, { - name: "encryptedHash", - type: "string", - internalType: "string", + "name": "encryptedInvoiceData", + "type": "string", + "internalType": "string" }, + { + "name": "encryptedHash", + "type": "string", + "internalType": "string" + } ], - outputs: [], - stateMutability: "nonpayable", + "outputs": [], + "stateMutability": "nonpayable" }, { - type: "function", - name: "fee", - inputs: [], - outputs: [ + "type": "function", + "name": "createInvoicesBatch", + "inputs": [ { - name: "", - type: "uint256", - internalType: "uint256", + "name": "tos", + "type": "address[]", + "internalType": "address[]" }, + { + "name": "amountsDue", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "tokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "encryptedPayloads", + "type": "string[]", + "internalType": "string[]" + }, + { + "name": "encryptedHashes", + "type": "string[]", + "internalType": "string[]" + } ], - stateMutability: "view", + "outputs": [], + "stateMutability": "nonpayable" }, { - type: "function", - name: "getInvoice", - inputs: [ + "type": "function", + "name": "fee", + "inputs": [], + "outputs": [ { - name: "invoiceId", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getInvoice", + "inputs": [ + { + "name": "invoiceId", + "type": "uint256", + "internalType": "uint256" + } ], - outputs: [ + "outputs": [ { - name: "", - type: "tuple", - internalType: "struct Chainvoice.InvoiceDetails", - components: [ + "name": "", + "type": "tuple", + "internalType": "struct Chainvoice.InvoiceDetails", + "components": [ { - name: "id", - type: "uint256", - internalType: "uint256", + "name": "id", + "type": "uint256", + "internalType": "uint256" }, { - name: "from", - type: "address", - internalType: "address", + "name": "from", + "type": "address", + "internalType": "address" }, { - name: "to", - type: "address", - internalType: "address", + "name": "to", + "type": "address", + "internalType": "address" }, { - name: "amountDue", - type: "uint256", - internalType: "uint256", + "name": "amountDue", + "type": "uint256", + "internalType": "uint256" }, { - name: "tokenAddress", - type: "address", - internalType: "address", + "name": "tokenAddress", + "type": "address", + "internalType": "address" }, { - name: "isPaid", - type: "bool", - internalType: "bool", + "name": "isPaid", + "type": "bool", + "internalType": "bool" }, { - name: "isCancelled", - type: "bool", - internalType: "bool", + "name": "isCancelled", + "type": "bool", + "internalType": "bool" }, { - name: "encryptedInvoiceData", - type: "string", - internalType: "string", + "name": "encryptedInvoiceData", + "type": "string", + "internalType": "string" }, { - name: "encryptedHash", - type: "string", - internalType: "string", - }, - ], - }, + "name": "encryptedHash", + "type": "string", + "internalType": "string" + } + ] + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "getPaymentStatus", - inputs: [ + "type": "function", + "name": "getPaymentStatus", + "inputs": [ { - name: "invoiceId", - type: "uint256", - internalType: "uint256", + "name": "invoiceId", + "type": "uint256", + "internalType": "uint256" }, { - name: "payer", - type: "address", - internalType: "address", - }, + "name": "payer", + "type": "address", + "internalType": "address" + } ], - outputs: [ + "outputs": [ { - name: "canPay", - type: "bool", - internalType: "bool", + "name": "canPay", + "type": "bool", + "internalType": "bool" }, { - name: "payerBalance", - type: "uint256", - internalType: "uint256", + "name": "payerBalance", + "type": "uint256", + "internalType": "uint256" }, { - name: "allowanceAmount", - type: "uint256", - internalType: "uint256", - }, + "name": "allowanceAmount", + "type": "uint256", + "internalType": "uint256" + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "getReceivedInvoices", - inputs: [ + "type": "function", + "name": "getReceivedInvoices", + "inputs": [ { - name: "user", - type: "address", - internalType: "address", - }, + "name": "user", + "type": "address", + "internalType": "address" + } ], - outputs: [ + "outputs": [ { - name: "", - type: "tuple[]", - internalType: "struct Chainvoice.InvoiceDetails[]", - components: [ + "name": "", + "type": "tuple[]", + "internalType": "struct Chainvoice.InvoiceDetails[]", + "components": [ { - name: "id", - type: "uint256", - internalType: "uint256", + "name": "id", + "type": "uint256", + "internalType": "uint256" }, { - name: "from", - type: "address", - internalType: "address", + "name": "from", + "type": "address", + "internalType": "address" }, { - name: "to", - type: "address", - internalType: "address", + "name": "to", + "type": "address", + "internalType": "address" }, { - name: "amountDue", - type: "uint256", - internalType: "uint256", + "name": "amountDue", + "type": "uint256", + "internalType": "uint256" }, { - name: "tokenAddress", - type: "address", - internalType: "address", + "name": "tokenAddress", + "type": "address", + "internalType": "address" }, { - name: "isPaid", - type: "bool", - internalType: "bool", + "name": "isPaid", + "type": "bool", + "internalType": "bool" }, { - name: "isCancelled", - type: "bool", - internalType: "bool", + "name": "isCancelled", + "type": "bool", + "internalType": "bool" }, { - name: "encryptedInvoiceData", - type: "string", - internalType: "string", + "name": "encryptedInvoiceData", + "type": "string", + "internalType": "string" }, { - name: "encryptedHash", - type: "string", - internalType: "string", - }, - ], - }, + "name": "encryptedHash", + "type": "string", + "internalType": "string" + } + ] + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "getSentInvoices", - inputs: [ + "type": "function", + "name": "getSentInvoices", + "inputs": [ { - name: "user", - type: "address", - internalType: "address", - }, + "name": "user", + "type": "address", + "internalType": "address" + } ], - outputs: [ + "outputs": [ { - name: "", - type: "tuple[]", - internalType: "struct Chainvoice.InvoiceDetails[]", - components: [ + "name": "", + "type": "tuple[]", + "internalType": "struct Chainvoice.InvoiceDetails[]", + "components": [ { - name: "id", - type: "uint256", - internalType: "uint256", + "name": "id", + "type": "uint256", + "internalType": "uint256" }, { - name: "from", - type: "address", - internalType: "address", + "name": "from", + "type": "address", + "internalType": "address" }, { - name: "to", - type: "address", - internalType: "address", + "name": "to", + "type": "address", + "internalType": "address" }, { - name: "amountDue", - type: "uint256", - internalType: "uint256", + "name": "amountDue", + "type": "uint256", + "internalType": "uint256" }, { - name: "tokenAddress", - type: "address", - internalType: "address", + "name": "tokenAddress", + "type": "address", + "internalType": "address" }, { - name: "isPaid", - type: "bool", - internalType: "bool", + "name": "isPaid", + "type": "bool", + "internalType": "bool" }, { - name: "isCancelled", - type: "bool", - internalType: "bool", + "name": "isCancelled", + "type": "bool", + "internalType": "bool" }, { - name: "encryptedInvoiceData", - type: "string", - internalType: "string", + "name": "encryptedInvoiceData", + "type": "string", + "internalType": "string" }, { - name: "encryptedHash", - type: "string", - internalType: "string", - }, - ], - }, + "name": "encryptedHash", + "type": "string", + "internalType": "string" + } + ] + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "invoices", - inputs: [ + "type": "function", + "name": "getWakuPublicKey", + "inputs": [ { - name: "", - type: "uint256", - internalType: "uint256", - }, + "name": "user", + "type": "address", + "internalType": "address" + } ], - outputs: [ + "outputs": [ { - name: "id", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initiateOwnershipTransfer", + "inputs": [ { - name: "from", - type: "address", - internalType: "address", + "name": "newOwner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "invoices", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" }, { - name: "to", - type: "address", - internalType: "address", + "name": "from", + "type": "address", + "internalType": "address" }, { - name: "amountDue", - type: "uint256", - internalType: "uint256", + "name": "to", + "type": "address", + "internalType": "address" }, { - name: "tokenAddress", - type: "address", - internalType: "address", + "name": "amountDue", + "type": "uint256", + "internalType": "uint256" }, { - name: "isPaid", - type: "bool", - internalType: "bool", + "name": "tokenAddress", + "type": "address", + "internalType": "address" }, { - name: "isCancelled", - type: "bool", - internalType: "bool", + "name": "isPaid", + "type": "bool", + "internalType": "bool" }, { - name: "encryptedInvoiceData", - type: "string", - internalType: "string", + "name": "isCancelled", + "type": "bool", + "internalType": "bool" }, { - name: "encryptedHash", - type: "string", - internalType: "string", + "name": "encryptedInvoiceData", + "type": "string", + "internalType": "string" }, + { + "name": "encryptedHash", + "type": "string", + "internalType": "string" + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "owner", - inputs: [], - outputs: [ + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ { - name: "", - type: "address", - internalType: "address", - }, + "name": "", + "type": "address", + "internalType": "address" + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "payInvoice", - inputs: [ + "type": "function", + "name": "payInvoice", + "inputs": [ { - name: "invoiceId", - type: "uint256", - internalType: "uint256", - }, + "name": "invoiceId", + "type": "uint256", + "internalType": "uint256" + } ], - outputs: [], - stateMutability: "payable", + "outputs": [], + "stateMutability": "payable" }, { - type: "function", - name: "receivedInvoices", - inputs: [ + "type": "function", + "name": "payInvoicesBatch", + "inputs": [ { - name: "", - type: "address", - internalType: "address", - }, + "name": "invoiceIds", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "pendingOwner", + "inputs": [], + "outputs": [ { - name: "", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "address", + "internalType": "address" + } ], - outputs: [ + "stateMutability": "view" + }, + { + "type": "function", + "name": "receivedInvoices", + "inputs": [ { - name: "", - type: "uint256", - internalType: "uint256", + "name": "", + "type": "address", + "internalType": "address" }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - stateMutability: "view", + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { - type: "function", - name: "sentInvoices", - inputs: [ + "type": "function", + "name": "registerWakuPublicKey", + "inputs": [ { - name: "", - type: "address", - internalType: "address", - }, + "name": "publicKey", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sentInvoices", + "inputs": [ { - name: "", - type: "uint256", - internalType: "uint256", + "name": "", + "type": "address", + "internalType": "address" }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - outputs: [ + "outputs": [ { - name: "", - type: "uint256", - internalType: "uint256", - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - stateMutability: "view", + "stateMutability": "view" }, { - type: "function", - name: "setFeeAmount", - inputs: [ + "type": "function", + "name": "setFeeAmount", + "inputs": [ { - name: "_fee", - type: "uint256", - internalType: "uint256", - }, + "name": "_fee", + "type": "uint256", + "internalType": "uint256" + } ], - outputs: [], - stateMutability: "nonpayable", + "outputs": [], + "stateMutability": "nonpayable" }, { - type: "function", - name: "setTreasuryAddress", - inputs: [ + "type": "function", + "name": "setTreasuryAddress", + "inputs": [ { - name: "newTreasury", - type: "address", - internalType: "address", + "name": "newTreasury", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "treasuryAddress", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "wakuPublicKeys", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdrawFees", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "FeeUpdated", + "inputs": [ + { + "name": "previousFee", + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, + { + "name": "newFee", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } ], - outputs: [], - stateMutability: "nonpayable", + "anonymous": false }, { - type: "function", - name: "treasuryAddress", - inputs: [], - outputs: [ + "type": "event", + "name": "InvoiceBatchCreated", + "inputs": [ + { + "name": "creator", + "type": "address", + "indexed": true, + "internalType": "address" + }, { - name: "", - type: "address", - internalType: "address", + "name": "token", + "type": "address", + "indexed": true, + "internalType": "address" }, + { + "name": "count", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "ids", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + } ], - stateMutability: "view", + "anonymous": false }, { - type: "function", - name: "withdrawFees", - inputs: [], - outputs: [], - stateMutability: "nonpayable", + "type": "event", + "name": "InvoiceBatchPaid", + "inputs": [ + { + "name": "payer", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "count", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "totalAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "ids", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + } + ], + "anonymous": false }, { - type: "event", - name: "InvoiceCancelled", - inputs: [ + "type": "event", + "name": "InvoiceCancelled", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, { - name: "id", - type: "uint256", - indexed: true, - internalType: "uint256", + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "from", - type: "address", - indexed: true, - internalType: "address", + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "to", - type: "address", - indexed: true, - internalType: "address", + "name": "tokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "InvoiceCreated", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - name: "tokenAddress", - type: "address", - indexed: false, - internalType: "address", + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + } ], - anonymous: false, + "anonymous": false }, { - type: "event", - name: "InvoiceCreated", - inputs: [ + "type": "event", + "name": "InvoicePaid", + "inputs": [ { - name: "id", - type: "uint256", - indexed: true, - internalType: "uint256", + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - name: "from", - type: "address", - indexed: true, - internalType: "address", + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "to", - type: "address", - indexed: true, - internalType: "address", + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "tokenAddress", - type: "address", - indexed: false, - internalType: "address", + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, + { + "name": "tokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + } ], - anonymous: false, + "anonymous": false }, { - type: "event", - name: "InvoicePaid", - inputs: [ + "type": "event", + "name": "OwnershipTransferCancelled", + "inputs": [ { - name: "id", - type: "uint256", - indexed: true, - internalType: "uint256", + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "from", - type: "address", - indexed: true, - internalType: "address", + "name": "cancelledPendingOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferInitiated", + "inputs": [ + { + "name": "currentOwner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "to", - type: "address", - indexed: true, - internalType: "address", + "name": "pendingOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "amount", - type: "uint256", - indexed: false, - internalType: "uint256", + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TreasuryAddressUpdated", + "inputs": [ + { + "name": "previousTreasury", + "type": "address", + "indexed": true, + "internalType": "address" }, { - name: "tokenAddress", - type: "address", - indexed: false, - internalType: "address", + "name": "newTreasury", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WakuKeyRegistered", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true, + "internalType": "address" }, + { + "name": "publicKey", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } ], - anonymous: false, + "anonymous": false + }, + { + "type": "error", + "name": "AlreadySettled", + "inputs": [] + }, + { + "type": "error", + "name": "ArrayLengthMismatch", + "inputs": [] + }, + { + "type": "error", + "name": "FeeMustBeNative", + "inputs": [] + }, + { + "type": "error", + "name": "IncorrectNativeValue", + "inputs": [] + }, + { + "type": "error", + "name": "IncorrectPaymentAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientAllowance", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAmount", + "inputs": [] }, -]; \ No newline at end of file + { + "type": "error", + "name": "InvalidBatchSize", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInvoiceHash", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInvoiceId", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidNewOwner", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidToken", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidWakuKey", + "inputs": [] + }, + { + "type": "error", + "name": "InvoiceAlreadyPaid", + "inputs": [] + }, + { + "type": "error", + "name": "InvoiceCancelledError", + "inputs": [] + }, + { + "type": "error", + "name": "InvoiceNotCancellable", + "inputs": [] + }, + { + "type": "error", + "name": "MixedTokenBatch", + "inputs": [] + }, + { + "type": "error", + "name": "NativeTransferFailed", + "inputs": [] + }, + { + "type": "error", + "name": "NoFeesAvailable", + "inputs": [] + }, + { + "type": "error", + "name": "NotAuthorizedPayer", + "inputs": [] + }, + { + "type": "error", + "name": "NotContract", + "inputs": [] + }, + { + "type": "error", + "name": "NotInvoiceCreator", + "inputs": [] + }, + { + "type": "error", + "name": "OwnershipNotPending", + "inputs": [] + }, + { + "type": "error", + "name": "Reentrancy", + "inputs": [] + }, + { + "type": "error", + "name": "SelfInvoicing", + "inputs": [] + }, + { + "type": "error", + "name": "TokenTransferFailed", + "inputs": [] + }, + { + "type": "error", + "name": "TreasuryNotSet", + "inputs": [] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [] + }, + { + "type": "error", + "name": "WithdrawFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + } +];