Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## [4.0.2] - 2025-04-29
### Fixes
- Added oracle decimals as constants for multiTokenPaymaster as some rpc endpoints return error
- Fixed bug in metadata fetching if the config doesnt have Paymaster address
Comment on lines +2 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Changelog entries clearly document the fixes in this release.

The changelog properly documents the two bugfixes included in this release. However, there's a small grammatical error.

- Fixed bug in metadata fetching if the config doesnt have Paymaster address
+ Fixed bug in metadata fetching if the config doesn't have a Paymaster address
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## [4.0.2] - 2025-04-29
### Fixes
- Added oracle decimals as constants for multiTokenPaymaster as some rpc endpoints return error
- Fixed bug in metadata fetching if the config doesnt have Paymaster address
## [4.0.2] - 2025-04-29
### Fixes
- Added oracle decimals as constants for multiTokenPaymaster as some rpc endpoints return error
- Fixed bug in metadata fetching if the config doesn't have a Paymaster address
🧰 Tools
🪛 LanguageTool

[uncategorized] ~5-~5: You might be missing the article “a” here.
Context: ...data fetching if the config doesnt have Paymaster address ## [4.0.1] - 2025-04-22 ### Fi...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


## [4.0.1] - 2025-04-22
### Fixes
- Removed 'entryPoint' params from `getAllCommonERC20PaymasterAddress`
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arka",
"version": "4.0.1",
"version": "4.0.2",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
156 changes: 156 additions & 0 deletions backend/src/constants/MultitokenPaymaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,160 @@ export const TokenDecimalsAndSymbol: Record<number, Record<string, TokenInfo>> =
'0xB3fe5374F67D7a22886A0eE082b2E2f9d2651651': { decimals: 18, symbol: 'LINK' },
'0x8eBAf22B6F053dFFeaf46f4Dd9eFA95D89ba8580': { decimals: 18, symbol: 'UNI.e' }
}
}

