Simple Offer
1. Summary
PWNSimpleLoanSimpleOffer.sol defines Simple Offer for the Simple Loan type.
2. Important links
3. Contract details
PWNSimpleLoanSimpleOffer.sol is written in Solidity version 0.8.16
Features
Make Simple Offer
Create Simple Loan terms from Simple Offer
Provides a function to encode Simple Offer
Inherited contracts, implemented Interfaces and ERCs
Functions
View Functions
Events
The PWN Simple Loan Simple Offer contract inherits events from the Simple Loan Offer contract and does not define any additional custom events or errors.
Simple Offer Struct
Type | Name | Comment |
---|---|---|
|
| 0 -> ERC-20 1 -> ERC-721 2 -> ERC-1155 |
|
| Address of an asset used as a collateral. |
|
| Token id of an asset used as a collateral, in case of ERC20 should be 0. |
|
| 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. |
Last updated