Skip to content

Rate limited FEI minter#154

Merged
Joeysantoro merged 4 commits intofeat/v2from
feat/v2-RatelimitedMinter
Sep 11, 2021
Merged

Rate limited FEI minter#154
Joeysantoro merged 4 commits intofeat/v2from
feat/v2-RatelimitedMinter

Conversation

@Joeysantoro
Copy link
Contributor

Adds a helper abstract class which hard rate limits the speed with which FEI can be minted by a contract.

Uses a buffer that gets depleted as FEI is minted and replenishes over time up to the cap.

Does not use the Timed utility to allow extending contracts to use it for other use cases.

Extents the base _mintFei method of CoreRef so all minting operations are affected.

This class is intended to be used by the PCVEquityMinter once that is merged into the v2 branch

Copy link
Contributor

@eswak eswak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

art 👌

/// @author Fei Protocol
abstract contract RateLimitedMinter is RateLimited {

uint256 private constant MAX_FEI_LIMIT_PER_SECOND = 10_000e18; // 10000 FEI/s or ~860m FEI/day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to not add in methods here to have this changeable by governor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge as is and add in another PR

@Joeysantoro Joeysantoro merged commit cdc5d84 into feat/v2 Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments