diff --git a/README.md b/README.md index ed16f6ae..606fda2e 100644 --- a/README.md +++ b/README.md @@ -145,18 +145,32 @@ npm run dev ### Frontend Configuration (`frontend/.env`) ```.env #Ethereum Sepolia (11155111) -VITE_CONTRACT_ADDRESS_11155111=0x54a542dCDC306eE281b5De4613EcEfe6e6ABc562 -#Ethereum Classic (61) -VITE_CONTRACT_ADDRESS_61=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe -#Polygon Mainnet (137) -VITE_CONTRACT_ADDRESS_137=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe +VITE_CONTRACT_ADDRESS_11155111=0x7bC4C5abb5b1B8355Aa65307C1cFDbe6254505d2 +#Ethereum Classic (61) — blank until redeployed, see note below +VITE_CONTRACT_ADDRESS_61= +#Polygon Mainnet (137) — blank until redeployed, see note below +VITE_CONTRACT_ADDRESS_137= #Project ID VITE_WALLETCONNECT_PROJECT_ID=Your Project ID can be obtained from https://dashboard.reown.com/ ``` + +> ⚠️ Ethereum Classic and Polygon are left blank on purpose. Both still run the +> v1 contract, which stores invoice payloads on-chain as strings and has no +> public key registry, so it does not match the current ABI. The app treats any +> non-empty address as supported, so filling these in would send calls those +> contracts cannot decode. Populate them only after redeploying. > ⚠️ **Security Note:** Never commit `.env` files to version control. Keep your private keys secure. ## Deployed Contracts + +### Current (hash-based invoice storage) +Stores only `keccak256` of the invoice data on-chain and exposes the public key +registry. This is the deployment the frontend is configured against. +- Ethereum Sepolia (11155111) +```0x7bC4C5abb5b1B8355Aa65307C1cFDbe6254505d2``` + ### v1 (Mainnet Deployment — Jan 1) +Stores the invoice payload on-chain as strings. Superseded, kept for reference. - Ethereum Sepolia (11155111) ```0x54a542dCDC306eE281b5De4613EcEfe6e6ABc562``` - Ethereum Classic (61) diff --git a/frontend/.env.example b/frontend/.env.example index 4c220784..2a2d125d 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1,12 +1,17 @@ # env-copy #Ethereum Sepolia (11155111) -VITE_CONTRACT_ADDRESS_11155111=0x54a542dCDC306eE281b5De4613EcEfe6e6ABc562 +VITE_CONTRACT_ADDRESS_11155111=0x7bC4C5abb5b1B8355Aa65307C1cFDbe6254505d2 +# Left blank deliberately. Both chains still run the v1 contract, which stores +# invoice payloads on-chain as strings and has no public key registry, so it +# does not match this ABI. The app treats any non-empty address as a supported +# network, so filling these in would send bytes32-encoded calls to a contract +# that cannot decode them. Populate them only after redeploying. # Ethereum Classic (61) -VITE_CONTRACT_ADDRESS_61=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe +VITE_CONTRACT_ADDRESS_61= # Polygon Mainnet (137) -VITE_CONTRACT_ADDRESS_137=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe +VITE_CONTRACT_ADDRESS_137= VITE_WALLETCONNECT_PROJECT_ID= diff --git a/frontend/README.md b/frontend/README.md index 47c867f9..a8299782 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -55,12 +55,17 @@ The frontend reads Vite environment variables from `.env`. The provided `.env.example` includes deployed contract addresses for supported networks and the WalletConnect project ID placeholder: ```env -VITE_CONTRACT_ADDRESS_11155111=0x54a542dCDC306eE281b5De4613EcEfe6e6ABc562 -VITE_CONTRACT_ADDRESS_61=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe -VITE_CONTRACT_ADDRESS_137=0xD044A85a5daC307217B9bF313A90E8a60AF7DdCe +VITE_CONTRACT_ADDRESS_11155111=0x7bC4C5abb5b1B8355Aa65307C1cFDbe6254505d2 +VITE_CONTRACT_ADDRESS_61= +VITE_CONTRACT_ADDRESS_137= VITE_WALLETCONNECT_PROJECT_ID= ``` +> ⚠️ Ethereum Classic and Polygon are left blank on purpose. Both still run the +> v1 contract, which does not match the current ABI. The app treats any +> non-empty address as supported, so filling these in would send calls those +> contracts cannot decode. Populate them only after redeploying. + To enable Web3 wallet functionality, create a free WalletConnect Project ID from the Reown dashboard: ```text diff --git a/frontend/src/contractsABI/ChainvoiceABI.js b/frontend/src/contractsABI/ChainvoiceABI.js index 82203610..33cb6176 100644 --- a/frontend/src/contractsABI/ChainvoiceABI.js +++ b/frontend/src/contractsABI/ChainvoiceABI.js @@ -77,14 +77,9 @@ export const ChainvoiceABI = [ "internalType": "address" }, { - "name": "encryptedInvoiceData", - "type": "string", - "internalType": "string" - }, - { - "name": "encryptedHash", - "type": "string", - "internalType": "string" + "name": "invoiceDataHash", + "type": "bytes32", + "internalType": "bytes32" } ], "outputs": [], @@ -110,14 +105,9 @@ export const ChainvoiceABI = [ "internalType": "address" }, { - "name": "encryptedPayloads", - "type": "string[]", - "internalType": "string[]" - }, - { - "name": "encryptedHashes", - "type": "string[]", - "internalType": "string[]" + "name": "invoiceDataHashes", + "type": "bytes32[]", + "internalType": "bytes32[]" } ], "outputs": [], @@ -188,14 +178,9 @@ export const ChainvoiceABI = [ "internalType": "bool" }, { - "name": "encryptedInvoiceData", - "type": "string", - "internalType": "string" - }, - { - "name": "encryptedHash", - "type": "string", - "internalType": "string" + "name": "invoiceDataHash", + "type": "bytes32", + "internalType": "bytes32" } ] } @@ -288,14 +273,9 @@ export const ChainvoiceABI = [ "internalType": "bool" }, { - "name": "encryptedInvoiceData", - "type": "string", - "internalType": "string" - }, - { - "name": "encryptedHash", - "type": "string", - "internalType": "string" + "name": "invoiceDataHash", + "type": "bytes32", + "internalType": "bytes32" } ] } @@ -354,14 +334,9 @@ export const ChainvoiceABI = [ "internalType": "bool" }, { - "name": "encryptedInvoiceData", - "type": "string", - "internalType": "string" - }, - { - "name": "encryptedHash", - "type": "string", - "internalType": "string" + "name": "invoiceDataHash", + "type": "bytes32", + "internalType": "bytes32" } ] } @@ -447,14 +422,9 @@ export const ChainvoiceABI = [ "internalType": "bool" }, { - "name": "encryptedInvoiceData", - "type": "string", - "internalType": "string" - }, - { - "name": "encryptedHash", - "type": "string", - "internalType": "string" + "name": "invoiceDataHash", + "type": "bytes32", + "internalType": "bytes32" } ], "stateMutability": "view" @@ -611,25 +581,6 @@ export const ChainvoiceABI = [ ], "stateMutability": "view" }, - { - "type": "function", - "name": "wakuPublicKeys", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "withdrawFees",