Lição 2

Generating LearnCoin (LC) Code with OpenZeppelin Wizard

By the end of this lesson, you should be able to: 1.Generate token code using OpenZeppelin Wizard. 2.Understand the basic structure of an ERC20 token.

Introduction

In our previous lesson, we learned what a Meme Coin is and the steps involved in creating one. In this lesson, we will take a more hands-on approach to create our own Meme Coin, which we will call LearnCoin (LC).

What is OpenZeppelin Wizard?

OpenZeppelin Wizard is a user-friendly tool that helps create, customize, and deploy smart contracts utilizing the OpenZeppelin Contracts library. It provides an easy interface where you can generate your token code by filling in specific details and selecting desired features.

Generating LearnCoin Code

Here’s how to do it:

Visit the OpenZeppelin Wizard Here

Select “ERC20” as the token type. ERC20 is a prevalent type of token on the Ethereum blockchain. These tokens abide by a set of rules and standards, ensuring they interact smoothly with other tokens and decentralized applications (dApps) on the Ethereum network.

Configure the following settings:

  • Name: The name of your token. In this case, “LearnCoin”.
  • Symbol: The symbol of your token. For LearnCoin, let’s use “LC”.
  • Premint: The amount of LearnCoin tokens you want to be minted initially (21 Milions in our case, like Bitcoin)
    Select the features you want to include:
  • Mintable: Privileged accounts will be able to create more supply.
  • Burnable: This feature allows tokens to be destroyed, decreasing the total supply.
  • Pausable: Privileged accounts will be able to pause the functionality marked as whenNotPaused. Useful for emergency response.
  • Permit: Without paying gas, token holders will be able to allow third parties to transfer from their account.
  • Votes: Keeps track of historical balances for voting in on-chain governance, with a way to delegate one’s voting power to a trusted account.
  • Flash Minting: Built-in flash loans. Lend tokens without requiring collateral as long as they’re returned in the same transaction.
  • Snapshots: Privileged accounts will be able to store snapshots of balances that can be retrieved later. For on-chain voting, the Votes option is preferable.
    Access Controls:
  • Ownable: This feature gives an account (the owner) exclusive functions.
  • Roles: This feature provides a way to assign permissions to different addresses.
    Upgradeability: This feature adds the ability to upgrade your smart contract without losing the existing data.
  • Transparent: This feature makes the contract’s governance more transparent.
  • UUPS: This is an upgrade mechanism that uses minimal storage and is more gas-efficient.
    Security Contact: This is an email address where potential security issues in your contract can be reported.
  • License: This determines the open-source license your project will use.
    This is going to be our Coin:

Click “Open in Remix IDE” to start creation of your token code.

Once you are on Remix IDE assure that on the Compiler Page on the left, you click on “Advanced Configurations” and checkmark “Enable Optimization”. After those settings, you can compile your contract.

Congratulations! You now have a complete, customized ERC20 token contract ready to be deployed on the Ethereum network!

Please note: The code generated by OpenZeppelin Wizard is based on the OpenZeppelin Contracts library, a trusted source for secure and standardized smart contract code. Nonetheless, you should always review and test the code thoroughly before deploying it.

Exclusão de responsabilidade
* O investimento em criptomoedas envolve riscos significativos. Prossiga com cuidado. O curso não pretende ser um conselho de investimento.
* O curso é criado pelo autor que se juntou ao Gate Learn. Qualquer opinião partilhada pelo autor não representa o Gate Learn.
Catálogo
Lição 2

Generating LearnCoin (LC) Code with OpenZeppelin Wizard

By the end of this lesson, you should be able to: 1.Generate token code using OpenZeppelin Wizard. 2.Understand the basic structure of an ERC20 token.

Introduction

In our previous lesson, we learned what a Meme Coin is and the steps involved in creating one. In this lesson, we will take a more hands-on approach to create our own Meme Coin, which we will call LearnCoin (LC).

What is OpenZeppelin Wizard?

OpenZeppelin Wizard is a user-friendly tool that helps create, customize, and deploy smart contracts utilizing the OpenZeppelin Contracts library. It provides an easy interface where you can generate your token code by filling in specific details and selecting desired features.

Generating LearnCoin Code

Here’s how to do it:

Visit the OpenZeppelin Wizard Here

Select “ERC20” as the token type. ERC20 is a prevalent type of token on the Ethereum blockchain. These tokens abide by a set of rules and standards, ensuring they interact smoothly with other tokens and decentralized applications (dApps) on the Ethereum network.

Configure the following settings:

  • Name: The name of your token. In this case, “LearnCoin”.
  • Symbol: The symbol of your token. For LearnCoin, let’s use “LC”.
  • Premint: The amount of LearnCoin tokens you want to be minted initially (21 Milions in our case, like Bitcoin)
    Select the features you want to include:
  • Mintable: Privileged accounts will be able to create more supply.
  • Burnable: This feature allows tokens to be destroyed, decreasing the total supply.
  • Pausable: Privileged accounts will be able to pause the functionality marked as whenNotPaused. Useful for emergency response.
  • Permit: Without paying gas, token holders will be able to allow third parties to transfer from their account.
  • Votes: Keeps track of historical balances for voting in on-chain governance, with a way to delegate one’s voting power to a trusted account.
  • Flash Minting: Built-in flash loans. Lend tokens without requiring collateral as long as they’re returned in the same transaction.
  • Snapshots: Privileged accounts will be able to store snapshots of balances that can be retrieved later. For on-chain voting, the Votes option is preferable.
    Access Controls:
  • Ownable: This feature gives an account (the owner) exclusive functions.
  • Roles: This feature provides a way to assign permissions to different addresses.
    Upgradeability: This feature adds the ability to upgrade your smart contract without losing the existing data.
  • Transparent: This feature makes the contract’s governance more transparent.
  • UUPS: This is an upgrade mechanism that uses minimal storage and is more gas-efficient.
    Security Contact: This is an email address where potential security issues in your contract can be reported.
  • License: This determines the open-source license your project will use.
    This is going to be our Coin:

Click “Open in Remix IDE” to start creation of your token code.

Once you are on Remix IDE assure that on the Compiler Page on the left, you click on “Advanced Configurations” and checkmark “Enable Optimization”. After those settings, you can compile your contract.

Congratulations! You now have a complete, customized ERC20 token contract ready to be deployed on the Ethereum network!

Please note: The code generated by OpenZeppelin Wizard is based on the OpenZeppelin Contracts library, a trusted source for secure and standardized smart contract code. Nonetheless, you should always review and test the code thoroughly before deploying it.

Exclusão de responsabilidade
* O investimento em criptomoedas envolve riscos significativos. Prossiga com cuidado. O curso não pretende ser um conselho de investimento.
* O curso é criado pelo autor que se juntou ao Gate Learn. Qualquer opinião partilhada pelo autor não representa o Gate Learn.