metapro
  • 🤝Welcome!
  • 💻metapro market
    • Set your account
    • Connect wallet + web3 login
    • Side panel
      • Transfer NFT
        • Multiple transfer (Airdrop NFT)
          • Import CSV List
      • Sell NFT
        • Initial NFT Selling (INS)
          • How to setup INS auction
          • How to buy on INS auction
        • Buy Now
          • How to setup Buy Now auction
          • How to buy on Buy Now auction
        • Auction (Bidding)
          • How to setup Auction
          • How to buy on Auction
      • All NFT assets
    • Buy Crypto
    • Top Menu
      • Profile
        • Profile Marketplace
        • My games
        • My assets
          • Royalty
        • Activities
      • Referral Panel
        • Register your downline
        • Downline wallets
        • My referral link
      • Profile Settings
      • Developer Portal
      • Logout
    • Assets
      • Marketplace
        • Auction Card
      • Most favorite
      • Newest assets
        • Asset Card
    • Games
      • Show all games
    • Leaderboard
    • Create asset (minter)
      • Gaming asset specification
      • How to create (mint) asset
        • 1. Setup NFT token
        • 2. Setup metadata
        • 3. Add meta asset
        • 4. Mint meta asset
        • 5. Meta asset created
    • Developers Portal
      • Create team
      • Create game
      • Developers Portal Panel
      • Unity Plugin
      • How to list game on metapro market?
    • Creators
    • Teams
    • Users
    • Wallet App
    • Launcher
    • Market and auction component fees
  • 🚀METAPRO LAUNCHER
    • What is metapro launcher?
    • Download launcher
    • Set your account
      • Login to launcher
    • Home
    • Games
      • Game card on launcher
        • Assets in this game
      • Install game on launcher
      • Update game on launcher
    • My games
      • Installed
      • Not installed
      • Wishlist
    • My assets
      • Collected assets
      • Created assets
      • Wishlist
    • NODEs app
  • 📱metapro one
    • About non-custodial wallet
    • Download & set up
      • Create new metapro wallet
      • Import existing wallet
    • Settings
      • Avatar
      • Multiple wallets
      • Wallet name
      • Private Key
        • Protect Private Key
        • How to find my Private Key
      • Recovery Phrases
        • Protect Recovery Phrases
        • How to find my Recovery Phrases
      • Application version
    • Network switch
    • Deposit (Tokens and Collectibles)
    • Send (Tokens and Collectibles)
      • Send Tokens
      • Send Collectibles (NFT)
    • Buy (Buy and Sell Crypto)
    • Browser
    • My assets
      • Tokens
        • Asset view
        • Adding Tokens
        • Activities
      • Collectibles (NFT)
      • Game assets (NFTma)
    • Explore
      • Apps
      • Collections (NFT)
      • Game assets (NFTma)
    • How to claim Airdrop
    • How to import wallet from MetaMask to metapro
    • Supported devices
  • ⛓️metapro protocol
    • API
      • Users service
      • Teams service
      • Apps service
      • Nft service
      • Nft events service
    • Meta asset
    • Metadata structure
    • Protocole structure
    • Unity Plugin
      • About metapro Unity plugin
      • What's new
      • Guides
        • Installation
        • Requirements
        • Package samples
        • Quick start
          • 1. Editor
            • Access tool
            • Import game key
            • Download resources
            • App data object
            • Change game key
            • Use app data in script
          • 2. Play mode (PC)
            • Enable Web3 in your game
            • Choose provider
            • Connect wallet
            • Login with Web3
            • Display user data
            • Show app tokens
            • Use user and app data from script
          • 3. Play mode (Mobile)
            • Enable Web3 in Your game
            • Choose provider
            • Connect wallet
            • Login with Web3
        • AFP (Additional Features Packages)
          • 1. Safe token transfer
          • 2. Phoenix
        • Troubleshooting
      • Reference
        • MetaproAPPSetup
        • Editor Window
        • Plugin Manager
        • Web3 connection providers
          • metapro
          • Wallet Connect
          • MetaMask
        • WindowController
        • AFP (Additional Features Packages)
          • SafeTransferFrom
          • Phoenix
  • 🛠️WALLET CONNECTOR
    • Introduction
    • Basic informations
      • Next 13 integration
      • React integration
      • Manual installation
  • 👨‍💻Developer Documentation
    • Introduction to Developer Documentation
      • What is a Meta asset?
      • What are the Benefits of Using Tokens as Access Keys for the Game Application
      • Why should I Choose the Meta Assets as the Access Keys for the Game Application?
      • How Does It Work, Exactly?
    • Available Environments
    • Blockchain Communication and information retrieval
      • How can we verify/distinguish a user?
      • How can we track a user's transactions?
      • What information can we obtain?
    • Integration with the Leaderboard service
    • Integration for in-Wallet Apps
    • Integration for Telegram Mini Apps
      • Integration Architecture and Configuration
      • Authorization and Session Management
      • Example Integration and Features
      • Code Examples from the Repository
      • Summary and Appendices
    • Developer documentation for the Construct 3 Plugin
      • Construct 3 - Install plugin
      • Plugin Configuration
      • User onboarding and authorization
      • User Management
      • Score System
      • Leaderboard System
      • Referral System
      • Gameplay
      • Smart Contract Interactions
      • User NFTs
      • Error Handling
      • Additional Getters for Plugin Properties
    • Integration Web3 with Your Game
      • What is Web3
      • Blockchain Basics
      • Differences between chains
      • What is a NFT
      • Advantages of Web3 Gaming
      • Examples of Web3 Games
    • Onboarding the Web3 Player
      • Value for Players
      • Explanation of Cryptocurrency Wallet
      • Rewards for Tournament Participation
      • Reselling Owned Assets
      • Integration of Metapro Wallet Connector
      • Displaying Data for Unlogged Users
      • How to Get Authorization Data
      • User Authorization Benefits
    • Creating Your First Meta Asset
      • The Difference between NFT and Meta Asset
      • Security and Transparency
      • Concept and Value of Meta Assets
      • How and Where to Create Your Meta Asset
        • Step-by-Step Guide on How to Create Your Asset
        • Explanation of URI (Metadata structure)
        • Explanation of the Meta Asset Data taken from our Back End
    • Implementing Meta Assets into Your Game
      • Integrate your Meta Asset to your game using Unity
      • Verify User Tokens Ownership
      • Displaying All User-Owned Tokens
      • Displaying All Assets Assigned to the Game on the Metapro Market
    • Smart Contracts
      • MetaproINS
        • Read Contract
        • Write Contract
      • MetaproBuyNow
        • Read Contract
        • Write Contract
      • MetaproAuction
        • Read Contract
        • Write Contract
      • MetaproMetaAsset
        • Read Contract
        • Write Contract
      • MetaproRoyalty
        • Read Contract
        • Write Contract
      • MetaproReferral
        • Read Contract
        • Write Contract
      • MetaproAirdrop
        • Read Contract
        • Write Contract
    • Universal Links & App Links with WalletConnect
  • 🔎General information
    • Blockchain
    • Blockchain Network Fee
    • Blockchain Native Token
    • Token ERC-1155 vs ERC-721
  • 📄Release Notes
    • Introduction to the Release Notes
    • Marketplace Updates
      • Release 07.03.2024
      • Release 06.03.2024
      • Release 04.03.2024
      • Release 19.02.2024
      • Release 24.01.2024
      • Release 09.01.2024
      • Release 03.01.2024
      • Release 21.12.2023
      • Release 18.12.2023
      • Release 13.12.2023
      • Release 12.12.2023
      • Release 02.12.2023
      • Release 30.11.2023
      • Release 24.11.2023
      • Release 22.11.2023
      • Release 17.11.2023
      • Release 13.11.2023
      • Release 09.11.2023
      • Release 08.11.2023
      • Release 07.11.2023
      • Release 31.10.2023
      • Release 26.10.2023
      • Release 25.10.2023
      • Release 24.10.2023
      • Release 18.10.2023
      • Release 05.10.2023
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 18.09.2023
      • Release 14.09.2023
      • Release 12.09.2023
      • Release 06.09.2023
      • Release 25.08.2023
      • Release 17.08.2023
      • Release 04.08.2023
      • Release 31.07.2023
      • Release 21.07.2023
      • Release 18.07.2023
      • Release 13.07.2023
    • Games Launcher Updates
      • Release 13.03.2024
      • Release 24.01.2024
      • Release 04.01.2024
      • Release 22.11.2023
      • Release 03.10.2023
      • Release 31.07.2023
      • Release 27.07.2023
      • Release 20.07.2023
      • Release 13.07.2023
    • Wallet Updates
      • Release 04.03.2024
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 15.09.2023
      • Release 30.08.2023
      • Release 18.07.2023
