I'm trying to develop a smart contract which collect fees from other contracts.
I tried to do:
function sendFees() public {
address payable feeCollector = payable(feeCollector addredd);
feeCollector.transfer(address(this).balance);
}
ad then I call the function like this:
sendFees();
But in ganache I didn’t see any balance change in feeCollector contract. In feeCollector contract there is this function:
receive() external payable {}
which, in theory, should receive all fees sent. I’m stuck and I can’t code anything else. Please help me.