Skip to content

Audit Trail

Audit Trail allows users to view the history of all states of a smart contract over time. By default, history will default to false.

POST bloc /users/{user}/{address}/contract?history=true

History must be added as URL query parameter

POST bloc/users/{user}/{address}/uploadList

Boolean parameter history must be added to request body

Query Private Chain

GET /cirrus/search/<contractName>?chainId=<chainId>.&address=eq.<address>

{   
    "chainId": "53",
    "blockNumber": "1020392",
    "transactionHash": "03849392",
    "sender": "0x369...",
    "state": {
        "storedData": "39483"
    },
    "chainId": "53",
    "blockNumber": "1020392",
    "transactionHash": "93482929",
    "sender": "0x123...",
    "state": {
        "storedData": "872382"
    }
}

Query Multiple Chains

GET /cirrus/search/<contractName>?chainId=in.123,234

{   
    "chainId": "123",
    "blockNumber": "1020392",
    "transactionHash": "03849392",
    "sender": "0x369...",
    "state": {
        "storedData": "39483"
    },
    "chainId": "234",
    "blockNumber": "1020392",
    "transactionHash": "93482929",
    "sender": "0x123...",
    "state": {
        "storedData": "872382"
    }
}

Query Main Chain

GET /cirrus/search/<contractName>?chainId=eq.<chainId>&address=eq.<address>

{   
    "chainId": "",
    "blockNumber": "1020392",
    "transactionHash": "03849392",
    "sender": "0x369...",
    "state": {
        "storedData": "39483"
    }
}

Query Chain (Bloc)

Bloc will only accept specific chain IDs, since it is unlikely for the same contract name/address pair to exist across different chains.

GET /contracts/{contractName}/{contractAddress}/state?&chainId=53

{   
    "chainId": "53",
    "blockNumber": "1020392",
    "transactionHash": "03849392",
    "sender": "0x369...",
    "state": {
        "storedData": "39483"
    }
}

Quick Start

  • Upload SimpleStorage.sol, enable “history” (if SMD, check “history” box in Upload Contract modal, if API, add ?history=true to URL query param), and call setData with a value of 8
  • Call setData with a value of 10
  • User can navigate to Contracts -> SimpleStorage -> Query Builder to view a history table showing the initial state and updated state by block number. Or, through the Cirrus endpoint: cirrus/search/contractName