balancer / balancer-v3-monorepo

GNU General Public License v3.0
30 stars 7 forks source link

Lottery hook #686

Closed joaobrunoah closed 1 month ago

joaobrunoah commented 1 month ago

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:

Issue Resolution

Closes #676