and the staking contract will earn a dividend in $Cake. Can someone guide me if this will allow me to withdraw the $Cake that builds up over time as the contract owner?
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
require(success);
}
or do I have to specify differently to get the Cake and not our token that has been added to the contact as staking?
why would you only get the $Cake
as once people start staking our token rewards at over 200 billion. so it is collecting cake from our main token contract. we need to be able to withdraw that cake as the community agreed for us to use it for buy and burns... the contract will be holding our token and will accumulate cake rewards. I dont want to withdraw our token of course just the cake.
The code you posted is for withdrawing BNB only. To withdraw Cake tokens your contract would need to call the transfer function of the Cake token contract.
Обсуждают сегодня