Is the "param1" of the call receipt no longer the function selector on the testnet? #2424
-
How can we find out what function is called from the receipts? |
Beta Was this translation helpful? Give feedback.
Answered by
maschad
Jun 13, 2024
Replies: 2 comments 7 replies
-
Could you share a code snippet including where you are calling this code from and also the the full receipt? |
Beta Was this translation helpful? Give feedback.
0 replies
-
sway code
client code
transaction on explorer |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@spacedragon I must apologize as this was overcomplicated.
I presume you are using
v1
encoding, thus the value10480
returned byparam1
includes the base offset for thescriptData
, and thus you do have access to the encoded function selector. Therefore you should be able to determine which function is called.Given
WORD_SIZE = 8
,CONTRACT_ID_LEN = 32
andASSET_ID_LEN = 32
bytes, you can decode it as such:Therefore we can use the
scriptData
from theTransactionResult
to get thedecodedFunctionSelector