Lesson 6: Contract not found on mainnet-fork-dev #308
-
I create my alchemy project as Patrick said:
And i get the API key, which has the next structure: https://eth-mainnet.alchemyapi.io/v2/API-KEY My brownie-config.yaml file is: dependencies:
#- <organization/repo>@version
- smartcontractkit/[email protected]
compiler:
solc:
remappings:
- '@chainlink=smartcontractkit/[email protected]'
dotenv: .env
networks:
kovan:
eth_usd_price_feed: '0x9326BFA02ADD2366b30bacB125260Af641031331'
verify: True
mainnet-fork:
eth_usd_price_feed: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419'
verify: False
mainnet-fork-dev:
eth_usd_price_feed: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419'
verify: False
development:
verify: False
ganache-testnet-dev:
verify: False
wallets:
from_key: ${PRIVATE_KEY} I added the mainnet-fork-dev with the line However, when I run the deploy.py file with the line
The contract 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 exists in the mainnet. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hello @carlitox477 for me it seems you have something missing with your constructor which is not taking the correct imput, may be is using this address
constructor(address _priceFeed) public {
priceFeed = AggregatorV3Interface(_priceFeed);
owner = msg.sender;
}
def deploy_fund_me():
account = get_account()
if network.show_active() not in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
price_feed_address = config["networks"][network.show_active()][
"eth_usd_price_feed"
]
else:
deploy_mocks()
price_feed_address = MockV3Aggregator[-1].address
fund_me = FundMe.deploy(
price_feed_address,
{"from": account},
publish_source=config["networks"][network.show_active()].get("verify"),
)
print(f"Contract deployed to {fund_me.address}")
return fund_me
FORKED_LOCAL_ENVIRONMENTS = ["mainnet-fork", "mainnet-fork-dev"]
LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"] |
Beta Was this translation helpful? Give feedback.
-
I found the answer to my problem after spending 4 hours looking the bug: I'm dumb XD It was a sintax error. Instead of So, that's why price_feed_address was interpreted as a tuple and that's why I got the error:
|
Beta Was this translation helpful? Give feedback.
I found the answer to my problem after spending 4 hours looking the bug: I'm dumb XD
It was a sintax error. Instead of
price_feed_address=config["networks"][network.show_active()]["eth_usd_price_feed"]
I putprice_feed_address=config["networks"][network.show_active()]["eth_usd_price_feed"],
. If you don't see the problem like me, here a hint: look for the comma (,) .So, that's why price_feed_address was interpreted as a tuple and that's why I got the error: