TermAuctionOfferLocker.sol

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

TermAuctionOfferLocker

This contract handles and proceesses Term Auction offer submissions

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

MAX_OFFER_PRICE

uint256 MAX_OFFER_PRICE

MAX_OFFER_COUNT

uint256 MAX_OFFER_COUNT

ADMIN_ROLE

bytes32 ADMIN_ROLE

AUCTIONEER_ROLE

bytes32 AUCTIONEER_ROLE

DEVOPS_ROLE

bytes32 DEVOPS_ROLE

INITIALIZER_ROLE

bytes32 INITIALIZER_ROLE

termRepoId

bytes32 termRepoId

termAuctionId

bytes32 termAuctionId

auctionStartTime

uint256 auctionStartTime

revealTime

uint256 revealTime

auctionEndTime

uint256 auctionEndTime

minimumTenderAmount

uint256 minimumTenderAmount

purchaseToken

contract IERC20Upgradeable purchaseToken

collateralTokens

mapping(contract IERC20Upgradeable => bool) collateralTokens

termRepoServicer

contract ITermRepoServicer termRepoServicer

emitter

contract ITermEventEmitter emitter

termAuction

contract ITermAuction termAuction

offers

mapping(bytes32 => struct TermAuctionOffer) offers

offerCount

uint256 offerCount

termContractPaired

bool termContractPaired

lockingPaused

bool lockingPaused

unlockingPaused

bool unlockingPaused

onlyWhileAuctionOpen

modifier onlyWhileAuctionOpen()

onlyWhileAuctionRevealing

modifier onlyWhileAuctionRevealing()

onlyOfferor

modifier onlyOfferor(address offeror, address authedUser)

onlyExistingOffer

modifier onlyExistingOffer(bytes32 id)

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 minimumTenderAmount_, contract IERC20Upgradeable purchaseToken_, contract IERC20Upgradeable[] collateralTokens_, address termInitializer_) external

pairTermContracts

function pairTermContracts(address termAuction_, contract ITermEventEmitter emitter_, contract ITermRepoServicer termRepoServicer_, address devopsMultisig_, address adminWallet_) external

lockOffersWithReferral

function lockOffersWithReferral(struct TermAuctionOfferSubmission[] offerSubmissions, address referralAddress) external returns (bytes32[])

Parameters

NameTypeDescription

offerSubmissions

struct TermAuctionOfferSubmission[]

An array of Term Auction offer submissions to lend an amount of money at rate no lower than the offer rate

referralAddress

address

A user address that referred the submitter of this offer

Return Values

NameTypeDescription

[0]

bytes32[]

A bytes32 array of unique on chain offer ids.

lockOffers

function lockOffers(struct TermAuctionOfferSubmission[] offerSubmissions) external returns (bytes32[])

Parameters

NameTypeDescription

offerSubmissions

struct TermAuctionOfferSubmission[]

An array of offer submissions

Return Values

NameTypeDescription

[0]

bytes32[]

A bytes32 array of unique on chain offer ids.

lockedOffer

function lockedOffer(bytes32 id) external view returns (struct TermAuctionOffer)

Parameters

NameTypeDescription

id

bytes32

An offer Id

Return Values

NameTypeDescription

[0]

struct TermAuctionOffer

A struct containing the details of the locked offer

revealOffers

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

Parameters

NameTypeDescription

ids

bytes32[]

An array offer ids to reveal

prices

uint256[]

An array of the offer prices to reveal

nonces

uint256[]

An array of nonce values to generate bid price hashes

unlockOffers

function unlockOffers(bytes32[] ids) external

unlockOffers unlocks multiple offers and returns funds to the offeror

Parameters

NameTypeDescription

ids

bytes32[]

An array of offer ids

getAllOffers

function getAllOffers(bytes32[] revealedOffers, bytes32[] unrevealedOffers) external returns (struct TermAuctionRevealedOffer[], struct TermAuctionOffer[])

Parameters

NameTypeDescription

revealedOffers

bytes32[]

An array of the revealed offer ids

unrevealedOffers

bytes32[]

An array of the unrevealed offer ids

Return Values

NameTypeDescription

[0]

struct TermAuctionRevealedOffer[]

An array of TermAuctionRevealedOffer structs containing details of the revealed offers

[1]

struct TermAuctionOffer[]

An array of TermAuctionOffer structs containing details of the unrevealed offers

unlockOfferPartial

function unlockOfferPartial(bytes32 id, address offeror, uint256 amount) public

Parameters

NameTypeDescription

id

bytes32

An offer Id

offeror

address

Address of the offeror

amount

uint256

The amount of purchase tokens to unlock

_lock

function _lock(struct TermAuctionOfferSubmission offerSubmission, address authedUser) internal returns (struct TermAuctionOffer)

_unlock

function _unlock(bytes32 id, address offeror) internal

_revealOffer

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

Will revert if either the price does not match the offer price or is greater than the max offer price

Parameters

NameTypeDescription

id

bytes32

An offer Id

price

uint256

The price of the offer to reveal

nonce

uint256

The user provided nonce value to generate the bid price hash

_generateOfferId

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

_processOfferForAuction

function _processOfferForAuction(bytes32 id) internal

_truncateOfferStruct

function _truncateOfferStruct(struct TermAuctionOffer hidden, uint256 price) internal pure returns (struct TermAuctionRevealedOffer revealed)

This does not check the hash of the revealed offer price

Parameters

NameTypeDescription

hidden

struct TermAuctionOffer

TermAuctionOffer to convert to TermAuctionRevealedOffer

price

uint256

The revealed price of the offer

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