Skip to content

Commit

Permalink
feat: support "input" param for verifiable tx
Browse files Browse the repository at this point in the history
Using contract calls in web3js, the transaction data can either be filled in the "data" parameter or "input" parameter, default is "input"

The current verified execution provider supports only "data" parameter, so code like this

const contract = new web3.eth.Contract(balanceOfABI, tokenContract)
let result = await contract.methods.balanceOf(tokenHolder).call();

doesn't work
  • Loading branch information
rdvorkin committed Oct 3, 2023
1 parent d9e6f1a commit 5b5edc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/prover/src/utils/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export async function executeVMCall({
executionPayload: allForks.ExecutionPayload;
network: NetworkName;
}): Promise<RunTxResult["execResult"]> {
const {from, to, gas, gasPrice, maxPriorityFeePerGas, value, data} = tx;
const {from, to, gas, gasPrice, maxPriorityFeePerGas, value, data, input} = tx;
const {result: block} = await rpc.request("eth_getBlockByHash", [bufferToHex(executionPayload.blockHash), true], {
raiseError: true,
});
Expand All @@ -181,7 +181,7 @@ export async function executeVMCall({
gasLimit: hexToBigInt(gas ?? block.gasLimit),
gasPrice: hexToBigInt(gasPrice ?? maxPriorityFeePerGas ?? "0x0"),
value: hexToBigInt(value ?? "0x0"),
data: data ? hexToBuffer(data) : undefined,
data: input ? hexToBuffer(input) : data ? hexToBuffer(data) : undefined,
block: {
header: getVMBlockHeaderFromELBlock(block, executionPayload, network),
},
Expand Down

0 comments on commit 5b5edc4

Please sign in to comment.