Simple Loan Request

1. Summary

PWNSimpleLoanRequest.sol is an abstract contract inherited by Simple Loan Request types.

3. Contract details

  • PWNSimpleLoanRequest.sol is written in Solidity version 0.8.16


  • Implements _makeRequest for borrowers to be able to make on-chain loan request

  • Provides a way to revoke loan requests

Inherited contracts, implemented Interfaces and ERCs




A function to make an on-chain loan request.

This function takes two arguments supplied by the loan request type:

  • bytes32requestStructHash - Hash of a proposed loan request

  • addressborrower - Address of a loan request proposer (borrower)


function _makeRequest(bytes32 requestStructHash, address borrower) internal {
    // Check that caller is a borrower
    if (msg.sender != borrower)
        revert CallerIsNotStatedBorrower(borrower);

    // Mark request as made
    requestsMade[requestStructHash] = true;

    emit RequestMade(requestStructHash, borrower);


Revokes supplied loan request nonce for msg.sender.

This function takes one argument supplied by the caller:

  • uint256offerNonce - Loan request nonce to revoke


function revokeRequestNonce(uint256 requestNonce) external {
    revokedRequestNonce.revokeNonce(msg.sender, requestNonce);


The PWN Simple Loan Request contract defines one event and no custom errors.

event RequestMade(bytes32 indexed requestHash, address indexed borrower);

RequestMade event is emitted when a borrower creates an on-chain loan request.

This event has two parameters:

  • bytes32 indexedrequestHash - Hash of a proposed loan request

  • address indexedborrower - Address of a loan request proposer (borrower)

Last updated