laboratory icon indicating copy to clipboard operation
laboratory copied to clipboard

Contract Explorer not correctly creating transactions for custom inputs

Open mootz12 opened this issue 5 months ago • 1 comments

What version are you using?

Whatever UI is live as of this bug report

What did you do?

Created a queue_set_reserve transaction against a testnet Blend pool.

Image

What did you expect to see?

The XDR to invoke queue_set_reserve with the first argument being the asset address, and the second being the metadata custom type.

What did you see instead?

The transaction applied the custom type to both args, causing simulation to fail.

Here is the XDR sent to the RPC for simulation for the example above:

AAAAAgAAAADJpxlxfRQ9EGrrxP+l6Mxd92w/XWf+5MTMy4LeCyw+IwAAAMgAFd1jAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABxm+NbrSPHENHsbJM8pOP1vmopTt3CgpZJd1nPBFjm38AAAARcXVldWVfc2V0X3Jlc2VydmUAAAAAAAACAAAAEQAAAAEAAAANAAAADwAAAAhjX2ZhY3RvcgAAAAMAiVRAAAAADwAAAAhkZWNpbWFscwAAAAMAAAAHAAAADwAAAAdlbmFibGVkAAAAAAAAAAABAAAADwAAAAVpbmRleAAAAAAAAAMAAAAAAAAADwAAAAhsX2ZhY3RvcgAAAAMAiVRAAAAADwAAAAhtYXhfdXRpbAAAAAMAiVRAAAAADwAAAAZyX2Jhc2UAAAAAAAMAAYagAAAADwAAAAVyX29uZQAAAAAAAAMAAw1AAAAADwAAAAdyX3RocmVlAAAAAAMAmJaAAAAADwAAAAVyX3R3bwAAAAAAAAMAB6EgAAAADwAAAApyZWFjdGl2aXR5AAAAAAADAAAAFAAAAA8AAAAKc3VwcGx5X2NhcAAAAAAACgAAAAAAAAAAAABa8xB6QAAAAAAPAAAABHV0aWwAAAADAExLQAAAABEAAAABAAAAAgAAAA8AAAAEdHlwZQAAABEAAAABAAAADQAAAA8AAAAIY19mYWN0b3IAAAADAIlUQAAAAA8AAAAIZGVjaW1hbHMAAAADAAAABwAAAA8AAAAHZW5hYmxlZAAAAAAAAAAAAQAAAA8AAAAFaW5kZXgAAAAAAAADAAAAAAAAAA8AAAAIbF9mYWN0b3IAAAADAIlUQAAAAA8AAAAIbWF4X3V0aWwAAAADAIlUQAAAAA8AAAAGcl9iYXNlAAAAAAADAAGGoAAAAA8AAAAFcl9vbmUAAAAAAAADAAMNQAAAAA8AAAAHcl90aHJlZQAAAAADAJiWgAAAAA8AAAAFcl90d28AAAAAAAADAAehIAAAAA8AAAAKcmVhY3Rpdml0eQAAAAAAAwAAABQAAAAPAAAACnN1cHBseV9jYXAAAAAAAAoAAAAAAAAAAAAAWvMQekAAAAAADwAAAAR1dGlsAAAAAwBMS0AAAAAPAAAABXZhbHVlAAAAAAAAEQAAAAEAAAANAAAADwAAAAhjX2ZhY3RvcgAAAAMAiVRAAAAADwAAAAhkZWNpbWFscwAAAAMAAAAHAAAADwAAAAdlbmFibGVkAAAAAAAAAAABAAAADwAAAAVpbmRleAAAAAAAAAMAAAAAAAAADwAAAAhsX2ZhY3RvcgAAAAMAiVRAAAAADwAAAAhtYXhfdXRpbAAAAAMAiVRAAAAADwAAAAZyX2Jhc2UAAAAAAAMAAYagAAAADwAAAAVyX29uZQAAAAAAAAMAAw1AAAAADwAAAAdyX3RocmVlAAAAAAMAmJaAAAAADwAAAAVyX3R3bwAAAAAAAAMAB6EgAAAADwAAAApyZWFjdGl2aXR5AAAAAAADAAAAFAAAAA8AAAAKc3VwcGx5X2NhcAAAAAAACgAAAAAAAAAAAABa8xB6QAAAAAAPAAAABHV0aWwAAAADAExLQAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

mootz12 avatar Nov 17 '25 21:11 mootz12

This was first reported to me and I had a different result but was not able to reproduce it. Here is the failure message for the original report:

Prepare: HostError: Error(WasmVm, InvalidAction) Event log (newest first): 0: [Diagnostic Event] contract:CCCJHH7GPF4AUS652AGSLOCYJDF3AJTOC4LHAZSUVXFG3UFONCHZYVYB, topics:[error, Error(WasmVm, InvalidAction)], data:["VM call trapped: UnreachableCodeReached", queue_set_reserve] 1: [Diagnostic Event] topics:[fn_call, CCCJHH7GPF4AUS652AGSLOCYJDF3AJTOC4LHAZSUVXFG3UFONCHZYVYB, queue_set_reserve], data:[{type: Void, value: Void}, {c_factor: 8000000, decimals: 7, enabled: true, index: 2, l_factor: 8000000, max_util: 9000000, r_base: 200000, r_one: 600000, r_three: 50000000, r_two: 1200000, reactivity: 20, supply_cap: 1600000000000000, util: 5000000}]

Instead of the custom type being duplicated, it looks like {type: Void, value: Void} was supplied instead of the asset address

mootz12 avatar Nov 17 '25 21:11 mootz12

@mootz12, the contract CDDG7DLOWSHRYQ2HWGZEZ4UTR7LPTKFFHN3QUCSZEXOWOPARMONX6T65 is no longer available. I know blend CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP also has a function call queue_set_reserve which works fine. Do they have another contract id I can test with? I test contracts using custom types contracts https://stellar.expert/explorer/testnet/contract/CBHQGTSBJWA54K67RSG3JPXSZY5IXIZ4FSLJM4PQ33FA3FYCU5YZV7MZ?filter=interface

jeesunikim avatar Jan 06 '26 00:01 jeesunikim

@jeesunikim I'm not able to reproduce anymore. Feel free to close.

mootz12 avatar Jan 07 '26 16:01 mootz12

It's possible that I fixed this when I tackled https://github.com/stellar/laboratory/issues/1733. Thanks for reporting. Closing it!

jeesunikim avatar Jan 07 '26 17:01 jeesunikim