From 09fe33f35f888daa901a3fdf2fb314d8bdf3fb8b Mon Sep 17 00:00:00 2001 From: vignesha22 <82584664+vignesha22@users.noreply.github.com> Date: Mon, 20 May 2024 14:26:13 +0530 Subject: [PATCH] added config to use multitoken to all chains (#102) --- admin_frontend/package-lock.json | 4 +- admin_frontend/package.json | 2 +- backend/config.json.default | 81 ++-- backend/package.json | 2 +- backend/src/abi/ChainlinkOracleAbi.ts | 509 ++++++++++++++++++++++++++ backend/src/paymaster/index.ts | 31 +- backend/src/routes/index.ts | 5 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- 9 files changed, 596 insertions(+), 44 deletions(-) create mode 100644 backend/src/abi/ChainlinkOracleAbi.ts diff --git a/admin_frontend/package-lock.json b/admin_frontend/package-lock.json index 7d4bba0..46cb049 100644 --- a/admin_frontend/package-lock.json +++ b/admin_frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "admin_frontend", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "admin_frontend", - "version": "1.2.2", + "version": "1.2.3", "dependencies": { "@emotion/react": "11.11.3", "@emotion/styled": "11.11.0", diff --git a/admin_frontend/package.json b/admin_frontend/package.json index 8679aa6..dff0365 100644 --- a/admin_frontend/package.json +++ b/admin_frontend/package.json @@ -1,6 +1,6 @@ { "name": "admin_frontend", - "version": "1.2.2", + "version": "1.2.3", "private": true, "dependencies": { "@emotion/react": "11.11.3", diff --git a/backend/config.json.default b/backend/config.json.default index 10a70a9..970e584 100644 --- a/backend/config.json.default +++ b/backend/config.json.default @@ -5,7 +5,8 @@ "contracts": { "etherspotPaymasterAddress": "0x7F690e93CecFca5A31E6e1dF50A33F6d3059048c" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 10, @@ -13,7 +14,8 @@ "contracts": { "etherspotPaymasterAddress": "0x805650ce74561C85baA44a8Bd13E19633Fd0F79d" }, - "thresholdValue": "21.8" + "thresholdValue": "21.8", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 14, @@ -21,7 +23,8 @@ "contracts": { "etherspotPaymasterAddress": "0x8A41594e5c6Fe492e437414c24eA6f401186b8d2" }, - "thresholdValue": "1556" + "thresholdValue": "1556", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 30, @@ -29,7 +32,8 @@ "contracts": { "etherspotPaymasterAddress": "0xe893A26dD53b325bFFaACdFA224692EFF4C448C4" }, - "thresholdValue": "0.00079" + "thresholdValue": "0.00079", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 31, @@ -37,7 +41,8 @@ "contracts": { "etherspotPaymasterAddress": "0xD302BE6e9D3fE0fBf8122a0C34611E31c0D0E792" }, - "thresholdValue": "0.00079" + "thresholdValue": "0.00079", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 56, @@ -45,7 +50,8 @@ "contracts": { "etherspotPaymasterAddress": "0xEA5ecE95D3A28f9faB161779d20128b449F9EC9C" }, - "thresholdValue": "0.09" + "thresholdValue": "0.09", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 97, @@ -53,7 +59,8 @@ "contracts": { "etherspotPaymasterAddress": "0x153e26707DF3787183945B88121E4Eb188FDCAAA" }, - "thresholdValue": "0.09" + "thresholdValue": "0.09", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 100, @@ -61,7 +68,8 @@ "contracts": { "etherspotPaymasterAddress": "0x373aBcF1EA9e5802778E32870e7f72C8A6a90349" }, - "thresholdValue": "50" + "thresholdValue": "50", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 114, @@ -69,7 +77,8 @@ "contracts": { "etherspotPaymasterAddress": "0x2a18C360b525824B3e5656B5a705554f2a5036Be" }, - "thresholdValue": "1556" + "thresholdValue": "1556", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 122, @@ -85,7 +94,8 @@ "contracts": { "etherspotPaymasterAddress": "0xAF628C207513c5E51d894b3733056B8080634923" }, - "thresholdValue": "669" + "thresholdValue": "669", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 137, @@ -93,7 +103,8 @@ "contracts": { "etherspotPaymasterAddress": "0x26FeC24b0D467C9de105217B483931e8f944ff50" }, - "thresholdValue": "69.85" + "thresholdValue": "69.85", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 5000, @@ -101,7 +112,8 @@ "contracts": { "etherspotPaymasterAddress": "0x8A41594e5c6Fe492e437414c24eA6f401186b8d2" }, - "thresholdValue": "44.24" + "thresholdValue": "44.24", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 5003, @@ -109,7 +121,8 @@ "contracts": { "etherspotPaymasterAddress": "0x8350355c08aDAC387b443782124A30A8942BeC2e" }, - "thresholdValue": "44.24" + "thresholdValue": "44.24", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 8217, @@ -117,7 +130,8 @@ "contracts": { "etherspotPaymasterAddress": "0x4ebd86AAF89151b5303DB072e0205C668e31E5E7" }, - "thresholdValue": "275.2" + "thresholdValue": "275.2", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 8453, @@ -125,7 +139,8 @@ "contracts": { "etherspotPaymasterAddress": "0x810FA4C915015b703db0878CF2B9344bEB254a40" }, - "thresholdValue": "15.19" + "thresholdValue": "15.19", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 42161, @@ -133,7 +148,8 @@ "contracts": { "etherspotPaymasterAddress": "0xEC2EE24E79C73DB13Dd9bC782856a5296626b7eb" }, - "thresholdValue": "43.10" + "thresholdValue": "43.10", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 43114, @@ -141,7 +157,8 @@ "contracts": { "etherspotPaymasterAddress": "0x527569794781671319f20374A050BDbef4181aB3" }, - "thresholdValue": "1.4" + "thresholdValue": "1.4", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 59144, @@ -149,7 +166,8 @@ "contracts": { "etherspotPaymasterAddress": "0xB3AD9B9B06c6016f81404ee8FcCD0526F018Cf0C" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 84532, @@ -157,7 +175,8 @@ "contracts": { "etherspotPaymasterAddress": "0xe893A26DD53b325BffAacDfA224692EfF4C448c4" }, - "thresholdValue": "15.19" + "thresholdValue": "15.19", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 421614, @@ -165,7 +184,8 @@ "contracts": { "etherspotPaymasterAddress": "0xe893A26DD53b325BffAacDfA224692EfF4C448c4" }, - "thresholdValue": "43.10" + "thresholdValue": "43.10", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 534351, @@ -173,7 +193,8 @@ "contracts": { "etherspotPaymasterAddress": "0xe893A26DD53b325BffAacDfA224692EfF4C448c4" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 534352, @@ -181,7 +202,8 @@ "contracts": { "etherspotPaymasterAddress": "0xB3AD9B9B06c6016f81404ee8FcCD0526F018Cf0C" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 11155111, @@ -189,7 +211,8 @@ "contracts": { "etherspotPaymasterAddress": "0xcaDBADcFeD5530A49762DFc9d1d712CcD6b09b25" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 28122024, @@ -197,7 +220,8 @@ "contracts": { "etherspotPaymasterAddress": "0xe893A26DD53b325BffAacDfA224692EfF4C448c4" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "orochi" }, { "chainId": 11155420, @@ -205,7 +229,8 @@ "contracts": { "etherspotPaymasterAddress": "0xB3AD9B9B06c6016f81404ee8FcCD0526F018Cf0C" }, - "thresholdValue": "21.8" + "thresholdValue": "21.8", + "MultiTokenPaymasterOracleUsed": "chainlink" }, { "chainId": 888888888, @@ -213,7 +238,8 @@ "contracts": { "etherspotPaymasterAddress": "0x810FA4C915015b703db0878CF2B9344bEB254a40" }, - "thresholdValue": "0.016" + "thresholdValue": "0.016", + "MultiTokenPaymasterOracleUsed": "orochi" }, { "chainId": 80002, @@ -221,6 +247,7 @@ "contracts": { "etherspotPaymasterAddress": "0xe893a26dd53b325bffaacdfa224692eff4c448c4" }, - "thresholdValue": "0.01" + "thresholdValue": "0.01", + "MultiTokenPaymasterOracleUsed": "chainlink" } ] diff --git a/backend/package.json b/backend/package.json index 966a880..45ae781 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "arka", - "version": "1.2.2", + "version": "1.2.3", "description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software", "type": "module", "directories": { diff --git a/backend/src/abi/ChainlinkOracleAbi.ts b/backend/src/abi/ChainlinkOracleAbi.ts new file mode 100644 index 0000000..d178ee2 --- /dev/null +++ b/backend/src/abi/ChainlinkOracleAbi.ts @@ -0,0 +1,509 @@ +export default [ + { + "inputs": [ + { + "internalType": "address", + "name": "_aggregator", + "type": "address" + }, + { + "internalType": "address", + "name": "_accessController", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "int256", + "name": "current", + "type": "int256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + } + ], + "name": "AnswerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "startedBy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startedAt", + "type": "uint256" + } + ], + "name": "NewRound", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessController", + "outputs": [ + { + "internalType": "contract AccessControllerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "aggregator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_aggregator", + "type": "address" + } + ], + "name": "confirmAggregator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "description", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_roundId", + "type": "uint256" + } + ], + "name": "getAnswer", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint80", + "name": "_roundId", + "type": "uint80" + } + ], + "name": "getRoundData", + "outputs": [ + { + "internalType": "uint80", + "name": "roundId", + "type": "uint80" + }, + { + "internalType": "int256", + "name": "answer", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "startedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "uint80", + "name": "answeredInRound", + "type": "uint80" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_roundId", + "type": "uint256" + } + ], + "name": "getTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestAnswer", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestRound", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestRoundData", + "outputs": [ + { + "internalType": "uint80", + "name": "roundId", + "type": "uint80" + }, + { + "internalType": "int256", + "name": "answer", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "startedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "uint80", + "name": "answeredInRound", + "type": "uint80" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "phaseAggregators", + "outputs": [ + { + "internalType": "contract AggregatorV2V3Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "phaseId", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_aggregator", + "type": "address" + } + ], + "name": "proposeAggregator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposedAggregator", + "outputs": [ + { + "internalType": "contract AggregatorV2V3Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint80", + "name": "_roundId", + "type": "uint80" + } + ], + "name": "proposedGetRoundData", + "outputs": [ + { + "internalType": "uint80", + "name": "roundId", + "type": "uint80" + }, + { + "internalType": "int256", + "name": "answer", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "startedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "uint80", + "name": "answeredInRound", + "type": "uint80" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposedLatestRoundData", + "outputs": [ + { + "internalType": "uint80", + "name": "roundId", + "type": "uint80" + }, + { + "internalType": "int256", + "name": "answer", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "startedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "uint80", + "name": "answeredInRound", + "type": "uint80" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessController", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/backend/src/paymaster/index.ts b/backend/src/paymaster/index.ts index 5d9d37a..6531873 100644 --- a/backend/src/paymaster/index.ts +++ b/backend/src/paymaster/index.ts @@ -9,6 +9,7 @@ import { PAYMASTER_ADDRESS } from '../constants/Pimlico.js'; import { getEtherscanFee } from '../utils/common.js'; import MultiTokenPaymasterAbi from '../abi/MultiTokenPaymasterAbi.js'; import OrochiOracleAbi from '../abi/OrochiOracleAbi.js'; +import ChainlinkOracleAbi from '../abi/ChainlinkOracleAbi.js'; export class Paymaster { feeMarkUp: BigNumber; @@ -42,7 +43,8 @@ export class Paymaster { return paymasterAndData; } - async sign(userOp: any, validUntil: string, validAfter: string, entryPoint: string, paymasterAddress: string, bundlerRpc: string, signer: Wallet, log?: FastifyBaseLogger) { + async sign(userOp: any, validUntil: string, validAfter: string, entryPoint: string, paymasterAddress: string, + bundlerRpc: string, signer: Wallet, log?: FastifyBaseLogger) { try { const provider = new providers.JsonRpcProvider(bundlerRpc); const paymasterContract = new ethers.Contract(paymasterAddress, abi, provider); @@ -69,10 +71,11 @@ export class Paymaster { } } - async getPaymasterAndDataForMultiTokenPaymaster(userOp: any, validUntil: string, validAfter: string, feeToken: string, ethPrice: string, paymasterContract: Contract, signer: Wallet) { + async getPaymasterAndDataForMultiTokenPaymaster(userOp: any, validUntil: string, validAfter: string, feeToken: string, + ethPrice: string, paymasterContract: Contract, signer: Wallet) { const exchangeRate = 1000000; // This is for setting min tokens required for the txn that gets validated on estimate const rate = ethers.BigNumber.from(exchangeRate).mul(ethPrice); - const priceMarkup = this.multiTokenMarkUp; + const priceMarkup = this.multiTokenMarkUp; // actual signing... // priceSource inputs available 0 - for using external exchange price and 1 - for oracle based price const hash = await paymasterContract.getHash( @@ -101,15 +104,24 @@ export class Paymaster { return paymasterAndData; } - async signMultiTokenPaymaster(userOp: any, validUntil: string, validAfter: string, entryPoint: string, paymasterAddress: string, feeToken: string, oracleAggregator: string, bundlerRpc: string, signer: Wallet, log?: FastifyBaseLogger) { + async signMultiTokenPaymaster(userOp: any, validUntil: string, validAfter: string, entryPoint: string, paymasterAddress: string, + feeToken: string, oracleAggregator: string, bundlerRpc: string, signer: Wallet, oracleName: string, log?: FastifyBaseLogger) { try { const provider = new providers.JsonRpcProvider(bundlerRpc); const paymasterContract = new ethers.Contract(paymasterAddress, MultiTokenPaymasterAbi, provider); - const oracleContract = new ethers.Contract(oracleAggregator, OrochiOracleAbi, provider); - const result = await oracleContract.getLatestData(1, ethers.utils.hexlify(ethers.utils.toUtf8Bytes('ETH')).padEnd(42, '0')) - const ethPrice = Number(ethers.utils.formatEther(result)).toFixed(0); + let ethPrice = ""; + if (oracleName === "orochi") { + const oracleContract = new ethers.Contract(oracleAggregator, OrochiOracleAbi, provider); + const result = await oracleContract.getLatestData(1, ethers.utils.hexlify(ethers.utils.toUtf8Bytes('ETH')).padEnd(42, '0')) + ethPrice = Number(ethers.utils.formatEther(result)).toFixed(0); + } else { + const chainlinkContract = new ethers.Contract(oracleAggregator, ChainlinkOracleAbi, provider); + const decimals = await chainlinkContract.decimals(); + const result = await chainlinkContract.latestAnswer(); + ethPrice = Number(ethers.utils.formatUnits(result, decimals)).toFixed(0); + } userOp.paymasterAndData = await this.getPaymasterAndDataForMultiTokenPaymaster(userOp, validUntil, validAfter, feeToken, ethPrice, paymasterContract, signer); - + if (!userOp.signature) userOp.signature = '0x'; const response = await provider.send('eth_estimateUserOperationGas', [userOp, entryPoint]); userOp.verificationGasLimit = response.verificationGasLimit; @@ -156,7 +168,8 @@ export class Paymaster { const tokenContract = new Contract(await erc20Paymaster.tokenAddress, minABI, provider) const tokenBalance = await tokenContract.balanceOf(userOp.sender); - if (tokenAmountRequired.gte(tokenBalance)) throw new Error(`The required token amount ${tokenAmountRequired.toString()} is more than what the sender has ${tokenBalance}`) + if (tokenAmountRequired.gte(tokenBalance)) + throw new Error(`The required token amount ${tokenAmountRequired.toString()} is more than what the sender has ${tokenBalance}`) let paymasterAndData = await erc20Paymaster.generatePaymasterAndDataForTokenAmount(userOp, tokenAmountRequired) userOp.paymasterAndData = paymasterAndData; diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 88faf80..10896c6 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -200,7 +200,10 @@ const routes: FastifyPluginAsync = async (server) => { } str += hex; str1 += hex1; - result = await paymaster.signMultiTokenPaymaster(userOp, str, str1, entryPoint, multiTokenPaymasters[chainId][gasToken], gasToken, multiTokenOracles[chainId][gasToken], networkConfig.bundler, signer, server.log); + if (!networkConfig.MultiTokenPaymasterOracleUsed || + !(networkConfig.MultiTokenPaymasterOracleUsed == "orochi" || networkConfig.MultiTokenPaymasterOracleUsed == "chainlink")) + throw new Error("Oracle is not Defined/Invalid"); + result = await paymaster.signMultiTokenPaymaster(userOp, str, str1, entryPoint, multiTokenPaymasters[chainId][gasToken], gasToken, multiTokenOracles[chainId][gasToken], networkConfig.bundler, signer, networkConfig.MultiTokenPaymasterOracleUsed, server.log); break; } default : { diff --git a/frontend/package-lock.json b/frontend/package-lock.json index a1c6693..27b0e76 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "arka_frontend", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "arka_frontend", - "version": "1.2.2", + "version": "1.2.3", "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", "@emotion/react": "^11.11.1", diff --git a/frontend/package.json b/frontend/package.json index 5b82775..6b1e142 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "arka_frontend", - "version": "1.2.2", + "version": "1.2.3", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11",