mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #13007 from ethereum/develop
Merge develop into breaking.
This commit is contained in:
@@ -318,12 +318,13 @@ will consume more gas than the 2300 gas stipend:
|
||||
- Sending Ether
|
||||
|
||||
.. warning::
|
||||
Contracts that receive Ether directly (without a function call, i.e. using ``send`` or ``transfer``)
|
||||
but do not define a receive Ether function or a payable fallback function
|
||||
throw an exception, sending back the Ether (this was different
|
||||
before Solidity v0.4.0). So if you want your contract to receive Ether,
|
||||
When Ether is sent directly to a contract (without a function call, i.e. sender uses ``send`` or ``transfer``)
|
||||
but the receiving contract does not define a receive Ether function or a payable fallback function,
|
||||
an exception will be thrown, sending back the Ether (this was different
|
||||
before Solidity v0.4.0). If you want your contract to receive Ether,
|
||||
you have to implement a receive Ether function (using payable fallback functions for receiving Ether is
|
||||
not recommended, since it would not fail on interface confusions).
|
||||
not recommended, since the fallback is invoked and would not fail for interface confusions
|
||||
on the part of the sender).
|
||||
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -109,6 +109,7 @@ of votes.
|
||||
function delegate(address to) external {
|
||||
// assigns reference
|
||||
Voter storage sender = voters[msg.sender];
|
||||
require(sender.weight != 0, "You have no right to vote");
|
||||
require(!sender.voted, "You already voted.");
|
||||
|
||||
require(to != msg.sender, "Self-delegation is disallowed.");
|
||||
@@ -132,7 +133,7 @@ of votes.
|
||||
// modifies `voters[msg.sender].voted`
|
||||
Voter storage delegate_ = voters[to];
|
||||
|
||||
// Voters cannot delegate to wallets that cannot vote.
|
||||
// Voters cannot delegate to accounts that cannot vote.
|
||||
require(delegate_.weight >= 1);
|
||||
sender.voted = true;
|
||||
sender.delegate = to;
|
||||
|
||||
Reference in New Issue
Block a user