Simple Proposal
Last updated
Last updated
PWNSimpleLoanSimpleProposal.sol defines the Simple Proposal type for Simple Loan and implements functions to make an on-chain proposal and accept proposals.
The Simple Proposal defines a single specific collateral loan. Interest can be either accruing or fixed.
PWNSimpleLoanSimpleProposal.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 Simple Proposal contract defines one event and no custom 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
collateralAmount
Amount of a collateral. Zero if ERC-721
bool
checkCollateralStateFingerprint
bytes32
collateralStateFingerprint
address
creditAddress
Address of credit asset
uint256
creditAmount
Amount of credit asset
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
expiration
Proposal expiration unix timestamp 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