AuctionBase for non-fungible tokens.
We omit a fallback function to prevent accidental sends to this contract.
Methods
BIDDER_ROLE
Copy function BIDDER_ROLE () external view returns ( bytes32 )
Returns
DEFAULT_ADMIN_ROLE
Copy function DEFAULT_ADMIN_ROLE () external view returns ( bytes32 )
Returns
ERC721
Copy function ERC721 () external view returns (contract IERC721Upgradeable )
CONTRACTS ///
Returns
MODERATOR_ROLE
Copy function MODERATOR_ROLE () external view returns ( bytes32 )
ROLES ///
Returns
auctionIdOffset
Copy function auctionIdOffset () external view returns ( uint256 )
Returns
auctions
Copy function auctions(uint256) external view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)
Parameters
Returns
bid
Copy function bid ( uint256 _tokenId , uint256 _bidAmount ) external nonpayable
Bids on an open auction, completing the auction if enough JEWELs are supplied.
Parameters
bidFor
Copy function bidFor ( address _bidder , uint256 _tokenId , uint256 _bidAmount ) external nonpayable
Bids on an open auction, completing the auction if enough JEWELs are supplied.
Parameters
cancelAuction
Copy function cancelAuction ( uint256 _tokenId ) external nonpayable
This is a state-modifying function that can be called while the contract is paused.depending on if the auction is escrow or not this might need to verify ownership
Cancels an auction that hasn't been won yet. Returns the NFT to original owner.
Parameters
cancelAuctionWhenPaused
Copy function cancelAuctionWhenPaused ( uint256 _tokenId ) external nonpayable
Cancels an auction when the contract is paused. Only the owner may do this, and NFTs are returned to the seller. This should only be used in emergencies.
Parameters
createAuction
Copy function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner) external nonpayable
Creates and begins a new auction. This can either escrow or not depending on implementation but should at the very least call _addAuction and check ownership
Parameters
crystalToken
Copy function crystalToken () external view returns (contract IERC20Upgradeable )
CONTRACTS ///
Returns
feeAddresses
Copy function feeAddresses ( uint256 ) external view returns ( address )
STATE ///
Parameters
Returns
feePercents
Copy function feePercents ( uint256 ) external view returns ( uint256 )
Parameters
Returns
getAuction
Copy function getAuction ( uint256 _tokenId ) external view returns (struct Auction )
Returns auction info for an NFT on auction.
Parameters
Returns
getAuctions
Copy function getAuctions ( uint256 [] _tokenIds ) external view returns (struct Auction [])
single endpoint gets an array of auctions
Parameters
Returns
getCurrentPrice
Copy function getCurrentPrice ( uint256 _tokenId ) external view returns ( uint256 )
Returns the current price of an auction.
Parameters
Returns
getRoleAdmin
Copy function getRoleAdmin ( bytes32 role) external view returns ( bytes32 )
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Returns
getUserAuctions
Copy function getUserAuctions ( address _address ) external view returns ( uint256 [])
returns the accounts auctions
Parameters
Returns
grantRole
Copy function grantRole ( bytes32 role , address account) external nonpayable
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
hasRole
Copy function hasRole ( bytes32 role , address account) external view returns ( bool )
Returns true
if account
has been granted role
.
Parameters
Returns
isOnAuction
Copy function isOnAuction ( uint256 _tokenId ) external view returns ( bool )
Checks if the token is currently on auction.
Parameters
Returns
onERC721Received
Copy function onERC721Received ( address , address , uint256 , bytes ) external pure returns ( bytes4 )
Always returns IERC721Receiver.onERC721Received.selector
.
Parameters
Returns
ownerCut
Copy function ownerCut () external view returns ( uint256 )
STATE ///
Returns
pause
Copy function pause () external nonpayable
paused
Copy function paused () external view returns ( bool )
Returns true if the contract is paused, and false otherwise.
Returns
renounceRole
Copy function renounceRole ( bytes32 role , address account) external nonpayable
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
revokeRole
Copy function revokeRole ( bytes32 role , address account) external nonpayable
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
setFees
Copy function setFees ( address [] _feeAddresses , uint256 [] _feePercents ) external nonpayable
Sets the addresses and percentages that will receive fees.
Parameters
supportsInterface
Copy function supportsInterface ( bytes4 interfaceId) external view returns ( bool )
See {IERC165-supportsInterface}.
Parameters
Returns
totalAuctions
Copy function totalAuctions () external view returns ( uint256 )
Returns
unpause
Copy function unpause () external nonpayable
userAuctions
Copy function userAuctions ( address , uint256 ) external view returns ( uint256 )
Parameters
Returns
Events
AuctionCancelled
Copy event AuctionCancelled ( uint256 auctionId, uint256 indexed tokenId)
Parameters
AuctionCreated
Copy event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner)
EVENTS ///
Parameters
AuctionSuccessful
Copy event AuctionSuccessful ( uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner)
Parameters
Paused
Copy event Paused ( address account)
Parameters
RoleAdminChanged
Copy event RoleAdminChanged ( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
Parameters
RoleGranted
Copy event RoleGranted ( bytes32 indexed role, address indexed account, address indexed sender)
Parameters
RoleRevoked
Copy event RoleRevoked ( bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Unpaused
Copy event Unpaused ( address account)
Parameters