I am trying to build a Dapp which includes functionality to deposit funds to a contract and withdraw them. The functions look like this
function fundContract() public payable {
require (msg.sender == users[msg.sender].addr);
users[msg.sender].balance += msg.value;
contractBalance+=msg.value;
}
function withdraw (uint amount) public onlyUser() payable{
require (msg.sender == users[msg.sender].addr);
require (amount > 0);
require (amount <= users[msg.sender].balance);
msg.sender.transfer(amount);
users[msg.sender].balance -= amount;
contractBalance-= amount;
}
I understand that there will be a function call to withdraw() specifying the amount parameter from the front end using web3.js send() command, but how do I provide the msg.value for the fundContract method from the viewpoint of a Dapp. Remix allows specifying the value in the message , but I can't find a way to do so for a Dapp.