PWN Vault
Asset storage
PWN Vault is the holder contract for the locked-in collateral and paid back credit. The contract can only be operated through the PWN (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.
- Deployment addresses
- Source code
- PWNVault.sol contract is written in Solidity version 0.8.4
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 PWN contract.
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.
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
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 assetaddress
_beneficiary
- An address of the recipient of the asset -> is set in the PWN logic contract
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 event is emitted when the
pull
function is called. This event has two parameters:
address indexed
origin
- Address from which asset is pulled into the Vault.
VaultPush event is emitted when the
push
function is called. This event has two parameters:
address indexed
beneficiary
- Address to which is the asset pushed (transferred) to.
VaultPushFrom event is emitted when the
pushFrom
function is called. This event has three parameters:
address indexed
origin
- An address of the lender who is providing the loan assetaddress indexed
beneficiary
- An address of the recipient of the asset -> is set in the PWN logic contract
Last modified 5mo ago