Protocol Contracts
Last updated
Last updated
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.
Initializes a Term Repo
setupTerm
: Validates Term Repo contracts against the Term Controller contract, emits initialization events during deployment and pairs validated Term Repo contracts with Protocol Contracts
setupAuction: 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
pauseDeploying: Triggers revert when trying to call setupTerm or setupAuction
unpauseDeploying: Resumes Term Initializer for regular deployment
Designates the Protocol treasury and reserve wallet address as well as maintain a ledger of validly deployed Protocol contracts
getTreasuryAddress: External view function that returns the Treasury wallet address
getProtocolReserveAddress: External view function that returns the Protocol Reserve allet address
isTermDeployed: External view function that returns a boolean indicating whether a given contract address was validly deployed by the Protocol
updateTreasuryAddress
: Updates or changes treasury address where servicing fees are collected
updateProtocolReserveAddress
: Updates or changes reserve address where protocol liquidated damages are collected
updateControllerAdminWallet: Updates or changes Controller Admin wallet
markTermDeployed
: Marks a smart contract as a valid Protocol deployment and adds address to Term Controller contract
unmarkTermDeployed: Removes a previously validated smart contract address from the Term Controller contract
A centralized price oracle contract that feeds pricing data to Term Repo contracts
usdValueOfTokens
: External function, returns value of tokens denominated in USD given an amount and a token address
addNewTokenPriceFeed
: Callable by Admin, adds/subscribes to a new price feed
removeTokenPriceFeed
: Callable by Admin, removes/unsubscribes from a previously added price feed
A centralized event emitter that records various important Protocol events to the blockchain
<internal only>