What the theory behind using msg.value instead of this.balance
when e.g withdrawing contributed funds from a contract?
E.g
wallet.transfer(this.balance);
wallet.transfer(msg.value);
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityWhat the theory behind using msg.value instead of this.balance
when e.g withdrawing contributed funds from a contract?
E.g
wallet.transfer(this.balance);
wallet.transfer(msg.value);
msg.value
is the amount of ETH sent to a payable
public
method in a contract.
this.balance
is the amount of ETH stored in the contract.