IFxMintTicket721
Inherits: IToken
Author: fx(hash)
ERC-721 token for mint tickets used to redeem FxGenArt721 tokens
Functions
activeMinters
Returns the list of active minters
function activeMinters(uint256) external view returns (address);
balances
Mapping of wallet address to pending balance available for withdrawal
function balances(address) external view returns (uint256);
baseURI
Returns the decoded content identifier of the metadata pointer
function baseURI() external view returns (bytes memory);
burn
Burns token ID from the circulating supply
function burn(uint256 _tokenId) external;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
claim
Claims token at current price and sets new price of token with initial deposit amount
function claim(uint256 _tokenId, uint256 _maxPrice, uint80 _newPrice) external payable;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_maxPrice | uint256 | Maximum payment amount allowed to prevent front-running of listing price |
_newPrice | uint80 | New listing price of token |
contractRegistry
Returns the address of the FxContractRegistry contract
function contractRegistry() external view returns (address);
contractURI
Gets the contact-level metadata for the ticket
function contractURI() external view returns (string memory);
Returns
Name | Type | Description |
---|---|---|
<none> | string | URI of the contract metadata |
deposit
Deposits taxes for given token
function deposit(uint256 _tokenId) external payable;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
depositAndSetPrice
Deposits taxes for given token and set new price for same token
function depositAndSetPrice(uint256 _tokenId, uint80 _newPrice) external payable;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_newPrice | uint80 | New listing price of token |
initialize
Initializes new generative art project
function initialize(
address _owner,
address _genArt721,
address _redeemer,
address _renderer,
uint48 _gracePeriod,
MintInfo[] calldata _mintInfo
) external;
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address of contract owner |
_genArt721 | address | Address of GenArt721 token contract |
_redeemer | address | Address of TicketRedeemer minter contract |
_renderer | address | Address of renderer contract |
_gracePeriod | uint48 | Period time before token enters harberger taxation |
_mintInfo | MintInfo[] | Array of authorized minter contracts and their reserves |
isForeclosed
Checks if token is foreclosed
function isForeclosed(uint256 _tokenId) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Status of foreclosure |
genArt721
Returns address of the FxGenArt721 token contract
function genArt721() external view returns (address);
getAuctionPrice
Gets the current auction price of the token
function getAuctionPrice(uint256 _currentPrice, uint256 _foreclosureTime) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_currentPrice | uint256 | Listing price of the token |
_foreclosureTime | uint256 | Timestamp of the foreclosure |
getDailyTax
Gets the daily tax amount based on current price
function getDailyTax(uint256 _currentPrice) external pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_currentPrice | uint256 | Current listing price |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Daily tax amount |
getDepositAmounts
Gets the deposit amount owed and remaining after change in price, claim or burn
function getDepositAmounts(uint256 _dailyTax, uint256 _depositAmount, uint256 _foreclosureTime)
external
view
returns (uint256, uint256);
Parameters
Name | Type | Description |
---|---|---|
_dailyTax | uint256 | Daily tax amount based on current price |
_depositAmount | uint256 | Total amount of taxes deposited |
_foreclosureTime | uint256 | Timestamp of current foreclosure |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Deposit amount owed |
<none> | uint256 | Deposit amount remaining |
getExcessTax
Gets the excess amount of taxes paid
function getExcessTax(uint256 _dailyTax, uint256 _depositAmount) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_dailyTax | uint256 | Daily tax amount based on current price |
_depositAmount | uint256 | Total amount of taxes deposited |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Excess amount of taxes |
getNewForeclosure
Gets the new foreclosure timestamp
function getNewForeclosure(uint256 _dailyTax, uint256 _depositAmount, uint256 _foreclosureTime)
external
view
returns (uint48);
Parameters
Name | Type | Description |
---|---|---|
_dailyTax | uint256 | Daily tax amount based on current price |
_depositAmount | uint256 | Amount of taxes being deposited |
_foreclosureTime | uint256 | Timestamp of current foreclosure |
Returns
Name | Type | Description |
---|---|---|
<none> | uint48 | Timestamp of new foreclosure |
getTaxDuration
Gets the total duration of time covered
function getTaxDuration(uint256 _dailyTax, uint256 _depositAmount) external pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_dailyTax | uint256 | Daily tax amount based on current price |
_depositAmount | uint256 | Amount of taxes being deposited |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Total time duration |
gracePeriod
Returns default grace period of time for each token
function gracePeriod() external view returns (uint48);
mint
Mints arbitrary number of tokens
Only callable by registered minter contracts
function mint(address _to, uint256 _amount, uint256 _payment) external;
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving tokens |
_amount | uint256 | Number of tokens being minted |
_payment | uint256 | Total payment amount of the transaction |
minters
Returns the active status of a registered minter contract
function minters(address) external view returns (uint8);
pause
Pauses all function executions where modifier is set
function pause() external;
primaryReceiver
Returns address of primary receiver for token sales
function primaryReceiver() external view returns (address);
redeemer
Returns the address of the TickeRedeemer contract
function redeemer() external view returns (address);
renderer
Returns the address of the renderer contract
function renderer() external view returns (address);
registerMinters
Registers minter contracts with resereve info
function registerMinters(MintInfo[] memory _mintInfo) external;
roleRegistry
Returns the address of the FxRoleRegistry contract
function roleRegistry() external view returns (address);
setBaseURI
Sets the new URI of the token metadata
function setBaseURI(bytes calldata _uri) external;
Parameters
Name | Type | Description |
---|---|---|
_uri | bytes | Decoded content identifier of metadata pointer |
setPrice
Sets new price for given token
function setPrice(uint256 _tokenId, uint80 _newPrice) external;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_newPrice | uint80 | New price of the token |
taxes
Mapping of ticket ID to tax information (grace period, foreclosure time, current price, deposit amount)
function taxes(uint256) external returns (uint48, uint48, uint80, uint80);
totalSupply
Returns the current circulating supply of tokens
function totalSupply() external returns (uint48);
unpause
Unpauses all function executions where modifier is set
function unpause() external;
updateStartTime
Updates taxation start time to the current timestamp
function updateStartTime(uint256 _tokenId) external;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
withdraw
Withdraws available balance amount to given address
function withdraw(address _to) external;
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address being withdrawn to |
Events
BaseURIUpdated
Event emitted when the base URI is updated
event BaseURIUpdated(bytes _uri);
Parameters
Name | Type | Description |
---|---|---|
_uri | bytes | Decoded content identifier of metadata pointer |
Claimed
Event emitted when token is claimed at either listing or auction price
event Claimed(
uint256 indexed _tokenId,
address indexed _claimer,
uint128 _newPrice,
uint48 _foreclosureTime,
uint80 _depositAmount,
uint256 _payment
);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_claimer | address | Address of the token claimer |
_newPrice | uint128 | Updated listing price of token |
_foreclosureTime | uint48 | Timestamp of new foreclosure date |
_depositAmount | uint80 | Total amount of taxes deposited |
_payment | uint256 | Current price of token in addition to taxes deposited |
Deposited
Event emitted when additional taxes are deposited
event Deposited(uint256 indexed _tokenId, address indexed _depositer, uint48 _foreclosureTime, uint80 _depositAmount);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_depositer | address | Address of tax depositer |
_foreclosureTime | uint48 | Timestamp of new foreclosure date |
_depositAmount | uint80 | Total amount of taxes deposited |
SetPrice
Event emitted when new listing price is set
event SetPrice(uint256 indexed _tokenId, uint128 _newPrice, uint128 _foreclosureTime, uint128 _depositAmount);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_newPrice | uint128 | New listing price of token |
_foreclosureTime | uint128 | Timestamp of new foreclosure date |
_depositAmount | uint128 | Adjusted amount of taxes deposited due to price change |
StartTimeUpdated
Event emitted when taxation start time is updated to current timestamp
event StartTimeUpdated(uint256 indexed _tokenId, address indexed _owner, uint128 _foreclosureTime);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
_owner | address | Address of token owner |
_foreclosureTime | uint128 | Timestamp of foreclosure date |
TicketInitialized
Event emitted when mint ticket is initialized
event TicketInitialized(
address indexed _genArt721,
address indexed _redeemer,
address indexed _renderer,
uint48 _gracePeriod,
MintInfo[] _mintInfo
);
Parameters
Name | Type | Description |
---|---|---|
_genArt721 | address | Address of FxGenArt721 token contract |
_redeemer | address | Address of TicketRedeemer contract |
_renderer | address | Address of renderer contract |
_gracePeriod | uint48 | Time period before token enters harberger taxation |
_mintInfo | MintInfo[] | Array of authorized minter contracts and their reserves |
Withdraw
Event emitted when balance is withdrawn
event Withdraw(address indexed _caller, address indexed _to, uint256 indexed _balance);
Parameters
Name | Type | Description |
---|---|---|
_caller | address | Address of caller |
_to | address | Address receiving balance amount |
_balance | uint256 | Amount of ether being withdrawn |
Errors
AllocationExceeded
Error thrown when total minter allocation exceeds maximum supply
error AllocationExceeded();
Foreclosure
Error thrown when token is in foreclosure
error Foreclosure();
GracePeriodActive
Error thrown when token is being claimed within the grace period
error GracePeriodActive();
GracePeriodInactive
Error thrown when token is outside of the grace period
error GracePeriodInactive();
InsufficientDeposit
Error thrown when deposit amount is not for at least one day
error InsufficientDeposit();
InsufficientPayment
Error thrown when payment amount does not meet price plus daily tax amount
error InsufficientPayment();
InvalidEndTime
Error thrown when reserve end time is invalid
error InvalidEndTime();
InvalidPrice
Error thrown when new listing price is less than the mininmum amount
error InvalidPrice();
InvalidStartTime
Error thrown when reserve start time is invalid
error InvalidStartTime();
PriceExceeded
Error thrown when current price exceeds maximum payment amount
error PriceExceeded();
MintActive
Error thrown when minting is active
error MintActive();
NotAuthorized
Error thrown when caller is not authorized to execute transaction
error NotAuthorized();
UnauthorizedAccount
Error thrown when caller does not have the specified role
error UnauthorizedAccount();
UnauthorizedMinter
Error thrown when caller does not have minter role
error UnauthorizedMinter();
UnauthorizedRedeemer
Error thrown when caller does not have the redeemer role
error UnauthorizedRedeemer();
UnregisteredMinter
Error thrown when caller is not a registered minter
error UnregisteredMinter();