Powered by GitBook
On this page
  • Link to the Smart Contract:
  • Buy
  • closeAuction
  • createAuction
  • onERC1155BatchReveived
  • onERC1155Received
  • renounceOwnership
  • setBusdAddress
  • setReferralAddress
  • setRoyaltyAddress
  • setTreasuryFee
  • setTressuryAddress
  • transferOwnership
  1. Developer Documentation
  2. Smart Contracts
  3. MetaproBuyNow

Write Contract

PreviousRead ContractNextMetaproAuction

Last updated 1 year ago

Link to the Smart Contract:

Buy

The method is used to purchase a specific auction.

Data

Description

Restrictions

_buyNowId (uint256)

The ID of the auction to buy

  • must be a valid auction ID

  • the auction must be active

_tokenQuantity (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

_data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

Transaction Example

a. Money from the buyer sent to the Contract

b. Money sent from the Contract to Level 1 money Referral send

c. Money sent from the Contract to Level 2 money Referral send

d. Money sent from the Contract to Level 3 money Referral send

e. Money sent from the Contract to the Contract Fee address

f. Money sent from the Contract to the Auction operator

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

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

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

j. Token Transferred: Amount of tokens

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

l. Token Transferred: Token Contract Address

closeAuction

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 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

_buyNowId (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:

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 (number of tokens sent back)

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

f. Token Transferred: Token Contract Address

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

createAuction

The createAuction method in the smart contract is designed for initiating the creation of Buy Now auctions. It is necessary to have a Token in order to list an auction, which can be either acquired for resale purposes or self-generated.

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

  • must be an owner of the token

_tokenPrice (uint256)

The price set for a single token, 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

_tokenQuantity (uint256)

The number of tokens to be sent for the auction.

  • cannot be 0

  • cannot be greater than owned tokens

_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

_level1ReferralFee (uint256)

The amount of referral fee received by the person who refers the auction at level 1. 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%

_level2ReferralFee (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%

_level3ReferralFee (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%

_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)

data (bytes)

Additional data, if needed.

  • By default, it is set to 0x00

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

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

setTreasuryFee

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

👨‍💻
https://bscscan.com/address/0x572d9f2e8392cd36a6347384168c0b5bc5ab1a59#writeContractbscscan.com
https://testnet.bscscan.com/tx/0xb559a00dc815b4f5205a422cfc3a72381febaa59cb13835ff0b57d69da8ece3dtestnet.bscscan.com
The participant who Bought a token:
https://testnet.bscscan.com/tx/0x531138ee3336e55f8994140e64f0e5fb41209ca9afff457712d23f95294da5e1testnet.bscscan.com
The operator claims unsold tokens from the Contract
https://testnet.bscscan.com/tx/0xf48742a05a22a66cc3d2f6d3a56accd70975c96401089083b77d4908d239d5eetestnet.bscscan.com
The operator closes the auction before the start