Tempus
Search…
TempusController
TempusController is the main entry point to the Tempus Protocol. It is used to trigger all user actions in the protocol, such as deposit and redeem. It is also used to simplify the interface for users, especially those that want to carry out atomic transactions. It is an Ownable contract where the owner can whitelist and blacklist the pools that can be used with the particular TempusController.
Since this contract is the main entry point to the protocol, it has implemented reentrancy protection by inheriting from OpenZeppelin implementation. Guards are implemented in all mutable public and external functions.
As we already mentioned, all the actions related to the TempusPool are accessible via its authorized controller.
So, TempusController is the entry point for:
  • Depositing Yield Bearing tokens
  • Depositing Backing tokens
  • Redemption to Yield Bearing tokens
  • Redemption to Backing tokens
  • Depositing and fixing yield by swapping all minted Yields to Capitals
  • Depositing and providing liquidity to TempusAMM with Capitals and Yields
  • Exiting from TempusAMM and redeeming to the backing or yield-bearing tokens

Depositing into TempusPools

There are multiple types of deposits to TempusPools and they are all done via controller.
Depositing yield-bearing tokens to TempusPool
1
function depositYieldBearing(
2
ITempusPool targetPool,
3
uint256 yieldTokenAmount,
4
address recipient
5
)
Copied!
targetPool:The Tempus Pool to which tokens will be deposited
yieldTokenAmount:amount of Yield Bearing Tokens to be deposited in yield-bearing token precision
recipient: The address which will receive Tempus Capital Tokens and Tempus Yield Tokens
This method deposits a yield-bearing token to TempusPool and mints an equal amount of capitals and Yields for msg.sender. msg.sender needs to approve the controller for spending a particular yield-bearing token before calling this method.