New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to decode UInt256 #103
Comments
@jcai I understand you want to decode the amount parameter value in the USDT transfer method, by learning from the Tron documentation example. you may try to use |
@mikeluxue Thank your reply.The
|
@jcai wow, sorry I missed checking the privilege of these methods. Obviously, these methods should be set to public privilege. |
@mikeluxue Thank you very much.When I want to parse some address of the block 54724400 ,some error occurs:
My code is: val rawRecipient = TypeDecoder.decodeStaticStruct(DATA.substring(8, 72), 0, new TypeReference[Address]() {}); //recipient address
val receiveAddress = rawRecipient.toString;
DATA is transaction link: https://tronscan.org/#/transaction/cd8f71299e97ddfc35170a79414db6d4d879327fdd368a5ebb9c47e0d0bfc9fd finally I found Trident can't parse the recipient address |
If I use |
@jcai you can see there are many data types in https://github.com/tronprotocol/trident/tree/main/trident-java/abi/src/main/java/org/tron/trident/abi/datatypes ,including StaticStruct and Address type. from my understanding, the StaticStruct type is a custom type similar to Object class in Java, which you can use TypeDecoder.decodeStaticStruct to decode this type of data. the type In one word, different data types correspond to different decoders。 |
Thank you very much for your reply!
mikeluxue ***@***.***> 于2023年9月18日周一 11:52写道:
… @jcai <https://github.com/jcai> you can see there are many data types in
https://github.com/tronprotocol/trident/tree/main/trident-java/abi/src/main/java/org/tron/trident/abi/datatypes
,including StaticStruct and Address type. from my understanding, the
StaticStruct type is a custom type similar to Object class in Java, which
you can use TypeDecoder.decodeStaticStruct to decode this type of data. the
type Address, is kind of a build-in type, which you can use
TypeDecoder.decodeAddress to decode.
[image: image]
<https://user-images.githubusercontent.com/7970865/268552392-5051d8e3-6389-4536-8db6-8d9311465ad3.png>
In one word, different data types correspond to different decoders。
in your case. the type Address can not be seen as a StaticStruct type, so
it should not be decoded using decodeStaticStruct method.
—
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABQCERHLG7JSPI2TMCSFDX27AORANCNFSM6AAAAAA4U7RL4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
regards,
Jun Tsai
|
I want to decode amount parameter value in usdt contract transfer method.I learn from https://developers.tron.network/docs/parameter-encoding-and-decoding
But occur some error:
The text was updated successfully, but these errors were encountered: