TermEventEmitter.sol

This contract operates at the protocol level and governs all instances of a Term Repo. This contract is a centralized event emitter that records important events to the blockchain

TermEventEmitter

This contract is a centralized event emitter that records important events to the blockchain

This contract operates at the protocol level and governs all instances of a Term Repo

DEVOPS_ROLE

bytes32 DEVOPS_ROLE

INITIALIZER_ROLE

bytes32 INITIALIZER_ROLE

TERM_CONTRACT

bytes32 TERM_CONTRACT

TERM_DELISTER

bytes32 TERM_DELISTER

constructor

constructor() public

initialize

function initialize(address devopsWallet_, address termDelister_, address termInitializer_) external

pairTermContract

function pairTermContract(address termContract) external

emitTermAuctionInitialized

function emitTermAuctionInitialized(bytes32 termRepoId, bytes32 termAuctionId, address termAuction, uint256 auctionEndTime, string version) external

Parameters

NameTypeDescription

termRepoId

bytes32

The id of the current Term Repo deployment being initialized

termAuctionId

bytes32

The id of the auction being initialized

termAuction

address

The address of the auction contract being initialized

auctionEndTime

uint256

The end time of the auction being initialized

version

string

The version tag of the smart contract deployed

emitBidAssigned

function emitBidAssigned(bytes32 termAuctionId, bytes32 id, uint256 amount) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

A bid id

amount

uint256

The amount assigned to this bid

emitOfferAssigned

function emitOfferAssigned(bytes32 termAuctionId, bytes32 id, uint256 amount) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

An offer id

amount

uint256

The amount assigned to this offer

emitAuctionCompleted

function emitAuctionCompleted(bytes32 termAuctionId, uint256 timestamp, uint256 blockNumber, uint256 totalAssignedBids, uint256 totalAssignedOffers, uint256 clearingPrice) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The Term Auction id of auction completed

timestamp

uint256

The timestamp of the current block

blockNumber

uint256

The number of the current block

totalAssignedBids

uint256

The number of assigned bids in the auction

totalAssignedOffers

uint256

The number of assigned offers in the auction

clearingPrice

uint256

The clearing price of the auction

emitAuctionCancelled

function emitAuctionCancelled(bytes32 termAuctionId, bool nonViableAuction, bool auctionCancelledforWithdrawal) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of the auction cancelled

nonViableAuction

bool

Auction not viable due to bid and offer prices not intersecting

auctionCancelledforWithdrawal

bool

Auction has been cancelled for manual fund withdrawal

emitCompleteAuctionPaused

function emitCompleteAuctionPaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of the auction paused

termRepoId

bytes32

The Term Repo id associated with auction paused

emitCompleteAuctionUnpaused

function emitCompleteAuctionUnpaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of the auction unpaused

termRepoId

bytes32

The Term Repo id associated with auction unpaused

emitTermAuctionBidLockerInitialized

function emitTermAuctionBidLockerInitialized(bytes32 termRepoId, bytes32 termAuctionId, address termAuctionBidLocker, uint256 auctionStartTime, uint256 revealTime, uint256 maxBidPrice, uint256 minimumTenderAmount, uint256 dayCountFractionMantissa) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with BidLocker initialized

termAuctionId

bytes32

The Term Auction id associated with BidLocker initialized

termAuctionBidLocker

address

The address of the TermAuctionBidLocker contract being intialized

auctionStartTime

uint256

The time at which auction bids will be accepted for submission

revealTime

uint256

The time at which sealed auction bids can be revealed

maxBidPrice

uint256

The maximum bid price for the auction

minimumTenderAmount

uint256

The minimum tender amount for the auction

dayCountFractionMantissa

uint256

The day count fraction remainder

emitBidLocked

function emitBidLocked(bytes32 termAuctionId, struct TermAuctionBid bid, address referralAddress) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

bid

struct TermAuctionBid

A struct containing details of the locked bid

referralAddress

address

The address of the referrer. Zero Address if none.

emitBidRevealed

function emitBidRevealed(bytes32 termAuctionId, bytes32 id, uint256 bidPrice) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

The bid id

bidPrice

uint256

The revealed price of the bid

emitBidUnlocked

function emitBidUnlocked(bytes32 termAuctionId, bytes32 id) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

A bid id

emitBidInShortfall

function emitBidInShortfall(bytes32 termAuctionId, bytes32 id) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

A bid id

emitBidLockingPaused

function emitBidLockingPaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where bid locking is paused

termRepoId

bytes32

The Term Repo id where bid locking is paused

emitBidLockingUnpaused

function emitBidLockingUnpaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where bid locking is unpaused

termRepoId

bytes32

The Term Repo id where bid locking is unpaused