export const OracleDecimals: Record<number, Record<string, {decimals: number}>> = {
'1': {
'0x3E7d1eAB13ad0104d2750B8863b489D65364e32D': { decimals: 8 },
'0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6': { decimals: 8 },
'0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c': { decimals: 8 },
'0x14e613AC84a31f709eadbdF89C6CC390fDc9540A': { decimals: 8 },
'0x31697852a68433DbCc2Ff612c516d69E3D9bd08F': { decimals: 8 },
'0xBAEbEFc1D023c0feCcc047Bff42E75F15Ff213E6': { decimals: 8 },
'0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676': { decimals: 8 }
},
'10': {
'0x8dBa75e83DA73cc766A7e5a0ee71F656BAb470d6': { decimals: 8 },
'0xECef79E109e997bCA29c1c0897ec9d7b03647F5E': { decimals: 8 },
'0x718A5788b89454aAE3A028AE9c111A29Be6c2a6F': { decimals: 8 },
'0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3': { decimals: 8 },
'0x2FCF37343e916eAEd1f1DdaaF84458a359b53877': { decimals: 8 },
'0xCc232dcFAAE6354cE191Bd574108c1aD03f86450': { decimals: 8 },
'0xA12CDDd8e986AF9288ab31E58C60e65F2987fB13': { decimals: 8 },
'0x0D276FC14719f9292D5C1eA2198673d1f4269246': { decimals: 8 },
'0x0f2Ed59657e391746C1a097BDa98F2aBb94b1120': { decimals: 8 },
'0xb429DE60943a8e6DeD356dca2F93Cd31201D9ed0': { decimals: 18 }
},
'56': {
'0xB97Ad0E74fa7d920791E90258A6E2085088b4320': { decimals: 8 },
'0xB6064eD41d4f67e353768aA239cA86f4F73665a1': { decimals: 8 },
'0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e': { decimals: 8 },
'0x51597f405303C4377E36123cBc172b13269EA163': { decimals: 8 },
'0x132d3C0B1D2cEa0BC552588063bdBb210FDeecfA': { decimals: 8 },
'0x93A67D414896A280bF8FFB3b389fE3686E014fda': { decimals: 8 },
'0xa3334A9762090E827413A7495AfeCE76F41dFc06': { decimals: 8 },
'0x7CA57b0cA6367191c94C8914d7Df09A57655905f': { decimals: 8 },
'0xb57f259E7C24e56a1dA00F66b55A5640d9f9E7e4': { decimals: 8 },
'0xca236E327F629f9Fc2c30A4E95775EbF0B89fac8': { decimals: 8 },
'0x20123C6ebd45c6496102BeEA86e1a6616Ca547c6': { decimals: 8 },
'0x8b0D36ae4CF8e277773A7ba5F35c09Edb144241b': { decimals: 8 },
'0xe2A47e87C0f4134c8D06A41975F6860468b2F925': { decimals: 8 },
'0x889158E39628C0397DC54B84F6b1cbe0AaEb7FFc': { decimals: 8 },
'0x7B49524ee5740c99435f52d731dFC94082fE61Ab': { decimals: 8 },
'0x13A9c98b07F098c5319f4FF786eB16E22DC738e1': { decimals: 8 },
'0x08E70777b982a58D23D05E3D7714f44837c06A21': { decimals: 8 },
'0xF2f8273F6b9Fc22C90891DC802cAf60eeF805cDF': { decimals: 8 },
'0x02Bfe714e78E2Ad1bb1C2beE93eC8dc5423B66d4': { decimals: 8 },
'0x9A18137ADCF7b05f033ad26968Ed5a9cf0Bf8E6b': { decimals: 8 },
'0xe0073b60833249ffd1bb2af809112c2fbf221DF6': { decimals: 8 },
'0x38393201952f2764E04B290af9df427217D56B41': { decimals: 8 },
'0x87701B15C08687341c2a847ca44eCfBc8d7873E1': { decimals: 8 },
'0x887f177CBED2cf555a64e7bF125E1825EB69dB82': { decimals: 8 },
'0x0Fe4D87883005fCAFaF56B81d09473D9A29dCDC3': { decimals: 8 },
'0xb056B7C804297279A9a673289264c17E6Dc6055d': { decimals: 8 },
'0xE5dbFD9003bFf9dF5feB2f4F445Ca00fb121fb83': { decimals: 8 },
'0x43d80f616DAf0b0B42a928EeD32147dC59027D41': { decimals: 8 },
'0x74E72F37A8c415c8f1a98Ed42E78Ff997435791D': { decimals: 8 },
'0xd5508c8Ffdb8F15cE336e629fD4ca9AdB48f50F0': { decimals: 8 },
'0x63A9133cd7c611d6049761038C16f238FddA71d7': { decimals: 8 },
'0x0Db8945f9aEf5651fa5bd52314C5aAe78DfDe540': { decimals: 8 },
'0xE188A9875af525d25334d75F3327863B2b8cd0F1': { decimals: 8 },
'0xD7eAa5Bf3013A96e3d515c055Dbd98DbdC8c620D': { decimals: 8 },
'0xBF63F430A79D4036A5900C19818aFf1fa710f206': { decimals: 8 },
'0xa767f745331D267c7751297D982b050c93985627': { decimals: 8 },
'0xC78b99Ae87fF43535b0C782128DB3cB49c74A4d3': { decimals: 8 },
'0xC333eb0086309a16aa7c8308DfD32c8BBA0a2592': { decimals: 8 },
'0x0E8a53DD9c13589df6382F13dA6B3Ec8F919B323': { decimals: 8 },
'0x3AB0A0d137D4F946fBB19eecc6e92E64660231C8': { decimals: 8 },
'0x4978c0abE6899178c1A74838Ee0062280888E2Cf': { decimals: 8 },
'0x9a177Bb9f5b6083E962f9e62bD21d4b5660Aeb03': { decimals: 8 }
},
'100': {
'0x68811D7DF835B1c33e6EEae8E7C141eF48d48cc7': { decimals: 8 },
'0x26C31ac71010aF62E6B486D1132E266D6298857D': { decimals: 8 },
'0x00288135bE38B83249F380e9b6b9a04c90EC39eE': { decimals: 8 },
'0xed322A5ac55BAE091190dFf9066760b86751947B': { decimals: 8 },
'0x2b481Dc923Aa050E009113Dca8dcb0daB4B68cDF': { decimals: 8 },
'0x1b723C855F7D2c2785F99486973271355e782d77': { decimals: 8 },
'0xBa95Bc8418Ebcdf8a690924E1d4aD5292139F2EA': { decimals: 8 },
'0xC77B83ac3Dd2a761073bD0f281f7b880B2DDDe18': { decimals: 8 },
'0x824b4A1A0443609A2ADd94a700b770FA5bE31287': { decimals: 8 },
'0x3c30c5c415B2410326297F0f65f5Cbb32f3aefCc': { decimals: 8 },
'0xeBbd67a84e33791F1bcFde74CDc22a71e332e2F1': { decimals: 8 },
'0x76e76F7E73F3BD42E3c2b4282B50b36E78130B4A': { decimals: 8 },
'0x3b84d6e6976D5826500572600eB44f9f1753827b': { decimals: 8 },
'0xC0a6Bf8d5D408B091D022C3C0653d4056D4B9c01': { decimals: 8 },
'0xd98735d78266c62277Bb4dBf3e3bCdd3694782F4': { decimals: 8 }
},
'137': {
'0xfE4A8cc5b5B2366C1B58Bea3858e81843581b2F7': { decimals: 8 },
'0x0A6513e40db6EB1b165753AD52E80663aeA50545': { decimals: 8 },
'0x72484B12719E23115761D5DA1646945632979bB6': { decimals: 8 },
'0x4746DeC9e833A82EC7C2C1356372CcF2cfcD2F3D': { decimals: 8 },
'0xF9680D99D6C9589e2a93a78A04A279e509205945': { decimals: 8 },
'0xd9FFdb71EbE7496cC440152d43986Aae0AB76665': { decimals: 8 },
'0xA1CbF3Fe43BC3501e3Fc4b573e822c70e76A7512': { decimals: 8 },
'0x2251169D32E7538652a9a8c86bf0c43bFcd956f1': { decimals: 8 },
'0x3D49406EDd4D52Fb7FFd25485f32E073b529C924': { decimals: 8 },
'0x49B0c695039243BBfEb8EcD054EB70061fd54aa0': { decimals: 8 },
'0x7C5D415B64312D38c56B54358449d0a4058339d2': { decimals: 8 },
'0xdf0Fb4e4F928d2dCB76f438575fDD8682386e13C': { decimals: 8 },
'0xDE31F8bFBD8c84b5360CFACCa3539B938dd78ae6': { decimals: 8 },
'0xD106B538F2A868c28Ca1Ec7E298C3325E0251d66': { decimals: 8 },
'0x336584C8E6Dc19637A5b36206B1c79923111b405': { decimals: 8 },
'0xDD229Ce42f11D8Ee7fFf29bDB71C7b81352e11be': { decimals: 8 },
'0x5d37E4b374E6907de8Fc7fb33EE3b0af403C7403': { decimals: 8 }
},
'204': {
'0x4fe32b0Bd039f28C8A452117D8006249415268c3': { decimals: 8 },
'0x2cAE4a97fC8AB1BD2703b56231ED662Cc4E76133': { decimals: 8 },
'0xD2852dCbEc372aaeDb13E4fa4863fcB17fD89496': { decimals: 8 },
'0xD2C1aa472260d176b811335f7362B86864a63136': { decimals: 8 }
},
'8453': {
'0x7e860098F58bBFC8648a4311b374B1D669a2bc6B': { decimals: 8 },
'0x591e79239a7d679378eC8c847e5038150364C78F': { decimals: 8 },
'0xd7818272B9e248357d13057AAb0B417aF31E817d': { decimals: 8 },
'0xD40e758b5eC80820B68DFC302fc5Ce1239083548': { decimals: 8 }
},
'42161': {
'0x50834F3163758fcC1Df9973b6e91f0F0F0434aD3': { decimals: 8 },
'0x3f3f5dF88dC9F13eac63DF89EC16ef6e7E25DdE7': { decimals: 8 },
'0xd0C7101eACbB49F3deCcCc166d238410D6D46d57': { decimals: 8 },
'0xb2A824043730FE05F3DA2efaFa1CBbe83fa548D6': { decimals: 8 },
'0xDB98056FecFff59D032aB628337A4887110df3dB': { decimals: 8 },
'0x9C917083fDb403ab5ADbEC26Ee294f6EcAda2720': { decimals: 8 },
'0x04180965a782E487d0632013ABa488A472243542': { decimals: 8 },
'0xBE5eA816870D11239c543F84b71439511D70B94f': { decimals: 8 },
'0x86E53CF1B870786351Da77A57575e79CB55812CB': { decimals: 8 },
'0xb2A8BA74cbca38508BA1632761b56C897060147C': { decimals: 8 },
'0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612': { decimals: 8 },
'0x383b3624478124697BEF675F07cA37570b73992f': { decimals: 8 },
'0x0809E3d38d1B4214958faf06D8b1B1a2b73f2ab8': { decimals: 8 },
'0xe74d69E233faB0d8F48921f2D93aDfDe44cEb3B7': { decimals: 8 },
'0xA43A34030088E6510FecCFb77E88ee5e7ed0fE64': { decimals: 8 },
'0xD6aB2298946840262FcC278fF31516D39fF611eF': { decimals: 18 },
'0x20d0Fcab0ECFD078B036b6CAf1FaC69A6453b352': { decimals: 8 },
'0xc5C8E77B397E531B8EC06BFb0048328B30E9eCfB': { decimals: 8 }
},
'43114': {
'0x3368310bC4AeE5D96486A73bae8E6b49FcDE62D3': { decimals: 8 },
'0xF096872672F44d6EBA71458D74fe67F9a77a23B9': { decimals: 8 },
'0xEBE676ee90Fe1112671f19b6B7459bC678B67e8a': { decimals: 8 },
'0xbBa56eF1565354217a3353a466edB82E8F25b08e': { decimals: 8 },
'0x49ccd9ca821EfEab2b98c60dC60F518E765EDe9a': { decimals: 8 },
'0x9a1372f9b1B71B3A5a72E092AE67E172dBd7Daaa': { decimals: 8 },
'0x3F968A21647d7ca81Fb8A5b69c0A452701d5DCe8': { decimals: 8 },
'0x3CA13391E9fb38a75330fb28f8cc2eB3D9ceceED': { decimals: 8 },
'0x2779D32d5166BAaa2B2b658333bA7e6Ec0C65743': { decimals: 8 },
'0xe89B3CE86D25599D1e615C0f6a353B4572FF868D': { decimals: 8 },
'0x3427232b88Ce4e7d62A03289247eE0cA5324f6ba': { decimals: 8 },
'0x02D35d3a8aC3e1626d3eE09A78Dd87286F5E8e3a': { decimals: 8 },
'0x976B3D034E162d8bD72D6b9C989d545b839003b0': { decimals: 8 },
'0x51D7180edA2260cc4F6e4EebB82FEF5c3c2B8300': { decimals: 8 },
'0x36E039e6391A5E7A7267650979fdf613f659be5D': { decimals: 8 },
'0x7CF8A6090A9053B01F3DF4D4e6CfEdd8c90d9027': { decimals: 8 },
'0x9df2195dc96e6Ef983B1aAC275649F3f28F82Aa1': { decimals: 8 },
'0x9Cf3Ef104A973b351B2c032AA6793c3A6F76b448': { decimals: 8 }
}
}
11 changes: 9 additions & 2 deletions backend/src/paymaster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ChainlinkOracleAbi from '../abi/ChainlinkOracleAbi.js';
import ERC20PaymasterV07Abi from '../abi/ERC20PaymasterV07Abi.js';
import ERC20Abi from '../abi/ERC20Abi.js';
import EtherspotChainlinkOracleAbi from '../abi/EtherspotChainlinkOracleAbi.js';
import { TokenDecimalsAndSymbol, UnaccountedCost } from '../constants/MultitokenPaymaster.js';
import { OracleDecimals, TokenDecimalsAndSymbol, UnaccountedCost } from '../constants/MultitokenPaymaster.js';
import { NativeOracleDecimals } from '../constants/ChainlinkOracles.js';
import { CoingeckoTokensRepository } from '../repository/coingecko-token-repository.js';
import { CoingeckoService } from '../services/coingecko.js';
Expand Down Expand Up @@ -433,6 +433,13 @@ export class Paymaster {
return tokenContract.symbol();
}

