10.1 Event summaries per contract instance

In MultiBaas event monitoring persistence is enabled on a per-smart contract per-address basis when a smart contract is linked (associated with) an address. See 4.4 Link a deployed smart contract instance This causes MultiBaas to start up an asynchronous Event Monitor that subscribes to events on that address via its blockchain node, pre-processes them, and persists them to MultiBaas for later retrieval. Transactions (and in turn their events) removed from the blockchain due to chain reorganizations are similarly removed from MultiBaas.

To see the most recent events for a specific contract:

  1. Select Contracts from the main menu
  2. Select a specific contract from the Contracts side menu
  3. Select a deployed instance of the contract from the sub menu
  4. Scroll to the Events section

Using the API:

Request
GET .../chains/ethereum/addresses/autotoken/events
Response

{
    "status": 200,
    "message": "Success",
    "result": [
        {
            "triggeredAt": "2019-09-30T02:38:16+09:00",
            "event": {
                "name": "Mint",
                "signature": "Mint(address,address,uint256)",
                "inputs": [
                    {
                        "name": "minter",
                        "value": "0xF9450D254A66ab06b30Cfa9c6e7AE1B7598c7172",
                        "hashed": false
                    },
                    {
                        "name": "receiver",
                        "value": "0xF9450D254A66ab06b30Cfa9c6e7AE1B7598c7172",
                        "hashed": false
                    },
                    {
                        "name": "value",
                        "value": "123000",
                        "hashed": false
                    }
                ],
                "rawFields": "{\"address\":\"0x9dee62d32898b37f2bdf7e7cb1fa16a45d31d67a\",\"topics\":[\"0xab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8\",\"0x000000000000000000000000f9450d254a66ab06b30cfa9c6e7ae1b7598c7172\",\"0x000000000000000000000000f9450d254a66ab06b30cfa9c6e7ae1b7598c7172\"],\"data\":\"0x000000000000000000000000000000000000000000000000000000000001e078\",\"blockNumber\":\"0x10\",\"transactionHash\":\"0x9c85fc363ec631f1b62ea8254e5634b3e120c57f3de6616bed4491b7ed319c7e\",\"transactionIndex\":\"0x0\",\"blockHash\":\"0x0eaecc9243c3cfa8ae13aa4a8f0ca23fd81224f3a7ed1fccca05ca1391b91b09\",\"logIndex\":\"0x0\",\"removed\":false}",
                "contract": {
                    "address": "0x9deE62D32898B37F2BDf7e7cB1FA16a45D31D67a",
                    "name": "MltiToken",
                    "label": "autotoken"
                },
                "indexInLog": 0
            },
            "transaction": {
                "from": "0xF9450D254A66ab06b30Cfa9c6e7AE1B7598c7172",
                "txData": "0xa0712d68000000000000000000000000000000000000000000000000000000000001e078",
                "txHash": "0x9c85fc363ec631f1b62ea8254e5634b3e120c57f3de6616bed4491b7ed319c7e",
                "txIndexInBlock": 0,
                "blockHash": "0x0eaecc9243c3cfa8ae13aa4a8f0ca23fd81224f3a7ed1fccca05ca1391b91b09",
                "blockNumber": 16,
                "contract": {
                    "address": "0x9deE62D32898B37F2BDf7e7cB1FA16a45D31D67a",
                    "name": "MltiToken",
                    "label": "autotoken"
                },
                "method": {
                    "name": "mint",
                    "signature": "mint(uint256)",
                    "inputs": [
                        {
                            "name": "_amount",
                            "value": "123.000",
                            "hashed": false
                        }
                    ],
                    "isConstructor": false,
                    "isFallback": false
                }
            }
        },
        ...
    ]
}


In this abbreviated response, we see a single event, Mint(). The standard event from web3 only includes the “rawFields” field. MultiBaas has enriched the event with the following:

  • triggeredAt: the wall clock time the block that the event was included in was mined
  • event: a structure about the event itself
    • name and signature
    • indexInLog: the event’s index within its parent transaction log
    • inputs: the parameters supplied to the event, decoded and converted according to type conversions
  • transaction: a structure about the transaction that generated the event
    • from: the address that initiated the transaction
    • txData, txHash, txIndexInBlock: key transaction fields
    • blockHash, blockNumber: key block information
    • contract: information about the contract the transaction is sent to, which could be different from the contract that generated the event
    • method: information about the original method called that resulted in the event being generated