ProjectOpenSea / seadrop

Smart contracts for primary drops on EVM chains

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to compile ERC721SeaDrop/ERC721SeaDropUpgradeable

Stevewu1234 opened this issue · comments

Compiler run failed
error[6959]: TypeError: Overriding function changes state mutability from "payable" to "nonpayable".
   --> lib/seadrop/src/ERC721SeaDrop.sol:502:5:
    |
502 |     function approve(
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
   --> lib/seadrop/lib/ERC721A/contracts/ERC721A.sol:434:5:
    |
434 |     function approve(address to, uint256 tokenId) public payable virtual override {
    |     ^ (Relevant source part starts here and spans across multiple lines).



error[6959]: TypeError: Overriding function changes state mutability from "payable" to "nonpayable".
   --> lib/seadrop/src/ERC721SeaDrop.sol:523:5:
    |
523 |     function transferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
   --> lib/seadrop/lib/ERC721A/contracts/ERC721A.sol:544:5:
    |
544 |     function transferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).



error[6959]: TypeError: Overriding function changes state mutability from "payable" to "nonpayable".
   --> lib/seadrop/src/ERC721SeaDrop.sol:534:5:
    |
534 |     function safeTransferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
   --> lib/seadrop/lib/ERC721A/contracts/ERC721A.sol:625:5:
    |
625 |     function safeTransferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).



error[6959]: TypeError: Overriding function changes state mutability from "payable" to "nonpayable".
   --> lib/seadrop/src/ERC721SeaDrop.sol:558:5:
    |
558 |     function safeTransferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
   --> lib/seadrop/lib/ERC721A/contracts/ERC721A.sol:648:5:
    |
648 |     function safeTransferFrom(
    |     ^ (Relevant source part starts here and spans across multiple lines).

this is because you are using a later version of ERC721A than is pinned in the lib submodule. to update to the correct version, run git submodule init && git submodule update in the root and ensure the commit hash for ERC721A lines up with the one in lib/ERC721A (9be81f0)

this is because you are using a later version of ERC721A than is pinned in the lib submodule. to update to the correct version, run git submodule init && git submodule update in the root and ensure the commit hash for ERC721A lines up with the one in lib/ERC721A (9be81f0)

it works, thanks

I have encountered the same TypeError when import ERC721SeaDropUpgradeable

TypeError: Overriding function changes state mutability from "payable" to "nonpayable".
    --> contracts/opensea/ERC721SeaDropUpgradeable.sol:4438:5:
     |
4438 |     function safeTransferFrom(
     |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
    --> contracts/opensea/ERC721SeaDropUpgradeable.sol:1218:5:
     |
1218 |     function safeTransferFrom(
     |     ^ (Relevant source part starts here and spans across multiple lines).

which commit could I checkout?

Moreover, it fail to compile if inheriting ERC721SeaDropUpgradeable, and there are multiple same errors encountered(Relevant source part starts here and spans across multiple lines), I found some lib contract(like operator-filter) inherited the initializable contract from openzepplin-contract, instead of openzepplin-contract-upgradeable. Is that the reason? please help.

TypeError: Derived contract must override modifier "reinitializer". Two or more base classes define modifier with same name.
  --> src/collection/CollectionImpl.sol:19:1:
   |
19 | contract CollectionImpl is
   | ^ (Relevant source part starts here and spans across multiple lines).
Note: Definition in "Initializable": 
   --> lib/seadrop/src-upgradeable/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:118:5:
    |
118 |     modifier reinitializer(uint8 version) {
    |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Definition in "Initializable": 
   --> lib/seadrop/src-upgradeable/lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol:107:5:
    |
107 |     modifier reinitializer(uint8 version) {
    |     ^ (Relevant source part starts here and spans across multiple lines).

this is likely an issue with conflicting libs, were you able to figure it out? closing due to staleness but let me know if i can help further.