GithubHelp home page GithubHelp logo

seadrop's Introduction

SeaDrop_GithubCover

Version Test CI Code Coverage License Docs Discussions

SeaDrop

SeaDrop is a contract for conducting primary NFT drops on evm-compatible blockchains.

Table of Contents

Background

SeaDrop is a contract to perform primary drops on evm-compatible blockchains. The types of drops supported are public drops, allow list stages, token gated drops, and server-side signed mints. An implementing token contract should contain the methods to interface with SeaDrop through an authorized user such as an Owner or Administrator.

Future SeaDrop contracts are envisioned to contain additional functionality like descending dutch auction mechanisms and payment in ERC20 tokens.

Deployments

Network SeaDrop 1.0
Ethereum

0x00005EA00Ac477B1030CE78506496e8C2dE24bf5

Sepolia
Polygon
Polygon Mumbai
Arbitrum One
Arbitrum Nova
Arbitrum Sepolia
Avalanche C-Chain
Avalanche Fuji
Optimism
Optimism Sepolia
Base
Base Sepolia
BSC
BSC Testnet
Klaytn
Klaytn Baobab
Gnosis Chain
Zora
Zora Sepolia

To deploy to a new EVM chain, follow the steps outlined here.

Diagram

SeaDrop Diagram

This diagram shows the logic flow in the case that a drop is hosted on OpenSea, with an optional mint hosted elsewhere. Note that a fee recipient is not required to integrate with SeaDrop, and a fee recipient may be any address.

Docs

Install

To install dependencies and compile contracts:

git clone --recurse-submodules https://github.com/ProjectOpenSea/seadrop && cd seadrop
yarn install
yarn build

Usage

To run hardhat tests written in javascript:

yarn test
yarn coverage

To profile gas usage:

yarn profile

Foundry Tests

SeaDrop also includes a suite of fuzzing tests written in solidity with Foundry.

To install Foundry (assuming a Linux or macOS system):

curl -L https://foundry.paradigm.xyz | bash

This will download foundryup. To start Foundry, run:

foundryup

To install dependencies:

forge install

To run tests:

forge test

To run gas snapshot:

forge snapshot

The following modifiers are also available:

  • Level 2 (-vv): Logs emitted during tests are also displayed.
  • Level 3 (-vvv): Stack traces for failing tests are also displayed.
  • Level 4 (-vvvv): Stack traces for all tests are displayed, and setup traces for failing tests are displayed.
  • Level 5 (-vvvvv): Stack traces and setup traces are always displayed.
forge test  -vv

For more information on foundry testing and use, see Foundry Book installation instructions.

To run lint checks:

yarn lint:check

Lint checks utilize prettier, prettier-plugin-solidity, and solhint.

"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.24",

Audits

SeaDrop was audited after development by Spearbit, read the report here.

Contributing

Contributions to SeaDrop are welcome by anyone interested in writing more tests, improving readability, optimizing for gas efficiency, or extending the protocol with new features.

When making a pull request, ensure that:

  • All tests pass.
  • Code coverage remains at 100% (coverage tests must currently be written in hardhat).
  • All new code adheres to the style guide:
    • All lint checks pass.
    • Code is thoroughly commented with natspec where relevant.
  • If making a change to the contracts:
    • Gas snapshots are provided and demonstrate an improvement (or an acceptable deficit given other improvements).
    • Reference contracts are modified correspondingly if relevant.
    • New tests (ideally via foundry) are included for all new features or code paths.
  • If making a modification to third-party dependencies, yarn audit passes.
  • A descriptive summary of the PR has been provided.

License

MIT Copyright 2022 Ozone Networks, Inc.

seadrop's People

Contributors

arr00 avatar arthurdelapo avatar broderickbonelli avatar dependabot[bot] avatar emo-eth avatar jim380 avatar joaomorais96 avatar molly-ting avatar ryanio avatar sevamove avatar slokh avatar stephankmin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seadrop's Issues

safeTransferFrom isn't virtual.

I want to change the functionality of safeTransferFrom to run some code that changes the NFT's on-chain stored data. But both the safeTransferFroms aren't virtual and making them virtual in order to override the function in an inherited contract breaks the minting functionality on OpenSea website. Changing the function body itself and deploying ERC721SeaDrop also breaks the minting functionality.

Getting warning that contract may not be deployable on mainnet.

forge create ...

[⠊] Compiling...
[⠒] Compiling 77 files with 0.8.17
[⠔] Solc 0.8.17 finished in 17.72s
Compiler run successful with warnings:
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).

