Developers Forum for XinFin XDC Network

Discussion on: Unable to call payable function from Remix, XDCPay and send funds

Collapse
ayyalu profile image
Ayyalusamy Ramadoss Author

function buyTokens(address beneficiary) public payable {
uint256 tokens = msg.value * 10;
_token.transferFrom(_wallet, beneficiary, tokens);
emit TokensPurchased(_msgSender(), beneficiary, msg.value, tokens);
_forwardFunds();
}