There is a little code to add when using OpenZeppelin to create a new ERC20 token. I am going to use Truffle, development framework which makes using external packages, migrations, and testing possible. The goal of this exercise is to create the SimpleToken, ERC20 token, which assigns the ...
Introduction 1хв. What is a token? 4хв. Learn about contract standards 4хв. Learn about OpenZeppelin 4хв. Exercise - Set up a new project and integrate OpenZeppelin 8хв. Exercise - Write an ERC20 token contract 8хв. Knowledge check 1хв. Summary 1хв....
Using the openzeppelin library we can create our ERC20 token calledMyTokenwith the following solidity code: // SPDX-License-Identifier: UNLICENSEDpragma solidity^0.8.2;import"@openzeppelin/contracts/token/ERC20/ERC20.sol";contractMyTokenisERC20{constructor()ERC20("MyToken","MTKN"){_mint(msg.se...
Collaborator Author PatrickAlphaC commented Jun 20, 2024 • edited The contract is a basic ERC20. You can see it here: // contracts/MyContract.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract My...
You know what an ERC-20 is, you probably have created your own versions of it several times (if not, have a look at: ERC-20). But how would you start in 2020 using the latest tools? Let's create a new ERC-2020 token contract with some basic functionality which focuses on simplicity...
solidity: pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract LandNFT is ERC721, Ownable { constructor() ERC721("Land Parcel", "LAND") {} function mint(address to, uint256 tokenId) public onlyOwner...
import “@openzeppelin/contracts/token/ERC20/ERC20.sol”;– Imports the ERC20 contract from OpenZeppelin as a base. contract PoweredByCoindoo is ERC20 {– Defines the name of the contract and extends the ERC20 contract. constructor() ERC20(“PoweredByCoindoo”, “COINDOO”) {– Initialize...
Whereas ERC-20 is capable to transfer fungible tokens and ERC-721 tokens can transfer non-fungible tokens (NFT). By solving the above issues ERC 1155 continues to flourish in the upcoming days. How Does ERC 1155 Token Creation work? OpenZeppelin Contract library is used to create your ERC ...
Choose the token template The next stage in OpenZeppelin is to choose a token template. Let's say you use the ERC20 token template on OpenZeeplin as an example. After picking the template, open OpenZeppelin and pick the option "share" beside the link to import the file. Return to the ...
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract CNYT is ERC20, Pausable, Ownable { constructor() ERC20("CNYT",...