TermAuctionBidLocker.sol

This contract belongs to the Term Auction group of contracts and is specific to a Term Repo deployment. This contract handles and proceesses Term Auction bid submissions

TermAuctionBidLocker

This contract handles and proceesses Term Auction bid submissions

This contract belongs to the Term Auction group of contracts and is specific to a Term Repo deployment

MAX_BID_PRICE

uint256 MAX_BID_PRICE

MAX_BID_COUNT

uint256 MAX_BID_COUNT

THREESIXTY_DAYCOUNT_SECONDS

uint256 THREESIXTY_DAYCOUNT_SECONDS

ADMIN_ROLE

bytes32 ADMIN_ROLE

AUCTIONEER_ROLE

bytes32 AUCTIONEER_ROLE

DEVOPS_ROLE

bytes32 DEVOPS_ROLE

INITIALIZER_ROLE

bytes32 INITIALIZER_ROLE

ROLLOVER_MANAGER

bytes32 ROLLOVER_MANAGER

termRepoId

bytes32 termRepoId

termAuctionId

bytes32 termAuctionId

auctionStartTime

uint256 auctionStartTime

revealTime

uint256 revealTime

auctionEndTime

uint256 auctionEndTime

minimumTenderAmount

uint256 minimumTenderAmount

dayCountFractionMantissa

uint256 dayCountFractionMantissa

purchaseToken

address purchaseToken

collateralTokens

mapping(contract IERC20Upgradeable => bool) collateralTokens

termRepoCollateralManager

contract ITermRepoCollateralManager termRepoCollateralManager

termRepoServicer

contract ITermRepoServicer termRepoServicer

termPriceOracle

contract ITermPriceOracle termPriceOracle

emitter

contract ITermEventEmitter emitter

termAuction

contract ITermAuction termAuction

bids

mapping(bytes32 => struct TermAuctionBid) bids

bidCount

uint256 bidCount

termContractPaired

bool termContractPaired

lockingPaused

bool lockingPaused

unlockingPaused

bool unlockingPaused

onlyWhileAuctionOpen

modifier onlyWhileAuctionOpen()

onlyWhileAuctionRevealing

modifier onlyWhileAuctionRevealing()

onlyBidder

modifier onlyBidder(address bidder, address authedUser)

whenLockingNotPaused

modifier whenLockingNotPaused()

whenUnlockingNotPaused

modifier whenUnlockingNotPaused()

notTermContractPaired

modifier notTermContractPaired()

constructor

constructor() public

initialize

function initialize(string termRepoId_, string auctionId_, uint256 auctionStartTime_, uint256 revealTime_, uint256 auctionEndTime_, uint256 redemptionTimestamp_, uint256 minimumTenderAmount_, address purchaseToken_, contract IERC20Upgradeable[] collateralTokens_, address termInitializer_) external

pairTermContracts

function pairTermContracts(address termAuction_, contract ITermRepoServicer termRepoServicer_, contract ITermEventEmitter emitter_, contract ITermRepoCollateralManager termRepoCollateralManager_, contract ITermPriceOracle termPriceOracle_, address devopsMultisig_, address adminWallet_) external

pairRolloverManager

function pairRolloverManager(address rolloverManager) external

Parameters

NameTypeDescription

rolloverManager

address

The address of the TermRepoRolloverManager contract

lockBidsWithReferral

function lockBidsWithReferral(struct TermAuctionBidSubmission[] bidSubmissions, address referralAddress) external returns (bytes32[])

Parameters

NameTypeDescription

bidSubmissions

struct TermAuctionBidSubmission[]

An array of Term Auction bid submissions to borrow an amount of money at rate up to but not exceeding the bid rate

referralAddress

address

A user address that referred the submitter of this bid

Return Values

NameTypeDescription

[0]

bytes32[]

A bytes32 array of unique on chain bid ids.

lockRolloverBid

function lockRolloverBid(struct TermAuctionBid bid) external

Parameters

NameTypeDescription

bid

struct TermAuctionBid

A struct containing details of the bid

lockBids

function lockBids(struct TermAuctionBidSubmission[] bidSubmissions) external returns (bytes32[])

Parameters

NameTypeDescription

bidSubmissions

struct TermAuctionBidSubmission[]

An array of bid submissions

Return Values

NameTypeDescription

[0]

bytes32[]

A bytes32 array of unique on chain bid ids.

lockedBid

function lockedBid(bytes32 id) external view returns (struct TermAuctionBid)

Parameters

NameTypeDescription

id

bytes32

A bid Id

Return Values

NameTypeDescription

[0]

struct TermAuctionBid

A struct containing details of the locked bid

revealBids

function revealBids(bytes32[] ids, uint256[] prices, uint256[] nonces) external

