Write Contract

Create

This is a function in the smart contract used to create a new Non-Fungible Token (NFT) on the ERC1155 standard

Data

Description

Restrictions

Create

Specifies the payable price that the user must pay to create the new NFT token

  • must be a positive number.

  • at least it must be 0.

Initial Owner (address)

It is the BNB address that will be the initial owner of the new NFT token.

  • must be a correct contract address.

Initial Supply (uint256)

Specifies the number of available copies of the same NFT token to be created

  • must be a positive number.

  • must be an integer.

bucketHash (string)

Represents the hash of data associated with the NFT token, such as the hash of an image, metadata file, etc., stored as a string.

  • must be unique.

  • cannot be empty.

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Example transaction:

a. Token Transfered FROM: Address from where the token was created

b. Token Transferred To: Address where the created Token was sent

c. Token Transferred: ERC-1155 standard of the token

d. Token Transferred: Amount of created tokens

e. Token Transferred: Token ID [number of the token ID]

f. Token Transferred: Token Contract Address

CreateReserved

The method is used to create special NFT tokens with IDs less than 1000. These tokens are reserved for specific purposes or special use cases done by Smart Contract Owner.

Data

Description

Restrictions

ID (unit256)

The ID of the token to be created. It must be less than 1000 and unique for each token.

  • Must be unique.

  • Must be a positive number.

  • must be an integer

initial Owner (address)

The address of the contract owner where the newly created token will be initially owned.

  • must be a correct contract address.

Initial Supply (uint256)

Specifies the number of available copies of the same NFT token to be created

  • must be a positive number.

  • must be an integer.

BucketHash (string)

Represents the hash of data associated with the NFT token, such as the hash of an image, metadata file, etc., stored as a string.

  • must be unique.

  • cannot be empty.

Data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Migrate

The Migrate method is a special function available only to the contract creator, allowing the migration of Meta Assets to a new contract, specifically NFT Meta Asset V2. It is important to note that this function has been included temporarily to facilitate the migration process while the next iteration of the standard (V2) is being developed. The planned release of Meta Asset V2 is set for Q1 2024. This function serves as a transitional measure and will be removed in the final version (V2) of the standard to ensure decentralization and avoid centralization concerns.

Data

Description

ID (uint256)

The ID of the token to be migrated.

Creator (address)

The address of the creator of the token.

bucketHash (string)

The bucket hash is where the asset data is stored.

to (address)

The address of the destination contract where the token will be transferred.

amount (uint256)

The number of tokens to transfer.

data (bytes)

Additional data, if needed.

Pause

The method aims to suspend the functionality of the contract. It is accessible only to the contract's owner.

RenounceOwnership

This method allows the contract's owner to renounce their ownership. This method is accessible only to the contract's owner.

This function enables the current owner to renounce ownership of the contract. Once this method is called, the owner will lose their privileges to manage the contract, and any methods that require owner permissions will no longer be accessible.

safeBatchTransferFrom

The safeBatchTransferFrom function allows for the secure transfer of multiple tokens from the owner's wallet to another specified address. The function takes the following parameters

Data

Description

Restrictions

From (address)

The address of the token owner's wallet.

  • must be a wallet address

  • must be the owner of tokens

To (address)

The address of the recipient's wallet to whom we want to transfer the tokens.

  • must be a wallet address

Ids (uint256[])

An array of token IDs that we want to transfer to the other address, is provided in the format [id1,id2,...].

  • must be a positive number

  • token must exist

Amounts (uint256[])

An array specifying the quantities of the respective tokens listed above, provided in the format [amountId1, amountId2,...]

  • must be a positive number

  • transfers from 1 to max amount

  • the first amount field is for the first id field

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Example transaction:

safeTransferFrom

The function allows for the secure transfer of a single token from the owner's wallet to another specified address. The function takes the following parameters:

Data

Description

Restrictions

From (address)

The address of the token owner's wallet.

  • must be a wallet address

  • must be the owner of the tokens

To (address)

The address of the recipient's wallet to whom we want to transfer the token.

  • must be a wallet address

Id (uint256)

The unique identifier of the token is to be transferred.

  • must be a positive number

  • token must exist

amount (uint256)

The quantity of the token to be transferred.

  • must be a positive number

  • transfers from 1 to max amount

  • the first amount field is for the first id field

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Example transaction:

a. Tokens Transfered FROM: Address from where the token was transferred

b. Tokens Transferred To: Address where the Tokens are sent

c. Tokens Transferred: ERC-1155 standard of the token

d. Tokens Transferred: Amount of tokens

e. Tokens Transferred: Token ID [ID of the transferred token]

f. Tokens Transferred: Token Contract Address

SetApprovalForAll

The method is used to allow or revoke permission for another contract to manage tokens on behalf of the caller. By setting the approval status to ture, we grant the operator the ability to manage the tokens, and by setting it to false, we revoke this permission.

Data

Description

Restrictions

Operator (address)

The address of the contract to which we want to grant or revoke management permission.

  • must be an address

Approved (bool)

Specifies whether we are allowing (true) or revoking (false) the management permission for the operator.

  • can be only true or false

  • we can use "1" (true) or "0" (false)

Example transaction:

setFee

This method is used to set the transaction fee in the contract. It is accessible only to the contract's owner.

Data

Description

Restrictions

fee (unit256)

The amount of the transaction fee to be set.

  • Only for the Contract owner

  • Must be a integer positive number

setTreasuryAddress

The method is used to set the treasury address in the contract. The treasury address is the designated account where funds or tokens are stored for various purposes, such as collecting fees, managing reserves, or distributing rewards.

Data

Description

Restrictions

Address (address)

The new treasury address to be set.

  • You must be the Contract owner

  • Must be a wallet address

setUri

The method allows the contract owner to update the URI associated with the NFTs in the contract. The URI points to a metadata file that contains information about the NFT, such as its name, description, image, and other attributes.

Data

Description

Restrictions

newUri (string)

The new URI to be set.

  • Must be a string

transferOwnership

The method is available only to the current owner of the contract and allows changing the ownership of the contract

Data

Description

Restrictions

newOwner (address)

The address of the new contract owner.

  • must be a wallet address

unpause

The method aims to resume the functionality of the contract. It is accessible only to the contract's owner.

Last updated