diff --git a/package-lock.json b/package-lock.json index 4dd1082b2..538ed101e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "lottie-web": "^5.12.2", "marked": "^11.2.0", "moment": "^2.29.4", - "revm-interpreter-js": "^0.1.2", + "revm-interpreter-js": "^1.0.1", "veaury": "^2.3.12", "viem": "^2.9.13", "vue": "^3.2.47", @@ -20855,9 +20855,9 @@ } }, "node_modules/revm-interpreter-js": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/revm-interpreter-js/-/revm-interpreter-js-0.1.2.tgz", - "integrity": "sha512-pmUdipVEIMD0UT6gpQp6a9oRZ9hTfLo1fcSbdrRSrdEs9UWlel2tVcC5dycCHD5Bwpx1cr+rBKgwRXWlB3rEKw==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/revm-interpreter-js/-/revm-interpreter-js-1.0.1.tgz", + "integrity": "sha512-wu8bdQdCgRunAbmxTeTvsFkTn5pVYBNOPLuUm4i7mFSoHGe2txHwaYqZK7M6k+/t4/YMnU07YFToxrp6EaUZlw==" }, "node_modules/rfdc": { "version": "1.3.1", @@ -39787,9 +39787,9 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "revm-interpreter-js": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/revm-interpreter-js/-/revm-interpreter-js-0.1.2.tgz", - "integrity": "sha512-pmUdipVEIMD0UT6gpQp6a9oRZ9hTfLo1fcSbdrRSrdEs9UWlel2tVcC5dycCHD5Bwpx1cr+rBKgwRXWlB3rEKw==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/revm-interpreter-js/-/revm-interpreter-js-1.0.1.tgz", + "integrity": "sha512-wu8bdQdCgRunAbmxTeTvsFkTn5pVYBNOPLuUm4i7mFSoHGe2txHwaYqZK7M6k+/t4/YMnU07YFToxrp6EaUZlw==" }, "rfdc": { "version": "1.3.1", diff --git a/package.json b/package.json index 093168bdd..f6bbcc3c3 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lottie-web": "^5.12.2", "marked": "^11.2.0", "moment": "^2.29.4", - "revm-interpreter-js": "^0.1.2", + "revm-interpreter-js": "^1.0.1", "veaury": "^2.3.12", "viem": "^2.9.13", "vue": "^3.2.47", diff --git a/src/helpers/pools/swap/libs/interpretContract.ts b/src/helpers/pools/swap/libs/interpretContract.ts index 914ec536b..77218bc81 100644 --- a/src/helpers/pools/swap/libs/interpretContract.ts +++ b/src/helpers/pools/swap/libs/interpretContract.ts @@ -1,4 +1,4 @@ -import { interpret } from "revm-interpreter-js"; +import { type InterpretParams, interpret } from "revm-interpreter-js"; import { encodeFunctionData, type Abi, @@ -23,14 +23,14 @@ export function interpretContract< abi, AbiStateMutability, functionName extends ContractFunctionName - ? functionName - : ContractFunctionName + ? functionName + : ContractFunctionName > = ContractFunctionArgs< abi, AbiStateMutability, functionName extends ContractFunctionName - ? functionName - : ContractFunctionName + ? functionName + : ContractFunctionName > >( parameters: EncodeFunctionDataParameters & { @@ -40,6 +40,8 @@ export function interpretContract< bytecodeAddress?: Address | ByteArray; code: Hex | ByteArray; gasLimit?: bigint; + staticCall?: boolean; + specificationName?: InterpretParams["specificationName"]; } ): DecodeFunctionResultReturnType { const tryToBytes = ( @@ -56,14 +58,17 @@ export function interpretContract< args: parameters.args, } as EncodeFunctionDataParameters); const interpretResult = interpret( - isBytes(parameters.code) ? parameters.code : hexToBytes(parameters.code), - hexToBytes(encodedData), - parameters.value, - tryToBytes(parameters.from), - tryToBytes(parameters.targetAddress), - tryToBytes(parameters.bytecodeAddress), - parameters.gasLimit - ); + { + bytecode: isBytes(parameters.code) ? parameters.code : hexToBytes(parameters.code), + data: hexToBytes(encodedData), + value: parameters.value, + from: tryToBytes(parameters.from), + targetAddress: tryToBytes(parameters.targetAddress), + bytecodeAddress: tryToBytes(parameters.bytecodeAddress), + gasLimit: parameters.gasLimit, + staticCall: parameters.staticCall, + specificationName: parameters.specificationName, + }); return decodeFunctionResult({ abi: parameters.abi, functionName: parameters.functionName,