Add/Import cusotm token on dex

Yes thatā€™s whats happening, and token sales for bnb are fine, was pulling my hair out trying to figure out if it was my code but its not as far as i can see. The code Iā€™ve been using is above.

Is the InchDex code above up to date? I saw your post on Discord, if you could get this up on GitHub that would help.

Itā€™s the boilerplate code man. Just download ethereum-boilerplate from github and try and buy anything on bsc with bnb, spending more than 0.01 doesnā€™t work, ive tried spending 0.04 with no luck, virgin code. Sales to bnb work fine it seems, just not from.

Hmm, had to buy some BNB but the base boilerplate is working on my end, everything is working with BNB amounts above 0.01 to another token.

Can you check youā€™re connected with the right wallet and confirm your balance.

Also the code for each chain seems to be the same so try on Polygon if you have MATIC.

Maybe an issue with your environment too, try a different browser with MetaMask.

Iā€™m noticing the Authenticate text in the bottom screenshot, you need to authenticate first.

i authenticated and it will sell tokens

So is it working now with the second browser?

no man if you read above you will see me say, it will sell from other tokens to bnb fine, it just wont sell bnb for other tokens. thereā€™s gotta be something wrong with this boilerplate install.

This is what I was referring to, you need to be clearer. Check your console for any errors. And you can deploy your project and get others to try using BNB.

Alright after so doing a clean install of boilerplate Iā€™m getting some errors, yarn install throws these warnings:

yarn install v1.22.18
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.4.0-0".
warning "react-scripts > [email protected]" has unmet peer dependency "autoprefixer@^10.0.2".
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning "react-scripts > react-dev-utils > [email protected]" has unmet peer dependency "typescript@>= 2.7".
warning "react-scripts > eslint-config-react-app > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
$ husky install
husky - Git hooks installed
Done in 105.06s.

then after updating my app id and server url, and renaming the env file to .env, I do yarn start and it throws a whole whack of warnings I donā€™t remember from before, and this error at the bottom

ERROR in src/components/Contract/Contract.jsx
  Line 90:34:  Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError  no-unsafe-optional-chaining

yarn start warnings (too big to post here follow link) https://pastebin.com/MBv40GVt

What else in my environment could be wrong? I did notice a difference between the boiler code folder and my project folder and that was the react-scripts version, my project folder is running 4.03 and the boilerplate was running v5 but in any case, the boilerplate was having the same symptoms as my project folder, I could sell bnb for tokens, but could not buy with bnb above 0.01bnb cost without the object object error and the server log saying insufficient bnb balance when itā€™s clearly not. as described in above post. Now I can go ahead and try to resolve these dependencies but this code is straight from github latest version, unmodified and I shouldnt really have too right?

See this: ERROR: no-unsafe-optional-chaining Ā· Issue #135 Ā· ethereum-boilerplate/ethereum-boilerplate (github.com)

well, that got rid of the contract error but still have the 98 warnings on this clean install. still have the same error. tried polygon network, same thing.

Hope you got 1inch plugin installed on the server you used ?
Try change the alerts to console.log to log errors rather than alerts

yeah server is up to date and has plugin, still getting the same server log error

Try to do this to get more info about the message in logs rather than alert

Sure I understand what your saying, Iā€™ll do that, when I get to work on it later. To be extra clear I am not using my code right now as I have come to the conclusion that the error is not in my code, right now Iā€™ve just downloaded a clean version of ethereum boilerplate and itā€™s doing the same thing. I will worry about my code as soon as I can get the base ethereum boilerplate doing what itā€™s supposed to do.

As stated above the server is throwing an error saying insufficient balance when I hit swap .

Not enough 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE. Amount: 40000000000000000. Balance: 132930217734578436.

I clearly have enough, 17 decimals on one side and 18 on the other. The problem seems to have to do with my environment somehow or my initial boilerplate install that Iā€™ve built on. But then why am I getting the same error and why as glad said is it working for him.

Does the same issue happen when you use Polygon or from MATIC price?

I could deploy the one Iā€™ve got working for you to try with your wallet if you want, the only things I changed were disabling eslint/prettier due to errors.

Yes a few posts up you asked me to try poly and I said it didnā€™t work, same result.

Yeah a pkg json maybe, but they should be the same, Iā€™ve tried a clean environment multiple times. Installed the missing dependencies it was warning about during yarn install, tried changing node versions, webpack 4 instead of 5, different versions of antd, and walletconnect.

I donā€™t get it. It installs and runs but with that huge list of warnings from above and also the original problem. The server is good and the tokens list, plugin is installed. Tried node 16 17 and 18. Seeing lots of walletconnect errors, xhr2-cookies errors, antd less files errors. Missing .ts files. Have a look through the list please. Iā€™m on arch Linux. Might have to make a YouTube video for context, but itā€™s literally freshly downloaded into a clean environment and untouched except the env file, and the contract.jsx fix. I have no issues installing other npm packages. If I can just get this boilerplate to work properly then I can pursue the labouring task of moving my project into it and hopefully not be crippled moving forward.

When I started the original project I think
I changed the react-scripts version to get rid of the warnings. I canā€™t quite remember but i think i just started a new project and then installed everything one by one that was in the boilerplate package json. Then copied the components and other files over. All seemed to be working until I started trying to get the swapper working. I need to just have it run the way it was supposed to out of the box. But sadly itā€™s just doing the same thing as my other project folder , at least that one compiles successfully without warnings.

Have you tried the BNB amount on the demo? ethereum-boilerplate