Punk Gateway
Last updated
Last updated
If you need to use CryptoPunks in the protocol, it must first be wrapped into WPUNKS. The WPUNKS Gateway contract is a helper contract to easily wrap and unwrap CryptoPunks as necessary when interacting with the protocol, since only ERC721 is used within protocol interactions.
function borrow( address reserveAsset, uint256 amount, uint256 punkIndex, address onBehalfOf, uint16 referralCode )
Allows users to borrow a specific amount
of the ERC20 reserve underlying asset, provided that the borrower already own some CryptoPunks collaterals. E.g. User borrows 10000 USDC, receiving the 10000 USDC in his wallet and lock CryptoPunks collateral asset in contract.
Parameter Name | Type | Description |
---|---|---|
function repay(uint256 punkIndex, uint256 amount)
Repays a borrowed amount
on a specific punk, burning the equivalent loan owned. E.g. User repays 10000 USDC, burning loan and receives collateral asset.
Parameter Name | Type | Description |
---|---|---|
function auction(uint256 punkIndex, uint256 bidPrice, address onBehalfOf)
Auction a un-health punk loan with ERC20 reserve.
function redeem(uint256 punkIndex, uint256 amount, uint256 bidFine)
Redeems a un-health CryptoPunks loan with ERC20 reserve.
function liquidate(uint256 punkIndex, uint256 amount)
Liquidates a un-health CryptoPunks loan with ERC20 reserve.
function borrowETH( uint256 amount, uint256 punkIndex, address onBehalfOf, uint16 referralCode )
Allows users to borrow a specific amount
of the native ETH, provided that the borrower already own some CryptoPunks collaterals. E.g. User borrows 100 ETH, receiving the 100 ETH in his wallet and lock CryptoPunks collateral asset in contract.
function repayETH(uint256 punkIndex, uint256 amount)
Repays a borrowed amount
on a specific CryptoPunks with native ETH.
function auction(uint256 punkIndex, address onBehalfOf)
Auctions a un-health punk loan with native ETH.
function redeemETH(uint256 punkIndex, uint256 amount, uint256 bidFine)
Redeems a un-health punk loan with native ETH.
function liquidateETH(uint256 punkIndex, uint256 amount)
Liquidates a un-health punk loan with native ETH.
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
reserveAsset
address
The address of the underlying asset to borrow
amount
uint256
The amount to be borrowed. Units should decimals of underlying reserve
punkIndex
uint256
The index of the CryptoPunks used as collateral
OnBehalfOf
address
The address of the user who will receive the debtTokens and NFT loans representing the borrow
referralCode
uint16
referral code for our referral program. Use 0 for no referral
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The amount to repay
punkIndex
uint256
The index of the CryptoPunks used as collateral
bidPrice
uint256
The bid price
onBehalfOf
address
The address of the user who will receive the CryptoPunks
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The amount of repaid debt
bidFine
uint256
The amount of bid fine
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The extra amount of repaid debt
amount
The amount to be borrowed. Units should be 18 decimals.
punkIndex
The index of the CryptoPunks used as collateral
onBehalfOf
The address of the user who will receive the debtTokens and NFT loans representing the borrow
referralCode
referral code for our referral program. Use 0 for no referral
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The amount to repay
punkIndex
uint256
The index of the CryptoPunks used as collateral
onBehalfOf
address
The address of the user who will receive the CryptoPunks
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The amount of repaid debt
bidFine
uint256
The amount of bid fine
punkIndex
uint256
The index of the CryptoPunks used as collateral
amount
uint256
The extra amount of repaid debt