Generated Docs
Solidity contracts provided as part of Paima Engine.
Core contracts
- PaimaL2Contract: The main L2 contract for a Paima L2.
State-annotated contracts
- AnnotatedMintNft: A standard ERC721 that accepts calldata in the mint function for any initialization data needed in a Paima dApp.
- InverseBaseProjectedNft: Project game state into a ERC721 NFT on an EVM layer initiated on said base layer.
- InverseAppProjectedNft: Project game state into a ERC721 NFT on an EVM layer initiated on the app layer.
- InverseBaseProjected1155: Project game state into a ERC1155 on an EVM layer initiated on said base layer.
- InverseAppProjected1155: Project game state into a ERC1155 on an EVM layer initiated on the app layer.
Facilitating monetization
- NativeNftSale: Facilitates selling NFTs that accepts extra data when buying for any initialization data needed in a Paima dApp.
- GenericPayment: Facilitates accepting payment that accepts extra data to know what the payment was for inside a Paima dApp.
- Erc20NftSale: Facilitates selling NFTs for specific ERC20s that accepts extra data when buying for any initialization data needed in a Paima dApp.
- OrderbookDexProxy: Proxy for the orderbook DEX contract.
- IOrderbookDex: Interface to facilitate trading inverse projected ERC1155 tokens.
- OrderbookDex: Facilitates trading inverse projected ERC1155 tokens.
Core contractsβ
import "@paima/evm-contracts/contracts/PaimaL2Contract.sol";
The main L2 contract for a Paima L2.
Functions
constructor(address _owner, uint256 _fee)public# |
Sets the contract owner to |
paimaSubmitGameInput(bytes data)public# |
Emits the |
withdrawFunds()public# |
Withdraws the contract balance to the |
setOwner(address newOwner)public# |
Sets the |
setFee(uint256 newFee)public# |
Sets the |
owner() β addresspublic# |
Contract owner. |
fee() β uint256public# |
Amount in wei that is required to be paid when calling |
PaimaGameInteraction(address indexed userAddress, bytes data, uint256 value)event# |
Emitted when |
State-annotated contractsβ
import "@paima/evm-contracts/contracts/AnnotatedMintNft.sol";
A standard ERC721 that accepts calldata in the mint function for any initialization data needed in a Paima dApp.
Upon deployment only the contract owner (specified in constructor parameter) is able to mint tokens. Additional
minters (e.g. NativeNftSale contract) need to be added by using the setMinter
function.
Modifiers
Functions
- constructor(name, symbol, supply, owner)
- supportsInterface(interfaceID)
- mint(_to, initialData)
- burn(_tokenId)
- setMinter(_minter)
- removeMinter(_minter)
- _baseURI()
- tokenURI(tokenId)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- updateMaxSupply(_maxSupply)
- exists(_tokenId)
- isMinter(_account)
- currentTokenId()
- baseURI()
- totalSupply()
- maxSupply()
- baseExtension()
- minters()
Ownable
ERC721
- balanceOf(owner)
- ownerOf(tokenId)
- name()
- symbol()
- approve(to, tokenId)
- getApproved(tokenId)
- setApprovalForAll(operator, approved)
- isApprovedForAll(owner, operator)
- transferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId, data)
- _ownerOf(tokenId)
- _getApproved(tokenId)
- _isAuthorized(owner, spender, tokenId)
- _checkAuthorized(owner, spender, tokenId)
- _increaseBalance(account, value)
- _update(to, tokenId, auth)
- _mint(to, tokenId)
- _safeMint(to, tokenId)
- _safeMint(to, tokenId, data)
- _burn(tokenId)
- _transfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId, data)
- _approve(to, tokenId, auth)
- _approve(to, tokenId, auth, emitEvent)
- _setApprovalForAll(owner, operator, approved)
- _requireOwned(tokenId)
Events
Errors
canMint()modifier# |
Reverts if |
onlyTokenOwner(uint256 tokenId)modifier# |
Reverts if |
constructor(string name, string symbol, uint256 supply, address owner)public# |
Sets the NFT's |
supportsInterface(bytes4 interfaceID) β boolpublic# |
Returns true if this contract implements the interface defined by |
mint(address _to, string initialData) β uint256external# |
Mints a new token to address |
burn(uint256 _tokenId)external# |
Burns token of ID |
setMinter(address _minter)external# |
Adds |
removeMinter(address _minter)external# |
Removes |
_baseURI() β stringinternal# |
Returns the |
tokenURI(uint256 tokenId) β stringpublic# |
Returns the token URI of specified |
setBaseURI(string _URI)external# |
Sets |
setBaseExtension(string _newBaseExtension)public# |
Sets |
updateMaxSupply(uint256 _maxSupply)external# |
Sets |
exists(uint256 _tokenId) β boolexternal# |
Returns true if specified |
isMinter(address _account) β boolpublic# |
Returns true if |
currentTokenId() β uint256public# |
The token ID that will be minted when calling the |
baseURI() β stringpublic# |
Base URI that is used in the |
totalSupply() β uint256public# |
Total token supply, increased by minting and decreased by burning. |
maxSupply() β uint256public# |
Maximum amount of tokens that is allowed to exist. |
baseExtension() β stringpublic# |
Base extension that is used in the |
minters() β mapping(address => bool)public# |
Returns true for addresses that are allowed to mint this token. |
UpdateMaxSupply(uint256 indexed oldMaxSupply, uint256 indexed newMaxSupply)event# |
Emitted when max supply is updated from |
SetMinter(address indexed newMinter)event# |
Emitted when |
RemoveMinter(address indexed oldMinter)event# |
Emitted when |
SetBaseURI(string oldUri, string newUri)event# |
Emitted when |
Minted(uint256 indexed tokenId, string initialData)event# |
Emitted when a new token with ID |
import "@paima/evm-contracts/contracts/token/IInverseProjectedNft.sol";
A standard ERC721 that can be burned and has a special tokenURI function accepting a custom base URI. See PRC3 for more.
Functions
- burn(_tokenId)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- tokenURI(tokenId, customBaseUri)
- tokenURI(tokenId, customUriInterface)
Events
burn(uint256 _tokenId)external# |
Burns token of ID |
setBaseURI(string _URI)external# |
Sets |
setBaseExtension(string _newBaseExtension)external# |
Sets |
tokenURI(uint256 tokenId, string customBaseUri) β stringexternal# |
Returns the token URI of specified |
tokenURI(uint256 tokenId, contract ITokenUri customUriInterface) β stringexternal# |
Returns the token URI of specified |
SetBaseExtension(string oldBaseExtension, string newBaseExtension)event# |
Emitted when |
SetBaseURI(string oldUri, string newUri)event# |
Emitted when |
import "@paima/evm-contracts/contracts/token/IInverseBaseProjectedNft.sol";
A Paima Inverse Projection NFT where initialization is handled by the base-layer. A standard ERC721 that accepts calldata in the mint function for any initialization data needed in a Paima dApp. See PRC3 for more.
Functions
IInverseProjectedNft
- burn(_tokenId)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- tokenURI(tokenId, customBaseUri)
- tokenURI(tokenId, customUriInterface)
Events
mint(address _to, string initialData, bytes data) β uint256external# |
Mints a new token to address |
mint(address _to, string initialData) β uint256external# |
Shorthand function that calls the |
Minted(uint256 indexed tokenId, string initialData)event# |
Emitted when the globally-enforced tokenId is minted, with |
import "@paima/evm-contracts/contracts/token/InverseBaseProjectedNft.sol";
A standard ERC721 that accepts calldata in the mint function for any initialization data needed in a Paima dApp. See PRC3 for more.
Modifiers
Functions
- constructor(name, symbol, owner)
- supportsInterface(interfaceId)
- mint(_to, initialData, data)
- mint(_to, initialData)
- burn(_tokenId)
- _baseURI()
- tokenURI(tokenId)
- tokenURI(tokenId, customBaseUri)
- tokenURI(tokenId, customUriInterface)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- updateMetadataBatch(_fromTokenId, _toTokenId)
- updateMetadata(_tokenId)
- currentTokenId()
- baseURI()
- totalSupply()
- baseExtension()
Ownable
ERC721
- balanceOf(owner)
- ownerOf(tokenId)
- name()
- symbol()
- approve(to, tokenId)
- getApproved(tokenId)
- setApprovalForAll(operator, approved)
- isApprovedForAll(owner, operator)
- transferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId, data)
- _ownerOf(tokenId)
- _getApproved(tokenId)
- _isAuthorized(owner, spender, tokenId)
- _checkAuthorized(owner, spender, tokenId)
- _increaseBalance(account, value)
- _update(to, tokenId, auth)
- _mint(to, tokenId)
- _safeMint(to, tokenId)
- _safeMint(to, tokenId, data)
- _burn(tokenId)
- _transfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId, data)
- _approve(to, tokenId, auth)
- _approve(to, tokenId, auth, emitEvent)
- _setApprovalForAll(owner, operator, approved)
- _requireOwned(tokenId)
Events
Errors
onlyTokenOwner(uint256 tokenId)modifier# |
Reverts if |
constructor(string name, string symbol, address owner)public# |
Sets the NFT's |
supportsInterface(bytes4 interfaceId) β boolpublic# |
Returns true if this contract implements the interface defined by |
mint(address _to, string initialData, bytes data) β uint256public# |
Mints a new token to address |
mint(address _to, string initialData) β uint256public# |
Shorthand function that calls the |
burn(uint256 _tokenId)public# |
Burns token of ID |
_baseURI() β stringinternal# |
Returns the |
tokenURI(uint256 tokenId) β stringpublic# |
Returns the token URI of specified |
tokenURI(uint256 tokenId, string customBaseUri) β stringpublic# |
Returns the token URI of specified |
tokenURI(uint256 tokenId, contract ITokenUri customUriInterface) β stringpublic# |
Returns the token URI of specified |
setBaseURI(string _URI)public# |
Sets |
setBaseExtension(string _newBaseExtension)public# |
Sets |
updateMetadataBatch(uint256 _fromTokenId, uint256 _toTokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to consecutive range of tokens. Can be overridden in inheriting contract. |
updateMetadata(uint256 _tokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to a single token. Can be overridden in inheriting contract. |
currentTokenId() β uint256public# |
The token ID that will be minted when calling the |
baseURI() β stringpublic# |
Base URI that is used in the |
totalSupply() β uint256public# |
Total token supply, increased by minting and decreased by burning. |
baseExtension() β stringpublic# |
Base extension that is used in the |
import "@paima/evm-contracts/contracts/token/IInverseAppProjectedNft.sol";
A Paima Inverse Projection NFT where initialization is handled by the app-layer.
A standard ERC721 that can be freely minted and stores an unique <minter, userTokenId>
pair (used in tokenURI) when minted.
See PRC3 for more.
Functions
IInverseProjectedNft
- burn(_tokenId)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- tokenURI(tokenId, customBaseUri)
- tokenURI(tokenId, customUriInterface)
Events
mint(address _to, bytes _verificationData, bytes _data) β uint256external# |
Mints a new token to address |
mint(address _to, bytes _verificationData) β uint256external# |
Shorthand function that calls the |
mint(address _to) β uint256external# |
Shorthand function that calls the |
currentNonce(address seller) β uint256external# |
Useful if you need to either needs to
|
Minted(uint256 indexed tokenId, address indexed minter, uint256 indexed userTokenId)event# |
Emitted when the globally-enforced tokenId in combination with an unique |
import "@paima/evm-contracts/contracts/token/InverseAppProjectedNft.sol";
A standard ERC721 that accepts calldata in the mint function for any initialization data needed in a Paima dApp. See PRC3 for more.
Modifiers
Functions
- constructor(name, symbol, owner)
- supportsInterface(interfaceId)
- currentNonce(user)
- validateMint(, )
- mint(_to, _verificationData, _data)
- mint(_to, _verificationData)
- mint(_to)
- burn(_tokenId)
- _baseURI()
- tokenURI(tokenId)
- tokenURI(tokenId, customBaseUri)
- tokenURI(tokenId, customUriInterface)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- updateMetadataBatch(_fromTokenId, _toTokenId)
- updateMetadata(_tokenId)
- tokenToMint()
- mintCount()
- currentTokenId()
- baseURI()
- totalSupply()
- baseExtension()
Ownable
ERC721
- balanceOf(owner)
- ownerOf(tokenId)
- name()
- symbol()
- approve(to, tokenId)
- getApproved(tokenId)
- setApprovalForAll(operator, approved)
- isApprovedForAll(owner, operator)
- transferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId)
- safeTransferFrom(from, to, tokenId, data)
- _ownerOf(tokenId)
- _getApproved(tokenId)
- _isAuthorized(owner, spender, tokenId)
- _checkAuthorized(owner, spender, tokenId)
- _increaseBalance(account, value)
- _update(to, tokenId, auth)
- _mint(to, tokenId)
- _safeMint(to, tokenId)
- _safeMint(to, tokenId, data)
- _burn(tokenId)
- _transfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId)
- _safeTransfer(from, to, tokenId, data)
- _approve(to, tokenId, auth)
- _approve(to, tokenId, auth, emitEvent)
- _setApprovalForAll(owner, operator, approved)
- _requireOwned(tokenId)
Events
Errors
onlyTokenOwner(uint256 tokenId)modifier# |
Reverts if |
constructor(string name, string symbol, address owner)public# |
Sets the NFT's |
supportsInterface(bytes4 interfaceId) β boolpublic# |
Returns true if this contract implements the interface defined by |
currentNonce(address user) β uint256public# |
No description given |
validateMint(address, bytes) β boolinternal# |
No description given |
mint(address _to, bytes _verificationData, bytes _data) β uint256public# |
Mints a new token to address |
mint(address _to, bytes _verificationData) β uint256public# |
Shorthand function that calls the |
mint(address _to) β uint256public# |
Shorthand function that calls the |
burn(uint256 _tokenId)public# |
Burns token of ID |
_baseURI() β stringinternal# |
Returns the |
tokenURI(uint256 tokenId) β stringpublic# |
Returns the token URI of specified |
tokenURI(uint256 tokenId, string customBaseUri) β stringpublic# |
Returns the token URI of specified |
tokenURI(uint256 tokenId, contract ITokenUri customUriInterface) β stringpublic# |
Returns the token URI of specified |
setBaseURI(string _URI)public# |
Sets |
setBaseExtension(string _newBaseExtension)public# |
Sets |
updateMetadataBatch(uint256 _fromTokenId, uint256 _toTokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to consecutive range of tokens. Can be overridden in inheriting contract. |
updateMetadata(uint256 _tokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to a single token. Can be overridden in inheriting contract. |
tokenToMint() β mapping(uint256 => struct MintEntry)public# |
tokenId => MintEntry. |
mintCount() β mapping(address => uint256)public# |
No description given |
currentTokenId() β uint256public# |
The token ID that will be minted when calling the |
baseURI() β stringpublic# |
Base URI that is used in the |
totalSupply() β uint256public# |
Total token supply, increased by minting and decreased by burning. |
baseExtension() β stringpublic# |
Base extension that is used in the |
import "@paima/evm-contracts/contracts/token/IInverseProjected1155.sol";
A standard ERC1155 that can be burned and has a special uri function accepting a custom base URI.
Functions
- burn(id, value)
- burnBatch(ids, values)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- uri(id, customBaseUri)
- uri(id, customUriInterface)
Events
burn(uint256 id, uint256 value)external# |
Burns |
burnBatch(uint256[] ids, uint256[] values)external# |
Burns batch of |
setBaseURI(string _URI)external# |
Sets |
setBaseExtension(string _newBaseExtension)external# |
Sets |
uri(uint256 id, string customBaseUri) β stringexternal# |
Returns the token URI of specified |
uri(uint256 id, contract IUri customUriInterface) β stringexternal# |
Returns the token URI of specified |
SetBaseExtension(string oldBaseExtension, string newBaseExtension)event# |
Emitted when |
SetBaseURI(string oldUri, string newUri)event# |
Emitted when |
import "@paima/evm-contracts/contracts/token/IInverseBaseProjected1155.sol";
A Paima Inverse Projection ERC1155 token where initialization is handled by the base-layer. A standard ERC1155 that accepts calldata in the mint function for any initialization data needed in a Paima dApp.
Functions
IInverseProjected1155
- burn(id, value)
- burnBatch(ids, values)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- uri(id, customBaseUri)
- uri(id, customUriInterface)
Events
mint(uint256 value, bytes data, string initialData) β uint256external# |
Mints |
Minted(uint256 indexed tokenId, uint256 value, string initialData)event# |
Emitted when |
import "@paima/evm-contracts/contracts/token/InverseBaseProjected1155.sol";
A Paima Inverse Projection ERC1155 token where initialization is handled by the base-layer. A standard ERC1155 that accepts calldata in the mint function for any initialization data needed in a Paima dApp.
Functions
- constructor(_name, _symbol, _owner)
- supportsInterface(interfaceId)
- totalSupply(id)
- mint(value, data, initialData)
- burn(id, value)
- burnBatch(ids, values)
- uri(id)
- uri(id, customBaseUri)
- uri(id, customUriInterface)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- updateMetadataBatch(_fromTokenId, _toTokenId)
- updateMetadata(_tokenId)
- _update(from, to, ids, values)
- name()
- symbol()
- currentTokenId()
- baseURI()
- baseExtension()
Ownable
ERC1155
- balanceOf(account, id)
- balanceOfBatch(accounts, ids)
- setApprovalForAll(operator, approved)
- isApprovedForAll(account, operator)
- safeTransferFrom(from, to, id, value, data)
- safeBatchTransferFrom(from, to, ids, values, data)
- _updateWithAcceptanceCheck(from, to, ids, values, data)
- _safeTransferFrom(from, to, id, value, data)
- _safeBatchTransferFrom(from, to, ids, values, data)
- _setURI(newuri)
- _mint(to, id, value, data)
- _mintBatch(to, ids, values, data)
- _burn(from, id, value)
- _burnBatch(from, ids, values)
- _setApprovalForAll(owner, operator, approved)
Events
Errors
constructor(string _name, string _symbol, address _owner)public# |
Sets the NFT's |
supportsInterface(bytes4 interfaceId) β boolpublic# |
Returns true if this contract implements the interface defined by |
totalSupply(uint256 id) β uint256public# |
Returns the total amount of tokens with ID |
mint(uint256 value, bytes data, string initialData) β uint256public# |
Mints |
burn(uint256 id, uint256 value)public# |
Burns |
burnBatch(uint256[] ids, uint256[] values)public# |
Burns batch of |
uri(uint256 id) β stringpublic# |
Returns the token URI of specified |
uri(uint256 id, string customBaseUri) β stringpublic# |
Returns the token URI of specified |
uri(uint256 id, contract IUri customUriInterface) β stringpublic# |
Returns the token URI of specified |
setBaseURI(string _URI)public# |
Sets |
setBaseExtension(string _newBaseExtension)public# |
Sets |
updateMetadataBatch(uint256 _fromTokenId, uint256 _toTokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to consecutive range of tokens. Can be overridden in inheriting contract. |
updateMetadata(uint256 _tokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to a single token. Can be overridden in inheriting contract. |
_update(address from, address to, uint256[] ids, uint256[] values)internal# |
See {ERC1155-_update}. |
name() β stringpublic# |
No description given |
symbol() β stringpublic# |
No description given |
currentTokenId() β uint256public# |
The token ID that will be minted when calling the |
baseURI() β stringpublic# |
Base URI that is used in the |
baseExtension() β stringpublic# |
Base extension that is used in the |
import "@paima/evm-contracts/contracts/token/IInverseAppProjected1155.sol";
A Paima Inverse Projection ERC1155 token where initialization is handled by the app-layer.
A standard ERC1155 that can be freely minted and stores an unique <minter, userTokenId>
pair (used in tokenURI
) when minted.
Functions
IInverseProjected1155
- burn(id, value)
- burnBatch(ids, values)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- uri(id, customBaseUri)
- uri(id, customUriInterface)
Events
currentNonce(address user) β uint256external# |
Useful if you need to either needs to
|
mint(uint256 value, bytes data, bytes verificationData) β uint256external# |
Mints |
mint(uint256 value, bytes data) β uint256external# |
This works identically to the other function with an extra data parameter, except this function just sets data to "". |
Minted(uint256 indexed tokenId, address indexed minter, uint256 indexed userTokenId, uint256 value)event# |
Emitted when |
import "@paima/evm-contracts/contracts/token/InverseAppProjected1155.sol";
A Paima Inverse Projection ERC1155 token where initialization is handled by the app-layer.
A standard ERC1155 that can be freely minted and stores an unique <minter, userTokenId>
pair (used in tokenURI
) when minted.
Functions
- constructor(_name, _symbol, _owner)
- supportsInterface(interfaceId)
- currentNonce(user)
- validateMint(, )
- initialSupply(id)
- totalSupply(id)
- mint(value, data, verificationData)
- mint(value, data)
- burn(id, value)
- burnBatch(ids, values)
- uri(id)
- uri(id, customBaseUri)
- uri(id, customUriInterface)
- setBaseURI(_URI)
- setBaseExtension(_newBaseExtension)
- updateMetadataBatch(_fromTokenId, _toTokenId)
- updateMetadata(_tokenId)
- _update(from, to, ids, values)
- name()
- symbol()
- tokenToMint()
- mintCount()
- currentTokenId()
- baseURI()
- baseExtension()
Ownable
ERC1155
- balanceOf(account, id)
- balanceOfBatch(accounts, ids)
- setApprovalForAll(operator, approved)
- isApprovedForAll(account, operator)
- safeTransferFrom(from, to, id, value, data)
- safeBatchTransferFrom(from, to, ids, values, data)
- _updateWithAcceptanceCheck(from, to, ids, values, data)
- _safeTransferFrom(from, to, id, value, data)
- _safeBatchTransferFrom(from, to, ids, values, data)
- _setURI(newuri)
- _mint(to, id, value, data)
- _mintBatch(to, ids, values, data)
- _burn(from, id, value)
- _burnBatch(from, ids, values)
- _setApprovalForAll(owner, operator, approved)
Events
Errors
constructor(string _name, string _symbol, address _owner)public# |
Sets the token's |
supportsInterface(bytes4 interfaceId) β boolpublic# |
Returns true if this contract implements the interface defined by |
currentNonce(address user) β uint256public# |
Useful if you need to either needs to
|
validateMint(address, bytes) β boolinternal# |
No description given |
initialSupply(uint256 id) β uint256public# |
Returns the amount of token with ID |
totalSupply(uint256 id) β uint256public# |
Returns the total amount of tokens with ID |
mint(uint256 value, bytes data, bytes verificationData) β uint256public# |
Mints |
mint(uint256 value, bytes data) β uint256public# |
This works identically to the other function with an extra data parameter, except this function just sets data to "". |
burn(uint256 id, uint256 value)public# |
Burns |
burnBatch(uint256[] ids, uint256[] values)public# |
Burns batch of |
uri(uint256 id) β stringpublic# |
Returns the token URI of specified |
uri(uint256 id, string customBaseUri) β stringpublic# |
Returns the token URI of specified |
uri(uint256 id, contract IUri customUriInterface) β stringpublic# |
Returns the token URI of specified |
setBaseURI(string _URI)public# |
Sets |
setBaseExtension(string _newBaseExtension)public# |
Sets |
updateMetadataBatch(uint256 _fromTokenId, uint256 _toTokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to consecutive range of tokens. Can be overridden in inheriting contract. |
updateMetadata(uint256 _tokenId)public# |
Function that emits an event to notify third-parties (e.g. NFT marketplaces) about an update to a single token. Can be overridden in inheriting contract. |
_update(address from, address to, uint256[] ids, uint256[] values)internal# |
See {ERC1155-_update}. |
name() β stringpublic# |
No description given |
symbol() β stringpublic# |
No description given |
tokenToMint() β mapping(uint256 => struct MintEntry)public# |
No description given |
mintCount() β mapping(address => uint256)public# |
No description given |
currentTokenId() β uint256public# |
The token ID that will be minted when calling the |
baseURI() β stringpublic# |
Base URI that is used in the |
baseExtension() β stringpublic# |
Base extension that is used in the |
Facilitating monetizationβ
import "@paima/evm-contracts/contracts/NativeNftSale.sol";
Facilitates selling NFTs that accepts extra data when buying for any initialization data needed in a Paima dApp.
Functions
- constructor()
- initialize(owner, _nft, _price)
- buyNft(receiverAddress, initialData)
- updatePrice(_nftPrice)
- withdraw(_account)
- upgradeContract(_newContract)
- receive()
OwnableUpgradeable
- __Ownable_init(initialOwner)
- __Ownable_init_unchained(initialOwner)
- owner()
- _checkOwner()
- renounceOwnership()
- transferOwnership(newOwner)
- _transferOwnership(newOwner)
ContextUpgradeable
BaseState
Events
Initializable
Errors
Initializable
constructor()public# |
No description given |
initialize(address owner, address _nft, uint256 _price)public# |
Initializes the contract with the requested price |
buyNft(address receiverAddress, string initialData) β uint256public# |
Purchases NFT for address |
updatePrice(uint256 _nftPrice)external# |
Changes the sale price to |
withdraw(address payable _account)external# |
Withdraws the contract balance to |
upgradeContract(address _newContract)external# |
Upgrades the contract implementation to |
receive()external# |
Function allowing the contract to receive native tokens. |
Initialized(address indexed owner, address indexed nft)event# |
Emitted when the contract is initialized. |
UpdatePrice(uint256 indexed oldPrice, uint256 indexed newPrice)event# |
Emitted when the NFT price is updated from |
BuyNFT(uint256 indexed tokenId, uint256 indexed PRICE, address indexed receiver, address buyer)event# |
Emitted when an NFT of |
import "@paima/evm-contracts/contracts/GenericPayment.sol";
Facilitates accepting payment that accepts extra data to know what the payment was for inside a Paima dApp.
Functions
- constructor()
- initialize(owner)
- pay(message)
- withdraw(_account)
- upgradeContract(_newContract)
- initialized()
OwnableUpgradeable
- __Ownable_init(initialOwner)
- __Ownable_init_unchained(initialOwner)
- owner()
- _checkOwner()
- renounceOwnership()
- transferOwnership(newOwner)
- _transferOwnership(newOwner)
ContextUpgradeable
Events
Initializable
Errors
Initializable
constructor()public# |
No description given |
initialize(address owner)public# |
Initializes the contracts, transferring ownership to the specified |
pay(string message)external# |
Transfers native tokens to the contract, providing |
withdraw(address payable _account)external# |
Withdraws the contract balance to |
upgradeContract(address _newContract)external# |
Upgrades the contract implementation to |
initialized() β boolpublic# |
True if contract has been initialized via the |
Initialized(address indexed owner)event# |
Emitted when the contract is initialized. |
Pay(uint256 amount, address payer, string message)event# |
Emitted when payment of |
import "@paima/evm-contracts/contracts/Erc20NftSale.sol";
Facilitates selling NFTs for specific ERC20s that accepts extra data when buying for any initialization data needed in a Paima dApp.
Functions
- constructor()
- initialize(currencies, owner, _nft, _price)
- buyWithToken(_tokenAddress, receiverAddress, initialData)
- removeWhitelistedToken(_token)
- whitelistTokens(_tokens)
- updatePrice(_nftPrice)
- withdraw(_account)
- upgradeContract(_newContract)
- tokenIsWhitelisted(_token)
- getDepositedCurrencies()
- getSupportedCurrencies()
OwnableUpgradeable
- __Ownable_init(initialOwner)
- __Ownable_init_unchained(initialOwner)
- owner()
- _checkOwner()
- renounceOwnership()
- transferOwnership(newOwner)
- _transferOwnership(newOwner)
ContextUpgradeable
Events
- Initialized(currencies, owner, nft)
- UpdatePrice(oldPrice, newPrice)
- RemoveWhitelistedToken(token)
- WhitelistTokens(tokens)
- BuyWithToken(tokenId, PRICE, receiver, buyer)
Initializable
Errors
Initializable
constructor()public# |
No description given |
initialize(contract ERC20[] currencies, address owner, address _nft, uint256 _price)public# |
Initializes the contract with the requested price |
buyWithToken(contract ERC20 _tokenAddress, address receiverAddress, string initialData) β uint256public# |
Purchases NFT for address |
removeWhitelistedToken(contract ERC20 _token)external# |
Removes |
whitelistTokens(contract ERC20[] _tokens)external# |
Adds |
updatePrice(uint256 _nftPrice)external# |
Changes the sale price to |
withdraw(address _account)external# |
Withdraws the contract balance of |
upgradeContract(address _newContract)external# |
Upgrades the contract implementation to |
tokenIsWhitelisted(contract ERC20 _token) β boolpublic# |
Returns true if |
getDepositedCurrencies() β contract ERC20[]public# |
Returns the token addresses that have been used as a payment in the NFT purchases. |
getSupportedCurrencies() β contract ERC20[]public# |
Returns an array of token addresses that are accepted as payment in the NFT purchase. |
Initialized(contract ERC20[] indexed currencies, address indexed owner, address indexed nft)event# |
Emitted when the contract is initialized. |
UpdatePrice(uint256 indexed oldPrice, uint256 indexed newPrice)event# |
Emitted when the NFT price is updated from |
RemoveWhitelistedToken(address indexed token)event# |
Emitted when the |
WhitelistTokens(address[] indexed tokens)event# |
Emitted when the |
BuyWithToken(uint256 indexed tokenId, uint256 indexed PRICE, address indexed receiver, address buyer)event# |
Emitted when an NFT of |
import "@paima/evm-contracts/contracts/Proxy/OrderbookDexProxy.sol";
Functions
constructor(address _implementation, address _owner, uint256 _defaultMakerFee, uint256 _defaultTakerFee, uint256 _orderCreationFee)public# |
No description given |
import "@paima/evm-contracts/contracts/orderbook/IOrderbookDex.sol";
Orders are identified by an asset-specific unique incremental orderId
.
Functions
- balances(user)
- claim()
- currentOrderId(asset)
- collectedFees()
- defaultMakerFee()
- defaultTakerFee()
- orderCreationFee()
- maxFee()
- getAssetFeeInfo(asset)
- getAssetAppliedFees(asset)
- setAssetFeeInfo(asset, makerFee, takerFee)
- setDefaultFeeInfo(makerFee, takerFee)
- setOrderCreationFee(fee)
- getOrder(asset, orderId)
- createSellOrder(asset, assetId, assetAmount, pricePerAsset)
- createBatchSellOrder(asset, assetIds, assetAmounts, pricesPerAssets)
- fillOrdersExactEth(asset, minimumAsset, orderIds)
- fillOrdersExactAsset(asset, assetAmount, orderIds)
- cancelSellOrder(asset, orderId)
- cancelBatchSellOrder(asset, orderIds)
- withdrawFees()
Events
- BalanceClaimed(user, amount)
- FeeInfoChanged(asset, makerFee, takerFee)
- OrderCreated(asset, assetId, orderId, seller, assetAmount, pricePerAsset, makerFee, takerFee)
- OrderFilled(asset, assetId, orderId, seller, buyer, assetAmount, pricePerAsset, makerFeeCollected, takerFeeCollected)
- OrderCancelled(asset, assetId, orderId)
- OrderCreationFeeChanged(oldFee, newFee)
- FeesWithdrawn(receiver, amount)
balances(address user) β uint256external# |
No description given |
claim()external# |
No description given |
currentOrderId(address asset) β uint256external# |
No description given |
collectedFees() β uint256external# |
No description given |
defaultMakerFee() β uint256external# |
No description given |
defaultTakerFee() β uint256external# |
No description given |
orderCreationFee() β uint256external# |
No description given |
maxFee() β uint256external# |
No description given |
getAssetFeeInfo(address asset) β struct IOrderbookDex.FeeInfoexternal# |
No description given |
getAssetAppliedFees(address asset) β uint256 makerFee, uint256 takerFeeexternal# |
No description given |
setAssetFeeInfo(address asset, uint256 makerFee, uint256 takerFee)external# |
MUST revert if |
setDefaultFeeInfo(uint256 makerFee, uint256 takerFee)external# |
MUST revert if |
setOrderCreationFee(uint256 fee)external# |
MUST revert if called by unauthorized account. |
getOrder(address asset, uint256 orderId) β struct IOrderbookDex.Orderexternal# |
No description given |
createSellOrder(address asset, uint256 assetId, uint256 assetAmount, uint256 pricePerAsset) β uint256external# |
The order information is saved in a mapping |
createBatchSellOrder(address asset, uint256[] assetIds, uint256[] assetAmounts, uint256[] pricesPerAssets) β uint256[]external# |
This is a batched version of |
fillOrdersExactEth(address asset, uint256 minimumAsset, uint256[] orderIds)external# |
Transfers portions of msg.value to the orders' sellers according to the price.
The sum of asset amounts of filled orders MUST be at least |
fillOrdersExactAsset(address asset, uint256 assetAmount, uint256[] orderIds)external# |
Transfers portions of msg.value to the orders' sellers according to the price.
The sum of asset amounts of filled orders MUST be exactly |
cancelSellOrder(address asset, uint256 orderId)external# |
MUST revert if the order's seller is not |
cancelBatchSellOrder(address asset, uint256[] orderIds)external# |
This is a batched version of |
withdrawFees()external# |
MUST transfer the entire contract balance to the owner.
MUST revert if called by unauthorized account.
MUST emit |
BalanceClaimed(address indexed user, uint256 amount)event# |
No description given |
FeeInfoChanged(address indexed asset, uint256 makerFee, uint256 takerFee)event# |
No description given |
OrderCreated(address indexed asset, uint256 indexed assetId, uint256 indexed orderId, address seller, uint256 assetAmount, uint256 pricePerAsset, uint256 makerFee, uint256 takerFee)event# |
No description given |
OrderFilled(address indexed asset, uint256 indexed assetId, uint256 indexed orderId, address seller, address buyer, uint256 assetAmount, uint256 pricePerAsset, uint256 makerFeeCollected, uint256 takerFeeCollected)event# |
No description given |
OrderCancelled(address indexed asset, uint256 indexed assetId, uint256 indexed orderId)event# |
No description given |
OrderCreationFeeChanged(uint256 oldFee, uint256 newFee)event# |
No description given |
FeesWithdrawn(address indexed receiver, uint256 amount)event# |
No description given |
import "@paima/evm-contracts/contracts/orderbook/OrderbookDex.sol";
Orders are identified by an asset-specific unique incremental orderId
.
Functions
- constructor()
- initialize(_owner, _defaultMakerFee, _defaultTakerFee, _orderCreationFee)
- claim()
- getAssetFeeInfo(asset)
- getAssetAppliedFees(asset)
- setAssetFeeInfo(asset, makerFee, takerFee)
- setDefaultFeeInfo(makerFee, takerFee)
- setOrderCreationFee(fee)
- getOrder(asset, orderId)
- createSellOrder(asset, assetId, assetAmount, pricePerAsset)
- createBatchSellOrder(asset, assetIds, assetAmounts, pricesPerAssets)
- fillOrdersExactEth(asset, minimumAsset, orderIds)
- fillOrdersExactAsset(asset, assetAmount, orderIds)
- cancelSellOrder(asset, orderId)
- cancelBatchSellOrder(asset, orderIds)
- withdrawFees()
- supportsInterface(interfaceId)
- _authorizeUpgrade()
- _createSellOrder(asset, assetId, assetAmount, pricePerAsset)
- _cancelSellOrder(asset, orderId)
- maxFee()
- balances()
- currentOrderId()
- collectedFees()
- defaultMakerFee()
- defaultTakerFee()
- orderCreationFee()
ReentrancyGuardUpgradeable
UUPSUpgradeable
- __UUPSUpgradeable_init()
- __UUPSUpgradeable_init_unchained()
- proxiableUUID()
- upgradeToAndCall(newImplementation, data)
- _checkProxy()
- _checkNotDelegated()
- UPGRADE_INTERFACE_VERSION()
OwnableUpgradeable
- __Ownable_init(initialOwner)
- __Ownable_init_unchained(initialOwner)
- owner()
- _checkOwner()
- renounceOwnership()
- transferOwnership(newOwner)
- _transferOwnership(newOwner)
ContextUpgradeable
Events
IOrderbookDex
- BalanceClaimed(user, amount)
- FeeInfoChanged(asset, makerFee, takerFee)
- OrderCreated(asset, assetId, orderId, seller, assetAmount, pricePerAsset, makerFee, takerFee)
- OrderFilled(asset, assetId, orderId, seller, buyer, assetAmount, pricePerAsset, makerFeeCollected, takerFeeCollected)
- OrderCancelled(asset, assetId, orderId)
- OrderCreationFeeChanged(oldFee, newFee)
- FeesWithdrawn(receiver, amount)
Initializable
Errors
- FeeTooHigh()
- OrderDoesNotExist(orderId)
- InsufficientEndAmount(expectedAmount, actualAmount)
- InsufficientPayment()
- InvalidArrayLength()
- InvalidInput(input)
- Unauthorized(sender)
Initializable
constructor()public# |
No description given |
initialize(address _owner, uint256 _defaultMakerFee, uint256 _defaultTakerFee, uint256 _orderCreationFee)public# |
No description given |
claim()external# |
No description given |
getAssetFeeInfo(address asset) β struct IOrderbookDex.FeeInfopublic# |
No description given |
getAssetAppliedFees(address asset) β uint256 makerFee, uint256 takerFeepublic# |
No description given |
setAssetFeeInfo(address asset, uint256 makerFee, uint256 takerFee)public# |
MUST revert if |
setDefaultFeeInfo(uint256 makerFee, uint256 takerFee)public# |
MUST revert if |
setOrderCreationFee(uint256 fee)public# |
MUST revert if called by unauthorized account. |
getOrder(address asset, uint256 orderId) β struct IOrderbookDex.Orderpublic# |
No description given |
createSellOrder(address asset, uint256 assetId, uint256 assetAmount, uint256 pricePerAsset) β uint256external# |
The order information is saved in a mapping |
createBatchSellOrder(address asset, uint256[] assetIds, uint256[] assetAmounts, uint256[] pricesPerAssets) β uint256[]external# |
This is a batched version of |
fillOrdersExactEth(address asset, uint256 minimumAsset, uint256[] orderIds)external# |
Transfers portions of msg.value to the orders' sellers according to the price.
The sum of asset amounts of filled orders MUST be at least |
fillOrdersExactAsset(address asset, uint256 assetAmount, uint256[] orderIds)external# |
Transfers portions of msg.value to the orders' sellers according to the price.
The sum of asset amounts of filled orders MUST be exactly |
cancelSellOrder(address asset, uint256 orderId)external# |
MUST revert if the order's seller is not |
cancelBatchSellOrder(address asset, uint256[] orderIds)external# |
This is a batched version of |
withdrawFees()external# |
MUST transfer the entire contract balance to the owner.
MUST revert if called by unauthorized account.
MUST emit |
supportsInterface(bytes4 interfaceId) β boolpublic# |
Returns true if this contract implements the interface defined by |
_authorizeUpgrade(address)internal# |
No description given |
_createSellOrder(address asset, uint256 assetId, uint256 assetAmount, uint256 pricePerAsset) β uint256internal# |
No description given |
_cancelSellOrder(address asset, uint256 orderId)internal# |
No description given |
maxFee() β uint256public# |
No description given |
balances() β mapping(address => uint256)public# |
No description given |
currentOrderId() β mapping(address => uint256)public# |
No description given |
collectedFees() β uint256public# |
No description given |
defaultMakerFee() β uint256public# |
No description given |
defaultTakerFee() β uint256public# |
No description given |
orderCreationFee() β uint256public# |
No description given |
FeeTooHigh()error# |
No description given |
OrderDoesNotExist(uint256 orderId)error# |
No description given |
InsufficientEndAmount(uint256 expectedAmount, uint256 actualAmount)error# |
No description given |
InsufficientPayment()error# |
No description given |
InvalidArrayLength()error# |
No description given |
InvalidInput(uint256 input)error# |
No description given |
Unauthorized(address sender)error# |
No description given |
Utilitiesβ
import "@paima/evm-contracts/contracts/BaseState.sol";
Functions
nftPrice() β uint256public# |
Required payment for the NFT in sale. |
initialized() β boolpublic# |
True if contract has been initialized via |
nftAddress() β addresspublic# |
Address of the NFT for sale. |
import "@paima/evm-contracts/contracts/State.sol";
Functions
nftPrice() β uint256public# |
Required payment for the NFT in sale. |
initialized() β boolpublic# |
True if contract has been initialized via |
nftAddress() β addresspublic# |
Address of the NFT for sale. |
depositedCurrencies() β contract ERC20[]public# |
Array of addresses of tokens that have been deposited to the contract via NFT sales. |
depositedCurrenciesMap() β mapping(contract ERC20 => bool)public# |
Mapping that returns true for address of token that has been deposited to the contract via NFT sale. |
supportedCurrencies() β contract ERC20[]public# |
Array of addresses of tokens that are accepted as payment for the NFT sale. |
import "@paima/evm-contracts/contracts/token/IERC4906Agnostic.sol";
MetadataUpdate(uint256 _tokenId)event# |
This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the token. |
BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId)event# |
This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the tokens. |
import "@paima/evm-contracts/contracts/ERC1967.sol";
ERC1967 contract providing randomized implementation storage slot Made as a small subset of https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/ERC1967/ERC1967Upgrade.sol
Functions
_assertCorrectImplementationSlot()internal# |
Assert that value of |
_getImplementation() β addressinternal# |
Returns the current implementation address. |
_setImplementation(address newImplementation)internal# |
Stores a new address in the EIP1967 implementation slot. |
import "@paima/evm-contracts/contracts/token/IUri.sol";
An interface exposing the uri
function from IERC1155MetadataURI.
Functions
uri(uint256 id) β stringexternal# |
Returns the URI for token type If the |
import "@paima/evm-contracts/contracts/token/ITokenUri.sol";
An interface exposing the tokenURI
function from IERC721Metadata.
Functions
tokenURI(uint256 tokenId) β stringexternal# |
Returns the Uniform Resource Identifier (URI) for |
import "@paima/evm-contracts/contracts/Proxy/NativeNftSaleProxy.sol";
Proxy contract mostly based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Proxy.sol
Functions
constructor(address implementation, address owner, address nftAddress, uint256 nftPrice)public# |
Sets |
_delegate(address target)internal# |
Delegates the current call to |
_fallback()internal# |
Delegates the current call to the address returned by |
fallback()external# |
Fallback function that delegates calls to the address returned by |
receive()external# |
Called if this contract is receiving native tokens and |
import "@paima/evm-contracts/contracts/Proxy/GenericPaymentProxy.sol";
Proxy contract mostly based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Proxy.sol
Functions
constructor(address implementation, address owner)public# |
Sets |
_delegate(address target)internal# |
Delegates the current call to |
_fallback()internal# |
Delegates the current call to the address returned by |
fallback()external# |
Fallback function that delegates calls to the address returned by |
import "@paima/evm-contracts/contracts/Proxy/Erc20NftSaleProxy.sol";
Proxy contract mostly based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Proxy.sol
Functions
constructor(address implementation, contract ERC20[] currencies, address owner, address nftAddress, uint256 nftPrice)public# |
Sets |
_delegate(address target)internal# |
Delegates the current call to |
_fallback()internal# |
Delegates the current call to the address returned by |
fallback()external# |
Fallback function that delegates calls to the address returned by |
receive()external# |
Called if this contract is receiving native tokens and |