Write Contract

create

The method is used to create an Initial NFT Selling (INS) auction in the Meta Asset (NFTma) contract. The user who wants to create an auction must be the owner of the token he wants to put up for sale.

Data

Description

Restrictions

tokenContractAddress (address)

The address of the token contract where the token is located and will be listed for sale.

  • must be a Token Contract Address

tokenId (uint256)

The ID of the token to be listed for sale in the auction.

  • tokenID must be greater than 0

  • the INS creator must be an owner of the token

minCap (uint256)

The minimum limit determines whether the minCap has been achieved, indicating the progress of the sale.

  • minCap must be at least 0

  • minCap cannot be greater than maxCap

  • cannot be greater than owned tokens

maxCap (uint256)

The maximum number of tokens to be sent for the auction.

  • maxCap must be equal to or greater than minCap

  • cannot be greater than owned tokens

pricePerToken (uint256)

The price set for a single token, is expressed in the units of the specified token (e.g., 0.0001 BUSD is represented as 1e14 in our case).

  • must be a positive number

  • possible min price 0.0001 BUSD

startBlock (uint256)

The block number at which the auction is scheduled to start.

  • must be a blockchain block

  • must be lower than endBlock

endBlock (uint256)

The block number at which the auction is scheduled to end.

  • must be a blockchain block

  • must be higher than startBlock

multipleDeposits (bool)

Specifies whether buyers can make multiple purchases in the auction.

  • can be only true or false

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

leavel1ReferralFee (uint256)

The amount of referral fee received by the person who refers the auction at level 1. It can be selected from 0 to 15% of the transaction amount. The sum of referral fees from all referrers cannot exceed 15%.

  • can be set from 0 to 15% (1% = 100)

  • the max sum of the referral fee must be set to 15%

leavel2ReferralFee (uint256)

The amount of referral fee received by the person who refers the auction at level 2. Can be selected from 0 to 15% of the transaction amount. The sum of referral fees from all referrers cannot exceed 15%.

  • can be set from 0 to 15% (1% = 100)

  • the max sum of the referral fee must be set to 15%

leavel3ReferralFee (uint256)

The amount of referral fee received by the person who refers the auction at level 3. Can be selected from 0 to 15% of the transaction amount. The sum of referral fees from all referrers cannot exceed 15%.

  • can be set from 0 to 15% (1% = 100)

  • the max sum of the referral fee must be set to 15%

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Transaction example:

Transaction Example

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

b. Token Transferred To: Address where the Token is sent

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

d. Token Transferred: Amount of tokens

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

f. Token Transferred: Token Contract Address

deposits

The method is used to purchase a specific auction.

Data

Description

Restrictions

insId (unit256)

The ID of the auction from which we want to purchase the token.

  • must be a positive number

  • the auction must be active

quantity (uint256)

The number of tokens that we want to purchase.

  • must be a positive number

referrer (address)

The address of the wallet from which we received the auction recommendation or the address of the person who registered us as an upline. If the user purchases the auction through a referral, the referrer will receive a commission from the transaction based on the agreed commission and referral level.

  • must be an address

Transaction example:

Transaction exmaple

a. Tokens Transferred FROM: Address from which the token was sent

b. Tokens Transferred TO: Address where the money is sent

c. Token Transferred For: The amount sent

d. Token Transferred: Name and link of the chain

emergencyInsWithdraw

The method is accessible only to the contract owner and is used for the emergency closure of an auction, even during its runtime. When an emergency closure is executed, all funds and tokens from the auction are transferred to the contract owner.

Data

Description

Restrictions

insId (unit256)

The ID of the auction from which we want to perform an emergency closure.

  • must be a positive number

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

onERC1155BatchReveived

The onERC1155BatchReceived is a standard function within the ERC-1155 interface in the Solidity environment, similar to onERC1155Received. However, it is used to handle the batch (multiple) receipt of tokens by a contract. When an address receives a batch of tokens (either NFTs or MFTs) on its contract, if that contract includes the onERC1155BatchReceived method, it is automatically invoked. This allows the contract to respond to the receipt of multiple tokens in a single transaction and execute appropriate actions.

Data

Description

Restrictions

address (operator)

The address performing the token batch transfer operation.

  • must be an address

address (from)

The address from which the tokens were sent.

  • must be an address

uint256[] (tokenID)

An array of token identifiers.

  • must be a number

uint256[] (value)

An array of amounts of received tokens corresponding to the respective IDs.

  • must be a number

bytes

Additional data passed along with the transfer operation.

  • By default, it is set to 0x00

The onERC1155Received function returns a special four-byte code (bytes4), which serves as a confirmation that the contract successfully received the tokens. In summary, onERC1155BatchReceived allows a contract to react to the receipt of a batch of ERC-1155 tokens and execute specific actions in response to this batch event.

