PatrickAlphaC / smartcontract-lottery

MIT License
79 stars 113 forks source link

Lesson7, 6:33:58: Status 404 after add openzeppelin API #48

Closed Daisonoio closed 2 years ago

Daisonoio commented 2 years ago

Hi,

After I had adding the openzeppelin contract Ownable.sol my contract no compile anymore.

Everytime I have error: "ConnectionError: Status 404 when getting package versions from Github: 'Not Found'"

I've try to change the contract into brownie-config into "@4.5.0", and i've try "npm install @openzeppelin/contracts" like sugest into the docs, but nothing works.

Have any hint?

Thanks

salamisami commented 2 years ago

Could you post your brownie-config.yaml and your import line on Lottery.sol?

Daisonoio commented 2 years ago

Could you post your brownie-config.yaml and your import line on Lottery.sol?

brownie-config.yaml

` dependencies:
  - smartcontractkit/chainlink-brownie-contracts@1.1.1
  - OpenZeppelin/openzeppelin-contract@4.5.0
dotenv: .env
compiler:
  solc:
    remappings:
      - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
      - '@openzeppelin=OpenZeppelin/openzeppelin-contract@4.5.0'

networks:
  mainnet-fork:
    eth_usd_price_feed: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419' `

Import line:

import "@openzeppelin/contracts/access/Ownable.sol";

I've try to changes dependecies and remapings with: OpenZeppelin/openzeppelin-contract@3.4.0

and: '@openzeppelin=OpenZeppelin/openzeppelin-contract@3.4.0'

like video but the result is the same

P.S: Another important thing: if I try to copy and paste the contract that I find into the repository when I compile I' receive in response the same error.

salamisami commented 2 years ago

Does this still happen if you also use the brownie-config.yaml from the repo?

Daisonoio commented 2 years ago

Thanks a lot.

I've found the mistake: in .yaml file I wrote

'@openzeppelin=OpenZeppelin/openzeppelin-contract@3.4.0'

instead of:

'@openzeppelin=OpenZeppelin/openzeppelin-contractS@3.4.0'