Hello everyone guys ! I wrote my token, the code of which is contained in 2 text documents I can share. Can you tell me why it is not possible to send money to the store's contract ? The receive function necessary for this is provided, but it is not possible to do this.

May 2, 2022, 6:25 PM
Who can help?
May 2, 2022, 6:27 PM
I assume your shop sells 1:1 eth-token
Then you have to make sure the shop has enough token balance.

Try running it on remix to see the errors more clearly.
May 2, 2022, 7:04 PM
I made sure
May 2, 2022, 7:06 PM
you minted 50 tokens to the TokenShop then you bought 1e18 tokens, that's why it was rejected.
May 2, 2022, 7:06 PM
ahhhhh, God
May 2, 2022, 7:07 PM
constructor
(address _shop) ERC20 ("My First Token", "MFT",
_shop, 50) {
May 2, 2022, 7:07 PM
yes
you opened my eyes
I will retry
Thank you so much, bro !
It works, but now there is another problem: I can’t see the balance in MM wallet
🤔
Do you know how I can make it display the balance?
May 2, 2022, 7:19 PM
metamask? there's import tokens link you can use
May 2, 2022, 7:30 PM
I used, but …
May 2, 2022, 7:30 PM
so many things to check:
are you deploying on the correct network?
are you using the correct wallet?
is your contract working fine?
was your transaction successful?
May 2, 2022, 7:34 PM
BSC, the code was written on solidity
Yes, I send weis to the correct address
Contract works fine
Yes, transaction was successful
May 2, 2022, 7:36 PM
Are there any templates to use for this checking?
May 3, 2022, 3:07 AM
where can i learn on making erc20 smart contracts ?
May 3, 2022, 4:09 PM

© 2024 Draquery.com All rights reserved.