And the contract doesn't get verified and there's a long error message.

Failed to submit contract verification, payload:
{"contractaddress":"0xe302b1451f10dd3e4dd4e76e2c68e9e1d4dcbcec","sourceCode":"{\"language\":\"Solidity\",\"sources\":{\"src/SeaDrop.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport { ISeaDrop } from \\\"./interfaces/ISeaDrop.sol\\\";\\n\\nimport {\\n    INonFungibleSeaDropToken\\n} from \\\"./interfaces/INonFungibleSeaDropToken.sol\\\";\\n\\nimport {\\n    AllowListData,\\n    MintParams,\\n    PublicDrop,\\n    TokenGatedDropStage,\\n    TokenGatedMintParams,\\n    SignedMintValidationParams\\n} from \\\"./lib/SeaDropStructs.sol\\\";\\n\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\n\\nimport { ReentrancyGuard } from \\\"solmate/utils/ReentrancyGuard.sol\\\";\\n\\nimport { IERC721 } from \\\"openzeppelin-contracts/token/ERC721/IERC721.sol\\\";\\n\\nimport {\\n    IERC165\\n} from \\\"openzeppelin-contracts/utils/introspection/IERC165.sol\\\";\\n\\nimport { ECDSA } from \\\"openzeppelin-contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nimport {\\n    MerkleProof\\n} from \\\"openzeppelin-contracts/utils/cryptography/MerkleProof.sol\\\";\\n\\n/**\\n * @title  SeaDrop\\n * @author James Wenzel (emo.eth)\\n * @author Ryan Ghods (ralxz.eth)\\n * @author Stephan Min (stephanm.eth)\\n * @notice SeaDrop is a contract to help facilitate ERC721 token drops\\n *         with functionality for public...

Error on remapping when install seadrop using foundry

Hi,

I install this repo using forge install but when I try to flatten my file, I got strange error (see pic). And then I try to check the remappings but I got different remappings from forge and remappings.txt from seadrop.

I'll open another issue to forge, it might be forge issue, but it doesn't happened with other project that use foundry's remappings.

image

Is ERC721SeaDropUpgradeable Supported?

Wanted to clarify if upgradeable contracts are supported? Having tried it out for a few days, I have noticed the following challenges that I do not encounter with the non-upgradeable version.

Note that I am on the main branch

  1. @openzeppelin/hardhat-upgrades is not included in package.json but utilised in hardhat.config.ts
  2. Custom Unrecognised Error encountered when attempting to mint on a locally forked Mumbai hardhat env and/or deploy a local instance of SeaDrop
  3. Deployment of ERC721SeaDropUpgradeable contract leads to a "Large Contract Size" error and requires allowUnlimitedContractSize: true to be included hardhat.config.ts
  4. No valid tests within src-upgradeable

Wanted to check with the team if the upgradeable contract is tested, supported and if there have been any cases where an upgradeable ERC721SeaDrop contract has been deployed and minted successfully.

Problem using seadrop in another contract

Hello friends

I want to write a special contract and deploy it through truffle or hardhat
My problem:
I get a clone from the seadrop contract and execute the yarn init and yarn build commands. After that, I write a contract as follows, but during compilation, errors are returned stating that some files do not exist (one of the errors returned is Error: not found operator-filter-registry/DefaultOperatorFilterer.sol
) where is the problem How can I solve my problem?

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import { ERC721SeaDrop } from "src/ERC721SeaDrop.sol";
contract Test is ERC721SeaDrop {
constructor(
string memory name,
string memory symbol
address[] memory allowedSeaDrop
) ERC721SeaDrop(name, symbol, allowedSeaDrop) {}
}

Unable to run yarn build

Tried on both master and seadrop-1.0. I get the same error:

Error HH404: File lib/ERC721A/contracts/ERC721A.sol, imported from src/ERC721ContractMetadata.sol, not found.

setMaxSupply missing checks!

ERC721A:

if(newMaxSupply < _totalMinted()){
     revert NewMaxSupplyLessThanTotalMinted(newMaxSupply);
  }

ERC1155:

 if(newMaxSupply < _tokenSupply[tokenid].totalMinted){ // or _tokenSupply[tokenid].totalSupply
      revert NewMaxSupplyLessThanTotalMinted(newMaxSupply);
 }

I guess those are require checks

setMaxSupply fix

Previously i suggested u check newMaxSupply against totalMinted() for ERC721 for the reason :

_checkMintQuantity Fn will always revert if u set newMaxSupply to a number less then totalMinted because totalSupply() returns
totalMinted() - burnedTokens.

        if (quantity + totalMinted > maxSupply) {
            revert MintQuantityExceedsMaxSupply(
                quantity + totalMinted,
                maxSupply
            );
        }

example :
-initial maxSupply : 5000

  • totalMinted : 5000
    -burn: 1000
    -setMaxSupply: 4500

Result : not possible to mint any more tokens . ERC721A version u use doesnt have spotMint to remint burned tokens ..

Adding to that :
ERC721SeaDropRandomOffset will revert always if u try to setRandomOffset after changing newMaxSupply to a number less then totalMinted().

        // Revert if the collection is not yet fully minted.
        if (_totalMinted() != maxSupply) {
            revert NotFullyMinted();
        }

Regarding ERC1155 . I didnt check

---

Getting the issue

Error HH404: File ../../../../lib/lib/openzeppelin-contracts-upgradeable/contracts/contracts/proxy/utils/Initializable.sol, imported from lib/operator-filter-registry/src/upgradeable/OperatorFiltererUpgradeable.sol, not found.

after I run

yarn profile

Creator earnings aren't enforced with the ExampleToken script

I'm using the DeployAndConfigureExampleToken.s.sol to deploy my contract on the sepolia testnet. The script has the following lines, which I think are supposed to enforce royalty.

uint16 feeBps = 500; // 5%
        token.updatePublicDrop(
            seadrop,
            PublicDrop(
                mintPrice,
                uint48(block.timestamp), // start time
                uint48(block.timestamp) + 1000, // end time
                maxTotalMintableByWallet,
                feeBps,
                true
            )
        );

But in the drop settings, I seed that earnings are optional for this collection. I want to make the earnings enforced at 5% according to the script. How can I make that happen?
Screenshot 2023-10-13 at 12 00 01 PM

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

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?

SeadDrop v2 discussion

-_decodeOrder for erc721OffererImplementation is asserting tokenType is erc155 and it pass in ur test because u always pass type ERC1155.

    const offerItem = {
      itemType: 3, // ERC1155
      token: token.address,
      identifierOrCriteria: toBN(tokenId),
      startAmount: toBN(quantity),
      endAmount: toBN(quantity),
    };

-in ERC721OffererImplemenation do u still have to check if seaport have "InvalidContractOrder" if qtty = 0?

_castAndInvert(minimumReceived[0].amount != 0);

unable to compile ERC721SeaDrop/ERC721SeaDropUpgradeable

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).

