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:
  • Create
  • CreateReserved
  • Migrate
  • Pause
  • RenounceOwnership
  • safeBatchTransferFrom
  • SetApprovalForAll
  • setFee
  • setTreasuryAddress
  • setUri
  • transferOwnership
  • unpause
  1. Developer Documentation
  2. Smart Contracts
  3. MetaproMetaAsset

Write Contract

PreviousRead ContractNextMetaproRoyalty

Last updated 1 year ago

Link to the Smart 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.

👨‍💻
https://bscscan.com/address/0xa293d68684be29540838dc8a0222de0c43c6b5b4#writeContractbscscan.com
Write Contract
https://testnet.bscscan.com/tx/0x12cb9bd37292165d9be3997318006332abdd63a4b3b733816bc5a881ae4348eftestnet.bscscan.com
https://testnet.bscscan.com/tx/0xb7fdd07f74ee1319f1df570b49e55d7dedb8bfe0bcd51c5139290a3273a6097btestnet.bscscan.com
https://testnet.bscscan.com/tx/0x7a693c8ea5f2cfe9d26eafdccacd2c1304799204fc4ec1588ac69ec644979336testnet.bscscan.com
https://testnet.bscscan.com/tx/0x77a5df5784793ca5366bd85cc71d314bee1ac83f0853ada29fa38f7ccbcd5fb3testnet.bscscan.com