emitBidUnlockingPaused

function emitBidUnlockingPaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where bid unlocking is paused

termRepoId

bytes32

The Term Repo id where bid unlocking is paused

emitBidUnlockingUnpaused

function emitBidUnlockingUnpaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where bid unlocking is unpaused

termRepoId

bytes32

The Term Repo id where bid unlocking is unpaused

emitTermAuctionOfferLockerInitialized

function emitTermAuctionOfferLockerInitialized(bytes32 termRepoId, bytes32 termAuctionId, address termAuctionOfferLocker, uint256 auctionStartTime, uint256 revealTime, uint256 maxOfferPrice, uint256 minimumTenderAmount) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with OfferLocker initialized

termAuctionId

bytes32

The Term Auction id associated with OfferLocker initialized

termAuctionOfferLocker

address

The address of the TermAuctionOfferLocker contract being intialized

auctionStartTime

uint256

The time at which auction bids will be accepted for submission

revealTime

uint256

The time at which sealed auction bids can be revealed

maxOfferPrice

uint256

The maximum offer price for the auction

minimumTenderAmount

uint256

The minimum tender amount for the auction

emitOfferLocked

function emitOfferLocked(bytes32 termAuctionId, bytes32 id, address offeror, bytes32 offerPrice, uint256 amount, address purchaseToken, address referralAddress) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

An offer id

offeror

address

The address of the offeror

offerPrice

bytes32

The offer price

amount

uint256

The amount of purchase tokens offered

purchaseToken

address

The address of the purchase token being offered

referralAddress

address

The address of the referrer. Zero Address if none.

emitOfferRevealed

function emitOfferRevealed(bytes32 termAuctionId, bytes32 id, uint256 offerPrice) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

An offer id

offerPrice

uint256

The offer price revealed

emitOfferUnlocked

function emitOfferUnlocked(bytes32 termAuctionId, bytes32 id) external

Parameters

NameTypeDescription

termAuctionId

bytes32

A Term Auction id

id

bytes32

An offer id

emitOfferLockingPaused

function emitOfferLockingPaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where offer locking is paused

termRepoId

bytes32

The Term Repo id where offer locking is paused

emitOfferLockingUnpaused

function emitOfferLockingUnpaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where offer locking is unpaused

termRepoId

bytes32

The Term Repo id where offer locking is unpaused

emitOfferUnlockingPaused

function emitOfferUnlockingPaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where offer unlocking is paused

termRepoId

bytes32

The Term Repo id where offer unlocking is paused

emitOfferUnlockingUnpaused