can not find the foundry dependencies from parent module of the hardhat project

I have tried to import seadrop into my token contract which is based on hardhat and finish the foundry installation on hardhat project. But when I try to compile the token contract which has imported ERC721Seadrop.sol, it failed and reports:

Error HH404: File operator-filter-registry/DefaultOperatorFilterer.sol, imported from lib/seadrop/src/ERC721SeaDrop.sol, not found.
Error HH413: File utility-contracts/TwoStepOwnable.sol => lib/seadrop/lib/utility-contracts/TwoStepOwnable.sol, imported from lib/seadrop/src/ERC721ContractMetadata.sol, not found.

It seems the submodule fail to remapping dependencies, how can I do?

About import remote libs

Hi, I have a question about the others repo libs for this contract .
when I had downloaded the seaport , and then use yarn to install all dependecies , and then found that all other libs cannot be downloaded . hoow to slove this problem .

need I download all this repos mannually to libs folder ?

Optimizer with too many runs results in loss of optimization

I tried several different values for the run attribute of the optimizer's configuration and compared results using hardhat-contract-sizer. I've reach the highest level of optimization for one single run:

with runs: 1_000_000

 ·------------------------------------|---------------------------|-----------------·
 |  Solc version: 0.8.17              ·  Optimizer enabled: true  ·  Runs: 1000000  │
 ·····································|···························|··················
 |  Contract Name                     ·  Size (KiB)               ·  Change (KiB)   │
 ·····································|···························|··················
 |  console                           ·                    0.084  ·                 │
 ·····································|···························|··················
 |  Strings                           ·                    0.084  ·                 │
 ·····································|···························|··················
 |  SafeTransferLib                   ·                    0.084  ·                 │
 ·····································|···························|··················
 |  MerkleProof                       ·                    0.084  ·                 │
 ·····································|···························|··················
 |  ECDSA                             ·                    0.084  ·                 │
 ·····································|···························|··················
 |  Math                              ·                    0.084  ·                 │
 ·····································|···························|··················
 |  MaliciousRecipient                ·                    1.037  ·                 │
 ·····································|···························|··················
 |  TwoStepAdministered               ·                    2.063  ·                 │
 ·····································|···························|··················
 |  ERC721A                           ·                    4.319  ·                 │
 ·····································|···························|··················
 |  TestERC721                        ·                    4.548  ·                 │
 ·····································|···························|··················
 |  ERC721ContractMetadata            ·                    7.873  ·                 │
 ·····································|···························|··················
 |  ERC721SeaDrop                     ·                   18.371  ·                 │
 ·····································|···························|··················
 |  ERC721SeaDropRandomOffset         ·                   18.739  ·                 │
 ·····································|···························|··················
 |  ERC721SeaDropBurnable             ·                   18.883  ·                 │
 ·····································|···························|··················
 |  SeaDrop                           ·                   20.595  ·                 │
 ·····································|···························|··················
 |  ERC721PartnerSeaDrop              ·                   22.067  ·                 │
 ·····································|···························|··················
 |  ERC721PartnerSeaDropRandomOffset  ·                   22.455  ·                 │
 ·····································|···························|··················
 |  ERC721PartnerSeaDropBurnable      ·                   22.579  ·                 │
 ·------------------------------------|---------------------------|-----------------·

