Replies: 1 comment
-
Hello @AnaAse, Please make your function setUp() external {
// fundMe = new FundMe(0x106379F11C3cF4027C38655b79327081eA9C9Cf5); OJO este numero copiado del curso!!!
DeployFundMe deployFundMe = new DeployFundMe();
fundMe = deployFundMe.run();
vm.deal(USER, 100e18);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I got kinda stock here, with the prank code.
I am getting the following error:
[FAIL: EvmError: Revert] testFundUpdatesFundedDataStructure() (gas: 16886)
Traces:
[16886] FundMeTest::testFundUpdatesFundedDataStructure()
├─ [0] VM::prank(user: [0x6CA6d1e2D5347Bfab1d91e883F1915560e09129D])
│ └─ ← [Return]
├─ [0] FundMe::fund{value: 100000000000000000}()
│ └─ ← [OutOfFunds] EvmError: OutOfFunds
└─ ← [Revert] EvmError: Revert
Seems to be obvious OutOfFunds yeah but... not as obvious really
FundMeTest:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Test, console} from "forge-std/Test.sol";
import {FundMe} from "../src/FundMe.sol";
import {DeployFundMe} from "../script/DeployFundMe.s.sol";
contract FundMeTest is Test {
FundMe fundMe;
address USER = makeAddr("user"); //we can use this user when we want to work with somebody
uint256 constant SEND_VALUE = 0.1 ether; // that makes it 100000000000000000
}
FundMe:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
// Note: The AggregatorV3Interface might be at a different location than what was in the video!
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
import {PriceConverter} from "./PriceConverter.sol";
error FundMe__NotOwner();
contract FundMe {
using PriceConverter for uint256;
}
}
// Concepts we didn't cover yet (will cover in later sections)
// 1. Enum
// 2. Events
// 3. Try / Catch
// 4. Function Selector
// 5. abi.encode / decode
// 6. Hash with keccak256
// 7. Yul / Assembly
DeployFundMe:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script} from "forge-std/Script.sol";
import {FundMe} from "../src/FundMe.sol";
import {HelperConfig} from "./HelperConfig.s.sol";
contract DeployFundMe is Script {
function run() external returns (FundMe){
//Before startBroadcast -> Not a "real" tx transaction
HelperConfig helperConfig = new HelperConfig();
address ethUsdPriceFeed = helperConfig.activeNetworkConfig();
}
PriceConverter:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
// Why is this a library and not abstract?
// Why not an interface?
library PriceConverter {
// We could make this public, but then we'd have to deploy it
function getPrice(AggregatorV3Interface priceFeed) internal view returns (uint256) {
// Sepolia ETH / USD Address
// https://docs.chain.link/data-feeds/price-feeds/addresses
}
Beta Was this translation helpful? Give feedback.
All reactions