lesson 7: SmartContract Lottery #1836
-
here is the error in my terminal Running 'scripts/deploy_lottery.py::main'... Transaction sent: 0x8ef2772ab557cf6e7bb5088682c154788b79e379341c296acc3572470547e073 Transaction sent: 0x737d009e9827546c81bb7567a7dd980f9b4c36ba10eae9579866d60c656851b7 deployed! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
deploy_lottery.py from scripts.helpful_scripts import get_account, get_contract def deploy_lottery():
account = get_account()
lottery = Lottery.deploy(
get_contract("eth_usd_price_feed").address,
get_contract("vrf_coordinator").address,
get_contract("link_token").address,
config["networks"][network.show_active()]["fee"],
config["networks"][network.show_active()]["keyhash"],
{"from": account},
publish_source=config["networks"][network.show_active()].get("verify", False),)
print("Deployed lottery!")
return lottery
def main():
deploy_lottery() |
Beta Was this translation helpful? Give feedback.
-
brownie-config.yaml dependencies:
- smartcontractkit/[email protected]
- OpenZeppelin/[email protected]
compiler:
solc:
remappings:
- '@chainlink=smartcontractkit/[email protected]'
- '@openzeppelin=OpenZeppelin/[email protected]'
networks:
default: development
development:
keyHash: "0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311"
fee: 100000000000000000
goerli:
vrf_coordinator: "0x2bce784e69d2Ff36c71edcB9F88358dB0DfB55b4"
eth_usd_price_feed: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e"
link_token: "0x326C977E6efc84E512bB9C30f76E30c160eD06FB"
keyHash: "0x0476f9a745b61ea5c0ab224d3a6e4c99f0b02fce4da01143a4f70aa80ae76e8a"
fee: 100000000000000000
verify: True
mainnet-fork:
eth_usd_price_feed: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
verify: False
wallets:
from key: $(PRIVATE_KEY) |
Beta Was this translation helpful? Give feedback.
-
Hello @sundaepromix Can you pass link to your repository if you have one? I think there is error in your contract = contract_type[-1]
or
contract = Contract.from_abi(contract_type._name, contract_address, contract_type.abi) And check if you have mapping implemented in contract_to_mock = {
"eth_usd_price_feed": MockV3Aggregator,
"vrf_coordinator_v2": VRFCoordinatorV2Mock,
"link_token": LinkToken
} As the problem is that your |
Beta Was this translation helpful? Give feedback.
-
Hello @sundaepromix
|
Beta Was this translation helpful? Give feedback.
-
Thanks so much for this, your the best..
Please is there any I can get your contact for mentorship.. I'm new in the
world of Blockchain
…On Fri, Feb 24, 2023, 4:52 PM Vasiliy Gualoto ***@***.***> wrote:
Hello @sundaepromix <https://github.com/sundaepromix>
Additionally to what @Neftyr <https://github.com/Neftyr> said, the none
type is saying that is not able to get the contract itself.
The reasons could be various:
1. if you deploy a contract o a script, and the try to use it in
another script for local development on ganache. It won't find the contract
as when you deploy to local you wont have a build folder with the addresses
of the last deployments. Try to run everything on the same execution
2. Check out your are deploying the mocks as @Neftyr
<https://github.com/Neftyr> suggested.
3. Try to find any typo on your imports.
—
Reply to this email directly, view it on GitHub
<#1836 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5IM265LCD2EF4CZZINAJITWZDKLHANCNFSM6AAAAAAVGFFI3U>
.
You are receiving this because you were mentioned.Message ID:
<smartcontractkit/full-blockchain-solidity-course-py/repo-discussions/1836/comments/5101773
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
@cromewar Can you please help me in solving this problem?
|
Beta Was this translation helpful? Give feedback.
Hello @sundaepromix
Additionally to what @Neftyr said, the none type is saying that is not able to get the contract itself.
The reasons could be various: