ERC20 Token Tutorial | Create Your Own Cryptocurrency

Поділитися
Вставка
  • Опубліковано 10 вер 2022
  • In this ERC20 token tutorial you will learn how to create your own cryptocurrency as an ERC20 token on Ethereum. We cover all of the steps from development and testing to deployment. Topics covered include testing in the Remix editor, creating a project with Hardhat, token design, ERC20 smart contract development, smart contract testing and deployment to Ethereum.
    Project repo on GitHub:
    github.com/jspruance/erc20-tu...
    Ethereum ERC20 Standard:
    ethereum.org/en/developers/do...
    Open Zeppelin ERC20 Documentation:
    docs.openzeppelin.com/contrac...
    If you've created your own token, I'd love for you to send me some (if you want)!
    My wallet address:
    0x3B5c1926441EC9bE1FA179831f9E6ea9b9205b2f
  • Наука та технологія

КОМЕНТАРІ • 441

  • @adityasingh11156
    @adityasingh11156 Рік тому +19

    Thanks😊 for sharing it. Your teaching style is very good. I like how you explain in detail each related concept smoothly rather than rushing through topic fastly.

    • @BlockExplorerMedia
      @BlockExplorerMedia  Рік тому +1

      Thanks Aditya - I appreciate the feedback and glad you liked it.

  • @alexismollet6751
    @alexismollet6751 Рік тому +4

    I loved this video very new to coding and got stuck on some coding errors, but your explaining was very detailed and I watched the whole thing anyway

  • @suryarghyasaha4984
    @suryarghyasaha4984 11 місяців тому +9

    I'm new to Blockchain Development and your videos helped me so much to grasp all the concepts so fast. You're an amazing teacher and I look forward to learning more and more from you. And since I recently made my own ERC20 token inspired by this tutorial, I sent some of them to the wallet address you mentioned in the descriptions. Thank You So Much man. Please keep up the good work.🙏🤝

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому +1

      Thanks so much and congrats on your token. May I know the smart contract address so I can import the token in my wallet? Nice work : )

  • @osempo
    @osempo 7 місяців тому

    Amazing video, the best tutorial on how to create and deploy a token, I hope you keep uploading content more often!

  • @rosariosway
    @rosariosway 9 місяців тому

    Thank you for this video! I have learned a lot of stuff through it, you did an excellent job! 👏

  • @AroseLove
    @AroseLove 10 місяців тому +1

    Amazing great stuff a few additional errors here and there (my own doing as only downloaded visual studio code today so was mainly extension errors) Thank you so much for this tutorial, there isn’t another started tutorial I’ve seen as good as this. 🙏🏻

  • @tokunbosuleimon4802
    @tokunbosuleimon4802 Рік тому +1

    Thanks😊 for sharing it. Your teaching style is very good. I like how you explain in detail each related concept smoothly rather than rushing through topic fastly, and please can you do a front -end

  • @TRVLCreative
    @TRVLCreative Рік тому +3

    Awesome video. Awesome teacher. Thank you for taking the time to teach the world about web3 effectively :)

  • @somnathmondal5561
    @somnathmondal5561 Рік тому +1

    Exited for this video ,, great work man
    🤜🤛

  • @ivanlagade
    @ivanlagade Рік тому +1

    Continue making valuable content sir. God bless you more.

  • @brunorocha9898
    @brunorocha9898 Рік тому +1

    great teacher.. thank you

  • @GauravSinghnikumb
    @GauravSinghnikumb 11 місяців тому +1

    the soidity version also takes into consideration the openzeppelin pragma solidity version , so keep that in mind

  • @UsmanKhan-nc2md
    @UsmanKhan-nc2md Рік тому +2

    honestelly sir this is one of the best vidio

  • @serjoka77
    @serjoka77 Рік тому

    Great Tutorial, thanks for sharing! One question: just curious why didn’t use the ownable extension of OpenZeppelin instead of creating a custom access modifier?

  • @williamwallace5707
    @williamwallace5707 2 місяці тому

    Very in-depth, great tutorial. I was wondering what type of environment you are coding in. Are you using Docker, a VM, cloud or your PC? I am new to coding, very basic understanding and am concerned about installing and experimenting with various scripts/software and blockchain based things.

  • @telego1151
    @telego1151 2 місяці тому

    Hey, thank you for the video, super thorough and helpful! One quick question though, is the coding the same for minting and BlockRewards now that Ethereum has moved to Proof of Stake or should we do anything different?

  • @abelasaya8709
    @abelasaya8709 7 місяців тому

    Thanks a lot, i am grateful for the video. cheers

  • @MikeDougherty
    @MikeDougherty 11 місяців тому +3

    It's been a while, so maybe you realized this already, but at 1:10:00 the explorer shows two transfers. One for the 1,000,000 and another to a different address for 50. I assume that is the blockReward you were trying to find toward the end, no?

  • @thatwasgaming6225
    @thatwasgaming6225 Рік тому +1

    thank you so much, this was an amazing video

  • @UsmanKhan-nc2md
    @UsmanKhan-nc2md Рік тому +1

    Thank You So much Sir I learned Alot

  • @andrecastro7817
    @andrecastro7817 Рік тому +1

    hey thanks alot for your video!! can this be deployed on the Binance Smart chian Network ? im trying to make one that taxes and gives reflections on each transactions.

  • @JohnDoe34548
    @JohnDoe34548 Місяць тому

    great video, sir.

  • @danielasema5988
    @danielasema5988 Рік тому +1

    great tutorial. Thanks so much

  • @nosktech7818
    @nosktech7818 Рік тому +1

    Can you show or direct me to adding the coding for a “creator reward” for receiving a percentage on every transaction , thank you great walk through 👍

  • @paulgallant3675
    @paulgallant3675 10 місяців тому

    Brilliant video thank you

  • @Bobbybaitz
    @Bobbybaitz Місяць тому

    Hi, I'm running into this error:
    npm : The term 'npm' is not recognized as the
    name of a cmdlet, function, script file, or
    operable program. Check the spelling of the
    name, or if a path was included, verify that
    the path is correct and try again.
    At line:1 char:1
    + npm init
    + ~~~
    + CategoryInfo : ObjectNotFound:
    (npm:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundE
    xception
    Any help?

  • @chams2385
    @chams2385 Рік тому

    BRO , YOU ARE LEGEND

  • @cryptotree999
    @cryptotree999 Рік тому

    Very nice and wonder full video

  • @elmmacwebmobileapps
    @elmmacwebmobileapps Рік тому

    Thanks for teaching master. I appreciate. Question is, how do you give or set a value to the token. say 1000000 tokens, have seen in the tutorial wher it say 1000000 and value $0.00 | so ho do i change or give value to the tokens.??

  • @srijanshovit844
    @srijanshovit844 Рік тому

    thanks..I finished my own version of it

  • @makindeoluwasegun4188
    @makindeoluwasegun4188 Рік тому

    Thanks for this 🙏

  • @REZAZIMohamedabdessamed
    @REZAZIMohamedabdessamed Рік тому

    Thanks for the quality explanation. I've a question, on the Transfer method I checked the original ERC20 implementation and they didn't multiply the amount input with the decimals... however it is still working (the balance got updated correctly).. how is that

  • @deekshanayak5688
    @deekshanayak5688 Рік тому

    Sir, your explanations have that clarity. Can I print token name,symbol on console like how you've shown the deployed address on console?

  • @GLOBALTECHFUSION
    @GLOBALTECHFUSION Місяць тому

    If you want to split the sale, First Pre-sale and after that the main one, how to be organized in the contract?

  • @ride66
    @ride66 Рік тому +1

    What is presale, private presale l, fairlaunch, stealth launch etc. Plz make a video on that sir! On all the launch types

  • @BlockExplorerMedia
    @BlockExplorerMedia  8 місяців тому +1

    A lot of people have been asking how to deploy to mainnet. In retrospect, I should have had that in the video! First add a 'mainnet' configuration in hardhat.config.js, under 'networks'. Then add your mainnet endpoint from Infura to the 'url' field. Finally target that configuration when you issue the deploy command, like this: 'npx hardhat run scripts/deploy.js --network mainnet'. Hope this helps.

    • @bethchen87
      @bethchen87 7 місяців тому

      @BlockExplorerMedia
      I was inplementing your code at 1:03:45, but got the error message:
      TypeError: oceanToken.deployed is not a function
      at main (C:\Projects\erc-20-tutorial\ocean-token\scripts\deploy.js:8:20)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      What might be the problem?
      Can somebody figure it out?

  • @jacektrocinski6337
    @jacektrocinski6337 5 місяців тому +2

    @47:00 I believe there's no need to duplicate the code in the _mint override of the token. Simply using super should suffice, as it will invoke the capped contract logic, which then triggers the ERC20 logic. This approach should maintain functionality without redundant code.

  • @armagosa2
    @armagosa2 Рік тому +1

    Awesome Video, can you do one similar with a tax function opposed to a burn function?

  • @MichaelWongManTak
    @MichaelWongManTak Рік тому

    Sir, thanks for your video. Is it possible to get support in real time guidance in setting up our token. ??

  • @BillyBishop589
    @BillyBishop589 Рік тому

    thanks for this great tutorial.. first tutorial in this blockchain space that worked.. everytime i write code i hit a brick wall with deprecated and outdated info.. thanks much when i go mainnet on polygon ill definitely will be sending a fat stack your way thanks again..

  • @galeraonthebeat
    @galeraonthebeat Рік тому

    Why do we need ERC20Capped if we created the same function (_mint) inside our token contract? We do not have a function that overrides cap value so we could just use our cap value that we could declare in constructor.

  • @MrPotatoHeadFX
    @MrPotatoHeadFX Рік тому

    Thank you for this. I was reading the solidity lang documentation and noticed that for large numbers it is ok to use 10e6 instead of 10000000 but when watching this and other videos no one seems to be using that style. Is there a reason why? my coding background is in matlab so for me its much easier, and cleaner to use the 10e6 notation

  • @kingcryptotv1539
    @kingcryptotv1539 Рік тому

    Great Communication

  • @jhhnadkins5669
    @jhhnadkins5669 Рік тому +1

    Hello, thanks very much for video. Process is same for bep20 token too? Can I find out? And can we add halving?

  • @drakegao816
    @drakegao816 Рік тому

    Derived contract must override function "_mint". Two or more base classes define function with same name and parameter types when I inherited those two contracts.

  • @mobiactive
    @mobiactive 2 місяці тому

    Good morning, to create a BSC network, do I need to change the router or do I have to change something else in the code?

  • @jcw1197
    @jcw1197 Рік тому +1

    Your block reward was showing in the tx hash! Just FYI, 🙂

  • @geradinfotso
    @geradinfotso Рік тому

    Thank you for your Usefull videos.

  • @thelegendjustice
    @thelegendjustice 6 місяців тому

    it says "infinite gas" for me on creating the constructor, what did i do wrong ? thanks

  • @mrcrazy3960
    @mrcrazy3960 Рік тому

    Please I’m getting this error any help
    “Before each” hook for “should set the right owner”:
    HardhatError; HH700: Artifact for contract “sunToken” not Found

  • @24PetrocoinLLC
    @24PetrocoinLLC 4 місяці тому

    can you include initial token pricing in the contract before deployment?

  • @astrofoundation
    @astrofoundation Рік тому +1

    I love your videos mate! :) ...

  • @kevinjurden9114
    @kevinjurden9114 Рік тому +6

    Could you create a video showing how to create a Token, and instead of minting rewards to 'miners'. Create an Liquidity pool, and mint rewards to those who are staking? Could be implemented into a Defi/Dapp video

  • @SimonSpiteri-bo2ty
    @SimonSpiteri-bo2ty Рік тому

    hey, this is fantastic. can we add eth reflections for things like a marketing wallet/treasury? can you do a little how to on those types of things? love your content

  • @autoRevolutionHubs
    @autoRevolutionHubs Рік тому +1

    thanks, bro, I created one token and I sent it to your wallet 1m also... thanks again

  • @TimKariuki
    @TimKariuki Рік тому +1

    Is it possible to add custom metadata to a token?

  • @franktimestamp
    @franktimestamp Рік тому +1

    Nice Vijeo...

  • @pantherverse
    @pantherverse Рік тому

    Hey man, am getting this error 'aquaToken contract
    "before each" hook for "Should set the right owner":
    HardhatError: HH700: Artifact for contract "AquaToken" not found.' What might be the problem?

  • @advikmarini
    @advikmarini 10 місяців тому

    I am getting another error when I try to run "npx hardhat run --network rinkeby scripts/deploy.js"
    This is the error that I am getting:
    TypeError: no matching function (argument="key", value="deployed", code=INVALID_ARGUMENT, version=6.6.4)
    I understand that it has something to do with the ethers version that I am using, but I'm not quite sure what the substitute would be for "deployed" in the current version that I am using for ethers, and I haven't been able to find a substitute on the internet for this function. Thanks!

  • @spyboy3924
    @spyboy3924 Рік тому

    thanks for the video 🙌🙌

  • @0cho8cho72
    @0cho8cho72 Рік тому

    really nice tutorial !!!

  • @hberrios23
    @hberrios23 9 місяців тому

    do you have any videos on creating a coin on different block chain network or all of the are the same?

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому

      So far I've only done Ethereum, but the code would be the same for any EVM-compatible chain (such as Polygon). You would just create a network config specific to that chain in the Hardhat config file and then target that for your deploy. For something like Solana it would be totally different code and process though.

  • @katour001
    @katour001 Рік тому

    i just want to say thank you You are a Hero

  • @spadanaco.638
    @spadanaco.638 10 місяців тому

    Hello. How to do that on iPhone? Does that work? Not sure why but whenever I get on remix I get an error message.

  • @officialjobsdekho5426
    @officialjobsdekho5426 Рік тому +1

    bro which code editor should I use to install hardhat? I am not familiar with visual code. If you can make a video about visual code for deploying the contract it would be easy to understand.

  • @VUVANDUNG22
    @VUVANDUNG22 2 місяці тому

    i have error please help me : Should set the max capped supply to the argument provided during deployment:
    TypeError: Cannot read properties of undefined (reading 'formatEther')

  • @jaspaw.5473
    @jaspaw.5473 Рік тому +1

    Am getting an "import error" on my code which I don't know how to solve. I downloaded your source code and it is giving me the same error.... I have a feeling that something with my visual code IDE is not right. ,Could someone please help me with this, it's been stressing me out for hours now. Thanks in advance.

  • @vaerube6670
    @vaerube6670 10 місяців тому +1

    thanks for sharing... hi sir @BlockExplorerMedia i got a question, when I perform the npx hardhat test, it shows "0 passing (1ms) ". I notice your terminal using is "node" instead of "powershell", is that the problems ?& how to solve it? 🙏

  • @noahcurry4510
    @noahcurry4510 Рік тому

    Around 15 minutes, we’re trying to deploy and run transactions but I keep getting a “false transaction mined but execution failed” it looks like it’s giving me an error pertaining to gas fees. Anybody know a fix?

  • @brenobertulucci134
    @brenobertulucci134 Рік тому

    on minute 53 i received this error on 3 last test function: TypeError: Cannot read properties of undefined (reading 'address')

  • @trihuynh5840
    @trihuynh5840 Рік тому

    Awesome thanks

  • @albechannel1
    @albechannel1 Рік тому +2

    Thanks a lot for this! Just a question: now that Rinkeby has been deprecated, would you suggest (to a newby like me…) how to use another testnet?

    • @shjndohjkaru
      @shjndohjkaru Рік тому +1

      you can using sepolia for same

    • @advikmarini
      @advikmarini 10 місяців тому

      Rinkeby has now been turned into Sepolia by the same company “alchemy” so I just went ahead and used the sepolia test network

  • @PulokPandit
    @PulokPandit Рік тому

    what will be the procedure to deploy it to main net and does it gonna cost me something ??

  • @prathikp4253
    @prathikp4253 Рік тому

    I am getting Error HH411: the library @openzeppelin/contracts, imported from contracts/..., is not installed. Try installing it using npm. Can you help me with this. I tried installing all versions but still throws this error when I compile

  • @jims7089
    @jims7089 Рік тому

    Great video, very informative. You were showing the ICHC token at the end of the vid, how much did it cost to implement, i.e. website costs, costs to deploy on mainnet etc?

    • @BlockExplorerMedia
      @BlockExplorerMedia  Рік тому +2

      I don't remember the exact costs tbh but probably $1-2k when it was all said and done. Most expensive was the ERC20 contract deploy, followed by the liquidity pool. Website costs $0 (Netlify). Also, I deployed the smart contract twice because I made a fatal mistake the first time! Of course deployment costs should be much less now. Hope that helps.

    • @PavedSoundRecords
      @PavedSoundRecords Рік тому

      @@BlockExplorerMedia What was the fatal mistake?

  • @ObscureOdysseys
    @ObscureOdysseys 10 місяців тому

    Alright so after a lot of debugging I actually got it to work on sepolia, what a great feeling!
    But, you never went back and taught us how to deploy on mainnet. Is it simply changing the infura endpoint link to mainnet link?

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому +1

      Yes, exactly. I pinned a comment to the top explaining. A lot of people have been asking this. Thanks!

  • @sirnawaz
    @sirnawaz Рік тому

    39:45. `block.coinbase`.. How does this field `coinbase` come from? Is it defined by (or related to) Coinbase Exchange? What is the type of `block`? Is it some `any` kind where arbitrary fields can be added by anyone?

  • @KCryptoYT
    @KCryptoYT Рік тому

    This is great!

  • @f_ftactics7928
    @f_ftactics7928 Рік тому

    for me somehow the initial balance is zero in my truffle test. I did use _mint function. Any ideas why? Thanks.

  • @SoftWorkDotNg
    @SoftWorkDotNg Рік тому +1

    The correct link contains a subdirectory "blob", that was what you missed.

  • @indiuma
    @indiuma Рік тому

    still get solidity version error tho it matches to hardhat file doesnt compile

  • @samrahul1993
    @samrahul1993 6 місяців тому

    when ever im tring to do npm init.. its giving me an error npm :
    The term 'npm' is not recognized as the name of a
    cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that
    the path is correct and try again.
    At line:1 char:1
    + npm init
    + ~~~

  • @williamchen8368
    @williamchen8368 11 місяців тому

    I am trying all on your steps, but i am stuck at the contract RTXToken is ERC20 {....sadly i cant compile with success.

  • @TopMutt
    @TopMutt Рік тому

    Does this tutorial cover whole process from start to end in complete?

  • @guillermobeitler5147
    @guillermobeitler5147 10 місяців тому

    I think you do an amazing job with your content. Do you have a class where you teach blockchain? I would pay to learn if you teach a course.

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому

      Thanks, I appreciate it! I don't have any courses at the moment but I've been thinking about creating one - will let you know.

  • @jamesluiz3889
    @jamesluiz3889 Рік тому

    I think I can't transfer the tokens to another address, the transaction keeps failing

  • @SuryaVino
    @SuryaVino 3 місяці тому

    at 44.35 you dont have artifacts folder and then 44.41 artifacts is shown here how

  • @HexElement
    @HexElement Рік тому +3

    Hey bro I have a quick question. This is my first crypto Im messing around with and am a total noob. When it comes to the Capped supply vs the Max Total Supply, I want to own 80% of the token and have 20% on the market. I put the cap amount at 10 mill and my amount to send the owner 8 mil. Does this mean there is only 8 mil in existence and 2 more mil can be minted.... Or does it mean that 2 mill can be bought and or minted? I need there to be a max supply of 10 mil and 2 mil of that is ready to be traded by the public, but etherscan is only showing 8.
    I know this is a crazy noob question, but I appreciate your time bro! Awesome tutorial!

    • @BlockExplorerMedia
      @BlockExplorerMedia  Рік тому +3

      hey Hex - great question. so for the tokens that you want to make publicly available on the market, those should go to your wallet first (at the time of contract deployment) and then you would transfer those tokens from your wallet into liquidity pools, for example on Uniswap, to be made available for trading. the remaining 20% left unminted could be for miner rewards or any other utility that you can think of. at least that's how I've always done it. some tokens don't have any kind of time-based minting or mining rewards. so at the simplest, you could send yourself 100%, provide 20% of that as liquidity and keep the remaining 80%. hope this helps.

    • @HexElement
      @HexElement Рік тому

      @@BlockExplorerMedia You just saved my life! Thats exactly what I was wanting to figure out. Thank you man, you got a subscriber!

    • @BlockExplorerMedia
      @BlockExplorerMedia  Рік тому

      You bet - thanks!!

    • @franklinokafor3229
      @franklinokafor3229 10 місяців тому

      ​@@HexElementcan you guys teach me i will pay.

    • @Globetrottersz1
      @Globetrottersz1 10 місяців тому

      @@BlockExplorerMedia a quick one, have compiled as successful unfortunately on. Js test have only managed 3 passing and 4 failing. Where might I be wrong!!?. Thanks in advance

  • @SchnubiMedia
    @SchnubiMedia 10 місяців тому

    Thanks for that Video
    How can i Pic Tax fees in this Contract?
    Thanks

  • @kruzoty929
    @kruzoty929 3 місяці тому

    hello, how i can add a web site and a twitter account to my contract erc20 ? a specifical code lign ?

  • @UCHIHA587
    @UCHIHA587 Рік тому

    successfully create i send my coin for your address thanks for the great video .... and

  • @user-gr7ff2kz5c
    @user-gr7ff2kz5c 9 місяців тому

    Hello thank you for the video, how can we deploy to main net, can you help with the configuration?

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому

      I pinned a comment to the top of this video explaining how. Let me know if you have any other questions.

  • @hiyutup8541
    @hiyutup8541 Рік тому

    how can ı reach full documentation for test hardhat ?

  • @bearsbestanimals
    @bearsbestanimals Рік тому

    Hello, how do I add a picture to the token?

  • @mikelac2
    @mikelac2 Рік тому

    Will this work with prc-20?

  • @kirazami2282
    @kirazami2282 Рік тому

    Hi Rinkeby test network has been deprecated, any solutions ? Thanks

  • @EclipseEgg
    @EclipseEgg 4 місяці тому

    will you get in trouble if you don't include MIT license statement?

  • @opionetics
    @opionetics 3 місяці тому

    whats the block reward for?

  • @MarketMasteryMedia
    @MarketMasteryMedia Місяць тому

    How can I set Buy and Sell Tax 5% on my token? Could you help me?

  • @jiaxunhoa4274
    @jiaxunhoa4274 Рік тому

    how much gas in ether did you pay for this creating of erc20? Amazing tutorial!! I really like it.

    • @BlockExplorerMedia
      @BlockExplorerMedia  Рік тому

      I don't remember exactly but the fee for deploying to testnet is nominal, and uses test Ether only. Deploying to mainnet will be more expensive.

    • @CharlesBLim
      @CharlesBLim Рік тому

      @@BlockExplorerMedia how about BEP20 is it the same with Erc20 in terms of the cost of deploying to the mainnet?