Skip to content

V2 Tribe Reserve Stabilizer#151

Merged
Joeysantoro merged 6 commits intofeat/v2-RatelimitedMinterfrom
feat/v2-TribeReserveStabilizer
Sep 11, 2021
Merged

V2 Tribe Reserve Stabilizer#151
Joeysantoro merged 6 commits intofeat/v2-RatelimitedMinterfrom
feat/v2-TribeReserveStabilizer

Conversation

@Joeysantoro
Copy link
Contributor

@Joeysantoro Joeysantoro commented Sep 3, 2021

Part of Fei V2 Phase 1 that handles the inflation of TRIBE when the collateralization ratio is low.

Replaces the logic regarding the FEI peg/oracle with collateralization ratio logic. If the CR is below the configured threshold, then exchanging FEI for minted TRIBE becomes possible.

Any TRIBE held by the contract is transferred first before performing a direct mint.

Also restricts TRIBE withdrawals from the contract so TRIBE held is effectively burned barring a mint operation.

Uses the RateLimited utility to put a cap on how much TRIBE can be minted at once.

// Transfer held TRIBE first, then mint to cover remainder
function _transfer(address to, uint256 amount) internal override {
_mint(to, amount);
uint256 _tribeBalance = balance();
Copy link
Contributor

Choose a reason for hiding this comment

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

this is using the cached token variable from the contract state, while the _mint() call uses a fresh ITribe(address(tribe())). Not sure if there could be some bad interaction here, but it would be nice to use the same source of information for both ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, although it should be fine because token is immutably set to equal tribe();

@Joeysantoro Joeysantoro force-pushed the feat/v2-TribeReserveStabilizer branch from 022bb45 to d36706f Compare September 7, 2021 20:41
@Joeysantoro Joeysantoro changed the base branch from feat/v2 to feat/v2-RatelimitedMinter September 7, 2021 20:41
@Joeysantoro Joeysantoro merged commit 28342c8 into feat/v2-RatelimitedMinter Sep 11, 2021
@xklob xklob deleted the feat/v2-TribeReserveStabilizer branch September 19, 2021 18:59
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