Solidity Set Value In Contract Call

[Solved] Solidity Set Value In Contract Call | Solidity - Code Explorer | yomemimo.com
Question : solidity set value in contract call

Answered by : anxious-alligator-bx1nkddr8shy

contract One { function buyTokens(address _beneficiary) public payable { require(msg.value == 1 ether); // do something... }
}
contract Two { address _one; function doBuy(uint _amount) public { address beneficiary = msg.sender; // set value to buyTokens as shown below: One(_one).buyTokens{ value: _amount }(beneficiary); }
}

Source : https://ethereum.stackexchange.com/a/60281/86303 | Last Update : Fri, 23 Sep 22

Answers related to solidity set value in contract call

Code Explorer Popular Question For Solidity