Create Your Own Memecoin & Sell It On Uniswap

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 268

  • @ismailhaider
    @ismailhaider Рік тому +7

    Right time for the video. Subscribed.

    • @coinlisting_net
      @coinlisting_net 4 місяці тому +1

      Have you crafted your own blockchain asset?

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

    I had this problem when publishing the contract
    This contract may be abstract, it may not implement an abstract parent's methods completely or it may not invoke an inherited
    contract's constructor correctly.

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

      Sounds like you need to switch the contract you are deploying from ERC20.sol to MyToken.sol in Remix
      There's an option on the left hand side. It changes back and is a bit annoying if you change other sertings

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

    Please do Pulsechain, i tried this but it does not work thanks.

  • @Letssendit
    @Letssendit 4 місяці тому +1

    Wonderful. You are rare to find

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

    Yay I’m 100th to comment, great work James, this has been very informative.
    Just a question, as the ratio is pegged 1:1 to ETH or MATIC, how would I create a pairing of eg. 10000 Memetokens is 1 ETH or MATIC, I’ve been banging my head for a bit to figure this out… thank you

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

      You can just change the starting price. Easiest way to do this is to set up a pool on testnet first using app.uniswap.org Get the pricing right on there and then copy the sqrtPriceX96 value from the tx (decode the input) in a block explorer.
      Can also work it out manually and @smartcontractprogrammer has a good video about how to calculate it based on the desired exchange rate

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

    hello @JamesBachini
    Thanks for the informative tutorial.
    Nevertheless, While trying to test the contract it only succeeds once and fail thereafter due code on line 52
    Can you please confirm the issue and propose a fix?

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

      Line 52 is setting up the liquidity pool. Are you deploying it on a network that has Uniswap v3? Deploying locally won't work for example

    • @moyoutube-q3b
      @moyoutube-q3b Рік тому +1

      @@JamesBachini Its deployed on Eth Goerli testnet, for some reason it deploys the first time. Upon changing the contract a bit and trying to deploy again it errors. I suspect this is due the token0 name been already pooled? I didnt test this yet and need to see if this is the bottleneck. On another note upon the first deployment the liquidity addition also faulted and didnt know why yet

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

      @@moyoutube-q3b it should deploy a new token each time so there can't be a liquidity pool setup. Maybe try it in remix?

    • @moyoutube-q3b
      @moyoutube-q3b Рік тому

      @@JamesBachini I do it in remix and indeed it must create it from scratch every time, yet its not working for some reason. I also noticed that it wasn't me alone who is having this issue so definitely there is something ought to be missing

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

    If possible can you add blacklist function like pepe did to avoid other to buy max quantity ?

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

      Pepe contract is open source so you can just copy it from there

  • @ShubhamSingh-mn7yj
    @ShubhamSingh-mn7yj Рік тому +1

    Great tutorial James!!!! But, how can we add or change the logo of our memecoin?

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

      The logo is not part of the smart contract and each service that displays a logo is different. So for Metamask for example Google "add erc20 logo metamask" and there will be some frontend code that will implement it

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

    How do I view the cryptocurrency source code of the Solana network? If I take the code of a certain cryptocurrency from the solana network, is it possible to manipulate and create my crypto by changing some parameters? If how do I do this procedure?

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

      The block explorers are different on Solana but you should find the code in the projects GitHub repository

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

    Great video thanks.
    I created a token but screwed up the liquidity.
    I am confused how to correct this and how to launch for sale...

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

      Do you want to send me the code and I'll take a look? Email is in the about section on UA-cam

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

      @@JamesBachini thank you

  • @berkant.35
    @berkant.35 8 місяців тому

    I have a promising project in mind and I want to realize it, but I have a question. Can we increase the supply after creating this token? So it's like printing money

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

      Not by default but you can add an owner function to the contract before you deploy it which allows a single wallet to be able to mint new tokens

    • @berkant.35
      @berkant.35 8 місяців тому

      @@JamesBachini Thanks!

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

    it say: execution failed.
    visible tokens: 0
    why?

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

      Something failed in the transaction, hard to guess what without anything to go on. Perhaps check if there was an error code and Google it

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

      thank you vm!
      is thre a way to generate like 1'000'000 coins which are then depositet directly into Metamask? that we can control all the supply? at the moment that just like a copy of matic with another name (if im not wrong)
      @@JamesBachini

  • @RWoolf-jq9fz
    @RWoolf-jq9fz Рік тому

    Nice video, any chance of making a rebase token video, I'm intrigued how they keep track of user balances

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

      Simple tutorial here: medium.com/coinmonks/solidity-tutorial-simple-tax-token-fd08bf90f351
      For production code I would take a look at some of the tokens trading on Dextools and check their code in Etherscan

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

    Great video, o was playing with standard erc-20 token, and i was asking myself how automate the insert into liquidity pool! the only thing i don't undestand is this, if i keep for me a 5-10% can i still create a oneside liquidity pool? make no sense to me... i could just sell it to uniswap and have free profit... how do uniswap handle it?
    thank you very much

    • @JamesBachini
      @JamesBachini  9 місяців тому +1

      Think of it like two buckets of tokens on a see saw or balance and to take funds out of one bucket you need to add it to the other one. If you create a one sided pool, one side of the pool has lots of tokenss but there's no base asset like USDC so you can't sell it for profit. If people buy the token they add USDC and take out the tokens. This creates a double sided market for buys and sells.

    • @Kryonnnn
      @Kryonnnn 9 місяців тому +1

      @@JamesBachini ok, so if none buy, i cannot sell it! Make sense! Thank you again!

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

    Thank you sir,please i have one question , howthis contract can be benefic for adopters? Thank you

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

      People who buy at the start only have upside. Early adopters have a no risk bet because price can only go up if the entire supply is on Uniswap noone has any to sell at the start

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

      Thank you sir, i kept it for my project,this was what i thought, sorry bro,i am kind of very old school :) i was a dev in 99 ! and came back last year to the web3 with a web4 project and it's very hard nowadays.

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

    How do we know the price for our meme coin? Where do we need to set the price ?

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

      It's set in the sqrtPriceX96 value. You can calculate it manually or set up the pools how you want on testnet first and then copy the values across from a block explorer (decoded input at bottom of tx)

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

    Hi , please Sir can you explain me your comment " When someone buys the token it adds the base asset to the other side of the pool which creates exit liquidity for anyone looking to sell their holdings. The liquidity provider receipt (NFT) is held by the token contract so it can never be used to remove liquidity." . Many thanks

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

      That is just explaining how Uniswap v3 works when someone makes a swap

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

    On line 36, how would we modify this to the Ethereum mainnet?

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

      address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
      Full list of wrapped native tokens at the bottom of this page: docs.uniswap.org/contracts/v3/reference/deployments

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

      Did you get a gas estimation error? I got an error after changing this. I also increased the total number of coins to 1.8 trillion ** 7 ** decimals and when I sent the project it said gas was $147, can you help me fix that, please?

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

      @@jocajoshy on Ethereum mainnet that sounds about right. Gas estimation error just means the tx is failing. Likely because of a bad token contract address for weth or deploying it to a local testnet where there is no Uniswap.
      Try it on Goerli testnet or Polygon first to make sure everything works as expected before you deploy to mainnet where gas fees are more significant

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

      @@JamesBachini Hi James - Okay, I did it on MetaMask ETH

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

    So do you have to do coding to make a meme coin? And add ethereum, or other crypto to it

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

      It certainly helps. A memecoin technically is just code in a smart contract

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

    Hello, I saw in metamask you swap MATIC with MyMeme. How we can do it with ETH?. Cant we use ETH contract? Currently its on Polygon right?

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

      Yes it's on the polygon which has MATIC as the native token. For Eth it would be better to deploy it on Ethereum mainnet or an L2 like Arbitrum that also uses Eth as the native asset

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

    From the script you provided, I only changed below:
    1) address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    2) uint supply = 10_000_000 * 10 ** decimals();
    3) unit160 constant sqrtPriceX96 = 77371252455336300000000000
    and it says execution failed.... do you have a guess on why?

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

      Probably as you adjusted the price you would need to adjust the ticks

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

    When I attempt to compile it just spins forever. Did I do something wrong? 🤔

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

      Strange, perhaps try clearing the browser cache and reloading remix. Never seen that before. If all else fails you could try using hardhat or foundry which do the same thing and are command line tools

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

      @JamesBachini I'm not sure what the cause was, but I was able to get it to work. This was a fun project for me to learn more about codes and how crypto works.
      Thanks for the info in the video! Also, your response to questions here in the chat were also extremely helpful. I definitely subbed. 🤙

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

    You are a great teacher, much appreciated.

  • @LateefAminu-i8p
    @LateefAminu-i8p 8 місяців тому

    Mr. James thank for all the effort you put into this video session, am sorry i have some difficulties while trying to swap the tokens with my testnet matic, i think the problem is coming from uniswap can you please kindly another way we can use to swap our tokens i look forward to for your msg soon thank you

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

      Not much to go on. Are you getting any errors when setting up the liquidity pool on Uniswap. Perhaps try minting msg.sender the tokens first and setting up the pool manually to start with

  • @bernardyard-tv5uk
    @bernardyard-tv5uk Рік тому +3

    hey @james bachini, thanks a lot for the video.
    i have a question and hope you can help out. If i try to create mymeme with a ratio of 500:1 matic it doesnt work in uniswap upon swaping and always give a price impact error. no matter how i create the sqrtx96 with any ratio it never work except for 1:1. i fixed the ticks for 3000 fee too.
    do you have any idea why it doesnt work with ratio other than 1:1?

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

      It will do you just need to get the tick bounds right. What I'd recommend is setting it up manually first on Goerli using app.uniswap.org then opening up the tx in etherscan. Go to the bottom and decode the input data. Use that in the contract and you should be good. Hope that helps

    • @bernardyard-tv5uk
      @bernardyard-tv5uk Рік тому

      @@JamesBachini Thanks for your attention. I Spent most of the day working as you suggested with no avail. I would appreciate if you can give me the correct working ticks and sqrtx96 values for 500:1 ration of mymeme/matic ❤

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

      @@bernardyard-tv5uk did you get this one working? I’m banging my head as anytime I change the ratio value, uniswap says that slippage is above 99% 😂 also it keeps erroring when I change the value of my fee to 3000, even though I changed uint value as well 😢

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

      @@RichReflectionz Did you happen do sort this out? :)

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

      Another month later, did you figure it out? Im looking to have 1:1000 ratio

  • @portall1220
    @portall1220 5 місяців тому

    Hi, James! Hope you're well. I'm trying to do what's in your tutorial, but the Mumbai testnet and Goerli are deprecated now and have been replaced by Sepolia. The problem is, I can't find the wrapped native token address for Sepolia WMATIC, there's only one for WETH in the Uniswap docs. Generally it seems that I can't use Sepolia in the same way you would use the Mumbai address for deployment in the contract you wrote. I'd like to follow your steps and complete everything using only Remix, but it seems that's impossible now with the method you used. Is this correct, or is there still a way? Your method of deploying the token straight to the testnet through 'address constant weth' is simple and I don't haveto play around with hardhat etc. Any advice would be much appreciated, as learning Hardhat is a much harder process that I'd like to avoid if possible. Cheers!

    • @JamesBachini
      @JamesBachini  5 місяців тому

      Yes you should be able to use Sepolia, check the contract addresses for tokens and router in the uniswap docs and yes use weth rather than wmatic

    • @portall1220
      @portall1220 5 місяців тому

      @@JamesBachini Thank you for responding! So if I want to use your method, I can't really pair my token with WMATIC like you did (unless I deploy to mainnet for testing) but test it by pairing it with WETH, because only WETH has an address on Sepolia like WMATIC had on Mumbai? Will the trade testing I'd do on Uniswap with WETH be transferrable when I deploy my token to the mainnet pairing it with WMATIC, though?
      Did some reading, and it is advised to test with the same currency I'd be pairing the token when launching on mainnet. Is this correct or does it really not matter when it comes to functionality and contract logic?

    • @JamesBachini
      @JamesBachini  5 місяців тому

      ​@@portall1220 For each Uniswap deployment there will be a native asset. For Polygon this is wrapped Matic and on Sepolia it is wrapped testnet ETH (WETH).
      As far as I'm aware these two tokens will function exactly the same so you can test with weth on Sepolia and then switch over to wmatic when you are ready to deploy on mainnet.

    • @JamesBachini
      @JamesBachini  5 місяців тому

      There is a list of contract addresses in the Uniswap docs. Here are the ones for Polygon docs.uniswap.org/contracts/v3/reference/deployments/polygon-deployments
      Wrapped native tokens at the bottom

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

    JERRY INU DONT SLEEP ON IT BUY IT AND HODL NOW!!!!!!

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

    will this be listed on dextools
    when u launch it

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

      I'm not launching anything, just a demo

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

    im not really a coder, but i understand most of it. im trying to understand what the exact code would look like if i needed to keep 5% of the token to stay with the team and 95% to the liquidity pool. im not sure how to use the _mint function per se

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

      Put this in the constructor function
      _mint(amount,msg.sender);
      Amount needs to include the decimals. The msg.sender part will mint them to the wallet address that deploys the contract.
      You'll need to add the new token contract address to Metamask to see the tokens.
      Try to keep the amount going to Uniswap the same or it will get complicated.

  • @gfx.8848s
    @gfx.8848s Рік тому

    Cool how to add burn method & what if we want to hold 5% token for community airdrop l or marketing rewards how to add that function ?

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

      Just mint some tokens for yourself in the constructor argument in addition to the main mint. There's an internal _burn function in the erc20 library. You can use this as you see fit.

    • @Dan-et4mz
      @Dan-et4mz Рік тому

      @@JamesBachini Can you share an example of this code? I've attempted it but I think the price is messing me up.

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

      @@Dan-et4mz _mint(msg.sender, supply / 20);
      _burn(msg.sender, amount);

    • @Dan-et4mz
      @Dan-et4mz Рік тому

      @@JamesBachini thank you!

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

    hey so when you bought the mymeme using Matic the value was 1 MyMeme = 1.00051 Matic but when you sold, it was 1 Matic = 1.00049 MyMeme. So effectively the value of 1 mymeme has dropped, right? but you said it has gone up. Am I getting this right or is this a stupid question?

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

      There was probably a tiny amount of slippage. The price goes up on buys and down after someone sells. If you buy and then sell the same amount the price will stay the same. Slippage is the effect that you get the worse price for the trade. So you get the closing price at which your order moved the market to. Hope that makes sense. It's a tiny amount on this but can get quite significant if trading early into small cap pools.

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

    this is a great one. However i did accordingly but when i triend to swap on uniswap, its saying Insufficient liquidity for this trade and its showing 0. please what mistake am i making.

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

      Did you call the addLiquidity function in the contract?

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

      yes, i did@@JamesBachini

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

    I was thinking. Is it possible to make this token using the INonfungiblePositionManager, IPancakeFactory, IPancakePair, IPancakeRouter02 interfaces, to do an automatic liquidity addition and burning?

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

      Probably. I think safemoon done something similar so might be worth checking their code and other memecoins on BNBchain

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

    Hey i have a question. Since the contract is 1:1 on the fair launched is there anyway we can calculate it for 1:10 or 1:1000

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

      Yes you will need to change the tick positions and sqrtPrice. What I'd suggest is doing it manually in the Uniswap app first then opening the tx up in a block explorer to get the correct values

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

    Hello Buddy! Great video 👏🙏 I'm having error when veryfing on Etherscan even with the flatten file. Have you ever verified it?

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

      Have you tried using a plugin for whatever framework you are using? i.e. hardhat, remix, foundry all have etherscan verification tools

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

    on line 35, is that number supposed to be your crypto wallet ID or not?

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

      No that is the contract address for Uniswaps Non-fungible position manager contract

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

    do know how to create an anti-whale mechanism so that the front running of bots on Uniswap don't happen... this has happened to a lot of coins at start... how to prevent it?

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

      Yeah Pepe had a function for that, like a blacklisting thing where the contract deployer can block addresses. Check their source code if you want to use it.

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

    Why Im not able to verify?

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

    I saw your video !! its really good

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

      Thank you

    • @S_B_SHORTS09
      @S_B_SHORTS09 5 місяців тому

      @@JamesBachini hello my doubt is -
      Can i create my own meme coin on solana and wait for a pump bit and sell the 50% of supply is that legal and can i eran this way? please answer my doubt..

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

      @@S_B_SHORTS09 You can certainly create a memecoin and sell some of the supply although if you are selling 50% then it's unlikely anyone would buy it or you would need to create massive demand to absorb that. Many memecoins have the full supply put into liquidity pools so there is no owner as such. Regarding legality you'd need to seek legal advice in your jurisdiction.

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

      @@JamesBachini thanks a lot man to clear my doubt ... u are the first person who literally cleared my doubt SUBSCRIBED UR CHANNEL keep it up :)

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

    so how does it work if we don't have to pair the liquidity? i mean we are creating a token and add it on uniswap without any money, people buy it and start to increase the price?

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

      Imagine you are putting one bucket of your tokens on one side of the pool and an empty bucket on the other side for Eth. As people buy the tokens the price goes up the curve and the Eth bucket fills up

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

    question if i created for i.e 10 billion can people mine it and it gets more than 10 billion ?

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

      No, people can't mine your token

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

    No one codes anymore

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

    With this approch would I still be able to collect fees on transations?

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

      If you create a transfer tax in the contract you can redirect a percentage of each transaction to a treasury wallet or something like that

  • @OvercameFStruggles-kailash
    @OvercameFStruggles-kailash 3 місяці тому

    Is everything without fees?

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

      On testnet everything is free. On mainnet there are transaction fees

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

    Also, is it effective to implement sqrtPriceX96 on line 40? What if the liquidity pool isnt large enough to account for a 1:1 trade. Or am I interpreting that incorrectly?

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

      You can price it as you please but bare in mind that you are providing only one side of the pool so there's no requirement for Eth/MATIC up front. The base asset gets added to the pool as people buy which provides exit liquidity. Because all the tokens are in the pool initially there's no need for sell side liquidity because there are no tokens in circulation to sell

  • @Dream-vu6bb
    @Dream-vu6bb Рік тому

    HEY I saw your video !! its really good
    Could you please share the code for ETH network
    Please confirm the 35th line address for eth network?

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

      Line 35 is the same
      Line 36 is
      address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

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

    It keeps saying that the gas is the transaction execution will likely fail due to the estimated gas being infinite. Do you know how I could fix this?

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

      Double check contract addresses in a block explorer. Weth needs to be changed for the Uniswap default one which are at the bottom of this page docs.uniswap.org/contracts/v3/reference/deployments
      Make sure you have some native tokens in the wallet to pay gas fees

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

    how would i do it on ether instead of polygon

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

      Hard to predict but deployment costs would be more expensive, probably in the hundreds of us dollars. Ethereum mainnet has a higher perceived value though so depends what you are doing.

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

    how to change the price to make 1 matic gets 100k token?

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

      Mint the tokens to msg.sender set it up manually is the easiest way without diving into tick prices

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

    is this deployable on Binance Smart Chain ?

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

      Change weth to wBNB and Uniswap to Pancakeswap and it should be good to go, test it on testnet first

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

      @@JamesBachini subscribing now.

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

    Can you deploy on Base?

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

      You can buy addresses will need to be changed

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

    why does your contract oly cost 90 cents to deploy, mine costs 190 dollars

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

      Because I deployed it to Polygon which has cheaper transaction fees than Ethereum mainnet

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

    how can this benefit me as a owner? how do i get control of my token if its listed on uniswap?

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

      The idea is to create a permissionless token with no benefits or privileges for the owner ... But you can always mint some tokens for founders, team, investors or dao in the constructor function

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

      @@JamesBachini how do i mint?

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

      @@TrushieldOfficial the token is minted in the constructor function when you first deploy the contract

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

      @@JamesBachini i know but i when i click add liquidity then all my token get sent to uniswap how do i generate more token?

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

      @@TrushieldOfficial use the _mint function, check openzeppelins erc20 docs if you need details on the spec

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

    Hi James! When deployed, I confirm the transaction in the polygon network, but I get a pending warning in remix and metamask. And it never gets processed.Why?

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

      Hard to say without any error code or something to go on. Did you change the weth address to wrapped matic?

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

      @@JamesBachini Yes, I changed it, but I get vm error and push0 error in remix ide. You tried all versions but the result is the same. I do not want to tire you too much on this issue, so I ask you to share the site where I can solve these errors. Thank you. Have a nice day.

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

      @@JamesBachini "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
      Returned error: invalid opcode: PUSH0
      OR the EVM version used by the selected environment is not compatible with the compiler EVM version."
      This is the error I get and it says evm:shanghai in the deploy section, but I can't change it in any way. Even if I send it to Metamask after the above error occurs, the distribution process does not occur.

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

      @@CryptoMatrxmaybe try debugging the transaction in tenderly

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

      @@CryptoMatrx it sounds like you are deploying it locally which wont work because there isn't a local version of Uniswap and weth

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

    Friend, could you show me how I can add a fee only when there is a token sale?

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

      Best way to change it from a fair launch to a profit generator would be to mint the msg.sender some tokens too. They can then sell into liquidity as people buy

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

      @@JamesBachini Let me take advantage and ask one more question. How do I make token price 1 = 0.000005 BUSD?

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

      @@JamesBachini Thank you for your attention my friend. I tested your contract on the Mumbai network and it worked correctly. When I went to test on the smart chain network - testnet an error occurred, I could not deploy. What do I need to do to be able to deploy it on the Smart Chain-testnet network?

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

      @@Stateofdinosaurs take a look at this video by @smartcontractprogammer which explains the price calculations
      ua-cam.com/video/hKhdQl126Ys/v-deo.html

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

      @@JamesBachini I made some changes to your contract can I send it to you to see if I did it correctly? is there any security flaw? For example, in the way I changed it, could you launch it on the production network and negotiate? I will send the changed code to your email.

  • @moyoutube-q3b
    @moyoutube-q3b Рік тому

    @James Bachini it seems that if we do the pool as the same transaction of the ctor it fails, i extracted pool creation, supply approval and minting each into its Ownable function. Pool creation and supply approval worked flawlessly. Yet the minting into the pool fails with gas estimation errors and there is no way around it. Do you have an idea why is this happening?

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

      I had the same issue with the constructor argument. My best guess is that it's because Uniswap deploys a pool contract when you first set up the pair and you can't add liquidity in the same block. Might be wrong on that.
      Double check contract addresses and perhaps get the standard code working on Goerli first and then work back from there to isolate the issue?

    • @moyoutube-q3b
      @moyoutube-q3b Рік тому

      @@JamesBachini Thanks for you interaction.
      I had the code work after extracting the functions except for Minting which is still faulting and reverting, i tried it over on Mumbai, Goerli and BSC testnet, all worked and deployed a contract, added pool and approved the supply except for Minting the supply to the pool kept failing. I, ofc researched about the subject and most of it indicated an issue with ticks and ticks Spacing.
      I would appreciate if you had a suggestion how to get the tickSpacing and calculate accurate ticks according to the fee (in solidity)

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

      @@moyoutube-q3b it's a bit of a long topic to cover in the comments. I'd recommend having a read of the Uniswap docs and maybe searching GitHub for code that is similar to what you are trying to do.
      Have you tried setting tickLower to -887270 and tickUpper to 887270?
      This will be full liquidity for a 500 fee pool.
      When fee changes the tick size changes so you can adjust the upper and lower values above. Round them to 887200 for example.
      There's also a library called TickMath.sol which might be useful if you are doing more concentrated liquidity positions

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

      @@moyoutube-q3b 0.3% == 60 tick spacing, 0.01% == 1 tick spacing, 0.05 == 10 tick spacing, 1% == 200

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

    Sorry friend, I'm going to disturb you once again. This example you created stopped working after the solidity update in the ERC20 contract. Could you check?

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

      The update to OpenZeppelin requires msg.sender to be passed into the constructor argument of the ownable function

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

      Yes, I did, the contract compiled and was able to deploy. However, when calling the function to add liquidity, it gives an error. I do not know what is happening. Could you make a new video updating the contract? please.@@JamesBachini

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

      @@Stateofdinosaurs did you change the supply amount going to Uniswap? I don't think it's an issue with the solidity update as it's not ownable

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

      I didn't change the supply@@JamesBachini

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

    How did you make 1 of your token worth $1 in matic?

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

      I set the price when creating the liquidity pool

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

      @@JamesBachini And can you make a profit by selling all the tokens you have?

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

      ​@@chaayino1766you need a buyer if you want to sell tokens. So you can't just set a price and sell a million tokens unless you have someone willing to buy them. You can only take liquidity out of the pool equal to what is put in

  • @4fins
    @4fins Рік тому

    How do you add a symbol?

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

      Like a logo in metamask? support.metamask.io/hc/en-us/articles/360059582151-How-to-add-a-token-logo

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

    How much does it cost to make one of these tokens?

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

      If you can do the dev work yourself then it's just a gas fee for deployment. On ethereum mainnet this can get expensive, up to $1000 during peak congestion times. On other chains deployment costs can be as low as $1. Then there are marketing costs, websites, socials, advertising etc.

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

      Which chain did you use in this video? It looked pretty cheap from what I saw

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

      @@alexlaudano8644 I think it was polygon, tx fees are so low it's like a permanent testnet for ethereum

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

    Hi, what happens if I change the square root price within the code?

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

      You will need to recalculate the tick positions when adding liquidity

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

      @@JamesBachini My token is now deployed on Uniswap. However, it does not seem to be very visible and can only be accessed with the swap feature on the DEX. How can I "verify" my token to make it more visible to other users of uniswap?

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

      @@JamesBachini My token is listed on uniswap but only accessible from my personal wallet. How can I make it so that it is visible to everyone who uses uniswap?

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

      When I try to look up my token on uniswap, it doesn’t come up. Do I need to verify the contract on etherscan before it becomes visible on uniswap?

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

    So learning solidity language is mandatory for making a solid meme coin?

    • @JamesBachini
      @JamesBachini  9 місяців тому +1

      A memecoin or any token is essentially a Solidity smart contract. You can probably publish something simple without learning much but to add custom functionality etc you would need to use Solidity and have a understanding of it

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

    Does the owner of the token get tax from the other buyers?

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

      No there are no special privileges for the owner in this example. You could code in either a transfer tax or a token allocation for the owner if you wish

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

    Hi, do you take on paid work, am looking for a dev who can start a fair launch contract for us, we have allot of money coming in and just don’t want to make any mistakes thanks

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

      Sure, contact details are here if you want to send me through the details or get on a call
      jamesbachini.com/contact/

  • @r.achanels3393
    @r.achanels3393 Рік тому

    How to verivied contract??

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

      There's a plugin for this on remix and hardhat or you can do it manually. You'll need an API key for the block explorer

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

    I am trying to create 300Billiom supply but stuck. Do you have paid support?

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

      Just change the supply value on line 38 to:
      uint supply = 300_000_000_000 * 10 ** decimals();
      github.com/jamesbachini/Memecoin/blob/a44f4bada2fc58ade74db2fc303aec66b6162a14/contracts/Meme.sol#L38

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

      @@JamesBachini Thanks for quick response. You are the best.

  • @dollris4575
    @dollris4575 5 місяців тому

    i wanna buy your meme coin ??

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

    How does this pay you the creator?

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

      It's not designed to make a profit. Some people will add a team allocation of tokens or a transfer tax to compensate the dev work

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

      Thank you for your reply

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

      You should do a video on how a person can do this and make some passive scratch

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

    why im not able to verify

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

    Can this be done with BnB

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

      Yes it's BNBchain is EVM so the same code will work. Change Uniswap for Pancakeswap and chainId in the config

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

      @@JamesBachini thank you James

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

      Will it work the same on pancake swap ie you don’t have to add liquidity

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

      @@jd4k991 depends on the architecture. I have it in my head that Pancakeswap was originally based on Uni v2 but to have single sided pools you need concentrated liquidity which was introduced by Uniswap v3. I think there might be a deployment of Uni v3 on BNBchain if Pancakeswap doesn't support it

  • @OvercameFStruggles-kailash
    @OvercameFStruggles-kailash 3 місяці тому

    Hi sir, I have a meme coin idea for Indian buyers specially, it would make a huge impact if it goes viral on universal buying as well.but I am from non coding background.😢 Please help me.

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

      You can use the open zeppelin contract wizard to generate basic code for tokens. Might still be a bit of a learning curve so try it on testnet first

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

    that's too much mateeech for me

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

    Has anyone had any issues verifying this contract on polygon

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

      I have launched the contract but can’t verify it? 0x45116b03e9a8ede9a53167a83319ed1ae375f95e

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

      Did you change the weth address to wmatic?

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

      I did. When trying to verify the contract I have used the following settings. License mit - 0.8.18 and a single file then just copy and paste the contract in but it just keeps getting a error 🤷‍♂️

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

      James have you tried to verify the token you launched?

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

      @@jd4k991 yes it verifies fine on etherscan. Maybe try verifying on remix with the plugin?
      Actually that won't work on polyscan. What is the error?

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

    How we can make ETH/MyMeme ?

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

      Deploy it on Ethereum. WETH is just wrapped ETH which is an erc20 token that Uniswap can use. This is obfuscated a lot by the UI where Eth and weth are used interchangeably. Worth reading the weth9 smart contract if you haven't already.

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

      @@zoltyq869 don't forget to change the weth contract address to mainnet WETH. Deploy and then call addliquidity() and it will add all the tokens to Uniswap pool.

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

      @@JamesBachini makes sense, I'm relatively new to this, once the contract is deployed how would I go about calling the addliquidity function? Or is that where I just go to uniswap and add rhe liquidity?

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

      @@zoltyq869 no it's a function in the contract. If you deploy it with hardhat like in the blog post its actually done automatically as part of the deployment script. Try it on testnet first

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

      @@JamesBachini gotcha, for some reason when I try to add liquidity in goerli for the contract which has a 500,000,000,000 supply it's saying like 54,000 for the pool? Is that avoidable by having the add liquidity function directly in the contract?

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

    Hi, could you please give the code for bep20 and erc20?

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

      Use the openzeppelin erc20 wizard
      docs.openzeppelin.com/contracts/4.x/wizard

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

    Is the process similar for BEP20 tokens?

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

      Yes bep20 is just an extension of erc20 for Binance smart chain so should work very similar. Change weth for wBNB

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

    Great tutorial, can you explain about maxTick = 887270, why it is set to this value. Thanks.

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

      It's near the max value for a int24 variable. You have to round down based on the tick size which depends on which fee the pool uses. Can find it by setting up a pool manually on the Uniswap UI (on testnet) checking the decoded input data on the tx in etherscan.

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

      @@JamesBachini Thank you so much.

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

    Hello Sir, greetings.
    Kindly share a code snippet of how to deploy 80% of the total minted tokens to uniswap address and have the rest sent to the developer address.
    You are of great help.
    Is it also possible to create a trading pair with a stablecoin such as USDT or USDC?
    Love from Africa.

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

      You can use the internal _mint(to,amount) function to send some to msg.sender
      Yes baseAsset can be whatever you want, including stablecoins

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

    Can someone invest in my business....

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

    I want to talk with you

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

    Can you do the same but with 20-30% staying with you as creator/team and have a tax per transactions 🙏🏾. I can see you are very active and very helpful. Im Subscribed!!

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

      Just use the internal _mint(wallet, amount) function in the constructor to mint team funds.
      For tax you need to overwrite the transfer function. Would need to do some testing with Uni v3 to make sure it works

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

    hey pls help me

  • @light-light
    @light-light Рік тому

    Interesting. But I concern that,
    If you send all of your coins to an exchange, and that's a one-in-a-kind case, when the price of those coins goes up, can someone from the exchange that owns all of them resist the temptation to sell them?

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

      Uniswap is decentralized, noone at the exchange owns the coins. They are held in a smart contract and made available for sale

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

      what about bots ? when You send token and bot instantly buy them all, how to prevent that situation ?
      @@JamesBachini

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

    🇪🇦👍

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

    Ew polygon

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

    everything worked fine , i launched on mumbai test net however when I went to Uniswap to swap my tesnet matic for the meme token it said Insufficient liquidity for this trade.

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

      Did you run the addliquidity function first?

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

      @@JamesBachini I believe so, after compiling the contract I deployed it to my wallet address then I added the coins to the liquidity pool. Is it possible I don't have enough testnet matic. I have about 8 matic on the Mumbai test network.

  • @light-light
    @light-light Рік тому

    And since I don't know much about uniswap, how can I swap another coin (B) I have with A after sending all the coins (A) I just created to uniswap? Even if the owner of uniswap's address does not agree, is all A-coin on sale? Can anyone buy it at any price? So why do prices go up? Even though all coins are on uniswap and everyone can buy them at the same price all the time?

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

      As you buy price goes up, as you sell price goes down. This can be over multiple orders or in terms of slippage a single order

    • @light-light
      @light-light Рік тому

      @@JamesBachini Thanks for reply. So the initial risk I should take is, contract launch fee (about 150$) and few trade fee (Ether) for A coin (what I make)?
      Then what? I post to reddit? What thread where? Then what if people does not show any interest? Lose all that 200$ around money? And the risk that if some of people shows interest and they buy some coin, so I buy together, spend another 200~1000$, and then no one shows interest anymore like situation?

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

      @@light-light If no one is interested in what you have built it will not be sold and you will have wasted your time and money
      Maybe take a look at past successful projects that are doing a similar thing to what you want to do and try to reverse engineer their marketing and growth systems

    • @light-light
      @light-light Рік тому

      @@JamesBachini so exclude contract injection fee, trade cost can be recoop if no one have interest? by trade back A coin to Ethereum.
      And what are past successful projects? search keyword is "meme coin"? I know some like doge or shibainu, but up to now my main role is game dev, so weak at crypt news.

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

      @@light-light Pepe was the most successful one recently. Check CMC for recently listed projects too. If no one buys the token you can not recoup gas fees or costs.

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

    "matich" ?

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

      Should it be Matik? If so I've been pronouncing it wrong for 3+ years 🫣

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

      @@JamesBachini I believe so but maybe I’m wrong myself ¯\_(ツ)_/¯

  • @Dan-et4mz
    @Dan-et4mz Рік тому

    @JamesBachini
    Great tutorial! Thank you. I want to modify the code so that 93.1% go to the pool supply and 6.9% are reserved. I set supplyPool to 931000 * 10 ** decimals and then supplyFuture to 69000 * 10 * decimals. Then I updated supply to supplyPool in the addLiquidity and fixOrdering functions.
    In the constructor, I have _mint(address(this), (supplyPool)); and then another line _mint(address(this), (supplyFuture));
    Would this be the correct implementation for my objective? There is an error: creation of Grandma errored: Returned error: {"jsonrpc":"2.0","error":"[ethjs-query] while formatting outputs from RPC '{\"value\":{\"code\":-32603,\"data\":{\"code\":-32000,\"message\":\"transaction underpriced\"}}}'","id":3860609465159503}
    Do I need to adjust the value of sqrtPriceX96? If so, to what value?

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

      Double ** decimals()
      Then maybe try minting supplyFuture to msg.sender (which is the deployer address) rather than the contract address

    • @Dan-et4mz
      @Dan-et4mz Рік тому

      @@JamesBachini thank you! will give these a go!

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

      @@Dan-et4mz did it work ?

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

    sir I text you on Instagram but you don't reply

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

      Apologies I don't use insta much, will take a look now

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

    function fixOrdering() private {
    if (address(this) < weth) {
    token0 = address(this);
    token1 = weth;
    amount0Desired = supply;
    amount1Desired = 0;
    minTick = 0;
    maxTick = 887270;
    } else {
    token0 = weth;
    token1 = address(this);
    amount0Desired = 0;
    amount1Desired = supply;
    minTick = -887270;
    maxTick = 0;
    }
    }
    }
    I M STUCK HERE PLS HELP ME
    WHAT SHOULD I DO ON THIS

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

      The code looks fine. What is the issue?