Ethereum Boilerplate Questions

what happens if you use 127.0.0.1:3000 instead of localhost?

Nice that works thanks! :slight_smile:

1 Like

I noticed when looking at ERC20Transfers on the BSC network, that the link to follow the transaction leads to Avalanche. when is should lead to bscscan.com/tx/.

followed it back to line 10 of ERC20Transfers.jsx:

const { ERC20Transfers, chainId } = useERC20Transfers();

ERC20Transfers - fills with data.
chainId - returns as undefined.

Will fix that with the next commit thanks for letting us know

For now you can add:

const { chainId } = useMoralisDapp()

to erc20 transfers

once you install 1inch plugin in what file you put the functions for the dex. under 1inchdex/conponents?

This is fixed now in newest version :slight_smile:

The logic for 1inch plugin can be found in src/hooks/useInchDex

EDIT: Regarding the .ENV entries, it looks like thatā€™s just a mistake when Dimity last updated. None of those new values are used anywhere in the repo.

Hey everybody, I have a few questions/observations regarding the boilerplateā€¦

  1. The Discord dev-chat channel is noisy so this dedicated post is great.
  2. I pulled latest changes and .env items are unexplained in the Readme or here in this forum thread. I can figure out what to do, but would be best to update the Readme.
frpcPath = F:\frpc\frpc.exe
chain = ganache
moralisSubdomain = xxxxxxx.usemoralis.com
abiPath = "F:\ethereum-boilerplate\Truffle\build\contracts\Contract.json"
  1. Thereā€™s no mention in the Quick Start about truffle or ganache or the proxy server as prerequisites.
  2. The Windows style ā€œF driveā€ hard-coded values should be consistent with the other ā€œinsert hereā€ placeholder text.
  3. There are no source code comments in the boilerplate. Templates such as OpenZeppelin have extensive source comments. Consider adding comments to reduce the number of inbound support inquiries.

I could do a pull request to help with this type work, but I donā€™t know whatā€™s intentional or scheduled to be changed soon.

Great job and I respect the work!

I was playing with the <TokenPrice> tag. but im having some issues.

this works:

           <TokenPrice
              address="0xb27adaffb9fea1801459a1a81b17218288c097cc"
              chain="bsc"
              image="/logo.png"
              size="40px"
            />

this dont work:

const [address, setAddress] = useState('')
setAddress(0xb27adaffb9fea1801459a1a81b17218288c097cc)

              <TokenPrice 
                address={address} 
                chain="bsc" 
                image="/logo.png"
                size="40px" 
              />

Because you need to put your address inside a string.


setAddress(ā€œ0xā€¦.837ā€œ)

Hey @kevlawton!

It looks like you didnā€™t notice my answer in the Discord. So I will duplicate it there.

Weā€™ve added more params for fast connection your localdevchain to your Moralis DB. If you donā€™t need them-specify appId and serverUrl only

2 Likes

Iā€™ll update the docs and we will make a video tutorial how to use this functionality :raised_hands: after updating the moralis-admin-cli

It is in a string, It makes it a string by making to starting state an empty string. The tag accepts the props, if I check the object with react dev tools both ways. But for some reason every time a pass a state to the prop it fails.

Well, based on what you posted in here the Input in setAddress() is clearly not inside string annotations.

I was trying to show the issue with more simplified code. Really I am passing something like coinData[3].bscContract into the setAddress().

both ways show this:

so it does appear that the data is passed in a string, but still not working. I know this is more of a issue with my understanding of react then it is with the Boilerplate, but thank you for any help you offer.

I solved my issue. I just had to add my state to the return,


return (
        coinData, 
        address // added state here
        ?
            <div className="coin">
                <TokenPrice 
                address={address} 
                chain="bsc" 
                image="/logo.png"
                size="40px" 
              />
1 Like

Hi everyone,

Iā€™m trying to run properly the git of Etherum Boilerplate but Iā€™m facing many issues.
Firt, whenever I go on the site I have an error 400 (missing address maybe) when trying to access to getNativeBalance function from my moralis server. Also, when I try to use the dex with testnet it says ā€œSwitch to supported eth network or edit InchDex settingsā€. And when I change eth with anything else in my code, the dex is showing up but we have no token to select.

Can you help me?

1 Like

Hi @midou099

Please share the error screenshots. Thank you :man_factory_worker:

Screenshot from 2021-11-05 16-47-15

Same error on POST request when trying to access to the wallet

For the dex,it is showing me tokens for bsc, eth but not bnb.

Thank you

1 Like

Iā€™ve checked your server logs. I see that you are calling getNativeBalance() for "chain":"ganache". But our web3API endpoints are not available for local chains.

They support all public testnets/mainnets