I have implemented this function and I think it has some Bugs and vulnerabilities this function so anyone can you help me to find the Vulnerability and bugs. I'm confused in this line
uint balance = address(this).balance;
and the next line to transfer the balance so is it possible for the hacker to use this line and transfer all the balance in his wallet?
function rescueNative() external{
require(msg.sender == owner, "only owner");
uint balance = address(this).balance;
owner.transfer(balance);
emit NativeRescued(address(this), balance);
}