Split fallback function and introduce "fallback()" and "receive()" syntax.

This commit is contained in:
Daniel Kirchner
2019-11-04 17:17:58 +01:00
parent 3d625cc239
commit 3321fc56ea
137 changed files with 1340 additions and 386 deletions
+2 -2
View File
@@ -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 {
}
}