I am trying to implement deposit functionality in my contract in the sense whoever calls the function below needs to deposit some ether. For example:
Contract A calls the function below and again, Contract A needs to deposit some ether.
I can do this with the remix interface by passing "VALUE". But I want to pass this variable as an argument.
Here is what
event Deposit(address sender, uint amount, uint balance);
function deposit(uint testAmount) public payable {
testAmount = msg.value; // GIVES ERROR
emit Deposit(msg.sender, testAmount, address(this).balance);
}
function doWork(int job_id, uint amount) public payable{
deposit(amount);
}