Eesee
Eesee
lots
struct IEesee.Lot[] lots
An array of all existing lots.
ESE
contract IERC20 ESE
ESE token this contract uses.
staking
contract IEeseeStaking staking
Eesee staking contract. Tracks volume for this contract.
random
contract IEeseeRandom random
Contract that provides random.
feeSplitter
address feeSplitter
Address the {fee}s are sent to.
nonceUsed
mapping(address => mapping(uint256 => bool)) nonceUsed
True if lot nonce has already been used.
minDuration
uint64 minDuration
Min and max durations for a lot.
maxDuration
uint64 maxDuration
RETURN_INTERVAL
uint32 RETURN_INTERVAL
In case random request fails to get delivered 24 hours after the lot was closed, unlock Reclaim functions.
fee
uint32 fee
Fee that is collected to {feeSplitter} from each fulfilled lot. [10000 == 100%]
createLotsAndBuyTickets
function createLotsAndBuyTickets(struct Asset[] assets, struct IEesee.LotParams[] params, uint32 expectedFee, uint32[] amounts, address recipient, bytes permit) external payable returns (uint256[] IDs, uint96 tokensSpent)
Creates lots and buys tickets in them. Emits {CreateLot} for each lot created and {BuyTicket} event for each ticket bought. Note: Because of how nonPayable check in buyTickets works, users can create Native type lots with this function only by calling it with multicall.
Parameters
assets
struct Asset[]
- Assets to list. Note: The sender must have them approved for this contract.
params
struct IEesee.LotParams[]
- Parameters for lots.
expectedFee
uint32
- Expected fee for this lot to avoid race condition with {changeFee}.
amounts
uint32[]
- Amounts of tickets to buy in each lot.
recipient
address
- Recipient of tickets.
permit
bytes
- Abi-encoded ESE permit data containing approveAmount, deadline, v, r and s. Set to empty bytes to skip permit.
Return Values
IDs
uint256[]
- IDs of created lots.
tokensSpent
uint96
- ESE tokens spent.
receiveAssets
function receiveAssets(uint256[] IDs, address recipient) external payable returns (struct Asset[] assets)
Receive assets the sender won from lots. Emits {ReceiveAsset} event for each of the asset received.
Parameters
IDs
uint256[]
- IDs of lots to claim assets in.
recipient
address
- Address to send Assets to.
Return Values
assets
struct Asset[]
- Assets received.
receiveTokens
function receiveTokens(uint256[] IDs, address recipient) external payable returns (uint96 amount)
Receive ESE the sender has earned from lots. Emits {ReceiveTokens} event for each of the claimed lot. Note: If the lot has expired, it takes 24 hours before {reclaimTokens} becomes available. If a random number is received in this timeframe, a winner is chosen and {receiveTokens} becomes avaliable for the winner to be called instead. In such case, a winner wins all collected ESE tokens instead of asset.
Parameters
IDs
uint256[]
- IDs of lots to claim tokens in.
recipient
address
- Address to send tokens to.
Return Values
amount
uint96
- ESE received.
reclaimAssets
function reclaimAssets(uint256[] IDs, address recipient) external payable returns (struct Asset[] assets)
Reclaim assets from expired lots. Emits {ReclaimAsset} event for each lot ID.
Parameters
IDs
uint256[]
- IDs of lots to reclaim assets in.
recipient
address
- Address to send assets to.
Return Values
assets
struct Asset[]
- Assets reclaimed.
reclaimTokens
function reclaimTokens(uint256[] IDs, address recipient) external payable returns (uint96 amount)
Reclaim ESE from expired lots. Emits {ReclaimTokens} event for each lot ID.
Parameters
IDs
uint256[]
- IDs of lots to reclaim tokens in.
recipient
address
- Address to send tokens to.
Return Values
amount
uint96
- ESE received.
Note: This function will only be available after 24 hours after the lot has ended/expired and if no random number was received in this 24 hour timeframe.
callExternal
function callExternal(address to, bytes data) external payable returns (bytes)
Call any external contract function. Is intended to be used with multicall.
Parameters
to
address
- Address to call.
data
bytes
- Data to call {to} with.
Return Values
[0]
bytes
bytes - Return data received from a call.
changeMinDuration
function changeMinDuration(uint64 _minDuration) external
Changes minDuration. Emits {ChangeMinDuration} event.
Parameters
_minDuration
uint64
- New minDuration.
Note: This function can only be called by ADMIN_ROLE.
changeMaxDuration
function changeMaxDuration(uint64 _maxDuration) external
Changes maxDuration. Emits {ChangeMaxDuration} event.
Parameters
_maxDuration
uint64
- New maxDuration.
Note: This function can only be called by ADMIN_ROLE.
changeFee
function changeFee(uint32 _fee) external
Changes fee. Emits {ChangeFee} event.
Parameters
_fee
uint32
- New fee.
Note: This function can only be called by ADMIN_ROLE.
changeFeeSplitter
function changeFeeSplitter(address _feeSplitter) external
Changes feeSplitter. Emits {ChangeFeeSplitter} event.
Parameters
_feeSplitter
address
- New fee.
Note: This function can only be called by ADMIN_ROLE.
getLotsLength
function getLotsLength() external view returns (uint256 length)
Get length of the lots array.
Return Values
length
uint256
- Length of the lots array.
getLotTicketHolder
function getLotTicketHolder(uint256 ID, uint32 ticket) external view returns (address)
Get the holder of the specified ticket in lot.
Parameters
ID
uint256
- ID of the lot.
ticket
uint32
- Ticket index.
Return Values
[0]
address
address - Ticket holder.
getLotTicketsHeldByAddress
function getLotTicketsHeldByAddress(uint256 ID, address _address) external view returns (uint32)
Get amount of tickets held by address in a lot.
Parameters
ID
uint256
- ID of the lot.
_address
address
- Holder address.
Return Values
[0]
uint32
uint32 - Tickets held by {_address}.
getLotBonusTicketsHeldByAddress
function getLotBonusTicketsHeldByAddress(uint256 ID, address _address) external view returns (uint32)
Get amount of bonus tickets held by address in a lot.
Parameters
ID
uint256
- ID of the lot.
_address
address
- Holder address.
Return Values
[0]
uint32
uint32 - Tickets held by {_address}.
getBuyTicketsRecipient
function getBuyTicketsRecipient(uint256 ID, uint32 transaction) external view returns (address)
Get the recipient of tickets in specified {transaction}.
Parameters
ID
uint256
- ID of the lot.
transaction
uint32
- Index of the transaction in a lot.
Return Values
[0]
address
address - The sender of the tickets in {transaction}.
createLots
function createLots(struct Asset[] assets, struct IEesee.LotParams[] params, uint32 expectedFee) public payable returns (uint256[] IDs)
Creates lots with assets from sender's balance. Emits {CreateLot} events for each created lot.
Parameters
assets
struct Asset[]
- Assets to list. Note: The sender must have them approved for this contract.
params
struct IEesee.LotParams[]
expectedFee
uint32
- Expected fee for this lot to avoid race condition with {changeFee}.
Return Values
IDs
uint256[]
- IDs of lots created.
buyTickets
function buyTickets(uint256[] IDs, uint32[] amounts, address recipient, bytes permit) public payable returns (uint96 tokensSpent)
Buys tickets to participate in a lot. Emits {BuyTicket} event for each ticket bought.
Parameters
IDs
uint256[]
- IDs of lots to buy tickets for.
amounts
uint32[]
- Amounts of tickets to buy in each lot.
recipient
address
- Recipient of tickets.
permit
bytes
- Abi-encoded ESE permit data containing approveAmount, deadline, v, r and s. Set to empty bytes to skip permit.
Return Values
tokensSpent
uint96
- ESE tokens spent.
Inherited from EeseeRoleHandler
Inherited from MulticallPayable
multicall
function multicall(bytes[] data) external payable returns (bytes[] results)
Allows calling multiple contract functions in a single call:
Parameters
data
bytes[]
- ABI-encoded data describing the call.
Inherited from EIP712
eip712Domain
function eip712Domain() public view virtual returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)
_See {EIP-5267}.
Available since v4.9._
Inherited from IERC5267
EIP712DomainChanged
event EIP712DomainChanged()
MAY be emitted to signal that the domain could have changed.
Inherited from ERC1155Holder
onERC1155Received
function onERC1155Received(address, address, uint256, uint256, bytes) public virtual returns (bytes4)
onERC1155BatchReceived
function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) public virtual returns (bytes4)
Inherited from ERC1155Receiver
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)
See {IERC165-supportsInterface}.
Inherited from ERC721Holder
onERC721Received
function onERC721Received(address, address, uint256, bytes) public virtual returns (bytes4)
_See {IERC721Receiver-onERC721Received}.
Always returns IERC721Receiver.onERC721Received.selector
._
Inherited from ERC2771Context
isTrustedForwarder
function isTrustedForwarder(address forwarder) public view virtual returns (bool)
Inherited from IEesee
lots
function lots(uint256) external view returns (uint32 totalTickets, uint32 bonusTickets, uint32 ticketsBought, uint96 ticketPrice, uint32 transactions, uint32 endTimestamp, uint32 fee, bool closed, bool buyout, bool assetClaimed, bool tokensClaimed, address owner, struct Asset asset)
ESE
function ESE() external view returns (contract IERC20)
staking
function staking() external view returns (contract IEeseeStaking)
random
function random() external view returns (contract IEeseeRandom)
minDuration
function minDuration() external view returns (uint64)
maxDuration
function maxDuration() external view returns (uint64)
fee
function fee() external view returns (uint32)
feeSplitter
function feeSplitter() external view returns (address)
nonceUsed
function nonceUsed(address, uint256) external view returns (bool)
RETURN_INTERVAL
function RETURN_INTERVAL() external view returns (uint32)
CreateLot
event CreateLot(uint256 ID, struct Asset asset, address signer, address owner, uint32 totalTickets, uint96 ticketPrice, uint32 endTimestamp)
ConsumeNonce
event ConsumeNonce(uint256 ID, address signer, uint256 nonce)
BuyTickets
event BuyTickets(uint256 ID, address recipient, uint32 lowerBound, uint32 ticketAmount, uint96 tokensSpent, uint32 bonusTickets)
AddVolumeReverted
event AddVolumeReverted(uint96 untrackedVolume, address recipient)
ReceiveAsset
event ReceiveAsset(uint256 ID, address winner, address recipient, struct Asset asset)
ReceiveTokens
event ReceiveTokens(uint256 ID, address claimer, address recipient, uint96 amount)
ReclaimAsset
event ReclaimAsset(uint256 ID, address owner, address recipient, struct Asset asset)
ReclaimTokens
event ReclaimTokens(uint256 ID, address claimer, address recipient, uint96 amount)
CollectRoyalty
event CollectRoyalty(address recipient, uint96 amount)
CollectFee
event CollectFee(address to, uint96 amount)
ChangeMinDuration
event ChangeMinDuration(uint64 previousMinDuration, uint64 newMinDuration)
ChangeMaxDuration
event ChangeMaxDuration(uint64 previousMaxDuration, uint64 newMaxDuration)
ChangeFee
event ChangeFee(uint32 previousFee, uint32 newFee)
ChangeFeeSplitter
event ChangeFeeSplitter(address previousFeeSplitter, address newFeeSplitter)
Last updated