Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NotZayne opened this issue Mar 31, 2023 · 3 comments
Open

Comments

@NotZayne
Copy link

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
Copy link
Author

error

@ccorderop
Copy link

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
eth_getCode

An Idea what could happen??

Tnx very much and have a nice day.

@moosakhuwaja
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants