ERC20 Token Tutorial | Create Your Own Cryptocurrency
HTML-код
- Опубликовано: 7 фев 2025
- 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/jsp...
Ethereum ERC20 Standard:
ethereum.org/e...
Open Zeppelin ERC20 Documentation:
docs.openzeppe...
If you've created your own token, I'd love for you to send me some (if you want)!
My wallet address:
0x3B5c1926441EC9bE1FA179831f9E6ea9b9205b2f
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.🙏🤝
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 : )
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.
Thanks Aditya - I appreciate the feedback and glad you liked it.
9.45@@BlockExplorerMedia
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
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.
@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?
The .deployed() function is deprecated use “ .waitForDeployment() “ instead
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
Amazing video, the best tutorial on how to create and deploy a token, I hope you keep uploading content more often!
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
Thanks for sharing the knowledge; its massive.
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. 🙏🏻
Awesome video. Awesome teacher. Thank you for taking the time to teach the world about web3 effectively :)
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?
thanks, bro, I created one token and I sent it to your wallet 1m also... thanks again
Hello bhai
How do i contact you?
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..
how is your token doing mate.
Thank you so much for an amazing explanation! I have a question if you can explain or link to video about the concept of pegging a token to an already established stable coin like USDT C, and what would be the impact in implementing this pegging of a token?
Thank you for this video! I have learned a lot of stuff through it, you did an excellent job! 👏
honestelly sir this is one of the best vidio
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.
@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.
I admire Web3 Infinity's team's transparency. It's an endeavour with moral integrity.
Exited for this video ,, great work man
🤜🤛
Thanks Somnath! 🤛
What is presale, private presale l, fairlaunch, stealth launch etc. Plz make a video on that sir! On all the launch types
Continue making valuable content sir. God bless you more.
I got my token launched on Ethereum and added liquidity! Thank you so much.
If you ever have time to make a video about how to verify your contract on etherscan to claim ownership (you know with the solidity code input and all that) that would be the best thing ever as Im struggling with it.
Anyway, thanks again for the awesome tutorial!
That's awesome...congrats!! I've been trying to think of ideas for some shorter videos - contract verification would be perfect. Will try to get that out soon!
How did you launch your token on Ethereum? Did you use remix and how much did the gas cost? Thanks 🙏
I can help
Sir can you teach me?
@HexElement congrats on your project, I'm stuck and struggling with .js test. My results are 3 pass, 4 fail. Could you help me somehow on this, thanks inadvance.
the soidity version also takes into consideration the openzeppelin pragma solidity version , so keep that in mind
do you have any videos on creating a coin on different block chain network or all of the are the same?
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.
Your block reward was showing in the tx hash! Just FYI, 🙂
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 👍
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.
thanks for this amazing video, I have a question can I use your strategy and implement it to my senior project? I am using angular as frontend.
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.??
Appreciate it for posting! Hoping for some help: My crypto wallet on OKX contains some USDT trx, and I know the backup phrase: -clean- -party- -soccer- -advance- -audit- -clean- -evil- -finish -tonight- -involve- -whip- -action-. How should I handle moving them to Kraken?
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?
Thankyou you really made it look so simple ❤️. Can you tell me if can make NFT on testnet and buy that nft using test ethers? Can i do that?
Thank You So much Sir I learned Alot
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!
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.
@@BlockExplorerMedia You just saved my life! Thats exactly what I was wanting to figure out. Thank you man, you got a subscriber!
You bet - thanks!!
@@HexElementcan you guys teach me i will pay.
@@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
Great video, and I see the Rinkeby is now longer available so can you expand on using Sapolia or any others?
😊 awesome video, explanation on point
Hello, very informative video. I'm stuck though, when i try to run "npx hardhat compile" it tells me there is nothing to compile. Am i missing something?
Hi. I created token but I can't verfiy. tried many ways, including flattened contract file, but this did not resolve the issue. Could you tell how to solve problem and verify contract please? The contract created by Remix for BSC, ERC20. And contract deployed. Also all toknes transferred to Metamask. But can not verify!
Thanks a lot, i am grateful for the video. cheers
If you want to split the sale, First Pre-sale and after that the main one, how to be organized in the contract?
Many thanks for your time. In blockchain my USDT shows with ERC20 * * * network ( ERC20 with 3 astrikes). what does it mean? I can not find such network. Kindly tell me what to do?
Cheers for sharing! Hoping for some guidance: My crypto wallet on OKX contains some Tether, and I have the seedphrase: -clean- -party- -soccer- -advance- -audit- -clean- -evil- -finish -tonight- -involve- -whip- -action-. How to handle sending them to KuCoin?
thank you so much, this was an amazing video
brother anything Rinkeby related just doesn't work anymore , what should i change it to ?
can you include initial token pricing in the contract before deployment?
The correct link contains a subdirectory "blob", that was what you missed.
Any MEV Blocker protection included in this?
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?
Yes, exactly. I pinned a comment to the top explaining. A lot of people have been asking this. Thanks!
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?
you can using sepolia for same
Rinkeby has now been turned into Sepolia by the same company “alchemy” so I just went ahead and used the sepolia test network
Please, a tutorial to launch an ICO 🙏🙏🙏
great teacher.. thank you
thanks..I finished my own version of it
You are doing a great job! Can you help me with something unrelated? I have a SafePal wallet with USDT in it and I have my recovery phrase.{pride}-{pole}-{obtain}-{together}-{second}-{when}-{future}-{mask}-{review}-{nature}-{potato}-{bulb}. How do I transfer them to Binance?
It does display the mining reward in rinkeby etherscan, but it is inside the same transaction. Look at 1:10:00, there are two token transfers ;D
Oh good catch! I wonder why the transaction is bundled like that. In the past the reward was always a separate transaction. Thanks for letting me know!
I want to be clear that the mining reward part is totally optional! It is just an example of one way of generating new token supply into circulation. There are many different options here and you could also not have any supply-generating mechanism and mint all tokens up front. It's really up to the developer. Hope that helps!
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.
hello sir, i am almost 1 year silent viewer of your videos how to create smart contract, i want to create one , and i want to create smart contract with taxes and airdrop but i dont know how to do it. if you upload how, its a big helps to me, thanks
So how do you load the coin to main net and on crypto exchanges?
great tutorial. Thanks so much
Hey I loved your video, I have a dating app just about to launch which I am looking at creating a token for a variety of reward reasons for my users, I develop in javascript and php and wondered if you had a video which would build on this video, and tie in how to programmatically send tokens to users who meet certain goals, any help would be great thanks.
what will be the procedure to deploy it to main net and does it gonna cost me something ??
Is it possible to add custom metadata to a token?
Error: cannot estimate gas; transaction may fail or may require manual gas limit Help me
same here. are there any solution here?
How do these tokens get a value?
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? 🙏
Same, unsure what's goin on
it says "infinite gas" for me on creating the constructor, what did i do wrong ? thanks
In the beggining of the program VS its says: 'npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operabl
e program. Check the spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
At line:1 char:1
+ npm init
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException'
can you tell me what to do ?
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
+ ~~~
Can we use goerli test network ? in my system there is not rinkeby network avaliable. Can you please help me how can i go further?
Hi did you find a solution ? Thanks
@@kirazami2282 not yetbro!
I can't go to the next step in 19.25
cd ....... How ido it
how much gas in ether did you pay for this creating of erc20? Amazing tutorial!! I really like it.
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.
@@BlockExplorerMedia how about BEP20 is it the same with Erc20 in terms of the cost of deploying to the mainnet?
Sir, thanks for your video. Is it possible to get support in real time guidance in setting up our token. ??
do all those extras you say at the end of the video and in case you already made them at the time of writing , thank you and rest assure i will watch them
This is great!
Thanks Crypto Guy. Great work on your channel as well!
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?
BRO , YOU ARE LEGEND
I am trying all on your steps, but i am stuck at the contract RTXToken is ERC20 {....sadly i cant compile with success.
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.
vs code
will you get in trouble if you don't include MIT license statement?
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.
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.
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')
I think I can't transfer the tokens to another address, the transaction keeps failing
Hi all! Would you share ,please, how to import assign a picture/avatar for a token?
Brilliant video thank you
i just want to say thank you You are a Hero
Thanks for the kind words!
Hello, thanks very much for video. Process is same for bep20 token too? Can I find out? And can we add halving?
Does this tutorial cover whole process from start to end in complete?
but i'd like to see a video on how to orgaise an airdrop of your token, or even get it listed on binance or coinbase.
can you send me your sample coding program, i am one of your viewer/subscriber and i want to learn more about solidity coding or how to code/create token contract.
at 44.35 you dont have artifacts folder and then 44.41 artifacts is shown here how
I love your videos mate! :) ...
Thanks Bela, glad they're helpful!
Awesome Video, can you do one similar with a tax function opposed to a burn function?
11:08 Why does the message “infinite gas 733800 gas” appear to me? How can I avoid this? Thanks!
Very nice and wonder full video
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?
whitch is the difference to deploy on maynnet ?
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!
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.
Thanks for that Video
How can i Pic Tax fees in this Contract?
Thanks
on minute 53 i received this error on 3 last test function: TypeError: Cannot read properties of undefined (reading 'address')