smartcontractkit / full-blockchain-solidity-course-py

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

AttributeError: Contract 'FundMe' object has no attribute 'getEntranceFee' #1856

Open NotZayne opened 1 year ago

NotZayne commented 1 year ago

Hi guys im stuck on this error when trying to deploy the fund_and_withdraw.py to the ganache-local chain. Im on the video linked at https://www.youtube.com/watch?v=M576WGiDBdQ 5:45:05 hrs. Cannot seem to get passed this.

fund_and_withdraw FundME
NotZayne commented 1 year ago
error
ccorderop commented 1 year ago

Hey friend. I'm writting from Spain ..

I have a similar problem .. i would like ask you if you could give me and idea what happen .. my error in lesson 6 is:

_raise AttributeError(f"Contract '{self.name}' object has no attribute '{name}'") AttributeError: Contract 'FundMe' object has no attribute 'getEntranceFee'

Script: from brownie import FundMe, accounts from scripts.helpful_scripts import get_account

def fund(): fund_me = FundMe[-1] account = get_account() print(account) entrance_fee = fund_me.getEntranceFee() print(entrance_fee)

def main(): fund()

FundMe.sol: function getEntranceFee() public view returns (uint256) { // minimumUSD uint256 minimumUSD = 50 * 10 * 18; uint256 price = getPrice(); uint256 precision = 1 10 * 18; // return (minimumUSD precision) / price; // We fixed a rounding error found in the video by adding one! return ((minimumUSD * precision) / price) + 1; }

I compiled FundMe.sol and i see in .json getEntranceFee() .. On ganache instance i see:

_web3_clientVersion eth_getBlockByNumber eth_accounts eth_getCode ethgetCode

An Idea what could happen??

Tnx very much and have a nice day.

moosakhuwaja commented 10 months ago

@NotZayne did you compiled after un-commenting getEntranceFee() ?