1

I am making a function to send ether to a smart contract and send the ether in the smart contract to another person.

If the smart contract does not include the ability to send ether to other people, will that ether be stored in the smart contract for life?

contract Bank {

    event Donation(address indexed _address, uint amount);

    receive() external payable { emit Donation(msg.sender, msg.value); }
    fallback() external payable { emit Donation(msg.sender, msg.value); }

...

    // no Withdraw function

}

And if i make bank with solidity, are there any other functions that must be implemented besides deposit and withdrawal?

1 Answer 1

1

If the smart contract does not include the ability to send ether to other people, will that ether be stored in the smart contract for life?

Yes.

Another way to withdraw is to add functionality for self destruct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.