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.
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
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
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
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 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 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
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
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?
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
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
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
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
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.
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
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.
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)
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
address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; Full list of wrapped native tokens at the bottom of this page: docs.uniswap.org/contracts/v3/reference/deployments
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?
@@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
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
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?
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
@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. 🤙
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
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
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?
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
@@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 ❤
@@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 😢
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 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?
@@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.
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
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
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.
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.
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?
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.
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.
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?
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
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?
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.
@@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..
@@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.
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?
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
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?
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
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
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.
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
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 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.
@@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.
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
@@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 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.
@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?
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?
@@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)
@@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
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?
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
@@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
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.
@@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?
@@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?
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
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
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
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
@@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
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.
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 🤷♂️
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.
@@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.
@@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?
@@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
@@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?
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.
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.
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!!
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
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?
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 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.
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 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?
@@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
@@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.
@@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.
@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?
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
Right time for the video. Subscribed.
Have you crafted your own blockchain asset?
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.
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
Please do Pulsechain, i tried this but it does not work thanks.
Wonderful. You are rare to find
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
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
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?
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
@@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
@@moyoutube-q3b it should deploy a new token each time so there can't be a liquidity pool setup. Maybe try it in remix?
@@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
If possible can you add blacklist function like pepe did to avoid other to buy max quantity ?
Pepe contract is open source so you can just copy it from there
Great tutorial James!!!! But, how can we add or change the logo of our memecoin?
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
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?
The block explorers are different on Solana but you should find the code in the projects GitHub repository
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...
Do you want to send me the code and I'll take a look? Email is in the about section on UA-cam
@@JamesBachini thank you
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
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
@@JamesBachini Thanks!
it say: execution failed.
visible tokens: 0
why?
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
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
Nice video, any chance of making a rebase token video, I'm intrigued how they keep track of user balances
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
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
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.
@@JamesBachini ok, so if none buy, i cannot sell it! Make sense! Thank you again!
Thank you sir,please i have one question , howthis contract can be benefic for adopters? Thank you
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
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.
How do we know the price for our meme coin? Where do we need to set the price ?
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)
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
That is just explaining how Uniswap v3 works when someone makes a swap
On line 36, how would we modify this to the Ethereum mainnet?
address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
Full list of wrapped native tokens at the bottom of this page: docs.uniswap.org/contracts/v3/reference/deployments
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?
@@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
@@JamesBachini Hi James - Okay, I did it on MetaMask ETH
So do you have to do coding to make a meme coin? And add ethereum, or other crypto to it
It certainly helps. A memecoin technically is just code in a smart contract
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?
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
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?
Probably as you adjusted the price you would need to adjust the ticks
When I attempt to compile it just spins forever. Did I do something wrong? 🤔
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
@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. 🤙
You are a great teacher, much appreciated.
Did you create your own token?
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
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
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?
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
@@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 ❤
@@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 😢
@@RichReflectionz Did you happen do sort this out? :)
Another month later, did you figure it out? Im looking to have 1:1000 ratio
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!
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
@@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?
@@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.
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
JERRY INU DONT SLEEP ON IT BUY IT AND HODL NOW!!!!!!
will this be listed on dextools
when u launch it
I'm not launching anything, just a demo
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
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.
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 ?
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.
@@JamesBachini Can you share an example of this code? I've attempted it but I think the price is messing me up.
@@Dan-et4mz _mint(msg.sender, supply / 20);
_burn(msg.sender, amount);
@@JamesBachini thank you!
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?
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.
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.
Did you call the addLiquidity function in the contract?
yes, i did@@JamesBachini
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?
Probably. I think safemoon done something similar so might be worth checking their code and other memecoins on BNBchain
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
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
Hello Buddy! Great video 👏🙏 I'm having error when veryfing on Etherscan even with the flatten file. Have you ever verified it?
Have you tried using a plugin for whatever framework you are using? i.e. hardhat, remix, foundry all have etherscan verification tools
on line 35, is that number supposed to be your crypto wallet ID or not?
No that is the contract address for Uniswaps Non-fungible position manager contract
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?
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.
Why Im not able to verify?
I saw your video !! its really good
Thank you
@@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..
@@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.
@@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 :)
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?
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
question if i created for i.e 10 billion can people mine it and it gets more than 10 billion ?
No, people can't mine your token
No one codes anymore
With this approch would I still be able to collect fees on transations?
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
Is everything without fees?
On testnet everything is free. On mainnet there are transaction fees
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?
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
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?
Line 35 is the same
Line 36 is
address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
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?
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
how would i do it on ether instead of polygon
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.
how to change the price to make 1 matic gets 100k token?
Mint the tokens to msg.sender set it up manually is the easiest way without diving into tick prices
is this deployable on Binance Smart Chain ?
Change weth to wBNB and Uniswap to Pancakeswap and it should be good to go, test it on testnet first
@@JamesBachini subscribing now.
Can you deploy on Base?
You can buy addresses will need to be changed
why does your contract oly cost 90 cents to deploy, mine costs 190 dollars
Because I deployed it to Polygon which has cheaper transaction fees than Ethereum mainnet
how can this benefit me as a owner? how do i get control of my token if its listed on uniswap?
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
@@JamesBachini how do i mint?
@@TrushieldOfficial the token is minted in the constructor function when you first deploy the contract
@@JamesBachini i know but i when i click add liquidity then all my token get sent to uniswap how do i generate more token?
@@TrushieldOfficial use the _mint function, check openzeppelins erc20 docs if you need details on the spec
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?
Hard to say without any error code or something to go on. Did you change the weth address to wrapped matic?
@@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.
@@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.
@@CryptoMatrxmaybe try debugging the transaction in tenderly
@@CryptoMatrx it sounds like you are deploying it locally which wont work because there isn't a local version of Uniswap and weth
Friend, could you show me how I can add a fee only when there is a token sale?
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
@@JamesBachini Let me take advantage and ask one more question. How do I make token price 1 = 0.000005 BUSD?
@@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?
@@Stateofdinosaurs take a look at this video by @smartcontractprogammer which explains the price calculations
ua-cam.com/video/hKhdQl126Ys/v-deo.html
@@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.
@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?
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?
@@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)
@@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
@@moyoutube-q3b 0.3% == 60 tick spacing, 0.01% == 1 tick spacing, 0.05 == 10 tick spacing, 1% == 200
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?
The update to OpenZeppelin requires msg.sender to be passed into the constructor argument of the ownable function
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
@@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
I didn't change the supply@@JamesBachini
How did you make 1 of your token worth $1 in matic?
I set the price when creating the liquidity pool
@@JamesBachini And can you make a profit by selling all the tokens you have?
@@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
How do you add a symbol?
Like a logo in metamask? support.metamask.io/hc/en-us/articles/360059582151-How-to-add-a-token-logo
How much does it cost to make one of these tokens?
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.
Which chain did you use in this video? It looked pretty cheap from what I saw
@@alexlaudano8644 I think it was polygon, tx fees are so low it's like a permanent testnet for ethereum
Hi, what happens if I change the square root price within the code?
You will need to recalculate the tick positions when adding liquidity
@@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?
@@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?
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?
So learning solidity language is mandatory for making a solid meme coin?
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
Does the owner of the token get tax from the other buyers?
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
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
Sure, contact details are here if you want to send me through the details or get on a call
jamesbachini.com/contact/
How to verivied contract??
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
I am trying to create 300Billiom supply but stuck. Do you have paid support?
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
@@JamesBachini Thanks for quick response. You are the best.
i wanna buy your meme coin ??
How does this pay you the creator?
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
Thank you for your reply
You should do a video on how a person can do this and make some passive scratch
why im not able to verify
Did you generate your digital token?
Can this be done with BnB
Yes it's BNBchain is EVM so the same code will work. Change Uniswap for Pancakeswap and chainId in the config
@@JamesBachini thank you James
Will it work the same on pancake swap ie you don’t have to add liquidity
@@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
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.
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
that's too much mateeech for me
Has anyone had any issues verifying this contract on polygon
I have launched the contract but can’t verify it? 0x45116b03e9a8ede9a53167a83319ed1ae375f95e
Did you change the weth address to wmatic?
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 🤷♂️
James have you tried to verify the token you launched?
@@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?
How we can make ETH/MyMeme ?
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.
@@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.
@@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?
@@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
@@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?
Hi, could you please give the code for bep20 and erc20?
Use the openzeppelin erc20 wizard
docs.openzeppelin.com/contracts/4.x/wizard
Is the process similar for BEP20 tokens?
Yes bep20 is just an extension of erc20 for Binance smart chain so should work very similar. Change weth for wBNB
Great tutorial, can you explain about maxTick = 887270, why it is set to this value. Thanks.
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.
@@JamesBachini Thank you so much.
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.
You can use the internal _mint(to,amount) function to send some to msg.sender
Yes baseAsset can be whatever you want, including stablecoins
Can someone invest in my business....
I want to talk with you
jamesbachini.com/contact/
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!!
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
hey pls help me
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?
Uniswap is decentralized, noone at the exchange owns the coins. They are held in a smart contract and made available for sale
what about bots ? when You send token and bot instantly buy them all, how to prevent that situation ?
@@JamesBachini
🇪🇦👍
Ew polygon
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.
Did you run the addliquidity function first?
@@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.
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?
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
@@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?
@@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
@@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.
@@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.
"matich" ?
Should it be Matik? If so I've been pronouncing it wrong for 3+ years 🫣
@@JamesBachini I believe so but maybe I’m wrong myself ¯\_(ツ)_/¯
@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?
Double ** decimals()
Then maybe try minting supplyFuture to msg.sender (which is the deployer address) rather than the contract address
@@JamesBachini thank you! will give these a go!
@@Dan-et4mz did it work ?
sir I text you on Instagram but you don't reply
Apologies I don't use insta much, will take a look now
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
The code looks fine. What is the issue?