onERC1155Received

The onERC1155Received function is a standard function within the ERC-1155 interface in the Solidity environment, concerning non-fungible tokens (NFTs) or multi-fungible tokens (MFTs). This function is designed to handle the receipt of tokens by a contract. When an address receives tokens (either NFTs or MFTs) on its contract, if that contract includes the onERC1155Received function, it is automatically invoked. This allows the contract to respond to the receipt of new tokens and execute appropriate actions.

Data

Description

Restrictions

address (operator)

The address performing the token transfer operation.

  • must be an address

address (from)

The address from which the tokens were sent.

  • must be an address

uint256 (tokenID)

The token identifier.

  • must be a number

uint256 (value)

The ammount of received tokens.

  • must be number

bytes

Additional data passed along with the transfer operation.

  • By default, it is set to 0x00

The onERC1155Received function returns a special four-byte code (bytes4), which serves as a confirmation that the contract successfully received the tokens. In summary, onERC1155Received enables a contract to react to the receipt of ERC-1155 tokens and trigger specific actions in response to this event.

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.

setBusdAddress

The setBusdAddress method allows the contract owner to update the address of the BUSD contract in the smart contract. This is important for connecting and interacting with the BUSD contract to perform operations such as token transfers, balance checks, and other financial transactions involving BUSD tokens. The owner can update the BUSD contract address if the contract is upgraded or replaced with a new version.

Data

Description

Restrictions

newAddress (address)

The new address of the BUSD contract to be set.

  • must be an address

setReferralAddress

The setReferralAddress method allows the contract owner to update the address of the referral contract in the smart contract. This is important for connecting and interacting with the referral contract to perform operations related to referral bonuses, commissions, or any other referral-related functionalities. The owner can update the referral contract address if the contract is upgraded or replaced with a new version or if they want to use a different referral contract for their application.

Data

Description

Restrictions

newAddress (address)

The new address of the referral contract to be set.

  • must be an address

setRoyaltyAddress

The setRoyaltyAddress method allows the contract owner to update the address of the royalty contract in the smart contract. This is important for connecting and interacting with the royalty contract to perform operations related to royalty payments, revenue sharing, or any other royalty-related functionalities. The owner can update the royalty contract address if the contract is upgraded or replaced with a new version or if they want to use a different royalty contract for their application.

Data

Description

Restrictions

newAddress (address)

The new address of the royalty contract to be set.

  • must be an address

setTreasureFee

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 (uint256)

The amount of the transaction fee to be set.

  • Only for the Contract owner

  • Must be a positive number

setTressuryAddress

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

newAddress (address)

The new treasury address to be set.

  • You must be the Contract owner

  • Must be a wallet address

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

withdraw

The method allows the contract owner or the operator of the auction to close the auction and collect tokens and funds from it. It is also used to withdraw the proceeds from a completed auction. The method is designed to handle various aspects of auction management, such as closing auctions prematurely, collecting tokens and funds, and managing the distribution of auction assets. This functionality provides flexibility and control over the auction process, ensuring a smooth and efficient experience for both the auction participants and the contract operator.

Data

Description

Restrictions

insId (uint256)

The ID of the auction to be closed/collected.

  • must be a valid auction ID

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Transaction Example:

Participants who claim the tokens from the Contract

Transaction Example

Tokens Transferred

a. Tokens Transferred: Visible 3 transactions that show the Referral structure

b. Token Transfered FROM: Address from where the money was sent

c. Token Transferred To: Address where the money is sent

d. Token Transferred For: The amount of money that was sent

e. Token Transferred: Token Contract Address

f. Token Transfered FROM: Address from where the token was sent

g. Token Transferred To: Address where the Token is sent

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

i. Token Transferred: Amount of tokens

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

k. Token Transferred: Token Contract Address

Transaction Example:

The Auction Operator who claims the tokens and money from the Contract

a. Tokens Transferred: Visible 2 transaction, the first transaction shows the price of the treasury second shows what the owner received

b. Token Transfered FROM: Address from where the money was sent

c. Token Transferred To: Address where the money is sent

d. Token Transferred For: The amount of money that was sent

e. Token Transferred: Token Contract Address

Shows the sent of unsold Tokens to the Auction Operator:

f. Token Transfered FROM: Address from where the token was sent

g. Token Transferred To: Address where the Token is sent

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

i. Token Transferred: Amount of tokens

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

k. Token Transferred: Token Contract Address

Transaction Example:

The Auction Operator cancels the auction before startBlock

Auction Details

Close

Shows the sent of unsold Tokens to the Auction Operator:

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

b. Token Transferred To: Address where the Token is sent

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

d. Token Transferred: Amount of tokens

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

f. Token Transferred: Token Contract Address

Last updated