smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.75k stars 2.9k forks source link

my current entry fee is 0 #717

Open DarrenWayn opened 2 years ago

DarrenWayn commented 2 years ago

my current entry fee is 0, i had no idea after running brownie run scripts/fund_and_withdraw.py --network ganache-local image Does anybody know how to fix this?

br0wnD3v commented 2 years ago

Did you first deploy the contract? If not it might be because FundMe[-1] has nothing to give so you get 0.

DarrenWayn commented 2 years ago

Yes i had run it using brownie run scripts/deploy.py but its still 0

DarrenWayn commented 2 years ago

image

I deploy the contract running this "brownie run scripts/deploy.py --network ganache-local" same as Patrick does in 05.44.40

DarrenWayn commented 2 years ago

image

br0wnD3v commented 2 years ago

There's a typo in your --network ganache-local and since it was on development by default which had nothing to give you received what was expected. 0 since the contract doesn't exist on that network.

DarrenWayn commented 2 years ago

Which one is typo?

So its because my config is development by default its became 0? So what should i change?

br0wnD3v commented 2 years ago

you wrote network as netowrk in your second command, check it. And yes, since the --network ganache-local flag was typed wrong it ran it on development which didn't had the deployed FundMe contract and hence the 0. Also can you do brownie networks list true and show the output?

DarrenWayn commented 2 years ago

image didn't work bot

Ethereum ├─Mainnet (Infura) │ ├─id: mainnet │ ├─chainid: 1 │ ├─explorer: https://api.etherscan.io/api │ ├─host: https://mainnet.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696 ├─Ropsten (Infura) │ ├─id: ropsten │ ├─chainid: 3 │ ├─explorer: https://api-ropsten.etherscan.io/api │ ├─host: https://ropsten.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696 ├─Rinkeby (Infura) │ ├─id: rinkeby │ ├─chainid: 4 │ ├─explorer: https://api-rinkeby.etherscan.io/api │ ├─host: https://rinkeby.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696 ├─Goerli (Infura) │ ├─id: goerli │ ├─chainid: 5 │ ├─explorer: https://api-goerli.etherscan.io/api │ ├─host: https://goerli.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696 ├─Kovan (Infura) │ ├─id: kovan │ ├─chainid: 42 │ ├─explorer: https://api-kovan.etherscan.io/api │ ├─host: https://kovan.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696 └─ganache-local ├─id: ganache-local ├─chainid: 1337 └─host: http://127.0.0.1:7545

Ethereum Classic ├─Mainnet │ ├─id: etc │ ├─chainid: 61 │ ├─explorer: https://blockscout.com/etc/mainnet/api │ └─host: https://www.ethercluster.com/etc └─Kotti ├─id: kotti ├─chainid: 6 ├─explorer: https://blockscout.com/etc/kotti/api └─host: https://www.ethercluster.com/kotti

Arbitrum └─Mainnet ├─id: arbitrum-main ├─chainid: 42161 ├─explorer: https://api.arbiscan.io/api ├─host: https://arb1.arbitrum.io/rpc └─multicall2: 0x5B5CFE992AdAC0C9D48E05854B2d91C73a003858

Avalanche ├─Mainnet │ ├─id: avax-main │ ├─chainid: 43114 │ ├─explorer: https://api.snowtrace.io/api │ └─host: https://api.avax.network/ext/bc/C/rpc └─Testnet ├─id: avax-test ├─chainid: 43113 └─host: https://api.avax-test.network/ext/bc/C/rpc

Binance Smart Chain ├─Testnet │ ├─id: bsc-test │ ├─chainid: 97 │ ├─explorer: https://api-testnet.bscscan.com/api │ └─host: https://data-seed-prebsc-1-s1.binance.org:8545 └─Mainnet ├─id: bsc-main ├─chainid: 56 ├─explorer: https://api.bscscan.com/api └─host: https://bsc-dataseed.binance.org

Fantom Opera ├─Testnet │ ├─id: ftm-test │ ├─chainid: 4002 │ ├─explorer: https://explorer.testnet.fantom.network │ └─host: https://rpc.testnet.fantom.network └─Mainnet ├─id: ftm-main ├─chainid: 250 ├─explorer: https://api.ftmscan.com/api └─host: https://rpcapi.fantom.network

Harmony └─Mainnet (Shard 0) ├─id: harmony-main ├─chainid: 1666600000 ├─host: https://api.harmony.one └─multicall2: 0x3E01dD8a5E1fb3481F0F589056b428Fc308AF0Fb

Polygon ├─Mainnet (Infura) │ ├─id: polygon-main │ ├─chainid: 137 │ ├─explorer: https://api.polygonscan.com/api │ ├─host: https://polygon-mainnet.infura.io/v3/$WEB3_INFURA_PROJECT_ID │ └─multicall2: 0xc8E51042792d7405184DfCa245F2d27B94D013b6 └─Mumbai Testnet (Infura) ├─id: polygon-test ├─chainid: 80001 ├─explorer: https://api-testnet.polygonscan.com/api ├─host: https://polygon-mumbai.infura.io/v3/$WEB3_INFURA_PROJECT_ID └─multicall2: 0x6842E0412AC1c00464dc48961330156a07268d14

