Skip to main content

SemiFungible1155

bitbeckers

Contract for minting semi-fungible EIP1155 tokens

Extends { Upgradeable1155 } token with semi-fungible properties and the concept of units

Adds split bit strategy as described in EIP-1155

Methods

__SemiFungible1155_init

function __SemiFungible1155_init() external nonpayable

see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }

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

burn

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

Parameters

NameTypeDescription
accountaddressundefined
iduint256undefined
valueuint256undefined

burnBatch

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

Parameters

NameTypeDescription
accountaddressundefined
idsuint256[]undefined
valuesuint256[]undefined

isApprovedForAll

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

See {IERC1155-isApprovedForAll}.

Parameters

NameTypeDescription
accountaddressundefined
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

ownerOf

function ownerOf(uint256 tokenID) external view returns (address _owner)

Returns the owner of a given token ID.

Parameters

NameTypeDescription
tokenIDuint256The ID of the token to query.

Returns

NameTypeDescription
_owneraddressThe address of the owner of the token.

proxiableUUID

function proxiableUUID() external view returns (bytes32)

Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the notDelegated modifier.

Returns

NameTypeDescription
_0bytes32undefined

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

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

supportsInterface

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

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressundefined

upgradeTo

function upgradeTo(address newImplementation) external nonpayable

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall

function upgradeToAndCall(address newImplementation, bytes data) external payable

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined
databytesundefined

uri

function uri(uint256 tokenID) external view returns (string _uri)

Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the uri function of the ERC1155URIStorageUpgradeable contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place.

Parameters

NameTypeDescription
tokenIDuint256The ID of the token to retrieve the metadata URI for.

Returns

NameTypeDescription
_uristringThe metadata URI for the specified token ID.

Events

AdminChanged

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

ApprovalForAll

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

Parameters

NameTypeDescription
account indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

BatchValueTransfer

event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values)

Emitted on transfer of values between fromTokenIDs to toTokenIDs of claimIDs

Parameters

NameTypeDescription
claimIDsuint256[]undefined
fromTokenIDsuint256[]undefined
toTokenIDsuint256[]undefined
valuesuint256[]undefined

BeaconUpgraded

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription
beacon indexedaddressundefined

Initialized

event Initialized(uint8 version)

Parameters

NameTypeDescription
versionuint8undefined

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

TransferBatch

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

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)

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
iduint256undefined
valueuint256undefined

URI

event URI(string value, uint256 indexed id)

Parameters

NameTypeDescription
valuestringundefined
id indexeduint256undefined

Upgraded

event Upgraded(address indexed implementation)

Parameters

NameTypeDescription
implementation indexedaddressundefined

ValueTransfer

event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value)

Emitted on transfer of value between fromTokenID to toTokenID of the same claimID

Parameters

NameTypeDescription
claimIDuint256undefined
fromTokenIDuint256undefined
toTokenIDuint256undefined
valueuint256undefined