List Offer
1. Summary
PWNSimpleLoanListOffer.sol defines List Offer for the Simple Loan type.
List offer enables creating offers for a list of NFTs from a collection or an entire NFT collection.
2. Important links
3. Contract details
PWNSimpleLoanListOffer.sol is written in Solidity version 0.8.16
Features
Make List Offer
Create Simple Loan terms from List Offer
Provides a function to encode List Offer
Inherited contracts, implemented Interfaces and ERCs
Functions
View Functions
Events
The PWN Simple Loan List Offer contract inherits events from the Simple Loan Offer contract and does not define any additional custom events or errors.
List Offer Struct
Type | Name | Comment |
---|---|---|
|
| 0 -> ERC-20 1 -> ERC-721 2 -> ERC-1155 |
|
| Address of an asset used as a collateral. |
|
| Merkle tree root of a set of whitelisted collateral ids. |
|
| Amount of tokens used as a collateral, in case of ERC721 should be 0. |
|
| Address of an loaned asset. |
|
| Amount of tokens which is requested as a loan. |
|
| Amount of tokens which act as a lenders loan interest. Borrower has to pay back a borrowed amount + yield. |
|
| Loan duration in seconds. |
|
| Request expiration unix timestamp in seconds. |
|
| Address of a borrower. This address has to sign a request for it to be valid. If the address is zero address, anybody with valid collateral can accept the offer. |
|
| Address of a lender. Only this address can accept a request. If the address is zero address, anybody with a loan asset can accept the request. |
|
| If true, offer will not be revoked on acceptance. Persistent offer can be revoked manually. |
|
| Additional value to enable identical requests in time. Without it, it would be impossible to make a request, which was once revoked. Nonce can be used to create a group of requests, where accepting one request will make other requests in the group invalid. |
Offer Values Struct
When a borrower decides to accept a list offer, concrete values for a simple loan have to be provided. Offer Values Struct serves this purpose.
Type | Name | Comment |
---|---|---|
|
| Selected collateral id to be used as a collateral. |
|
| Proof of inclusion, that selected collateral id is whitelisted. This proof should create same hash as the merkle tree root given in an Offer. Can be empty for collection offers. |
Last updated