This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from 0xsequence/builder-minting
add a guide for how to mint in-game currency
- Loading branch information
Showing
12 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
docs/100-builder/03-mint-an-item-from-a-collection/03-mint-currency-from-ERC20.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# How to mint in-game currency in Builder | ||
|
||
## Introduction | ||
|
||
In this guide, we’re going to walk through the process of creating your own in-game currency through minting from an ERC-20 contract. | ||
|
||
Currency tokens add new and interesting dimensions to in-game economies, transactions, and player interactions. | ||
|
||
#### What is an ERC-20 token? | ||
|
||
An ERC-20 token is a digital coin - what makes it special is that it follows a [set of rules called ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/), making it easy to use in different places on the internet. These tokens often represent value or be used for specific purposes. Unlike the other common token - NFT's, these tokens are fungible. | ||
|
||
#### Fungability vs Non-Fungibility | ||
|
||
This is the key distinction to understand. | ||
|
||
Fungible tokens (like ERC-20 tokens) are interchangeable, and each unit is the same as every other unit, just like dollars or euros. They can easily be split or combined into different quantities. | ||
|
||
Non-fungible tokens (like ERC-721 tokens) represent unique items with individual properties, such as digital art or collectibles. Each token is distinct and not directly exchangeable with another on a like-for-like basis. | ||
|
||
### Prerequisite: Create a Project and deploy a Smart Contract | ||
|
||
Before you get started creating (minting) currency, you will need to first deploy the smart contract you wish to mint from. If you have not done so already, go back and do [how to load an item collection through deploying a smart contract](https://docs.sequence.xyz/minting-game-items/deploy-an-item-collection). | ||
|
||
## Step 1: Select the contract for your currency | ||
|
||
Start by selecting the contract you would like to create currency from. | ||
|
||
Once in the contract dashboard, you should see the ERC-20 contract that you have deployed - select it. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_choose_contract_mint_currency.png) | ||
|
||
|
||
## Step 2: Navigate to Write Contract | ||
|
||
When opening the contract, you will see several options. Everything from details like your contract address, type, the network its deployed on - to options for adding gas or help setting up an indexer. Below those details, you have more options to view contract details and interact with it. | ||
|
||
Within that subset of options, select `Write Contract`. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_select_write_contract_mint_currency.png) | ||
|
||
|
||
Selecting this will reveal a variety of methods on the smart contract. | ||
|
||
Select the `mint` method. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_select_mint_method_mint_currency.png) | ||
|
||
|
||
|
||
## Step 3: Provide details for the Mint method | ||
|
||
Selecting `mint` will expand the method, providing inputs. | ||
|
||
Enter the address you want your currency to be minted to, for this example put your own address in. | ||
|
||
Enter the amount of currency you want to create. | ||
|
||
Then hit `write` to send a transaction to mint. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_fill_mint_details_mint_currency.png) | ||
|
||
|
||
## Step 4: Mint and sign your transaction | ||
|
||
Once you hit `write`, a modal with your wallet will pop-up. In order to create (mint) your currency, you will need to send a transaction. | ||
|
||
Read the transaction details and execute the transaction by hitting `confirm` on the signature. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_sign_transaction_mint_currency.png) | ||
|
||
|
||
After you sign the transaction, the network will take a few seconds (maybe minutes depending on the network and other factors) to confirm your transaction. | ||
|
||
When the transaction is complete, you will have created your own currency by minting them from the smart contract! | ||
|
||
## Step 5: Confirm your minted currency | ||
|
||
Click the `Balances` subsection to see the currency that we created and minted. | ||
|
||
|
||
![Sequence builder choose contract](/img/builder/builder_confirm_mint_currency.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,9 +132,6 @@ To catch any unwanted migration, you can use the `onMigration` callback. | |
|
||
## Nodejs Server with Gas Sponsoring using Sequence Builder | ||
|
||
:::tip Need access to our Sequence Builder? | ||
Reach out to us by email @ [email protected] or complete our Sequence Pro form to hear back: https://pro.sequence.xyz/. | ||
::: | ||
|
||
If you want to have your transactions sponsored & paid for with a credit card, you can follow the below steps before beginning your code, at the following link: https://sequence.build/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
static/img/builder/builder_fill_mint_details_mint_currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
static/img/builder/builder_select_mint_method_mint_currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
static/img/builder/builder_select_write_contract_mint_currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
static/img/builder/builder_sign_transaction_mint_currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.