Hey guys I am new to coding although have been taking some online classes. I am trying to fork bsc token although when I try to launch it in remix I get an error “false transaction mined but execution failed” I have tried to fork several contracts and seem to get this same error. From the research I’ve done it seems to be coming from the constructor but it seems all the tokens I’m forking from used the same constructor? So I’m wondering what I’m doing wrong.

Any help appreciated

May 20, 2022, 7:24 PM
Hey guys I am new to coding although have been taking some online classes. I am trying to fork bsc token although when I try to launch it in remix I get an error “false transaction mined but execution failed” I have tried to fork several contracts and seem to get this same error. From the research I’ve done it seems to be coming from the constructor but it seems all the tokens I’m forking from used the same constructor? So I’m wondering what I’m doing wrong.

Any help appreciated
Update

I // out a line within the constructor and then it will allow me to deploy

Pair = IDEXFACTORY(router.factory)).createPair(WBNB, address(this));

Does anyone know how I would fix this error? I feel like I cannot remove this line as it relates to the pcs LP pairing
Let me know if anyone can assist
Hey
Sounds good thanks
May 20, 2022, 8:37 PM
the chain
May 20, 2022, 9:17 PM
The issue seemed to be that I was using mainnet router and trying to launch on testnet. Thanks everyone for your support
May 20, 2022, 9:20 PM
Many tokens create a uniswap (or pancakeswap) pair when they deploy. If you try to deploy with a wrong router address, these tokens will not deploy.
May 20, 2022, 10:12 PM
I am having another issue now where on testnet pancake swap I am only able to sell from the “onlyOwner” wallet. I already turned on a function within the contract to allow trading so tokens can be sent or recieved from any wallet.
May 20, 2022, 10:57 PM
check for tx amount limits or wallet limits/taxes
with owner account you can usually sell with 1% slippage, so check slippage too
May 20, 2022, 11:47 PM
I tried with slippage up to 30% and selling as little as 1 token
May 20, 2022, 11:51 PM
paste your _transfer function in pastebin.com
and share there
May 20, 2022, 11:54 PM
https://pastebin.com/HFHUE7WQ
Did I do it right?
May 21, 2022, 12:07 AM
D:
do the same with _transferFrom
May 21, 2022, 12:09 AM
https://pastebin.com/krcYGNdS
May 21, 2022, 12:12 AM
mhm nothing special here :\
May 21, 2022, 12:16 AM
No I didn’t think there was anything special just wondering why it’s not working. I copied the code from another project and changed the name etc to be how I wanted, got it launched added liquidity seems like all wallets can send tokens and buy tokens but only “onlyOwner” can sell
May 21, 2022, 12:21 AM
Sounds like a scam to me. The way you would do this in code is to see if someone (who is not the owner) is trying to transfer tokens to the pair address (this would be a "sell"), and then not allow it to happen. So in the code you would look for something in the transfer method for comparisons concerning msg.sender owner to, and something like PAIR_ADDRESS or address(pair) or something to do with the pair.
This isn't very helpful, most of the logic is going to be in _transferFrom
You can learn everything you need to know by reading Uniswap contracts. They are on github and they are very simple.
May 21, 2022, 1:33 AM
🆒😎
May 21, 2022, 1:41 AM
their are need a tutorial, not documentation or contract
May 21, 2022, 1:56 AM
I'm happy you figured it out.
May 23, 2022, 12:49 PM

© 2024 Draquery.com All rights reserved.