With runs: 1:

 ·------------------------------------|---------------------------|----------------·
 |  Solc version: 0.8.17              ·  Optimizer enabled: true  ·  Runs: 1       │
 ·····································|···························|·················
 |  Contract Name                     ·  Size (KiB)               ·  Change (KiB)  │
 ·····································|···························|·················
 |  console                           ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  SafeTransferLib                   ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  MerkleProof                       ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  Math                              ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  Strings                           ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  ECDSA                             ·                    0.084  ·         0.000  │
 ·····································|···························|·················
 |  MaliciousRecipient                ·                    0.765  ·        -0.272  │
 ·····································|···························|·················
 |  TwoStepAdministered               ·                    1.394  ·        -0.669  │
 ·····································|···························|·················
 |  ERC721A                           ·                    3.171  ·        -1.148  │
 ·····································|···························|·················
 |  TestERC721                        ·                    3.219  ·        -1.329  │
 ·····································|···························|·················
 |  ERC721ContractMetadata            ·                    5.743  ·        -2.130  │
 ·····································|···························|·················
 |  ERC721SeaDrop                     ·                   14.150  ·        -4.221  │
 ·····································|···························|·················
 |  ERC721SeaDropRandomOffset         ·                   14.436  ·        -4.304  │
 ·····································|···························|·················
 |  ERC721SeaDropBurnable             ·                   14.499  ·        -4.384  │
 ·····································|···························|·················
 |  SeaDrop                           ·                   15.334  ·        -5.261  │
 ·····································|···························|·················
 |  ERC721PartnerSeaDrop              ·                   17.053  ·        -5.015  │
 ·····································|···························|·················
 |  ERC721PartnerSeaDropRandomOffset  ·                   17.357  ·        -5.098  │
 ·····································|···························|·················
 |  ERC721PartnerSeaDropBurnable      ·                   17.401  ·        -5.178  │
 ·------------------------------------|---------------------------|----------------·

That's a pretty huge difference so I thought I'd suggest this update here.

how to deploy my contract

Hello friends

I want to deploy the following contract
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { ERC721SeaDrop } from "../ERC721SeaDrop.sol";

contract JungleK is ERC721SeaDrop {
constructor(
string memory name,
string memory symbol
address[] memory allowedSeaDrop
) ERC721SeaDrop(name, symbol, allowedSeaDrop) {}
}

My first question is what is the solution?
The second question is that every time after deploy according to the documentation page https://github.com/ProjectOpenSea/seadrop/blob/main/docs/SeaDropTokenDeployment.md I encounter the following error

Submitting verification for [src/jungle/Test.sol:TestTr] "ssss ".
Encountered an error verifying this contract:
Response: NOTOK'' Details: Invalid API Key''

Unable to run forge test

I'm getting solidity compiler version conflicts when trying to run forge test.
Is there a way to get forge to compile the contracts?
Screenshot 2023-04-14 at 09 34 24

Error while executing `yarn build`

Following instructions exactly.

  • git clone --recurse-submodules https://github.com/ProjectOpenSea/seadrop && cd seadrop [success]
  • yarn install [success]
  • yarn build | failed with error below.
