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

TypeError Function has override specified but does not override anything #7

Open
jackluo2012 opened this issue Jan 18, 2023 · 8 comments

Comments

@jackluo2012
Copy link

TypeError: Function has override specified but does not override anything. --> contracts/BullBear.sol:69:24: | 69 | ) internal virtual override

old
// The following functions are overrides required by Solidity. function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); }
new
`
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721, ERC721Enumerable)
{
super._beforeTokenTransfer(from, to, tokenId, batchSize);
}

`

@happylolonly
Copy link

happylolonly commented Feb 2, 2023

I also can't compile, tried different versions, @zeuslawyer please help

image

@scguaquetam
Copy link

Can you share your smart contract to see the imports? I think it is not recognizing the parent smart contract ERC721Enumerable.

@scguaquetam
Copy link

I see a detail, can be that way
The original function inside ERC721Enumerable parent contract imported from openzeppelin has 4 inputs parameters in its function.
in your github contract, you call it with 3 values
looks like you are missing batchSize

@happylolonly
Copy link

@sheva323 I am using code from this branch - https://github.com/zeuslawyer/chainlink-dynamic-nft-alchemy/blob/price-feeds/contracts/Bull&Bear.sol
didn't change it

@scguaquetam
Copy link

Ohh I see, the additional parameter in one little solution, it takes off some errors, but there still the error appearing. Im trying to test here.

@happylolonly
Copy link

Would be cool if you can fix it, I would continue lesson;)
Noob in Solidity for now to understand how to fix all 😄

@scguaquetam
Copy link

it's actually strange, it shouldn't have problems.

@happylolonly
Copy link

happylolonly commented Feb 6, 2023

I see a detail, can be that way The original function inside ERC721Enumerable parent contract imported from openzeppelin has 4 inputs parameters in its function. in your github contract, you call it with 3 values looks like you are missing batchSize

did it, it helped to compile, thanks 🙏
@jackluo2012

@zeuslawyer would be good to add this fix to repo, and update Alchemy course, so new people won't face problems

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