IFxMintTicket721

Git Source

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

NameTypeDescription
_tokenIduint256ID 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

NameTypeDescription
_tokenIduint256ID of the token
_maxPriceuint256Maximum payment amount allowed to prevent front-running of listing price
_newPriceuint80New 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

NameTypeDescription
<none>stringURI of the contract metadata

deposit

Deposits taxes for given token

function deposit(uint256 _tokenId) external payable;

Parameters

NameTypeDescription
_tokenIduint256ID 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

NameTypeDescription
_tokenIduint256ID of the token
_newPriceuint80New 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

NameTypeDescription
_owneraddressAddress of contract owner
_genArt721addressAddress of GenArt721 token contract
_redeemeraddressAddress of TicketRedeemer minter contract
_rendereraddressAddress of renderer contract
_gracePerioduint48Period time before token enters harberger taxation
_mintInfoMintInfo[]Array of authorized minter contracts and their reserves

isForeclosed

Checks if token is foreclosed

function isForeclosed(uint256 _tokenId) external view returns (bool);

Parameters

NameTypeDescription
_tokenIduint256ID of the token

Returns

NameTypeDescription
<none>boolStatus 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

NameTypeDescription
_currentPriceuint256Listing price of the token
_foreclosureTimeuint256Timestamp of the foreclosure

getDailyTax

Gets the daily tax amount based on current price

function getDailyTax(uint256 _currentPrice) external pure returns (uint256);

Parameters

NameTypeDescription
_currentPriceuint256Current listing price

Returns

NameTypeDescription
<none>uint256Daily 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

NameTypeDescription
_dailyTaxuint256Daily tax amount based on current price
_depositAmountuint256Total amount of taxes deposited
_foreclosureTimeuint256Timestamp of current foreclosure

Returns

NameTypeDescription
<none>uint256Deposit amount owed
<none>uint256Deposit amount remaining

getExcessTax

Gets the excess amount of taxes paid

function getExcessTax(uint256 _dailyTax, uint256 _depositAmount) external view returns (uint256);

Parameters

NameTypeDescription
_dailyTaxuint256Daily tax amount based on current price
_depositAmountuint256Total amount of taxes deposited

Returns

NameTypeDescription
<none>uint256Excess amount of taxes

getNewForeclosure

Gets the new foreclosure timestamp

function getNewForeclosure(uint256 _dailyTax, uint256 _depositAmount, uint256 _foreclosureTime)
    external
    view
    returns (uint48);

Parameters

NameTypeDescription
_dailyTaxuint256Daily tax amount based on current price
_depositAmountuint256Amount of taxes being deposited
_foreclosureTimeuint256Timestamp of current foreclosure

Returns

NameTypeDescription
<none>uint48Timestamp of new foreclosure

getTaxDuration

Gets the total duration of time covered

function getTaxDuration(uint256 _dailyTax, uint256 _depositAmount) external pure returns (uint256);

Parameters

NameTypeDescription
_dailyTaxuint256Daily tax amount based on current price
_depositAmountuint256Amount of taxes being deposited

Returns

NameTypeDescription
<none>uint256Total 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

NameTypeDescription
_toaddressAddress receiving tokens
_amountuint256Number of tokens being minted
_paymentuint256Total 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

NameTypeDescription
_uribytesDecoded content identifier of metadata pointer

setPrice

Sets new price for given token

function setPrice(uint256 _tokenId, uint80 _newPrice) external;

Parameters

NameTypeDescription
_tokenIduint256ID of the token
_newPriceuint80New 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

NameTypeDescription
_tokenIduint256ID of the token

withdraw

Withdraws available balance amount to given address

function withdraw(address _to) external;

Parameters

NameTypeDescription
_toaddressAddress being withdrawn to

Events

BaseURIUpdated

Event emitted when the base URI is updated

event BaseURIUpdated(bytes _uri);

Parameters

NameTypeDescription
_uribytesDecoded 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

NameTypeDescription
_tokenIduint256ID of the token
_claimeraddressAddress of the token claimer
_newPriceuint128Updated listing price of token
_foreclosureTimeuint48Timestamp of new foreclosure date
_depositAmountuint80Total amount of taxes deposited
_paymentuint256Current 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

NameTypeDescription
_tokenIduint256ID of the token
_depositeraddressAddress of tax depositer
_foreclosureTimeuint48Timestamp of new foreclosure date
_depositAmountuint80Total 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

NameTypeDescription
_tokenIduint256ID of the token
_newPriceuint128New listing price of token
_foreclosureTimeuint128Timestamp of new foreclosure date
_depositAmountuint128Adjusted 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

NameTypeDescription
_tokenIduint256ID of the token
_owneraddressAddress of token owner
_foreclosureTimeuint128Timestamp 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

NameTypeDescription
_genArt721addressAddress of FxGenArt721 token contract
_redeemeraddressAddress of TicketRedeemer contract
_rendereraddressAddress of renderer contract
_gracePerioduint48Time period before token enters harberger taxation
_mintInfoMintInfo[]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

NameTypeDescription
_calleraddressAddress of caller
_toaddressAddress receiving balance amount
_balanceuint256Amount 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();