-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from DeepitAG/verify-using-solc-input
Verify contracts using Solc standard JSON input
- Loading branch information
Showing
18 changed files
with
213 additions
and
29 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
1 change: 1 addition & 0 deletions
1
packages/buidler-core/test/fixture-projects/contracts-nameclash-project/buidler.config.js
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 @@ | ||
module.exports = {}; |
3 changes: 3 additions & 0 deletions
3
packages/buidler-core/test/fixture-projects/contracts-nameclash-project/contracts/A.sol
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,3 @@ | ||
pragma solidity ^0.5.1 | ||
import "./B.sol"; | ||
contract A {} |
3 changes: 3 additions & 0 deletions
3
packages/buidler-core/test/fixture-projects/contracts-nameclash-project/contracts/B.sol
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,3 @@ | ||
pragma solidity ^0.5.1 | ||
import "./C.sol"; | ||
contract B {} |
2 changes: 2 additions & 0 deletions
2
packages/buidler-core/test/fixture-projects/contracts-nameclash-project/contracts/C.sol
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,2 @@ | ||
pragma solidity ^0.5.1 | ||
contract C {}; |
2 changes: 2 additions & 0 deletions
2
...ges/buidler-core/test/fixture-projects/contracts-nameclash-project/contracts/folder/C.sol
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,2 @@ | ||
pragma solidity ^0.5.1 | ||
contract C {}; |
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
16 changes: 16 additions & 0 deletions
16
packages/buidler-etherscan/test/buidler-project/contracts/ReentrancyGuard.sol
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,16 @@ | ||
pragma solidity 0.5.15; | ||
|
||
contract ReentrancyGuard { | ||
uint256 public guardCounter; | ||
|
||
constructor() internal { | ||
guardCounter = 1; | ||
} | ||
|
||
modifier nonReentrant() { | ||
guardCounter += 1; | ||
uint256 localCounter = guardCounter; | ||
_; | ||
require(localCounter == guardCounter, "re-entered"); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/buidler-etherscan/test/buidler-project/contracts/TestContract.sol
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
10 changes: 10 additions & 0 deletions
10
packages/buidler-etherscan/test/buidler-project/contracts/TestReentrancyGuardImported.sol
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,10 @@ | ||
pragma solidity 0.5.15; | ||
|
||
import "./imported/ReentrancyGuard.sol"; | ||
|
||
contract TestReentrancyGuardImported is ReentrancyGuard { | ||
|
||
function foo() public nonReentrant returns(uint) { | ||
return 0; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/buidler-etherscan/test/buidler-project/contracts/TestReentrancyGuardLocal.sol
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,10 @@ | ||
pragma solidity 0.5.15; | ||
|
||
import "./ReentrancyGuard.sol"; | ||
|
||
contract TestReentrancyGuardLocal is ReentrancyGuard { | ||
|
||
function foo() public nonReentrant returns(uint) { | ||
return 1; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/buidler-etherscan/test/buidler-project/contracts/imported/ReentrancyGuard.sol
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,32 @@ | ||
pragma solidity 0.5.15; | ||
|
||
/** | ||
* @title Helps contracts guard against reentrancy attacks. | ||
* @author Remco Bloemen <remco@2π.com>, Eenae <alexey@mixbytes.io> | ||
* @dev If you mark a function `nonReentrant`, you should also | ||
* mark it `external`. | ||
*/ | ||
contract ReentrancyGuard { | ||
/// @dev counter to allow mutex lock with only one SSTORE operation | ||
uint256 private _guardCounter; | ||
|
||
constructor() internal { | ||
// The counter starts at one to prevent changing it from zero to a non-zero | ||
// value, which is a more expensive operation. | ||
_guardCounter = 1; | ||
} | ||
|
||
/** | ||
* @dev Prevents a contract from calling itself, directly or indirectly. | ||
* Calling a `nonReentrant` function from another `nonReentrant` | ||
* function is not supported. It is possible to prevent this from happening | ||
* by making the `nonReentrant` function external, and make it call a | ||
* `private` function that does the actual work. | ||
*/ | ||
modifier nonReentrant() { | ||
_guardCounter += 1; | ||
uint256 localCounter = _guardCounter; | ||
_; | ||
require(localCounter == _guardCounter, "re-entered"); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/buidler-etherscan/test/buidler-project/contracts/libraries/SafeMath.sol
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.5.1; | ||
pragma solidity 0.5.15; | ||
|
||
|
||
library SafeMath { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/artifacts | ||
/cache |