Smart Contract Annotations
In-line comments on the Maker Protocol's Core Smart Contracts
Understanding the various terms used in our smart contracts can involve a significant time investment for developers looking at the codebase for the first time. Due to this fact, we need resources in various formats to ensure they can get up and running quickly. We believe, in order to complement the technical documentation on docs.makerdao.com, that highlighting sections of the codebase and annotating it with comments can surface relevant information developers need while reading the raw contracts in order to understand the contracts better.
Examples of how annotations may be useful for developers:
- Highlight terms to display their definitions
- Explain various input parameters in-depth
- Ex: Explain the precise role of users defined as
guywithin input parameters.
- Link to sections of other smart contracts from where function calls typically originate from
Vatis called from
- Additional context to Maker specific design practices that other smart contract developers might not be accustomed to
- Ex: Show the event log signature produced by the
notemodifier on a function.
- Help developers navigate through scenarios that result in calls across multiple smart contracts
- Ex: Keepers participating in collateral auctions kick the process with
Cat, bad debt is settled in
Vat, accounted for in
Vow, and a series of transactions on
flipuntil they receive collateral they purchased for a discount.
- Superimposing the operational view of the system on all functions will help developers build richer mental models of the Maker Protocol.
- Ex: Annotating a function's
authmodifier and mentioning the smart contracts authorized to call it.
Annotations will also serve as an open and collaborative discussion layer that helps developers discuss and evolve their understanding of the smart contracts over time.
Hypothesis annotations can be viewed by expanding a sidebar on the top right corner of your browser window.
There are three options to view annotations on a webpage: