Skip to main content Link Menu Expand (external link) Document Search Copy Copied

SeatVoucher

SeatVoucher

An ERC1155 token contract for managing seat vouchers. This contract allows minting and burning seat vouchers, and provides functionality for associating them with specific club seats.

Methods

BURNER_ROLE

function BURNER_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

MINTER_ROLE

function MINTER_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

addClubSeats

function addClubSeats(string name_, string symbol_, string baseURI_, string contractURI_, uint256 maxCapacity_) external nonpayable

Only accessible by accounts with the DEFAULT_ADMIN_ROLE.

Adds a new set of club seats.Requires max capacity to be greater than zero

Parameters

NameTypeDescription
name_stringThe name of the club seats.
symbol_stringThe symbol of the club seats.
baseURI_stringThe base URI for token metadata.
contractURI_stringThe URI for the contract metadata.
maxCapacity_uint256The maximum capacity of the club seats.

balanceOf

function balanceOf(address account, uint256 id) external view returns (uint256)

See {IERC1155-balanceOf}. Requirements: - account cannot be the zero address.

Parameters

NameTypeDescription
accountaddressundefined
iduint256undefined

Returns

NameTypeDescription
_0uint256undefined

balanceOfBatch

function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])

See {IERC1155-balanceOfBatch}. Requirements: - accounts and ids must have the same length.

Parameters

NameTypeDescription
accountsaddress[]undefined
idsuint256[]undefined

Returns

NameTypeDescription
_0uint256[]undefined

baseURI

function baseURI() external view returns (string)

Returns the base URI set via {_setBaseURI}.

Returns

NameTypeDescription
_0stringundefined

burn

function burn(address account, uint256 id, uint256 value) external nonpayable

Only accessible by accounts with the BURNER_ROLE.

Burns a specified amount of tokens from the specified account.Requires the caller to be the token owner or approved by the owner.

Parameters

NameTypeDescription
accountaddressThe account to burn tokens from.
iduint256The ID of the token to burn.
valueuint256The amount of tokens to burn.

burnBatch

function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable

Only accessible by accounts with the BURNER_ROLE.

Burns a batch of tokens from the specified account.Requires the caller to be the token owner or approved by the owner.

Parameters

NameTypeDescription
accountaddressThe account to burn tokens from.
idsuint256[]The IDs of the tokens to burn.
valuesuint256[]The amounts of tokens to burn for each ID.

clubSeatsFrom

function clubSeatsFrom(uint256 id) external view returns (address)

Returns the address of the club seats contract associated with the given id.

Parameters

NameTypeDescription
iduint256The id of the club seats.

Returns

NameTypeDescription
_0addressThe address of the club seats contract.

clubs

function clubs() external view returns (uint32)

Returns

NameTypeDescription
_0uint32undefined

contractURI

function contractURI() external view returns (string)

returns contract-level-metadata, See https://docs.opensea.io/docs/contract-level-metadata

Returns

NameTypeDescription
_0stringundefined

exists

function exists(uint256 id) external view returns (bool)

Indicates whether any token exist with a given id, or not.

Parameters

NameTypeDescription
iduint256undefined

Returns

NameTypeDescription
_0boolundefined

getRoleAdmin

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

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0bytes32undefined

grantRole

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. May emit a {RoleGranted} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns

NameTypeDescription
_0boolundefined

isApprovedForAll

function isApprovedForAll(address account, address operator) external view returns (bool)

See {IERC1155-isApprovedForAll}.

Parameters

NameTypeDescription
accountaddressundefined
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

mint

function mint(address account, uint256 id, uint256 amount, bytes data) external nonpayable

Only accessible by accounts with the MINTER_ROLE.

Mints a single token to the specified account.

Parameters

NameTypeDescription
accountaddressThe account to mint the token to.
iduint256The ID of the token to be minted.
amountuint256The amount of tokens to mint.
databytesAdditional data to pass along with the minting.

mintBatch

function mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable

Only accessible by accounts with the MINTER_ROLE.

