# Protocol Contracts

Protocol contracts are evergreen contracts at the protocol level that govern and apply across all Term Repos. The following contracts belong to this class and handle protocol level authentication, security controls, event logging and manage centralized price feeds.

<table><thead><tr><th>Contract</th><th>Description and Key Functions</th></tr></thead><tbody><tr><td><a href="https://github.com/term-finance/term-finance-contracts/blob/main/contracts/TermInitializer.sol"><mark style="color:yellow;"><code>TermInitializer.sol</code></mark></a></td><td><mark style="color:yellow;">Initializes a Term Repo</mark></td></tr><tr><td><pre><code>INITIALIZER_APPROVAL_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.5.31/protocol-class/terminitializer#setupterm"><code>setupTerm</code></a>: Validates Term Repo contracts against the Term Controller contract, emits initialization events during deployment and pairs validated Term Repo contracts with Protocol Contracts</td></tr><tr><td><pre><code>INITIALIZER_APPROVAL_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.5.31/protocol-class/terminitializer#setupauction">setupAuction</a>: Validates Term Auction contracts against the Term Controller contract, emits initialization events during deployment and pairs Term Auction contracts with Protocol Contracts and Term Repo contracts</td></tr><tr><td><pre><code>ADMIN_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.5.31/protocol-class/terminitializer#pausedeploying">pauseDeploying</a>: Triggers revert when trying to call setupTerm or setupAuction</td></tr><tr><td><pre><code>ADMIN_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.5.31/protocol-class/terminitializer#unpausedeploying">unpauseDeploying</a>: Resumes Term Initializer for regular deployment</td></tr><tr><td><a href="https://github.com/term-finance/term-finance-contracts/blob/main/contracts/TermController.sol"><mark style="color:yellow;"><code>TermController.sol</code></mark></a></td><td><mark style="color:yellow;">Designates the Protocol treasury and reserve wallet address as well as maintain a ledger of validly deployed Protocol contracts</mark></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#gettreasuryaddress">getTreasuryAddress</a>: External view function that returns the Treasury wallet address</td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#getprotocolreserveaddress">getProtocolReserveAddress</a>: External view function that returns the Protocol Reserve allet address</td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#istermdeployed">isTermDeployed</a>: External view function that returns a boolean indicating whether a given contract address was validly deployed by the Protocol</td></tr><tr><td><pre><code>DEVOPS_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#updatetreasuryaddress"><code>updateTreasuryAddress</code></a>: Updates or changes treasury address where servicing fees are collected</td></tr><tr><td><pre><code>DEVOPS_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#updateprotocolreserveaddress"><code>updateProtocolReserveAddress</code></a>: Updates or changes reserve address where protocol liquidated damages are collected</td></tr><tr><td><pre><code>ADMIN_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#updatecontrolleradminwallet">updateControllerAdminWallet</a>: Updates or changes Controller Admin wallet</td></tr><tr><td><pre><code>CONTROLLER_ADMIN_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#marktermdeployed"><code>markTermDeployed</code></a>: Marks a smart contract as a valid Protocol deployment and adds address to Term Controller contract</td></tr><tr><td><pre><code>CONTROLLER_ADMIN_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termcontroller#unmarktermdeployed">unmarkTermDeployed</a>: Removes a previously validated smart contract address from the Term Controller contract</td></tr><tr><td><a href="https://github.com/term-finance/term-finance-contracts/blob/main/contracts/TermPriceConsumerV3.sol"><mark style="color:yellow;"><code>TermPriceConsumerV3.sol</code></mark></a></td><td><mark style="color:yellow;">A centralized price oracle contract that feeds pricing data to Term Repo contracts</mark></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termpriceconsumerv3#usdvalueoftokens"><code>usdValueOfTokens</code></a>: External function, returns value of tokens denominated in USD given an amount and a token address</td></tr><tr><td><pre><code>DEVOPS_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termpriceconsumerv3#addnewtokenpricefeed"><code>addNewTokenPriceFeed</code></a>: Callable by Admin, adds/subscribes to a new price feed</td></tr><tr><td><pre><code>DEVOPS_ROLE
</code></pre></td><td></td></tr><tr><td></td><td><a href="../../0.6.0/protocol-class/termpriceconsumerv3#removetokenpricefeed"><code>removeTokenPriceFeed</code></a>: Callable by Admin, removes/unsubscribes from a previously added price feed</td></tr><tr><td><a href="https://github.com/term-finance/term-finance-contracts/blob/main/contracts/TermEventEmitter.sol"><mark style="color:yellow;"><code>TermEventEmitter.sol</code></mark></a></td><td><mark style="color:yellow;">A centralized event emitter that records various important Protocol events to the blockchain</mark></td></tr><tr><td></td><td><code>&#x3C;internal only></code></td></tr></tbody></table>
