-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80bb793
commit a29462c
Showing
8 changed files
with
227 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"payable-fallback": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
contract Generic { | ||
|
||
constructor() {} | ||
|
||
function anyFunction() {} | ||
|
||
//// fallback with receive | ||
receive() public {} | ||
|
||
receive() external onlyOwner {} | ||
|
||
receive() external virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
//// fallback with no name | ||
function() public {} | ||
|
||
function() { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
function() external onlyOwner {} | ||
|
||
function() virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
|
||
//// fallback explicit | ||
fallback() {} | ||
|
||
fallback() { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() external onlyOwner{ | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() virtual {} | ||
|
||
|
||
fallback() external payable {} | ||
function() external payable {} | ||
receive() public virtual payable {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
contract Generic { | ||
|
||
constructor() {} | ||
|
||
function anyFunction() {} | ||
|
||
//// fallback with receive | ||
receive() payable public {} | ||
|
||
receive() payable external onlyOwner {} | ||
|
||
receive() payable external virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
//// fallback with no name | ||
function() payable {} | ||
|
||
function() payable { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
function() payable external onlyOwner {} | ||
|
||
function() payable virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
|
||
//// fallback explicit | ||
fallback() payable {} | ||
|
||
fallback() payable { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() payable external onlyOwner{ | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() payable virtual {} | ||
|
||
|
||
fallback() external payable {} | ||
function() external payable {} | ||
receive() external virtual payable {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
contract Generic { | ||
|
||
constructor() {} | ||
|
||
function anyFunction() {} | ||
|
||
//// fallback with receive | ||
receive() public {} | ||
|
||
receive() external onlyOwner {} | ||
|
||
receive() external virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
//// fallback with no name | ||
function() public {} | ||
|
||
function() { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
function() external onlyOwner {} | ||
|
||
function() virtual { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
|
||
//// fallback explicit | ||
fallback() {} | ||
|
||
fallback() { | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() external onlyOwner{ | ||
uint256 anUintToFillSpace; | ||
} | ||
|
||
fallback() virtual {} | ||
|
||
|
||
fallback() external payable {} | ||
function() external payable {} | ||
receive() public virtual payable {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters