Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #168 from 0xsequence/builder-minting
Browse files Browse the repository at this point in the history
add a guide for how to mint in-game currency
  • Loading branch information
taylanpince authored Dec 1, 2023
2 parents 129c92c + d8dc568 commit bc64351
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 7 deletions.
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)
2 changes: 1 addition & 1 deletion docs/250-metadata/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ To learn how to use the Sequence Metadata service, please read:
## Pricing & Usage

The Sequence Metadata is available for free with moderate request limits, but if your project
requires higher limits, please contact the [Sequence Pro](https://pro.sequence.xyz) team.
requires higher limits, please contact the [Sequence](https://sequence.xyz) team.

1 change: 0 additions & 1 deletion docs/300-relayer/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ that they allow:
* Parallel transactions -- parallelize the dispatch of transactions in some cases
* Fire + forget model -- easily send transactions to the relayer, which will ensure fast delivery
* Optimal gas pricing for transactions
* Free to use / Sequence Pro gives you more reporting

The best part: transactions with Sequence Relayer are compatible with *any* existing/deployed Ethereum
contract, and thus, integrating the Sequence Relayer doesn't require any changes to your contracts or dapp.
Expand Down
3 changes: 0 additions & 3 deletions docs/300-relayer/02-building-relaying-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion docs/350-games-sdk/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Sequence Web3 Games SDK offers:
* Supports HTML5, Unity and Unreal games


Please contact the [Sequence Pro](https://pro.sequence.xyz) team for help with your project.
Please contact the [Sequence](https://sequence.xyz) team for help with your project.
1 change: 0 additions & 1 deletion docs/450-node-gateway/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ You don’t need to worry about scaling either: the Sequence Node Gateway scales
* Fast access to log data
* Single point of access to a large number of nodes with automatic fail-over. No need to update your node provider URL in case of a node failure.
* Integrations with: Infura, Alchemy, Quicknode, and internally managed nodes.
* For Sequence Pro users only


3 changes: 3 additions & 0 deletions static/img/builder/builder_choose_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 static/img/builder/builder_confirm_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.
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.
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 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.

0 comments on commit bc64351

Please sign in to comment.