WPunkGateway

Punk

contract IPunks Punk

WPunk

contract IWrappedPunks WPunk

Pool

contract IPool Pool

proxy

address proxy

punk

address punk

wpunk

address wpunk

pool

address pool

constructor

constructor(address _punk, address _wpunk, address _pool) public

Sets the WETH address and the PoolAddressesProvider address. Infinite approves pool.

Parameters

NameTypeDescription

_punk

address

Address of the Punk contract

_wpunk

address

Address of the Wrapped Punk contract

_pool

address

Address of the proxy pool of this contract

initialize

function initialize() external

supplyPunk

function supplyPunk(struct DataTypes.ERC721SupplyParams[] punkIndexes, address onBehalfOf, uint16 referralCode) external

supplies (deposits) WPunk into the reserve, using native Punk. A corresponding amount of the overlying asset (xTokens) is minted.

Parameters

NameTypeDescription

punkIndexes

struct DataTypes.ERC721SupplyParams[]

punkIndexes to supply to gateway

onBehalfOf

address

address of the user who will receive the xTokens representing the supply

referralCode

uint16

integrators are assigned a referral code and can potentially receive rewards.

withdrawPunk

function withdrawPunk(uint256[] punkIndexes, address to) external

_withdraws the WPUNK reserves of msg.sender.

Parameters

NameTypeDescription

punkIndexes

uint256[]

indexes of nWPunks to withdraw and receive native WPunk

to

address

address of the user who will receive native Punks

acceptBidWithCredit

function acceptBidWithCredit(bytes32 marketplaceId, bytes payload, struct DataTypes.Credit credit, uint256[] punkIndexes, uint16 referralCode) external

Implements the acceptBidWithCredit feature. AcceptBidWithCredit allows users to accept a leveraged bid on ParaSpace NFT marketplace. Users can submit leveraged bid and pay at most (1 - LTV) * $NFT

The nft receiver just needs to do the downpayment

Parameters

NameTypeDescription

marketplaceId

bytes32

The marketplace identifier

payload

bytes

The encoded parameters to be passed to marketplace contract (selector eliminated)

credit

struct DataTypes.Credit

The credit that user would like to use for this purchase

punkIndexes

uint256[]

referralCode

uint16

The referral code used

batchAcceptBidWithCredit

function batchAcceptBidWithCredit(bytes32[] marketplaceIds, bytes[] payloads, struct DataTypes.Credit[] credits, uint256[] punkIndexes, uint16 referralCode) external

Implements the batchAcceptBidWithCredit feature. AcceptBidWithCredit allows users to accept a leveraged bid on ParaSpace NFT marketplace. Users can submit leveraged bid and pay at most (1 - LTV) * $NFT

The nft receiver just needs to do the downpayment

Parameters

NameTypeDescription

marketplaceIds

bytes32[]

The marketplace identifiers

payloads

bytes[]

The encoded parameters to be passed to marketplace contract (selector eliminated)

credits

struct DataTypes.Credit[]

The credits that the makers have approved to use for this purchase

punkIndexes

uint256[]

referralCode

uint16

The referral code used

emergencyERC721TokenTransfer

function emergencyERC721TokenTransfer(address token, uint256 tokenId, address to) external

transfer ERC721 from the utility contract, for ERC721 recovery in case of stuck tokens due direct transfers to the contract address.

Parameters

NameTypeDescription

token

address

ERC721 token to transfer

tokenId

uint256

tokenId to send

to

address

recipient of the transfer

emergencyPunkTransfer

function emergencyPunkTransfer(address to, uint256 punkIndex) external

transfer native Punk from the utility contract, for native Punk recovery in case of stuck Punk due selfdestructs or transfer punk to pre-computated contract address before deployment.

Parameters

NameTypeDescription

to

address

recipient of the transfer

punkIndex

uint256

punk to send

getWPunkAddress

function getWPunkAddress() external view returns (address)

Get WPunk address used by WPunkGateway

onERC721Received

function onERC721Received(address, address, uint256, bytes) public virtual returns (bytes4)