aeternity / ae_mdw

Aeternity Middleware in Elixir
26 stars 10 forks source link

Some type of transactions are not listed in the `activities` #1780

Closed CedrikNikita closed 2 weeks ago

CedrikNikita commented 1 month ago

https://mainnet.aeternity.io/mdw/v3/transactions/th_9hsJzzrx67y17ue7vKK7kyyi9hoYgCvaYqBe9sZBe998hR5pq

It seems that this type of transactions are not listed https://mainnet.aeternity.io/mdw/v3/aex9/ct_2AiMceYFXnUdA6A9Lu2ZQ2tr2TpfbGVfkxLfBnceoWgHTKZYvc/transfers?account=ak_uTWegpfN6UjA4yz8X4ZVRi9xKEYeXHJDRZcRryTsRHAFoBpLa

This is the only transaction related to this contract we have managed to get from mdw, using this endpont.

https://mainnet.aeternity.io/mdw/v2/accounts/ak_uTWegpfN6UjA4yz8X4ZVRi9xKEYeXHJDRZcRryTsRHAFoBpLa/activities

{
      "type": "ContractCallTxEvent",
      "height": 948377,
      "block_hash": "mh_2pDPja17d8s9wbNXW4CpRgDsE3ueGaKHzxbLH4ZjShJMfywH1A",
      "payload": {
        "block_hash": "mh_2pDPja17d8s9wbNXW4CpRgDsE3ueGaKHzxbLH4ZjShJMfywH1A",
        "block_height": 948377,
        "encoded_tx": "tx_+NcLAfhCuEChT03iTcuCicVPgT0j4/gvAGqxglbCR4ira10Qq+XMMwCoAhPn012N4bzvuVOGmUryoKKtJKUHv1YWvRlOySgKuI/4jSsBoQF3HDimaXVPjyhNjk1H78cNW6xmYoc24cvQ9B28s5M0c4HtoQWZwC5BRsMejDEbHpUkBwsFjZAjxY8XEU962oV5E6Ic0wOGpk9pV/gAgw54nACCGdKEO5rKAK8rEe/MWOErnwCg4p7nIz2hDixqNe5TdyE80zAksQug/ePzXsWaAab6iodvgw9CAJcvXjU=",
        "hash": "th_CJemh2nFtMnfHojh9spMJNk7fsnY8xwUkBZN87UH2WVh2dL1Q",
        "micro_index": 34,
        "micro_time": 1716293178417,
        "signatures": [
          "sg_N72ZXnmWgqNpTozLzXs5TYzAFaBg3mhyE122AFhuWfzUx8WYT66X1azRqERZC41x3peEmZ8grKRvph13BwQrhkzHsW7HG"
        ],
        "tx": {
          "abi_version": 3,
          "aexn_type": "aex9",
          "amount": 0,
          "arguments": [
            {
              "type": "address",
              "value": "ak_2ioisnF4reEMxWz4hkX5DhR4D6h83oW9ShHfAvs89E6PKqphA9"
            },
            {
              "type": "int",
              "value": 1000000
            }
          ],
          "call_data": "cb_KxHvzFjhK58AoOKe5yM9oQ4sajXuU3chPNMwJLELoP3j817FmgGm+oqHb4MPQgBotanh",
          "caller_id": "ak_uTWegpfN6UjA4yz8X4ZVRi9xKEYeXHJDRZcRryTsRHAFoBpLa",
          "contract_id": "ct_2AiMceYFXnUdA6A9Lu2ZQ2tr2TpfbGVfkxLfBnceoWgHTKZYvc",
          "fee": 182860000000000,
          "function": "create_allowance",
          "gas": 6610,
          "gas_price": 1000000000,
          "gas_used": 5288,
          "log": [
            {
              "address": "ct_2AiMceYFXnUdA6A9Lu2ZQ2tr2TpfbGVfkxLfBnceoWgHTKZYvc",
              "data": "cb_Xfbg4g==",
              "topics": [
                "6675387653529534352993899574763440621350730065146058041830673378811230846814",
                "53875091683475111476451629676645823991858014834876290127600872463679999915123",
                "102503460869547734593096252361841109291585426008369033344117281444812455316103",
                "1000000"
              ]
            }
          ],
          "nonce": 237,
          "result": "ok",
          "return": {
            "type": "unit",
            "value": ""
          },
          "return_type": "ok",
          "ttl": 948380,
          "type": "ContractCallTx",
          "version": 1
        }
      },
sborrazas commented 1 month ago

@CedrikNikita that transaction does not generate any burn, mint, swap or transfer events that might generate an aex9 transfer. It only generates a single event Allowance: https://mainnet.aeternity.io/mdw/v3/contracts/logs?scope=gen:948377 . That's why it does not appear in aex9 transfers. The reason it appears it activities is because the account created the contract call transaction, that's why the type is ContractCallTxEvent and not Aex9TransferEvent