In this example, every time a swap is executed in a pool registered with this hook, a "random" number is drawn. If the drawn number is not equal to a lucky number, the user will pay fees to the hook contract. But, if the drawn number equals a lucky number, the user won't pay hook fees and will receive all fees accrued by the hook.
Type of change
[ ] Bug fix
[x] New feature
[ ] Breaking change
[ ] Dependency changes
[ ] Code refactor / cleanup
[ ] Documentation or wording changes
[ ] Other
Checklist:
[x] The diff is legible and has no extraneous changes
[x] Complex code has been commented, including external interfaces
[x] Tests have 100% code coverage
[x] The base branch is either main, or there's a description of how to merge
Description
This PR implements a lottery hook example.
In this example, every time a swap is executed in a pool registered with this hook, a "random" number is drawn. If the drawn number is not equal to a lucky number, the user will pay fees to the hook contract. But, if the drawn number equals a lucky number, the user won't pay hook fees and will receive all fees accrued by the hook.
Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution
Closes #676