Skip to content

make a transation with calldata error #113

@yuzhongrong

Description

@yuzhongrong

this is simulate error of firstRevert

"firstRevert": {
"txHash": "0x7d7423dc76877f947bfcb7ea87ed20357f9b5275dcd6b575119245ced5c0d6f2",
"gasUsed": 22087,
"gasPrice": "0",
"gasFees": "0",
"fromAddress": "0xF727aDCef4C8e1D348ACD16e815538FcB0403E1b",
"toAddress": "0xC1c4301C5bd4eBe2C04817aC815AaceB4DeDA8DB",
"coinbaseDiff": "0",
"ethSentToCoinbase": "0",
"error": "execution reverted",
"revert": "\u0000\u0000\u0000",
"value": null
}

the code follow:

this is the transation create:

this is calldata:

const calldata = ethers.utils.solidityPack(
['address', 'address', 'uint128', 'uint128', 'uint8'],
[
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', //weth
'0x538a69cbb33F94EcB35B21dFa778577B5714Af4B', //pair address
ethers.utils.parseUnits('0.5', 18),
ethers.utils.parseUnits('19899100', 18),
1,
]
);

const transaction = {
chainId: 5,
type: 2,
to: "0xC1c4301C5bd4eBe2C04817aC815AaceB4DeDA8DB", //test4 address
data:calldata, //⬅️
value: ethers.utils.parseEther("0"),
maxFeePerGas: GWEI * 100n,
gasLimit: 3000000,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions