MintableIncentivizedERC721

Basic ERC721 implementation

_ERC721Data

struct MintableERC721Data _ERC721Data

onlyPoolAdmin

modifier onlyPoolAdmin()

Only pool admin can call functions marked by this modifier.

onlyPool

modifier onlyPool()

Only pool can call functions marked by this modifier.

_addressesProvider

contract IPoolAddressesProvider _addressesProvider

UserState - additionalData is a flexible field. PTokens and VariableDebtTokens use this field store the index of the user's last supply/withdrawal/borrow/repayment. StableDebtTokens use this field to store the user's stable rate.

POOL

contract IPool POOL

ATOMIC_PRICING

bool ATOMIC_PRICING

_underlyingAsset

address _underlyingAsset

constructor

constructor(contract IPool pool, string name_, string symbol_, bool atomic_pricing) internal

Constructor.

Parameters

NameTypeDescription

pool

contract IPool

The reference to the main Pool contract

name_

string

The name of the token

symbol_

string

The symbol of the token

atomic_pricing

bool

name

function name() public view returns (string)

Returns the token collection name.

symbol

function symbol() external view returns (string)

Returns the token collection symbol.

balanceOf

function balanceOf(address account) public view virtual returns (uint256)

getIncentivesController

function getIncentivesController() external view virtual returns (contract IRewardController)

Returns the address of the Incentives Controller contract

Return Values

NameTypeDescription

[0]

contract IRewardController

The address of the Incentives Controller

setIncentivesController

function setIncentivesController(contract IRewardController controller) external

Sets a new Incentives Controller

Parameters

NameTypeDescription

controller

contract IRewardController

the new Incentives controller

setBalanceLimit

function setBalanceLimit(uint64 limit) external

Sets new Balance Limit

Parameters

NameTypeDescription

limit

uint64

the new Balance Limit

_setName

function _setName(string newName) internal

Update the name of the token

Parameters

NameTypeDescription

newName

string

The new name for the token

_setSymbol

function _setSymbol(string newSymbol) internal

Update the symbol for the token

Parameters

NameTypeDescription

newSymbol

string

The new symbol for the token

ownerOf

function ownerOf(uint256 tokenId) public view virtual returns (address)

See {IERC721-ownerOf}.

tokenURI

function tokenURI(uint256) external view virtual returns (string)

See {IERC721Metadata-tokenURI}.

approve

function approve(address to, uint256 tokenId) external virtual

See {IERC721-approve}.

getApproved

function getApproved(uint256 tokenId) public view virtual returns (address)

See {IERC721-getApproved}.

setApprovalForAll

function setApprovalForAll(address operator, bool approved) external virtual

See {IERC721-setApprovalForAll}.

isApprovedForAll

function isApprovedForAll(address owner, address operator) public view virtual returns (bool)

See {IERC721-isApprovedForAll}.

transferFrom

function transferFrom(address from, address to, uint256 tokenId) external virtual

See {IERC721-transferFrom}.

safeTransferFrom

function safeTransferFrom(address from, address to, uint256 tokenId) external virtual

See {IERC721-safeTransferFrom}.

safeTransferFrom

function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) external virtual

See {IERC721-safeTransferFrom}.

_safeTransferFrom

function _safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) internal

_safeTransfer

function _safeTransfer(address from, address to, uint256 tokenId, bytes) internal virtual

_Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked.

_data is additional data, it has no specified format and it is sent in call to to.

This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. implement alternative mechanisms to perform token transfer, such as signature-based.

Requirements:

  • from cannot be the zero address.

  • to cannot be the zero address.

  • tokenId token must exist and be owned by from.

Emits a {Transfer} event._

_exists

function _exists(uint256 tokenId) internal view virtual returns (bool)

_Returns whether tokenId exists.

Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.

Tokens start existing when they are minted (_mint), and stop existing when they are burned (_burn)._

_isApprovedOrOwner

function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool)

_Returns whether spender is allowed to manage tokenId.

Requirements:

  • tokenId must exist._

_mintMultiple

function _mintMultiple(address to, struct DataTypes.ERC721SupplyParams[] tokenData) internal virtual returns (uint64 oldCollateralizedBalance, uint64 newCollateralizedBalance)

_burnMultiple

function _burnMultiple(address user, uint256[] tokenIds) internal virtual returns (uint64 oldCollateralizedBalance, uint64 newCollateralizedBalance)

_transfer

function _transfer(address from, address to, uint256 tokenId) internal virtual

_Transfers tokenId from from to to. As opposed to {transferFrom}, this imposes no restrictions on msg.sender.

Requirements:

  • to cannot be the zero address.

  • tokenId token must be owned by from.

Emits a {Transfer} event._

_transferCollateralizable

function _transferCollateralizable(address from, address to, uint256 tokenId) internal virtual returns (bool isUsedAsCollateral_)

update collateral information on transfer

collateralizedBalanceOf

function collateralizedBalanceOf(address account) public view virtual returns (uint256)

get the collateralized balance of a specific user

setIsUsedAsCollateral

function setIsUsedAsCollateral(uint256 tokenId, bool useAsCollateral, address sender) external virtual returns (bool)

changes the collateral state/config of a token

Return Values

NameTypeDescription

[0]

bool

if the state has changed

batchSetIsUsedAsCollateral

function batchSetIsUsedAsCollateral(uint256[] tokenIds, bool useAsCollateral, address sender) external virtual returns (uint256 oldCollateralizedBalance, uint256 newCollateralizedBalance)

the ids of the token want to change the collateral state

Return Values

NameTypeDescription

oldCollateralizedBalance

uint256

uint256 (user's old collateralized balance), uint256 (user's new collateralized balance)

newCollateralizedBalance

uint256

isUsedAsCollateral

function isUsedAsCollateral(uint256 tokenId) external view returns (bool)

get the the collateral configuration of a specific token

isAuctioned

function isAuctioned(uint256 tokenId) external view returns (bool)

get the auction configuration of a specific token

startAuction

function startAuction(uint256 tokenId) external virtual

start auction

endAuction

function endAuction(uint256 tokenId) external virtual

end auction

getAuctionData

function getAuctionData(uint256 tokenId) external view returns (struct DataTypes.Auction auction)

get auction data

supportsInterface

function supportsInterface(bytes4 interfaceId) external view virtual returns (bool)

See {IERC165-supportsInterface}.

tokenOfOwnerByIndex

function tokenOfOwnerByIndex(address owner, uint256 index) external view virtual returns (uint256)

See {IERC721Enumerable-tokenOfOwnerByIndex}.

totalSupply

function totalSupply() public view virtual returns (uint256)

See {IERC721Enumerable-totalSupply}.

tokenByIndex

function tokenByIndex(uint256 index) external view virtual returns (uint256)

See {IERC721Enumerable-tokenByIndex}.