0

I was exploring about bytecode and came across a sample transaction mentioned in a Medium article. The issue is that I couldn't understand what do the 2 bytecodes mean in the Input Data bytecode below:

The sample tx is here: https://etherscan.io/tx/0xac80bab0940f061e184b0dda380d994e6fc14ab5d0c6f689035631c81bfe220b/advanced

enter image description here

1 Answer 1

1

The transaction input data is encoded using Contract ABI specification

swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline)
0x
8803dbee
000000000000000000000000000000000000000000000001158e460913d00000
0000000000000000000000000000000000000000000000003a4837fc5242c4ec
00000000000000000000000000000000000000000000000000000000000000a0
0000000000000000000000009a7ed54b8c2c5816c1800476f5111a1e88657502
0000000000000000000000000000000000000000000000000000000060cfee3f
0000000000000000000000000000000000000000000000000000000000000002
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
0000000000000000000000003c9d6c1c73b31c837832c72e04d3152f051fc1a9
  • 8803dbee function signature
  • 000000000000000000000000000000000000000000000001158e460913d00000 amountOut
  • 0000000000000000000000000000000000000000000000003a4837fc5242c4ec amountInMax
  • 00000000000000000000000000000000000000000000000000000000000000a0 offset to path (dynamic array are encoded using an offset to the array beginning)
  • 0000000000000000000000009a7ed54b8c2c5816c1800476f5111a1e88657502 to
  • 0000000000000000000000000000000000000000000000000000000060cfee3f deadline

At offset 0xa0 is the array beginning

0000000000000000000000000000000000000000000000000000000000000002
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
0000000000000000000000003c9d6c1c73b31c837832c72e04d3152f051fc1a9

The first slot is the array length 2, then following are the two entries in the array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.