+18
-4
@@ -11,9 +11,6 @@ coverage
|
||||
coverage.json
|
||||
typechain
|
||||
|
||||
# don't push the environment vars!
|
||||
.env
|
||||
|
||||
# Built application files
|
||||
.DS*
|
||||
*.apk
|
||||
@@ -101,4 +98,21 @@ lint/tmp/
|
||||
|
||||
gas-report.txt
|
||||
|
||||
lib
|
||||
# Compiler files
|
||||
cache/
|
||||
out/
|
||||
|
||||
# Ignores development broadcast logs
|
||||
!/broadcast
|
||||
/broadcast/*/31337/
|
||||
/broadcast/**/dry-run/
|
||||
/broadcast/
|
||||
|
||||
# Docs
|
||||
docs/
|
||||
|
||||
# Dotenv file
|
||||
.env
|
||||
|
||||
# zkSync
|
||||
zkout/
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
[submodule "lib/foundry-devops"]
|
||||
path = lib/foundry-devops
|
||||
url = https://github.com/cyfrin/foundry-devops
|
||||
[submodule "lib/chainlink-brownie-contracts"]
|
||||
path = lib/chainlink-brownie-contracts
|
||||
url = https://github.com/smartcontractkit/chainlink-brownie-contracts
|
||||
[submodule "lib/forge-std"]
|
||||
path = lib/forge-std
|
||||
url = https://github.com/foundry-rs/forge-std
|
||||
[submodule "lib/solmate"]
|
||||
path = lib/solmate
|
||||
url = https://github.com/transmissions11/solmate
|
||||
@@ -28,7 +28,7 @@ import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFCo
|
||||
import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol";
|
||||
import "@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol";
|
||||
import "@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
|
||||
import "hardhat/console.sol";
|
||||
//import "hardhat/console.sol";
|
||||
|
||||
error Raffle__NotEnoughETHEntered();
|
||||
error Raffle__TransferFailed();
|
||||
|
||||
+10
-4
@@ -1,8 +1,14 @@
|
||||
# Foundry Configuration
|
||||
|
||||
|
||||
[profile.default]
|
||||
src = "contracts"
|
||||
out = "out"
|
||||
libs = ["lib"]
|
||||
remappings = ['@chainlink.=.contracts=/lib/chainlink-brownie-contracts/contracts/']
|
||||
|
||||
remappings = [
|
||||
'@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts/',
|
||||
'@solmate=lib/solmate/src/',
|
||||
"@chainlink/=lib/chainlink/contracts/src/v0.8/",
|
||||
"hardhat/=./contracts/"
|
||||
]
|
||||
|
||||
|
||||
[profile.test]
|
||||
|
||||
Submodule
+1
Submodule lib/forge-std added at 1714bee72e
@@ -1,19 +0,0 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {Counter} from "../src/Counter.sol";
|
||||
|
||||
contract CounterScript is Script {
|
||||
Counter public counter;
|
||||
|
||||
function setUp() public {}
|
||||
|
||||
function run() public {
|
||||
vm.startBroadcast();
|
||||
|
||||
counter = new Counter();
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
contract Counter {
|
||||
uint256 public number;
|
||||
|
||||
function setNumber(uint256 newNumber) public {
|
||||
number = newNumber;
|
||||
}
|
||||
|
||||
function increment() public {
|
||||
number++;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import {Test, console} from "forge-std/Test.sol";
|
||||
import {Counter} from "../src/Counter.sol";
|
||||
|
||||
contract CounterTest is Test {
|
||||
Counter public counter;
|
||||
|
||||
function setUp() public {
|
||||
counter = new Counter();
|
||||
counter.setNumber(0);
|
||||
}
|
||||
|
||||
function test_Increment() public {
|
||||
counter.increment();
|
||||
assertEq(counter.number(), 1);
|
||||
}
|
||||
|
||||
function testFuzz_SetNumber(uint256 x) public {
|
||||
counter.setNumber(x);
|
||||
assertEq(counter.number(), x);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user