telosnetwork / teloscan

Telos EVM block explorer for viewing blocks, transactions, contracts, staking, and more
https://teloscan.io
Apache License 2.0
22 stars 25 forks source link

include Labels on the read query responses #763

Closed Viterbo closed 4 months ago

Viterbo commented 6 months ago

Description

Currently, the Address page in the contract tab offers a way to interact with the functions of a contract. In particular, there are functions that return a complex structure of numbers, making it time-consuming to deduce which value corresponds to each property.

This issue requests the incorporation of labels on the results based on the ABI.

Example: https://testnet.teloscan.io/address/0x08B10679B2Cf7A244293fD670CDf0EF5F2982588?tab=contract Go to Read > getConfig and run the query.

It will return:

Result (uint16): [ 3, 2500000, 86400, 33285 ]

If you look at the ABI you will find the correct labels for each field:

   {
      "name":"getConfig",
      "type":"function",
      "inputs":[

      ],
      "outputs":[
         {
            "name":"minimumRequestConfirmations",
            "type":"uint16",
            "internalType":"uint16"
         },
         {
            "name":"maxGasLimit",
            "type":"uint32",
            "internalType":"uint32"
         },
         {
            "name":"stalenessSeconds",
            "type":"uint32",
            "internalType":"uint32"
         },
         {
            "name":"gasAfterPaymentCalculation",
            "type":"uint32",
            "internalType":"uint32"
         }
      ],
rozzaswap commented 4 months ago

PR tested and approved, good job!