KIP 007 - Enhancements to the Minter Contract API

Author: Hover Labs, [email protected]

Created: 09/22/2021

Status: DRAFT

Summary

Kolibri was deployed on Feb 17, 2021 on the Tezos Edo Protocol.

The Edo protocol limited deployed contract sizes to 16kb. This caused Hover Labs to be required to make non-optimal changes to some APIs in the Minter contract in order to get it to a size that was deployable. Since then, Hover labs has helped to increase the protocol limit contract size limit to 32kb which went live in the Florence protocol.

Additionally, a number of safety features were built into the protocol for launch. These features now consume valuable space in the contracts, and complicate contract APIs.

Motivation

This proposal seeks to simplify contract APIs and developer tooling by making a number of non-controversial changes the Minter contract.

Simpler APIs make developer’s lives easier, decrease the risk of mistakes during development and upgrades and generally improve long term maintainability of the system.

Removing dead features allows for additional space for more features in these contracts in the future.

All proposed changes in this KIP do not affect current protocol behavior. Where possible, existing APIs are marked as deprecated, but left in place, so as to not break developer tooling. Lastly, all updates in this KIP are not time critical, and can be shipped at any time.

Details

Changes

The following set of changes are proposed. All changes contain reference code and are fully unit tested.

1. Add Ability to Update Developer/Stability Fund Split (Implementation)

The Minter divides all interest between the developer and stability funds. This parameter is currently set at 90% to the stability fund and 10% to the developer fund.

At launch, there was an unintentional omission of an API to modify this parameter. In the future, governance may want to adjust this parameter.

This fix adds a setter for this parameter, so that Kolibri’s decentralized governance can use the DAO to adjust this parameter.

2. Remove ovenMax Parameter (Implementation)

As a safety feature at launch, Hover Labs built a feature that could limit the value of individual ovens. This could restrict flows of capital into the system, ensuring that ovens could be liquidated in a timely manner, and that the system didn’t grow to be too risky before it was battle tested.

The feature was never enabled and is now defunct. This change removes this parameter, simplifying the contract API and saving space in the contract for future upgrades.

3. Decompose updateContracts API (Implementation)

To save space, a single API (called updateContracts) was created to update the values of all 5 contracts the minter needs to interact with: the token contract, oven proxy contract, oven factory contract, developer fund contract and stability fund contract.

Now that the Tezos protocol allows larger smart contracts, this change decomposes this entrypoint into 5 APIs (setTokenContract, setOvenProxyContract, setOvenFactoryContract, setDeveloperFundContract and setStabilityFundContract). These APIs may only be called by the DAO contract.

The new APIs make tooling easier to write and maintain. It also makes governance lambdas submitted to the DAO easier to validate.

This change does not add or remove features, it is for developer convenience.

4. Decompose updateParams API (Implementation)
As in change 3, a single API (updateParams) was created to update the stability fee, collateralization ratio, liquidation fee and oven max was created to save space.

This change decomposes this entrypoint into 3 APIs (setStabilityFee, setCollateralizationRatio, setLiquidationFee). Note an API for setOvenMax is not provided, this feature was removed in change #2.

The new APIs make tooling easier to write and maintain. It also makes governance lambdas submitted to the DAO easier to validate.

This change does not add or remove features, it is for developer convenience.

Migration Path

All changes above have been placed on a branch in the Kolibri Contracts Repository, along with KIP-006. The branch also includes automated functions to perform migration of contracts and formulate the necessary governance lambda (see this pull request)

Hover Labs intends to produce a slate of contract improvements with KIP-006. However, given that KIP-006 may be controversial, no features in this proposal are tightly coupled to KIP-006. If KIP-006 is not accepted, these improvements could be included as either a standalone update to the Minter, or along with another Minter feature.

2 Likes

Woo! I’m all for these changes :smiley:

Yes to all these recommendations!

2 Likes

Thanks for coding these. They all seem like great improvements. If possible we should change the number of this proposal to KIP-007 (the interest rate proposal that passed was KIP-005)

1 Like

Changed to KIP-007! Thanks for looking out.

1 Like

This has been proposed, passed voting, and is currently in the timelock!