Mints a batch of tokens to the specified account.

Parameters

NameTypeDescription
toaddressThe account to mint the tokens to.
idsuint256[]The IDs of the tokens to be minted.
amountsuint256[]The amounts of tokens to mint for each ID.
databytesAdditional data to pass along with the minting.

renounceRole

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. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeRole

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. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

safeBatchTransferFrom

function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable

See {IERC1155-safeBatchTransferFrom}.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
idsuint256[]undefined
amountsuint256[]undefined
databytesundefined

safeTransferFrom

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable

See {IERC1155-safeTransferFrom}.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
iduint256undefined
amountuint256undefined
databytesundefined

setApprovalForAll

function setApprovalForAll(address operator, bool approved) external nonpayable

See {IERC1155-setApprovalForAll}.

Parameters

NameTypeDescription
operatoraddressundefined
approvedboolundefined

setBaseURI

function setBaseURI(string baseURI_) external nonpayable

Only accessible by accounts with the DEFAULT_ADMIN_ROLE.

Sets the base URI for token metadata.See {URIStorage}

Parameters

NameTypeDescription
baseURI_stringThe new base URI.

setContractURI

function setContractURI(string contractURI_) external nonpayable

Only accessible by accounts with the DEFAULT_ADMIN_ROLE.

Sets the contract URI for metadata.See {URIStorage}

Parameters

NameTypeDescription
contractURI_stringThe new contract URI.

setTokenURI

function setTokenURI(uint256 tokenId, string tokenURI_) external nonpayable

Only accessible by accounts with the DEFAULT_ADMIN_ROLE.

Sets the token URI for a given token.See {URIStorage}

Parameters

NameTypeDescription
tokenIduint256The ID of the token.
tokenURI_stringThe new token URI.

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

Overrides supportsInterface to include ERC1155 and AccessControl interfaces.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

totalSupply

function totalSupply(uint256 id) external view returns (uint256)

Total amount of tokens in with a given id.

Parameters

NameTypeDescription
iduint256undefined

Returns

NameTypeDescription
_0uint256undefined

uri

function uri(uint256 tokenId) external view returns (string)

Overrides the ERC1155 uri function to retrieve the token URI.See {ERC1155URIStorage}

Parameters

NameTypeDescription
tokenIduint256The ID of the token.

Returns

NameTypeDescription
_0stringThe token URI.

Events

ApprovalForAll

event ApprovalForAll(address indexed account, address indexed operator, bool approved)

Emitted when account grants or revokes permission to operator to transfer their tokens, according to approved.

Parameters

NameTypeDescription
account indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

ClubSeatsAdded

event ClubSeatsAdded(address clubSeatsAddress, uint256 id)

Parameters

NameTypeDescription
clubSeatsAddressaddressundefined
iduint256undefined

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Emitted when newAdminRole is set as role's admin role, replacing previousAdminRole DEFAULT_ADMIN_ROLE is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._

Parameters

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Emitted when account is granted role. sender is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Emitted when account is revoked role. sender is the account that originated the contract call: - if using revokeRole, it is the admin role bearer - if using renounceRole, it is the role bearer (i.e. account)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

TransferBatch

event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)

Equivalent to multiple {TransferSingle} events, where operator, from and to are the same for all transfers.

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
idsuint256[]undefined
valuesuint256[]undefined

TransferSingle

event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)

Emitted when value tokens of token type id are transferred from from to to by operator.

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
iduint256undefined
valueuint256undefined

URI

event URI(string value, uint256 indexed id)

Emitted when the URI for token type id changes to value, if it is a non-programmatic URI. If an {URI} event was emitted for id, the standard https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that value will equal the value returned by {IERC1155MetadataURI-uri}.

Parameters

NameTypeDescription
valuestringundefined
id indexeduint256undefined

Errors

ClubNotAsignedTo

error ClubNotAsignedTo(uint256 id)

Parameters

NameTypeDescription
iduint256undefined

Back to top

Copyright © Guardians Of The Ball. This site is powered by Gitlab Pages