Generating typings for: 36 artifacts in dir: typechain-types for target: ethers-v5
An unexpected error occurred:

TypeError: Cannot convert a Symbol value to a string
    at Array.join (<anonymous>)
    at GlobSync._process (<root>\seadrop\node_modules\typechain\node_modules\glob\sync.js:113:53)
    at new GlobSync (<root>\seadrop\node_modules\typechain\node_modules\glob\sync.js:46:10)
    at globSync (<root>\seadrop\node_modules\typechain\node_modules\glob\sync.js:24:10)
    at <root>\seadrop\node_modules\typechain\src\utils\glob.ts:6:13
    at Array.map (<anonymous>)
    at glob (<root>\seadrop\node_modules\typechain\src\utils\glob.ts:5:35)
    at SimpleTaskDefinition.action (<root>\seadrop\node_modules\@typechain\hardhat\src\index.ts:69:26)
    at Environment._runTaskDefinition (<root>\seadrop\node_modules\hardhat\src\internal\core\runtime-environment.ts:308:35)
    at Environment.run (<root>\seadrop\node_modules\hardhat\src\internal\core\runtime-environment.ts:156:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

dead code

error InvalidSignedPaymentToken(address got, address want);
error InvalidSignedMintPrice(
address paymentToken,
uint256 got,
uint256 minimum
);
error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);
error InvalidSignedMaxTotalMintableByWalletPerToken(
uint256 got,
uint256 maximum
);
error InvalidSignedFromTokenId(uint256 got, uint256 minimum);
error InvalidSignedToTokenId(uint256 got, uint256 maximum);
error InvalidSignedStartTime(uint256 got, uint256 minimum);
error InvalidSignedEndTime(uint256 got, uint256 maximum);
error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);
error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);

Deploying upgradeable ERC721SeaDrop using the official steps has breaking issues

I have followed the exact steps as listed in https://github.com/ProjectOpenSea/seadrop/tree/main/src-upgradeable#readme to deploy an upgradeable seadrop contract, using the ExampleToken contract.

However once deployed it does get indexed as a collection on opensea but when attempting the drop the collection I would get an error in opensea as follows:

image

image

This is using a fresh copy of the most recent commit, having tried on multiple wallets and networks. This issue does not occur when deploying a contract from the opensea UI using the web interface but only when deploying a contract using hardhat.

We are currently blocked from launching a drop so any help would be greatly appreciated 🙏🏻

maxSupply is never reached when calculating randomOffset

There is a discrepancy between the comment

// randomOffset returns between 1 and MAX_SUPPLY

and the code

randomOffset = (uint256(keccak256(abi.encode(block.difficulty))) % (maxSupply - 1)) + 1;

Doing % someNumber already yields a number between 0 and someNumber - 1. Here, doing % (maxSupply - 1) yields a number between 0 and maxSupply - 2, then the last +1 raises it to a number between 1 and maxSupply - 1. If we want a number between 1 and maxSupply we could simply do

randomOffset = (uint256(keccak256(abi.encode(block.difficulty))) % maxSupply) + 1;

The result achieved by obtaining a number between 1 and maxSupply - 1 is that we have the guarantee that the token indexes will get shifted by at least 1 offset. If we want to open the possibility for the random draw to achieve a total index shifting of zero (effectively keeping the indexes as they were), we do need to generate a number between 1 and maxSupply or more simply: a number between 0 and maxSupply - 1 by just removing the + 1:

randomOffset = uint256(keccak256(abi.encode(block.difficulty))) % maxSupply;

Then in the only use of this state variable:

((tokenId + randomOffset) % _maxSupply) +

we trade the possibility of randomOffset being equal to maxSupply (resulting to zero shift) with the possibility of it being equal to zero (achieving the same result) at a slightly lower gas cost

Upgradable contract issue

Hello, I would like to deploy an upgradeable contract but I am getting this error.

Downloading compiler 0.8.17
DeclarationError: Identifier not found or not unique.
  --> src/lib/ERC721AConduitPreapprovedUpgradeable.sol:19:16:
   |
19 |     ) internal onlyInitializing {
   |                ^^^^^^^^^^^^^^^^


Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces

Besides, I don't understand what address "0x4468A5B725E2C63056131121cD33b66848E1dd87" is in scripts/deploy.ts.
(Related article: https://forum.openzeppelin.com/t/deploy-proxy-parameters/38707)

Thank you for your consideration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.