mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Split fallback function and introduce "fallback()" and "receive()" syntax.
This commit is contained in:
@@ -174,7 +174,7 @@ abstract contract DAOInterface {
|
||||
// );
|
||||
|
||||
/// @notice Create Token with `msg.sender` as the beneficiary
|
||||
function () external payable;
|
||||
receive() external payable;
|
||||
|
||||
|
||||
/// @dev This function is used to send ether back
|
||||
@@ -389,7 +389,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
|
||||
allowedRecipients[curator] = true;
|
||||
}
|
||||
|
||||
function () external payable {
|
||||
receive() external payable override(DAOInterface, TokenCreation) {
|
||||
if (now < closingTime + creationGracePeriod && msg.sender != address(extraBalance))
|
||||
createTokenProxy(msg.sender);
|
||||
else
|
||||
|
||||
@@ -50,7 +50,7 @@ contract ManagedAccount is ManagedAccountInterface{
|
||||
// When the contract receives a transaction without data this is called.
|
||||
// It counts the amount of ether it receives and stores it in
|
||||
// accumulatedInput.
|
||||
function() external payable {
|
||||
receive() external payable {
|
||||
accumulatedInput += msg.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,6 @@ override returns (bool success) {
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
function() external payable {
|
||||
receive() external payable {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user