beefyfinance / beefy-contracts

Public repo for the community devs to advance the Beefy protocol.
https://app.beefy.finance
175 stars 163 forks source link

Add a modifier to limit deposits from a vault #223

Closed prevostc closed 12 months ago

prevostc commented 1 year ago

Solves this issue https://github.com/beefyfinance/beefy-contracts/issues/23

There are sometimes where we're pushing an experimental vault. Or for a few different reasons, we might want to have a temporary cap on deposits. The goal would be to have a reusable contract that lets strategies have a cap for the first x blocks of their existence. This would prevent people from apeing $5M into something experimental.

There is some choices made here I'm not sure about:

prevostc commented 1 year ago

Weso review:

I see the issue mentions it being time bound. It's not really practical as you are setting the time arbitrarily when deploying the contract. Also should have an ability to change cap size by owner. Also it's cheaper to write modifier logic in an internal view function then call the function in the modifier.