Dutch Proposal
Last updated
Last updated
PWNSimpleLoanDutchAuctionProposal.sol defines the Dutch Auction Proposal type for Simple Loan and implements functions to make an on-chain proposal and accept proposals.
The Dutch Auction Proposal creates a dutch auction with user pre-defined collateral, loan duration and interest. Credit amount drops (or goes up, if proposal is an offer) from user defined minimum and maximum for the auction duration from auction start. Interest can be either accruing or fixed.
PWNSimpleLoanDutchAuctionProposal.sol is written in Solidity version 0.8.16
Provides acceptProposal
function and makeProposal
for on-chain proposals
Defines the Proposal
struct
The PWN Simple Loan Dutch Auction Proposal contract defines one event and five errors.
Errors
Proposal
structType | Name | Comment |
---|---|---|
collateralCategory
Corresponding collateral category
address
collateralAddress
Address of a loan collateral
uint256
collateralId
ID of a collateral. Zero if ERC-20
uint256
minCollateralAmount
Minimal amount of tokens used as a collateral
bool
checkCollateralStateFingerprint
bytes32
collateralStateFingerprint
address
creditAddress
Address of credit asset
uint256
minCreditAmount
Minimum amount of tokens which are proposed as a loan to a borrower. If isOffer
is true, auction will start with this amount, otherwise it will end with this amount.
uint256
maxCreditAmount
Maximum amount of tokens which is proposed as a loan to a borrower. If isOffer
is true, auction will end with this amount, otherwise it will start with this amount.
uint256
availableCreditLimit
Maximum credit limit of credit asset
uint256
fixedInterestAmount
Fixed interest amount in credit tokens. It is the minimum amount of interest which has to be paid by a borrower
uint24
accruingInterestAPR
Accruing interest APR with 2 decimals
uint32
duration
Loan duration in seconds
uint40
auctionStart
Auction start timestamp in seconds
uint40
auctionDuration
Auction duration in seconds
address
allowedAcceptor
Allowed acceptor address. Zero address if propsal can be accepted by any account
address
proposer
Proposer address
bytes32
proposerSpecHash
Hash of a proposer specific data, which must be provided during a loan creation
bool
isOffer
Flag to determine if a proposal is an offer or loan request
uint256
refinancingLoanId
ID of a loan to be refinanced. Zero if creating a new loan.
uint256
nonceSpace
Nonce space of the proposal
uint256
nonce
Nonce of the proposal
address
loanContract
Loan type contract