XDai ├─Mainnet │ ├─id: xdai-main │ ├─chainid: 100 │ ├─explorer: https://blockscout.com/xdai/mainnet/api │ └─host: https://xdai.poanetwork.dev └─Testnet ├─id: xdai-test ├─chainid: 77 ├─explorer: https://blockscout.com/poa/sokol/api └─host: https://sokol.poa.network

Development ├─Ganache-CLI │ ├─id: development │ ├─cmd: ganache-cli │ └─host: http://127.0.0.1 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─gas_limit: 12000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─Geth Dev │ ├─id: geth-dev │ ├─cmd: ethnode │ └─host: http://127.0.0.1 │ └─port: 8545 ├─Hardhat │ ├─id: hardhat │ ├─cmd: npx hardhat node │ └─host: http://localhost │ └─port: 8545 ├─Hardhat (Mainnet Fork) │ ├─id: hardhat-fork │ ├─cmd: npx hardhat node │ ├─host: http://localhost │ └─timeout: 120 │ ├─fork: mainnet │ └─port: 8545 ├─Ganache-CLI (BSC-Mainnet Fork) │ ├─id: bsc-main-fork │ ├─cmd: ganache-cli │ ├─host: http://127.0.0.1 │ └─timeout: 120 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─fork: bsc-main │ ├─gas_limit: 12000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─Ganache-CLI (FTM-Mainnet Fork) │ ├─id: ftm-main-fork │ ├─cmd: ganache-cli │ ├─host: http://127.0.0.1 │ └─timeout: 120 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─fork: ftm-main │ ├─gas_limit: 12000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─Ganache-CLI (Polygon-Mainnet Fork) │ ├─id: polygon-main-fork │ ├─cmd: ganache-cli │ ├─host: http://127.0.0.1 │ └─timeout: 120 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─fork: polygon-main │ ├─gas_limit: 20000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─Ganache-CLI (XDai-Mainnet Fork) │ ├─id: xdai-main-fork │ ├─cmd: ganache-cli │ ├─host: http://127.0.0.1 │ └─timeout: 120 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─fork: xdai-main │ ├─gas_limit: 20000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─Ganache-CLI (Avax-Mainnet Fork) │ ├─id: avax-main-fork │ ├─cmd: ganache-cli │ ├─host: http://127.0.0.1 │ └─timeout: 120 │ ├─accounts: 10 │ ├─evm_version: istanbul │ ├─fork: avax-main │ ├─gas_limit: 20000000 │ ├─mnemonic: brownie │ └─port: 8545 ├─mainnet-fork-dev │ ├─id: mainnet-fork-dev │ ├─cmd: ganache-cli │ └─host: http://127.0.0.1 │ ├─accounts: 10 │ ├─fork: https://eth-mainnet.alchemyapi.io/v2/M7q9VXTVw4sgqD90SDBfYK1akqfZ119a │ ├─mnemonic: brownie │ └─port: 7545 └─mainnet-fork ├─id: mainnet-fork ├─cmd: ganache-cli └─host: http://127.0.0.1 ├─accounts: 10 ├─fork: https://eth-mainnet.alchemyapi.io/v2/vCxdI-5eDI9hanRJMhdTLM_BnVVzgJnO ├─mnemonic: brownie └─port: 7545

here, do you know whats wrong

br0wnD3v commented 2 years ago

First of all do brownie networks delete ganache-local and then run brownie networks add Ethereum ganache-local host=http://127.0.0.1:8545 chainid=1337. Then for precaution keep the ganache GUI open too, can you run it now? If not, share your deploy.py and brownie-config.yaml file please.

DarrenWayn commented 2 years ago

image here this is with port 8545, i tried this before an have n error

deploy.py image

brownie-config.yaml image

br0wnD3v commented 2 years ago

Another question, did you add the MockV3Aggregator.sol file under contracts/test ? And can you share the helpful_scripts.py too?

DarrenWayn commented 2 years ago

yes i added it. sure image

image

image

br0wnD3v commented 2 years ago

I see something that is maybe leading to the errors, the starting price is already in wei and what you are saying to the script is Web3.toWei(STARTING_PRICE,"ether") that we need to covert 200000000000 which is supposedly in "eth" to convert it to wei which will translate it to 200000000000000000000000000000 Wei. Try removing the toWei line and directly make use of STARTING_PRICE in the helper_scripts.py

DarrenWayn commented 2 years ago

Heyyy yesss it workkkss thanks, i am very confuse so i re code all the lesson 6 xD

br0wnD3v commented 2 years ago

Its okay @DarrenWayn, cheers :)

Vaibhavcste commented 2 years ago

@bot-eth-dev @DarrenWayn I followed all your conversations, I was in the same error , but still unresolved. The txn get reverted