private async getChainlinkOracleDecimals(oracleAddress: string, chainId: number, oracleContract: Contract) {
if (OracleDecimals[chainId]?.[oracleAddress]) {
return OracleDecimals[chainId][oracleAddress]?.decimals;
}
return oracleContract.decimals();
}

private async getEstimateUserOperationGas(
provider: providers.JsonRpcProvider,
userOp: any,
Expand Down Expand Up @@ -575,7 +582,7 @@ export class Paymaster {
const promises = [
this.getTokenDecimals(gasToken, chainId, provider),
this.getTokenSymbol(gasToken, chainId, provider),
chainlinkContract.decimals(),
this.getChainlinkOracleDecimals(oracleAddress, chainId, chainlinkContract),
chainlinkContract.latestAnswer()
];

Expand Down
62 changes: 45 additions & 17 deletions backend/src/routes/metadata-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as EtherspotAbi from "../abi/EtherspotAbi.js";
import {abi as verifyingPaymasterAbi} from "../abi/VerifyingPaymasterAbi.js";
import {abi as verifyingPaymasterV2Abi} from "../abi/VerifyingPaymasterAbiV2.js";
import {abi as verifyingPaymastersV3Abi} from "../abi/VerifyingPaymasterAbiV3.js";
import { getAddress } from "ethers/lib/utils";

const metadataRoutes: FastifyPluginAsync = async (server) => {

Expand Down Expand Up @@ -92,16 +93,28 @@ const metadataRoutes: FastifyPluginAsync = async (server) => {
const signer = new Wallet(privateKey, provider)
const sponsorWalletBalance = await signer.getBalance();
const sponsorAddress = await signer.getAddress();
let sponsorBalance = 0;

//get native balance of the sponsor in the EtherSpotPaymaster-contract
const paymasterContract = new Contract(networkConfig.contracts.etherspotPaymasterAddress, EtherspotAbi.default, provider);
const sponsorBalance = await paymasterContract.getSponsorBalance(sponsorAddress);
if (networkConfig.contracts.etherspotPaymasterAddress) {
try {
//get native balance of the sponsor in the EtherSpotPaymaster-contract
const paymasterContract = new Contract(getAddress(networkConfig.contracts.etherspotPaymasterAddress), EtherspotAbi.default, provider);
sponsorBalance = await paymasterContract.getDeposit();
} catch (err) {
request.log.error(err);
}
}

const verifyingPaymaster = apiKeyEntity.verifyingPaymasters ? JSON.parse(apiKeyEntity.verifyingPaymasters)[chainId] : undefined;
let verifyingPaymasterDeposit;
let verifyingPaymasterDeposit = 0;
if (verifyingPaymaster) {
const vpContract = new Contract(verifyingPaymaster, verifyingPaymasterAbi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
try {
// VerifyingPaymaster address is stored in the DB as checksummed address so no need to checksum it
const vpContract = new Contract(verifyingPaymaster, verifyingPaymasterAbi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
} catch (err) {
request.log.error(err);
}
}
const chainsSupported: { chainId: number, entryPoint: string }[] = [];
SupportedNetworks.map(element => {
Expand Down Expand Up @@ -192,15 +205,26 @@ const metadataRoutes: FastifyPluginAsync = async (server) => {
const signer = new Wallet(privateKey, provider)
const sponsorWalletBalance = await signer.getBalance();
const sponsorAddress = await signer.getAddress();

//get native balance of the sponsor in the EtherSpotPaymaster-contract
const paymasterContract = new Contract(networkConfig.contracts.etherspotPaymasterAddress, EtherspotAbi.default, provider);
const sponsorBalance = await paymasterContract.getDeposit();
let sponsorBalance = 0;
if (networkConfig.contracts.etherspotPaymasterAddress) {
try {
//get native balance of the sponsor in the EtherSpotPaymaster-contract
const paymasterContract = new Contract(getAddress(networkConfig.contracts.etherspotPaymasterAddress), EtherspotAbi.default, provider);
sponsorBalance = await paymasterContract.getDeposit();
} catch (err) {
request.log.error(err);
}
}
const verifyingPaymaster = apiKeyEntity.verifyingPaymastersV2 ? JSON.parse(apiKeyEntity.verifyingPaymastersV2)[chainId] : undefined;
let verifyingPaymasterDeposit;
let verifyingPaymasterDeposit = 0;
if (verifyingPaymaster) {
const vpContract = new Contract(verifyingPaymaster, verifyingPaymasterV2Abi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
try {
// VerifyingPaymaster address is stored in the DB as checksummed address so no need to checksum it
const vpContract = new Contract(verifyingPaymaster, verifyingPaymasterV2Abi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
} catch (err) {
request.log.error(err);
}
}
const chainsSupported: { chainId: number, entryPoint: string }[] = [];
SupportedNetworks.map(element => {
Expand All @@ -213,7 +237,7 @@ const metadataRoutes: FastifyPluginAsync = async (server) => {
return reply.code(ReturnCode.SUCCESS).send({
sponsorAddress: sponsorAddress,
sponsorWalletBalance: sponsorWalletBalance,
sponsorBalance: sponsorBalance,
sponsorBalance: verifyingPaymasterDeposit ?? sponsorBalance,
chainsSupported: chainsSupported,
tokenPaymasters: tokenPaymasterAddresses,
multiTokenPaymasters,
Expand Down Expand Up @@ -293,10 +317,14 @@ const metadataRoutes: FastifyPluginAsync = async (server) => {
const sponsorAddress = await signer.getAddress();

const verifyingPaymaster = apiKeyEntity.verifyingPaymastersV3 ? JSON.parse(apiKeyEntity.verifyingPaymastersV3)[chainId] : undefined;
let verifyingPaymasterDeposit;
let verifyingPaymasterDeposit = 0;
if (verifyingPaymaster) {
const vpContract = new Contract(verifyingPaymaster, verifyingPaymastersV3Abi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
try {
const vpContract = new Contract(verifyingPaymaster, verifyingPaymastersV3Abi ,provider);
verifyingPaymasterDeposit = await vpContract.getDeposit();
} catch (err) {
request.log.error(err);
}
}
const chainsSupported: { chainId: number, entryPoint: string }[] = [];
SupportedNetworks.map(element => {
Expand Down
3 changes: 2 additions & 1 deletion backend/src/routes/paymaster-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ const paymasterRoutes: FastifyPluginAsync<PaymasterRoutesOpts> = async (server,
if (!contractWhitelistResult) throw new Error('Contract Method not whitelisted');
}
const isWhitelisted = await checkWhitelist(api_key, epVersion, userOp.sender, sponsorshipPolicy.id);
if (!isWhitelisted) {
// For EPV_06 we still use the old paymaster which whitelists the address on-chain if its verifyingPaymaster it goes to case vps for EPV_06 which checks on db
if (!isWhitelisted && epVersion !== EPVersions.EPV_06) {
throw new Error('This sender address has not been whitelisted yet');
}
if (epVersion === EPVersions.EPV_06)
Expand Down