I'm using https://github.com/OpenZeppelin/defender-serverless to manage and deploy resources. It's really simplifying our flow, a great tool However, when deploying a sentinel with a contract event as a condition, it gets ignored and the event is not registered.
Looks like you're missing the abi property.
The ABI is required for block-type sentinels (as opposed to Forta-type) if you wish to have at least one condition. I've tested this locally, and by adding the ABI you should see the desired result:
When I started implementing this, I couldn't find how to set up sentinels with serverless. What I did was set up one manually. Then, I downloaded the serverless config from the UI. The "abi" field wasn't there, so I guess, it needs to be fixed there too.
Initially, I created the abi file as ".json" and added it: ${file(./abis/connextrouter.json)} but it didn't work, throwing this error:
Configuration error:
at 'resources.Resources.sentinels.watcher-polygon': unsupported string format
It only got to work with ".abi" as an ext. I'm curious why and if there's a special function (smth like "file-json") to read jsons.
Thanks once again, using serverless for this is dope!
We auto-generate our documentation based on the JSON schemas. You can find a reference of that in the README or on our documentation page. For block sentinels specifically, you can find the properties here.
We do not export the ABI from the defender export due to response size limitations, similarly for autotask code.
As for the error you're getting when using .json rather than .json.<x> , I'm not 100% sure the reason behind this. However, I believe this might be due to how ${file(...)} interprets files. .json files. I think these are automatically resolved to objects, rather than a string.