chainlink-dynamic-nft-alchemy icon indicating copy to clipboard operation
chainlink-dynamic-nft-alchemy copied to clipboard

TypeError Function has override specified but does not override anything

Open jackluo2012 opened this issue 2 years ago • 8 comments

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); }

`

jackluo2012 avatar Jan 18 '23 06:01 jackluo2012

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

image

happylolonly avatar Feb 02 '23 13:02 happylolonly

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

scguaquetam avatar Feb 02 '23 15:02 scguaquetam

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

scguaquetam avatar Feb 02 '23 15:02 scguaquetam

@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

happylolonly avatar Feb 02 '23 15:02 happylolonly

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.

scguaquetam avatar Feb 02 '23 16:02 scguaquetam

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

happylolonly avatar Feb 02 '23 16:02 happylolonly

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

scguaquetam avatar Feb 02 '23 16:02 scguaquetam

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

happylolonly avatar Feb 06 '23 18:02 happylolonly