Hi guys Im new and try to learn solidity to be able to deploy my first dApp.
I've seen different functions for sending, what are differencies bettween?
And another question, when I write a deposit function, can I specify the amount as a function parameter like here the _value:
function Deposit(uint _value) public payable {
}
Because only the msg.value is deposited successfully. How does it work, when I want to let the user to enter the amount at a webpage he wants to deposit?
the first option is the correct one to transfer, the second is no longer used, and the third is an event. Regarding the function, the payment will be made through the network's native crypto, you have to do it through the global variable msg.value
So to keep the argument uint amoun is ok and can be used later on to specify the amount right?
the payment will be made through the network's native crypto, you have to do it through the global variable msg.value
Got it. What would be the way to use a stable coin like DAI within an application for deposit and withdraw?
Ok, so only msg.value matters right?
What about the other question, is it possible to build an dApp which is interacting with the user, using a stable coin?
Is it possible? For example like a lottery, user can deposit DAI and withdraw DAI afterwards?
Yes thank you you have answered a lot of questions.
I would appreciate if someone could share an example for a smart contract which is interacting using a stable coin like BUSDT or DAI. Using google I only see result how to create a stable coin, which is not my focus.