PWN Vault
Asset storage
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 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.
2. Important links
Deployment addresses
Rinkeby (deprecated): 0x2f705615E25D705813cC0E29f4225Db0EDB82eCa
Source code
3. Contract Details
PWNVault.sol contract is written in Solidity version 0.8.4
Functions
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.
pull
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:
MultiToken.Asset memory
_asset
- An asset construct (see MultiToken)address
_origin
- Address from which asset is pulled into the Vault.
push
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:
MultiToken.Asset memory
_asset
- An asset construct (see MultiToken)address
_beneficiary
- An address of the recipient of the asset -> is set in the PWN logic contract
pushFrom
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:
MultiToken.Asset memory
_asset
- An asset construct (see MultiToken)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
Events
PWN Vault contract defines three events and no custom errors.
VaultPull
VaultPull
VaultPull event is emitted when the pull
function is called.
This event has two parameters:
MultiToken.Asset
asset
- An asset construct (see MultiToken)address indexed
origin
- Address from which asset is pulled into the Vault.
VaultPush
VaultPush
VaultPush event is emitted when the push
function is called.
This event has two parameters:
MultiToken.Asset
asset
- An asset construct (see MultiToken)address indexed
beneficiary
- Address to which is the asset pushed (transferred) to.
VaultPushFrom
VaultPushFrom
VaultPushFrom event is emitted when the pushFrom
function is called.
This event has three parameters:
MultiToken.Asset
asset
- An asset construct (see MultiToken)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 updated