HelperConfig.s.sol Explained #6349
JuanPedro0410
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here I import the tools for the contract. The MockV3Aggregator is a contract that simulate the pricefeed on a local blockchain.
The script has some tools to make script contracts.
Create the contract that inherits from Script.sol contract
Create the variables for ther contract. the first one is a variable of type networkConfig that will we used to store the network that is used.
The 2 last variables store 2 parameters for a function.
create the type NetworkConfig that when you create a variable or store something in, you must to pass an address called priceFeed. That this will we what stores the function.
in the constructor you check if the chainId of the network is the chainId of sepolia, if it is correct makes activeNetworkConfig equals to getSepoliaEthConfig() that returns a network config
else it execute getOrCreateAnvilEthConfig() that deploy or if it has been deployed run the code, of a contract that simulate a pricefeed on a local enviroment and returns the network local config
Beta Was this translation helpful? Give feedback.
All reactions