Hello, I want to deploy my smart contract but before I do I want to check one function that my frontend calls. I want my users to send their coins to this smart contract and it will redirect those coins to the wallet address that created the smart contract, does this code work?
owner_ = payable(msg.sender)âŚ
function buyToken(uint8 status, address paymentcontract, uint256 value) public payable {
require(msg.sender != address(0), âZero addressâ);
if(status==0){
owner.transfer(msg.value);
}else{
wsum= IBEP20(paymentcontract);
require(wsum.allowance(msg.sender,address(this)) > value, âPlease allow fund firstâ);
wsum.transferFrom(msg.sender,owner,value);
}
}