Developer Docs
AppGitHub
  • Welcome!
  • Smart contracts
    • Core
      • Introduction
      • Deep Dive
      • Smart Contract Reference
        • PWN Hub
          • Tags
        • PWN Config
        • PWN Vault
        • Loan Types
          • Simple Loan
        • Proposals
          • Simple Loan Proposal
            • Simple Proposal
            • List Proposal
            • Elastic Proposal
            • Elastic Chainlink Proposal
            • Dutch Proposal
        • PWN Utilized Credit
        • PWN LOAN
        • PWN Revoked Nonce
        • Peripheral Contracts
          • Acceptor Controller
            • World ID
          • State Fingerprint Computer
            • UniV3
            • Chicken Bonds
          • Pool Adapter
            • Aave
            • Compound
            • ERC4626
        • Miscellaneous
          • PWN Fee Calculator
          • PWN Signature Checker
          • PWN Errors
          • PWN Periphery
          • Timelock
    • PWN DAO
      • Governance
        • Optimistic
        • Token
      • Tokens
        • PWN
        • stPWN
        • vePWN
          • Stake
          • Power
          • Metadata
      • Epoch Clock
      • Miscellaneous
        • Errors
        • EpochPowerLib
    • Tools
      • PWN Safe
        • Architecture
        • Security considerations
        • Smart Contract Reference
          • PWN Safe Factory
          • ATR Module
            • Tokenized Asset Manager
            • Recipient Permission Manager
          • Whitelist
          • ATR Guard
            • Operators context
      • Token Bundler
      • PWN Deployer
    • Libraries
      • MultiToken
    • Contract Addresses
  • More documentation
    • PWN Docs
    • FAQ
    • Audits
    • Using PWN without front-end
  • Deprecated
    • PWN Beta
      • Architecture
      • PWN
        • Off-chain signed offer
        • Offer types
      • PWN Vault
      • PWN LOAN
Powered by GitBook
On this page
  • 1. Summary
  • 2. Important links
  • 3. Contract Details
  • Functions
  • pull
  • push
  • pushFrom
  • Events
  • VaultPull
  • VaultPush
  • VaultPushFrom
Edit on GitHub
  1. Deprecated
  2. PWN Beta

PWN Vault

Asset storage

PreviousOffer typesNextPWN LOAN

Last updated 2 years ago

1. Summary

PWN Vault is the holder contract for the locked-in collateral and paid back credit. The contract can only be operated through the (logic) contract.

All approval of tokens utilized within the PWN context has to be done towards the PWN Vault address - as ultimately it's the contract accessing the tokens.

2. Important links

  • Deployment addresses

    • Mainnet:

    • Polygon:

    • Görli:

    • Mumbai:

    • Rinkeby (deprecated):

  • Source code

  • ABI

3. Contract Details

  • PWNVault.sol contract is written in Solidity version 0.8.4

Functions

pull

Function accessing an asset and pulling it into the vault.

The function assumes a prior token approval was made with the PWNVault address to be approved.

This function takes two arguments:

  • address_origin - Address from which asset is pulled into the Vault.

push

Function pushing an asset from the vault, sending to a defined recipient. This function is used for claiming a paid back loan or defaulted collateral.

This function takes two arguments:

  • address_beneficiary - An address of the recipient of the asset -> is set in the PWN logic contract

pushFrom

Function pushing an asset from a lender, sending it to a borrower.

This function assumes prior approval for the asset to be spent by the borrower's address.

This function takes three arguments:

  • address_origin - An address of the lender who is providing the loan asset

  • address_beneficiary - An address of the recipient of the asset -> is set in the PWN logic contract

Events

PWN Vault contract defines three events and no custom errors.

event VaultPull(MultiToken.Asset asset, address indexed origin);
event VaultPush(MultiToken.Asset asset, address indexed beneficiary);
event VaultPushFrom(MultiToken.Asset asset, address indexed origin, address indexed beneficiary);

VaultPull

VaultPull event is emitted when the pull function is called.

This event has two parameters:

  • address indexedorigin - Address from which asset is pulled into the Vault.

VaultPush

VaultPush event is emitted when the push function is called.

This event has two parameters:

  • address indexedbeneficiary - Address to which is the asset pushed (transferred) to.

VaultPushFrom

VaultPushFrom event is emitted when the pushFrom function is called.

This event has three parameters:

  • address indexedorigin - An address of the lender who is providing the loan asset

  • address indexedbeneficiary - An address of the recipient of the asset -> is set in the PWN logic contract

The functions described below are important to understand the events the contract emits. These functions can not be called directly and the contract can only be operated through the contract.

MultiToken.Asset memory_asset - An asset construct (see )

MultiToken.Asset memory_asset - An asset construct (see )

MultiToken.Asset memory_asset - An asset construct (see )

MultiToken.Assetasset - An asset construct (see )

MultiToken.Assetasset - An asset construct (see )

MultiToken.Assetasset - An asset construct (see )

PWN
0xb98efe56decceb1bec9faeeaf62500deb0953474
0xaF0d978275a2e7e3109F8C6307Ffd281774C623E
0xDBdb041842407c109F65b23eA86D99c1E0D94522
0x2fd4B676192C701778724408B72e9A29af2eB8c0
0x2f705615E25D705813cC0E29f4225Db0EDB82eCa
GitHub
JSON
Text
PWN
MultiToken
MultiToken
MultiToken
MultiToken
MultiToken
MultiToken