Parameters

NameTypeDescription

ids

bytes32[]

An array of bid ids of the bids to reveal

prices

uint256[]

An array of the bid prices to reveal

nonces

uint256[]

An array of nonce values to generate bid price hashes

unlockBids

function unlockBids(bytes32[] ids) external

unlockBids unlocks multiple bids and returns funds to the bidder

Parameters

NameTypeDescription

ids

bytes32[]

An array of ids to unlock

getAllBids

function getAllBids(bytes32[] revealedBids, bytes32[] expiredRolloverBids, bytes32[] unrevealedBids) external returns (struct TermAuctionRevealedBid[], struct TermAuctionBid[])

Parameters

NameTypeDescription

revealedBids

bytes32[]

An array of the revealed offer ids

expiredRolloverBids

bytes32[]

An array of the expired rollover bid ids

unrevealedBids

bytes32[]

An array of the unrevealed offer ids

Return Values

NameTypeDescription

[0]

struct TermAuctionRevealedBid[]

An array of TermAuctionRevealedBid structs containing details of the revealed bids

[1]

struct TermAuctionBid[]

An array of TermAuctionBid structs containing details of the unrevealed bids

auctionUnlockBid

function auctionUnlockBid(bytes32 id, address bidder, address[] bidCollateralTokens, uint256[] amounts) external

Parameters

NameTypeDescription

id

bytes32

A bytes32 bid id

bidder

address

The address of the bidder

bidCollateralTokens

address[]

The addresses of the token used as collateral

amounts

uint256[]

The amounts of collateral tokens to unlock

_lock

function _lock(struct TermAuctionBidSubmission bidSubmission, address authedUser) internal returns (struct TermAuctionBid)

_lockRolloverBid

function _lockRolloverBid(struct TermAuctionBid bid) internal

_unlock

function _unlock(bytes32 id, address bidder, address[] bidCollateralTokens, uint256[] amounts) internal

_revealBid

function _revealBid(bytes32 id, uint256 price, uint256 nonce) internal

_getAllBids

function _getAllBids(bytes32[] revealedBids, bytes32[] expiredRolloverBids, bytes32[] unrevealedBids) internal returns (struct TermAuctionRevealedBid[], struct TermAuctionBid[])

Parameters

NameTypeDescription

revealedBids

bytes32[]

An array of the revealed offer ids

expiredRolloverBids

bytes32[]

An array of the expired rollover bid ids

unrevealedBids

bytes32[]

An array of the unrevealed offer ids

Return Values

NameTypeDescription

[0]

struct TermAuctionRevealedBid[]

An array of TermAuctionRevealedBid structs containing details of the revealed bids

[1]

struct TermAuctionBid[]

An array of TermAuctionBid structs containing details of the unrevealed bids

_truncateBidStruct

function _truncateBidStruct(struct TermAuctionBid bid) internal pure returns (struct TermAuctionRevealedBid revealed)

This does not check the hash of the revealed bid price

Parameters

NameTypeDescription

bid

struct TermAuctionBid

The TermAuctionBid to convert to TermAuctionRevealedBid

_processRevealedBidsForValidity

function _processRevealedBidsForValidity(bytes32[] revealedBids, uint256 unrevealedBidCount) internal returns (struct TermAuctionBid[], uint256, uint256, uint256)

_isRolloverStillValid

function _isRolloverStillValid(struct TermAuctionBid revealedBid, contract ITermRepoServicer pairOffServicer) internal returns (bool)

_isInInitialCollateralShortFall

function _isInInitialCollateralShortFall(uint256 bidAmount, address[] collateralTokens_, uint256[] collateralAmounts) internal view returns (bool)

_isInMaintenanceCollateralShortFall

function _isInMaintenanceCollateralShortFall(uint256 bidAmount, uint256 bidPrice, address[] collateralTokens_, uint256[] collateralAmounts) internal view returns (bool)

_fillRevealedBidsForAuctionClearing

function _fillRevealedBidsForAuctionClearing(bytes32[] revealedBids, uint256 auctionBidCount) internal returns (struct TermAuctionRevealedBid[])

_generateBidId

function _generateBidId(bytes32 id, address user) internal view returns (bytes32)

_processBidForAuction

function _processBidForAuction(bytes32 id) internal

pauseLocking

function pauseLocking() external

unpauseLocking

function unpauseLocking() external

pauseUnlocking

function pauseUnlocking() external

unpauseUnlocking

function unpauseUnlocking() external

_authorizeUpgrade

function _authorizeUpgrade(address impl) internal

required override by the OpenZeppelin UUPS module

Parameters

NameTypeDescription

impl

address

new impl address for proxy upgrade

Last updated