How to withdraw money from verified contract

I transferred the wrong money to the verified contract , how to withdraw the wrongly transferred amount.I am the creator of the contract. Thank you.

Hi, welcome to the community! :wave:

I think you should share the contract address, so we can have a look at if there is a function you can withdraw your funds

You can upgrade your Contract if it is upgradeable.
add code:


import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

function withdraw(address to, uint256 amount)
        external
        onlyOwner
    {

        uint256 balance = address(this).balance;
        require(amount <= balance);
        payable(to).transfer(amount);

    }
1 Like