ProjectOpenSea / seadrop

Smart contracts for primary drops on EVM chains

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seadrop deployment failing when a certain line is added to the constructor.

zendevil opened this issue · comments

I add the line mintSeaDrop to the constructor like so:

    constructor(
        string memory name,
        string memory symbol,
        address[] memory allowedSeaDrop
    ) ERC721ContractMetadata(name, symbol) {
        // Put the length on the stack for more efficient access.
        uint256 allowedSeaDropLength = allowedSeaDrop.length;

        // Set the mapping for allowed SeaDrop contracts.
        for (uint256 i = 0; i < allowedSeaDropLength; ) {
            _allowedSeaDrop[allowedSeaDrop[i]] = true;
            unchecked {
                ++i;
            }
        }
	mintSeaDrop(0x373F3D184E7a9145B9a8c4528Fb48E79171154aA,1); //<--- added here

        // Set the enumeration.
        _enumeratedAllowedSeaDrop = allowedSeaDrop;

        // Emit an event noting the contract deployment.
        emit SeaDropTokenDeployed();
    }

And it gives me the following error:

[⠒] Compiling...
[⠒] Compiling 78 files with 0.8.17
[⠊] Solc 0.8.17 finished in 9.85s
Compiler run successful with warnings:
Warning (5574): Contract code size is 30473 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> script/DeployAndConfigureExampleToken.s.sol:12:1:
   |
12 | contract DeployAndConfigureExampleToken is Script {
   | ^ (Relevant source part starts here and spans across multiple lines).

Warning (5574): Contract code size is 27955 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> script/DeploySeaDropCloneFactory.s.sol:10:1:
   |
10 | contract DeploySeaDropCloneFactory is BaseCreate2Script {
   | ^ (Relevant source part starts here and spans across multiple lines).

Warning (5574): Contract code size is 25025 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> src/extensions/ERC721SeaDropBurnable.sol:15:1:
   |
15 | contract ERC721SeaDropBurnable is ERC721SeaDrop {
   | ^ (Relevant source part starts here and spans across multiple lines).

Traces:
  [6234925] → new DeployAndConfigureExampleToken@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
    └─ ← 30473 bytes of code

  [309288] DeployAndConfigureExampleToken::run() 
    ├─ [0] VM::startBroadcast() 
    │   └─ ← ()
    ├─ [243336] → new <Unknown>@0x71FCaB2Cd648f4b1c5f1BbAdf1f4526Cf8271346
    │   ├─ emit OwnershipTransferred(param0: 0x0000000000000000000000000000000000000000, param1: 0x373F3D184E7a9145B9a8c4528Fb48E79171154aA)
    │   ├─ [78371] OperatorFilterRegistry::registerAndSubscribe(0x71FCaB2Cd648f4b1c5f1BbAdf1f4526Cf8271346, 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6) 
    │   │   ├─ emit RegistrationUpdated(registrant: 0x71FCaB2Cd648f4b1c5f1BbAdf1f4526Cf8271346, registered: true)
    │   │   ├─ emit SubscriptionUpdated(registrant: 0x71FCaB2Cd648f4b1c5f1BbAdf1f4526Cf8271346, subscription: 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6, subscribed: true)
    │   │   └─ ← ()
    │   └─ ← 0 bytes of code
    └─ ← 0x15e26ff3


Error: 
Script failed.

Any way to fix this?

Use the internal _mint function instead, and as I said previously please open discussions instead of issues for your questions.