Skip to content

Instantly share code, notes, and snippets.

@ggonzalez94
Created October 26, 2022 14:55
Show Gist options
  • Save ggonzalez94/0926d33fae15a4d7c8583aead8300b28 to your computer and use it in GitHub Desktop.
Save ggonzalez94/0926d33fae15a4d7c8583aead8300b28 to your computer and use it in GitHub Desktop.
Docs vs Actual Events Autotasks
//Event recieved in the autotask notification - some fields have been removed to make it more readable
{
"hash": "0xf2d2aed435c6a8be8065039781cb38cc4f74198afc2739ac7316ec648d382dc3",
"transaction": {
"transactionHash": "0xf2d2aed435c6a8be8065039781cb38cc4f74198afc2739ac7316ec648d382dc3",
"blockHash": "0x342bfe6897fcac02574d1698910ea643de4ac150f2b1fe224a3b72ee3d425345",
"blockNumber": "0x778d7e",
"logs": [
{
"transactionHash": "0xf2d2aed435c6a8be8065039781cb38cc4f74198afc2739ac7316ec648d382dc3",
"address": "0x65e185a91724defe857eac637edc5e7873678bd2",
"blockHash": "0x342bfe6897fcac02574d1698910ea643de4ac150f2b1fe224a3b72ee3d425345",
"blockNumber": "0x778d7e",
"data": "0x00000000000000000000000000000000000000000000000000000000000000c8",
"logIndex": "0xa9",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000b0ddb2a001fa06045374e21af24dbf58fe843e2a"
],
"transactionIndex": "0x43"
}
],
"contractAddress": null,
"effectiveGasPrice": "0x3d8fad9e",
"cumulativeGasUsed": "0xb6e047",
"from": "0xebfcc6f525fd7a5098e10e31e8b3636ce6d4c872",
"gasUsed": "0xbf93",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000080000000000000000040020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000001000000000000000000000000000000000002000000010000000000000000040000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x65e185a91724defe857eac637edc5e7873678bd2",
"transactionIndex": "0x43",
"type": "0x2"
},
"blockHash": "0x342bfe6897fcac02574d1698910ea643de4ac150f2b1fe224a3b72ee3d425345",
"blockNumber": "0x778d7e",
"timestamp": 1666752132,
"matchReasons": [
{
"type": "event",
"signature": "Transfer(address,address,uint256)",
"address": "0x65e185a91724defe857eac637edc5e7873678bd2",
"args": [
"0x0000000000000000000000000000000000000000",
"0xB0Ddb2A001Fa06045374e21af24dbf58FE843E2A",
"200"
],
"params": {
"from": "0x0000000000000000000000000000000000000000",
"to": "0xB0Ddb2A001Fa06045374e21af24dbf58FE843E2A",
"value": "200"
}
}
],
"matchedAddresses": [
"0x65e185a91724defe857eac637edc5e7873678bd2"
],
"metadata": {
"sanctionedAddress": "0xB0Ddb2A001Fa06045374e21af24dbf58FE843E2A"
},
"type": "BLOCK",
"value": "0x0",
"autotaskConditionRunId": "d2ec2bad-232d-4bdc-b38e-c2bec9fe5ef7"
}
{
"transaction": { // eth_getTransactionReceipt response body
... // see https://eips.ethereum.org/EIPS/eip-1474
},
"blockHash": "0xab..123", // block hash from where this transaction was seen
"matchReasons": [ // the reasons why sentinel triggered
{
"type": "event", // event, function, or transaction
"address": "0x123..abc", // address of the event emitting contract
"signature": "...", // signature of your event/function
"condition": "value > 5", // condition expression (if any)
"args": ["5"], // parameters by index (unnamed are present)
"params": { "value": "5" } // parameters by name (unnamed are not present)
"metadata": {...} // metadata injected by Autotask Condition (if applicable)
}
],
"matchedAddresses":["0x000..000"] // the addresses from this transaction your are monitoring
"sentinel": {
"id": "44a7d5...31df5", // internal ID of your sentinel
"name": "Sentinel Name", // name of your sentinel
"abi": [...], // abi of your address (or undefined)
"addresses": ["0x000..000"], // addresses your sentinel is watching
"confirmBlocks": 0, // number of blocks sentinel waits (can be 'safe' or 'finalized' on PoS clients)
"network": "rinkeby" // network of your address
"chainId": 4 // chain Id of the network
},
"value": "0x16345785D8A0000" // value of the transaction
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment