-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration Tests Added and Makefile
- Loading branch information
1 parent
e57b780
commit 1c91f09
Showing
10 changed files
with
172 additions
and
35 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,11 @@ | ||
TestFundMeContract:testFundFailsWithLessEthSent() (gas: 27782) | ||
TestFundMeContract:testFundIsGettingUpdatedWithMultipleUsers() (gas: 165488) | ||
TestFundMeContract:testFundUpdatesFundedDataStructures() (gas: 104606) | ||
TestFundMeContract:testFundersAddedToArray() (gas: 165497) | ||
TestFundMeContract:testMinimumUSD() (gas: 8400) | ||
TestFundMeContract:testOwnerMsgSender() (gas: 8588) | ||
TestFundMeContract:testPriceFeedVersion() (gas: 13622) | ||
TestFundMeContract:testTotalBalance() (gas: 8530) | ||
TestFundMeContract:testWithdrawWithMultipleUsers() (gas: 507119) | ||
TestFundMeContract:testWithdrawWithMultipleUsersCheaper() (gas: 506359) | ||
TestFundMeContract:testWithdrawWithSingleFunder() (gas: 89007) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-include .env | ||
|
||
build:; forge build | ||
|
||
deploy-sepolia: | ||
forge script script/FundMe.s.sol --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY) --broadcast --verify --etherscan-api-key $(ETHERSCAN_API_KEY) --force -vvvv | ||
|
||
|
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
Submodule foundry-devops
added at
47393d
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,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import {FundMe} from "../src/FundMe.sol"; | ||
import {Script, console} from "../lib/forge-std/src/Script.sol"; | ||
import {DevOpsTools} from "../lib/foundry-devops/src/DevOpsTools.sol"; | ||
|
||
contract FundFundMe is Script { | ||
uint256 SEND_VALUE = 0.01 ether; | ||
|
||
function fundFundMe(address mostRecentDeployedAddress) public { | ||
vm.startBroadcast(); | ||
FundMe(payable(mostRecentDeployedAddress)).fund{value: SEND_VALUE}(); | ||
vm.stopBroadcast(); | ||
console.log("Account Funded"); | ||
} | ||
|
||
function run() external { | ||
address mostRecentDeployedAddress = DevOpsTools | ||
.get_most_recent_deployment("FundMe", block.chainid); | ||
vm.startBroadcast(); | ||
fundFundMe(mostRecentDeployedAddress); | ||
vm.stopBroadcast(); | ||
} | ||
} | ||
|
||
contract WithdrawFundMe is Script { | ||
function withdrawFundMe(address mostRecentDeployedAddress) public { | ||
vm.startBroadcast(); | ||
FundMe(payable(mostRecentDeployedAddress)).withdrawCheaper(); | ||
vm.stopBroadcast(); | ||
console.log("Funds Withdrawn"); | ||
} | ||
|
||
function run() external { | ||
address mostRecentDeployedAddress = DevOpsTools | ||
.get_most_recent_deployment("FundMe", block.chainid); | ||
vm.startBroadcast(); | ||
withdrawFundMe(mostRecentDeployedAddress); | ||
vm.stopBroadcast(); | ||
} | ||
} |
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
Oops, something went wrong.