-
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.
- Loading branch information
1 parent
6c0c01c
commit 10c3e9e
Showing
10 changed files
with
221 additions
and
0 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# All e2e test temporary folders | ||
projects-initialization-tests-* | ||
fixture-projects-run-* |
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,18 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
pragma abicoder v2; | ||
pragma solidity ^0.8.19; | ||
|
||
import "./B.sol"; | ||
|
||
contract A { | ||
uint256 private storedData; | ||
|
||
function set(uint256 value) public { | ||
storedData = value; | ||
} | ||
|
||
function get() public view returns (uint256) { | ||
return storedData; | ||
} | ||
} |
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,13 @@ | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
pragma solidity ^0.8.19; | ||
|
||
import "./C.sol"; | ||
|
||
contract B { | ||
uint public x; | ||
|
||
function inc() public { | ||
x++; | ||
} | ||
} |
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.8.19; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.19; | ||
|
||
// Uncomment this line to use console.log | ||
// import "hardhat/console.sol"; | ||
|
||
contract Lock { | ||
uint public unlockTime; | ||
address payable public owner; | ||
|
||
event Withdrawal(uint amount, uint when); | ||
|
||
constructor(uint _unlockTime) payable { | ||
require( | ||
block.timestamp < _unlockTime, | ||
"Unlock time should be in the future" | ||
); | ||
|
||
unlockTime = _unlockTime; | ||
owner = payable(msg.sender); | ||
} | ||
|
||
function withdraw() public { | ||
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal | ||
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp); | ||
|
||
require(block.timestamp >= unlockTime, "You can't withdraw yet"); | ||
require(msg.sender == owner, "You aren't the owner"); | ||
|
||
emit Withdrawal(address(this).balance, block.timestamp); | ||
|
||
owner.transfer(address(this).balance); | ||
} | ||
} |
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,84 @@ | ||
// Sources flattened with hardhat v2.19.2 https://hardhat.org | ||
|
||
// SPDX-License-Identifier: MIT AND MPL-2.0 AND UNLICENSED | ||
|
||
pragma abicoder v2; | ||
|
||
// File contracts/C.sol | ||
|
||
pragma solidity ^0.8.19; | ||
|
||
contract C {} | ||
|
||
|
||
// File contracts/B.sol | ||
|
||
// Original license: SPDX_License_Identifier: MPL-2.0 | ||
|
||
pragma solidity ^0.8.19; | ||
|
||
contract B { | ||
uint public x; | ||
|
||
function inc() public { | ||
x++; | ||
} | ||
} | ||
|
||
|
||
// File contracts/A.sol | ||
|
||
// Original license: SPDX_License_Identifier: MIT | ||
|
||
// Original pragma directive: pragma abicoder v2 | ||
pragma solidity ^0.8.19; | ||
|
||
contract A { | ||
uint256 private storedData; | ||
|
||
function set(uint256 value) public { | ||
storedData = value; | ||
} | ||
|
||
function get() public view returns (uint256) { | ||
return storedData; | ||
} | ||
} | ||
|
||
|
||
// File contracts/Lock.sol | ||
|
||
// Original license: SPDX_License_Identifier: UNLICENSED | ||
pragma solidity ^0.8.19; | ||
|
||
// Uncomment this line to use console.log | ||
// import "hardhat/console.sol"; | ||
|
||
contract Lock { | ||
uint public unlockTime; | ||
address payable public owner; | ||
|
||
event Withdrawal(uint amount, uint when); | ||
|
||
constructor(uint _unlockTime) payable { | ||
require( | ||
block.timestamp < _unlockTime, | ||
"Unlock time should be in the future" | ||
); | ||
|
||
unlockTime = _unlockTime; | ||
owner = payable(msg.sender); | ||
} | ||
|
||
function withdraw() public { | ||
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal | ||
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp); | ||
|
||
require(block.timestamp >= unlockTime, "You can't withdraw yet"); | ||
require(msg.sender == owner, "You aren't the owner"); | ||
|
||
emit Withdrawal(address(this).balance, block.timestamp); | ||
|
||
owner.transfer(address(this).balance); | ||
} | ||
} |
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,40 @@ | ||
// Sources flattened with hardhat v2.19.2 https://hardhat.org | ||
|
||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
// File contracts/Lock.sol | ||
|
||
// Original license: SPDX_License_Identifier: UNLICENSED | ||
pragma solidity ^0.8.19; | ||
|
||
// Uncomment this line to use console.log | ||
// import "hardhat/console.sol"; | ||
|
||
contract Lock { | ||
uint public unlockTime; | ||
address payable public owner; | ||
|
||
event Withdrawal(uint amount, uint when); | ||
|
||
constructor(uint _unlockTime) payable { | ||
require( | ||
block.timestamp < _unlockTime, | ||
"Unlock time should be in the future" | ||
); | ||
|
||
unlockTime = _unlockTime; | ||
owner = payable(msg.sender); | ||
} | ||
|
||
function withdraw() public { | ||
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal | ||
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp); | ||
|
||
require(block.timestamp >= unlockTime, "You can't withdraw yet"); | ||
require(msg.sender == owner, "You aren't the owner"); | ||
|
||
emit Withdrawal(address(this).balance, block.timestamp); | ||
|
||
owner.transfer(address(this).balance); | ||
} | ||
} |
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 @@ | ||
module.exports = { | ||
solidity: "0.8.19", | ||
}; |
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,6 @@ | ||
{ | ||
"name": "minimal", | ||
"dependencies": { | ||
"hardhat": "file:../../../packages/hardhat-core/hardhat-2.19.1.tgz" | ||
} | ||
} |
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,19 @@ | ||
#! /usr/bin/env sh | ||
|
||
# it should flatten all the files in the folder because no file names are passed | ||
if ! npx hardhat flatten | diff - flatten_all_files.txt; then | ||
echo "The flatten file is different from the flatten_all_files.txt" | ||
exit 1 | ||
fi | ||
|
||
# it should flatten only the 'Lock.sol' file because it is passed as an argument | ||
if ! npx hardhat flatten contracts/Lock.sol | diff - flatten_lock_file.txt; then | ||
echo "The flatten file is different from the flatten_lock_file.txt" | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
|
||
|
||
|