function emitOfferUnlockingUnpaused(bytes32 termAuctionId, bytes32 termRepoId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of Term Auction where offer unlocking is unpaused

termRepoId

bytes32

The Term Repo id where offer unlocking is unpaused

emitTermRepoCollateralManagerInitialized

function emitTermRepoCollateralManagerInitialized(bytes32 termRepoId, address termRepoCollateralManager, address[] collateralTokens, uint256[] initialCollateralRatios, uint256[] maintenanceCollateralRatios, uint256[] liquidatedDamagesSchedule) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with collateral manger being initialized

termRepoCollateralManager

address

The address of the TermRepoCollateralManager contract being intialized

collateralTokens

address[]

An array containing a list of the addresses of all accepted collateral tokens

initialCollateralRatios

uint256[]

An array containing the initial collateral ratios for each collateral token

maintenanceCollateralRatios

uint256[]

An array containing the maintenance collateral ratios for each collateral token

liquidatedDamagesSchedule

uint256[]

An array containing the liquidated damages applicable to each collateral token

emitPairReopeningBidLocker

function emitPairReopeningBidLocker(bytes32 termRepoId, address termRepoCollateralManager, address termAuctionBidLocker) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id for the Term Repo being reopened

termRepoCollateralManager

address

The TermRepoCollateralManager address for the Term Repo being reopened

termAuctionBidLocker

address

The new TermAuctionBidLocker to be paired for reopening

emitCollateralLocked

function emitCollateralLocked(bytes32 termRepoId, address borrower, address collateralToken, uint256 amount) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

collateralToken

address

The address of the collateral token locked

amount

uint256

The amount of collateral being locked

emitCollateralUnlocked

function emitCollateralUnlocked(bytes32 termRepoId, address borrower, address collateralToken, uint256 amount) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

collateralToken

address

The address of the collateral token locked

amount

uint256

The amount of collateral being unlocked

emitLiquidation

function emitLiquidation(bytes32 termRepoId, address borrower, address liquidator, uint256 closureAmount, address collateralToken, uint256 amountLiquidated, uint256 protocolSeizureAmount, bool defaultLiquidation) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

liquidator

address

The address of the liquidator

closureAmount

uint256

The amount of repurchase exposure covered

collateralToken

address

The address of the collateral tokens liquidated

amountLiquidated

uint256

The amount of collateral tokens liquidated

protocolSeizureAmount

uint256

defaultLiquidation

bool

emitLiquidationPaused

function emitLiquidationPaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The id of Term Repo where liquidations are paused

emitLiquidationUnpaused

function emitLiquidationUnpaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The id of Term Repo where liquidation is unpaused

emitTermRepoServicerInitialized

function emitTermRepoServicerInitialized(bytes32 termRepoId, address termRepoServicer, address purchaseToken, uint256 maturityTimestamp, uint256 endOfRepurchaseWindow, uint256 redemptionTimestamp, uint256 servicingFee, string version) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with TermRepoServicer being initialized

termRepoServicer

address

The address of the TermRepoServicer contract being initialized

purchaseToken

address

The address of the purchase token

maturityTimestamp

uint256

The time at which repurchase is due

endOfRepurchaseWindow

uint256

The time at which the repurchase window ends

redemptionTimestamp

uint256

The time when redemption of Term Repo Tokens begins

servicingFee

uint256

percentage share of bid amounts charged to bidder

version

string

The version tag of the smart contract deployed

emitReopeningOfferLockerPaired

function emitReopeningOfferLockerPaired(bytes32 termRepoId, address termRepoServicer, address termAuctionOfferLocker, address termAuction) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id for the Term Repo being reopened

termRepoServicer

address

The address of the TermRepoServicer contract for the Term Repo being reopened

termAuctionOfferLocker

address

The TermAuctionOfferLocker to be paired for reopening

termAuction

address

The address of the TermAuction contract to be paired for reopening

emitOfferLockedByServicer

function emitOfferLockedByServicer(bytes32 termRepoId, address offeror, uint256 amount) external

This event is not to be confused with OfferLocked by TermOfferLocker Both this event and OfferLocked will be triggered, this one specifically refers to corresponding action taken by Term Servicer

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

offeror

address

The address of the offeror

amount

uint256

The offer amount to be locked

emitOfferUnlockedByServicer

function emitOfferUnlockedByServicer(bytes32 termRepoId, address offeror, uint256 amount) external

This event is not to be confused with OfferUnlocked by TermOfferLocker Both this event and OfferLocked will be triggered, this one specifically refers to corresponding action taken by Term Servicer

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

offeror

address

The address of the offeror

amount

uint256

The offer amount to be unlocked

emitOfferFulfilled

function emitOfferFulfilled(bytes32 offerId, address offeror, uint256 purchasePrice, uint256 repurchasePrice, uint256 repoTokensMinted) external

Parameters

NameTypeDescription

offerId

bytes32

A unique offer id

offeror

address

The address of the offeror

purchasePrice

uint256

The offer amount fulfilled

repurchasePrice

uint256

The repurchase price due to offeror at maturity

repoTokensMinted

uint256

The amount of Term Repo Tokens minted to offeror

emitTermRepoTokensRedeemed

function emitTermRepoTokensRedeemed(bytes32 termRepoId, address redeemer, uint256 redemptionAmount, uint256 redemptionHaircut) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

redeemer

address

The address of the redeemer

redemptionAmount

uint256

The amount of TermRepoTokens redeemed

redemptionHaircut

uint256

The haircut applied to redemptions (if any) due to unrecoverable repo exposure

emitBidFulfilled

function emitBidFulfilled(bytes32 termRepoId, address bidder, uint256 purchasePrice, uint256 repurchasePrice, uint256 servicingFees) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

bidder

address

The address of the bidder

purchasePrice

uint256

The bid amount fulfilled in auction

repurchasePrice

uint256

The repurchase price due at maturity

servicingFees

uint256

The fees earned by the protocol

emitExposureOpenedOnRolloverNew

function emitExposureOpenedOnRolloverNew(bytes32 termRepoId, address borrower, uint256 purchasePrice, uint256 repurchasePrice, uint256 servicingFees) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

purchasePrice

uint256

The purchase price received from new TermRepo

repurchasePrice

uint256

The new repurchase price due at maturity of new TermRepo

servicingFees

uint256

The fees earned by the protocol

emitExposureClosedOnRolloverExisting

function emitExposureClosedOnRolloverExisting(bytes32 termRepoId, address borrower, uint256 amountRolled) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

amountRolled

uint256

The repurchase exposure balance closed on old Term Repo

emitRepurchasePaymentSubmitted

function emitRepurchasePaymentSubmitted(bytes32 termRepoId, address borrower, uint256 amount) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

amount

uint256

The amount submitted for repurchase

emitMintExposureAccessGranted

function emitMintExposureAccessGranted(bytes32 termRepoId, address authedUser) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

authedUser

address

User granted mint exposure access

emitMintExposure

function emitMintExposure(bytes32 termRepoId, address minter, uint256 netTokensReceived, uint256 servicingFeeTokens, uint256 repurchasePrice) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

minter

address

The address of the minter

netTokensReceived

uint256

The amount of Term Repo Tokens received by minter net of servicing fees

servicingFeeTokens

uint256

The number of Term Repo Tokens retained by protocol in servicing fees

repurchasePrice

uint256

The repurchase exposure opened by minter against Term Repo Token mint

emitBurnCollapseExposure

function emitBurnCollapseExposure(bytes32 termRepoId, address borrower, uint256 closeAmount) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

borrower

address

The address of the borrower

closeAmount

uint256

The amount of repurchase exposure to close

emitTermRepoRolloverManagerInitialized

function emitTermRepoRolloverManagerInitialized(bytes32 termRepoId, address rolloverManager) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with TermRepoRolloverManager being initialized

rolloverManager

address

The address of the TermRepoRolloverManager contract being initialized

emitRolloverTermApproved

function emitRolloverTermApproved(bytes32 termRepoId, bytes32 rolloverTermAuctionId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id of existing Term Repo

rolloverTermAuctionId

bytes32

The Term Auction Id that rollover bid will be submitted into

emitRolloverTermApprovalRevoked

function emitRolloverTermApprovalRevoked(bytes32 termRepoId, bytes32 rolloverTermAuctionId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id of existing Term Repo

rolloverTermAuctionId

bytes32

The Term Auction Id whose rollover approval is revoked

emitRolloverElection

function emitRolloverElection(bytes32 termRepoId, bytes32 rolloverTermRepoId, address borrower, address rolloverAuction, uint256 rolloverAmount, bytes32 hashedBidPrice) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id of existing Term Repo

rolloverTermRepoId

bytes32

The Term Repo Id of Rollover Term Repo

borrower

address

The address of the borrower

rolloverAuction

address

The address of the auction being rolled over to

rolloverAmount

uint256

The repurchase amount being rolled over

hashedBidPrice

bytes32

The hash of the rollover bid price

emitRolloverCancellation

function emitRolloverCancellation(bytes32 termRepoId, address borrower) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id of existing Term Repo

borrower

address

The address of the borrower

emitRolloverProcessed

function emitRolloverProcessed(bytes32 termRepoId, address borrower) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id of existing Term Repo

borrower

address

The address of the borrower

emitTermRepoLockerInitialized

function emitTermRepoLockerInitialized(bytes32 termRepoId, address termRepoLocker) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with TermRepoLocker contract being initialized

termRepoLocker

address

The address of the TermRepoLocker contract being initialized

emitTermRepoLockerTransfersPaused

function emitTermRepoLockerTransfersPaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

emitTermRepoLockerTransfersUnpaused

function emitTermRepoLockerTransfersUnpaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

A Term Repo id

emitTermRepoTokenInitialized

function emitTermRepoTokenInitialized(bytes32 termRepoId, address termRepoToken, uint256 redemptionRatio) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with the TermRepoToken being initalized

termRepoToken

address

The address of the TermRepoToken contract being initialized

redemptionRatio

uint256

The number of purchase tokens redeemable per unit of Term Repo Token at par

emitTermRepoTokenMintingPaused

function emitTermRepoTokenMintingPaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with the TermRepoToken where minting is paused

emitTermRepoTokenMintingUnpaused

function emitTermRepoTokenMintingUnpaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with the TermRepoToken where minting is unpaused

emitTermRepoTokenBurningPaused

function emitTermRepoTokenBurningPaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with the TermRepoToken where burning is paused

emitTermRepoTokenBurningUnpaused

function emitTermRepoTokenBurningUnpaused(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The Term Repo id associated with the TermRepoToken where burning is unpaused

emitDelistTermRepo

function emitDelistTermRepo(bytes32 termRepoId) external

Parameters

NameTypeDescription

termRepoId

bytes32

The id of the Term Repo being delisted

emitDelistTermAuction

function emitDelistTermAuction(bytes32 termAuctionId) external

Parameters

NameTypeDescription

termAuctionId

bytes32

The id of the Term Auction being delisted

emitTermContractUpgraded

function emitTermContractUpgraded(address proxy, address implementation) external

Parameters

NameTypeDescription

proxy

address

address of proxy contract

implementation

address

address of new impl contract proxy has been upgraded to

_authorizeUpgrade

function _authorizeUpgrade(address) internal view

required override by the OpenZeppelin UUPS module

Last updated