Code Monkey home page Code Monkey logo

opensea-creatures's Introduction

OpenSea Creatures - Starter ERC721, ERC1155, and factory contracts

What's included:

Sample ERC721/ERC1155 Contracts

This includes a very simple sample ERC721 / ERC1155 for the purposes of demonstrating integration with the OpenSea marketplace. We include a script for minting the items.

Additionally, this contract whitelists the proxy accounts of OpenSea users so that they are automatically able to trade the ERC721 item on OpenSea (without having to pay gas for an additional approval). On OpenSea, each user has a "proxy" account that they control, and is ultimately called by the exchange contracts to trade their items. (Note that this addition does not mean that OpenSea itself has access to the items, simply that the users can list them more easily if they wish to do so)

Factory Contracts

In addition to these template 721/1155 contracts, we provide sample factory contracts for running gas-free presales of items that haven't been minted yet. See https://docs.opensea.io/docs/opensea-initial-item-sale-tutorial for more info.

Requirements

Node version

Either make sure you're running a version of node compliant with the engines requirement in package.json, or install Node Version Manager nvm and run nvm use to use the correct version of node.

Installation

Run

yarn

If you run into an error while building the dependencies and you're on a Mac, run the code below, remove your node_modules folder, and do a fresh yarn install:

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
sudo npm explore npm -g -- npm install node-gyp@latest # Update node-gyp

Deploying

Deploying to the Rinkeby network.

  1. Add test fundings to your Rinkeby testnet node on https://faucet.rinkeby.io
  2. To access a Rinkeby testnet node, you'll need to sign up for Alchemy and get a free API key. Click "View Key" and then copy the part of the URL after v2/. a. You can use Infura if you want as well. Just change ALCHEMY_KEY below to INFURA_KEY.
  3. Using your API key and the mnemonic for your Metamask wallet (make sure you're using a Metamask seed phrase that you're comfortable using for testing purposes), run:
export ALCHEMY_KEY="<your_alchemy_project_id>"
export MNEMONIC="<metmask_mnemonic>"
export DEPLOY_CREATURES_SALE=0 
yarn truffle deploy --network rinkeby

Minting tokens.

After deploying to the Rinkeby network, there will be a contract on Rinkeby that will be viewable on Rinkeby Etherscan. For example, here is a recently deployed contract. You should set this contract address and the address of your Metamask account as environment variables when running the minting script. If a CreatureFactory was deployed, which the sample deploy steps above do, you'll need to specify its address below as it will be the owner on the NFT contract, and only it will have mint permissions. In that case, you won't need NFT_CONTRACT_ADDRESS, as all we need is the contract with mint permissions here.

export OWNER_ADDRESS="<my_address>"
export NFT_CONTRACT_ADDRESS="<deployed_contract_address>"
export FACTORY_CONTRACT_ADDRESS="<deployed_factory_contract_address>"
export NETWORK="rinkeby"
node scripts/mint.js

Diagnosing Common Issues

If you're running a modified version of sell.js and not getting expected behavior, check the following:

  • Is the expirationTime in future? If no, change it to a time in the future.

  • Is the expirationTime a fractional second? If yes, round the listing time to the nearest second.

  • Are the input addresses all strings? If no, convert them to strings.

  • Are the input addresses checksummed? You might need to use the checksummed version of the address.

  • Is your computer's internal clock accurate? If no, try enabling automatic clock adjustment locally or following this tutorial to update an Amazon EC2 instance.

  • Do you have any conflicts that result from globally installed node packages? If yes, try yarn remove -g truffle; yarn

  • Are you running a version of node compliant with the engines requirement in package.json? If no, try nvm use; rm -rf node_modules; yarn

About OpenSea Creature Accessories

This is a sample ERC-1155 contract for the purposes of demonstrating integration with the OpenSea marketplace for crypto collectibles. We also include:

  • A factory contract for making sell orders for unminted items (allowing for gas-free and mint-free presales).
  • A configurable lootbox contract for selling randomized collections of ERC-1155 items.

On top of the features from the OpenSea ERC721 sample contracts above, ERC1155

  • supports multiple creators per contract, where only the creator is able to mint more copies
  • supports pre-minted items for the lootbox to choose from

Configuring the Lootbox

Open CreatureAccessoryLootbox.sol

  1. Change Class to reflect your rarity levels.
  2. Change NUM_CLASSES to reflect how many classes you have (this gets used for sizing fixed-length arrays in Solidity)
  3. In constructor, set the OptionSettings for each of your classes. To do this, as in the example, call setOptionSettings with
    1. Your option id,
    2. The number of items to issue when the box is opened,
    3. An array of probabilities (basis points, so integers out of 10,000) of receiving each class. Should add up to 10k and be descending in value.
  4. Then follow the instructions below to deploy it! Purchases will auto-open the box. If you'd like to make lootboxes tradable by users (without a purchase auto-opening it), contact us at [email protected].

Why are some standard methods overridden?

This contract overrides the isApprovedForAll method in order to whitelist the proxy accounts of OpenSea users. This means that they are automatically able to trade your ERC-1155 items on OpenSea (without having to pay gas for an additional approval). On OpenSea, each user has a "proxy" account that they control, and is ultimately called by the exchange contracts to trade their items.

Note that this addition does not mean that OpenSea itself has access to the items, simply that the users can list them more easily if they wish to do so!

Requirements

Node version

Either make sure you're running a version of node compliant with the engines requirement in package.json, or install Node Version Manager nvm and run nvm use to use the correct version of node.

Installation

Run

yarn

Deploying

Deploying to the Rinkeby network.

  1. Follow the steps above to get a Rinkeby node API key
  2. Using your API key and the mnemonic for your MetaMask wallet (make sure you're using a MetaMask seed phrase that you're comfortable using for testing purposes), run:
export ALCHEMY_KEY="<alchemy_project_id>" # or you can use INFURA_KEY
export MNEMONIC="<metmask_mnemonic>"
DEPLOY_ACCESSORIES_SALE=1 yarn truffle migrate --network rinkeby

Deploying to the mainnet Ethereum network.

Make sure your wallet has at least a few dollars worth of ETH in it. Then run:

yarn truffle migrate --network live

Look for your newly deployed contract address in the logs! ๐Ÿฅณ

Viewing your items on OpenSea

OpenSea will automatically pick up transfers on your contract. You can visit an asset by going to https://opensea.io/assets/CONTRACT_ADDRESS/TOKEN_ID.

To load all your metadata on your items at once, visit https://opensea.io/get-listed and enter your address to load the metadata into OpenSea! You can even do this for the Rinkeby test network if you deployed there, by going to https://rinkeby.opensea.io/get-listed.

Troubleshooting

It doesn't compile!

Install truffle locally: yarn add truffle. Then run yarn truffle migrate ....

You can also debug just the compile step by running yarn truffle compile.

It doesn't deploy anything!

This is often due to the truffle-hdwallet provider not being able to connect. Go to your Alchemy Dashboard (or infura.io) and create a new project. Use your "project ID" as your new ALCHEMY_KEY and make sure you export that command-line variable above.

ERC1155 Implementation

To implement the ERC1155 standard, these contracts use the Multi Token Standard by Horizon Games, available on npm and GitHub and also under the MIT License.

Running Local Tests

In one terminal window, run:

yarn run ganache-cli

Once Ganache has started, run the following in another terminal window:

yarn run test

opensea-creatures's People

Contributors

alexanderatallah avatar cupojoseph avatar dependabot[bot] avatar dfinzer avatar djviau avatar eltociear avatar jmac-opensea avatar joshuawu avatar leon-do avatar lynaj avatar lyubinov avatar meemaw avatar michael-cohen-io avatar sunwrobert avatar themaxkim 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensea-creatures's Issues

Error: Requested to sign transaction with address using OpenSeaPort in sell.js

hi i have a contract up and verified in rinkeby testnet and 16 assets minted iam trying to use your sell.js script to set fixed price for my assets but im getting this error i have checked everything and im using the same .env file that i used for minting and minting is ok

the error

Auctioning an item for a fixed price...
Initializing proxy for account: (owner address)
(node:18272) UnhandledPromiseRejectionWarning: Error: Requested to sign transaction with address: (owner address), instantiated with address: (owner address)
    at PrivateKeyWalletSubprovider.

what should i do ?

How to get Address of Deployed Contract?

How do I get the address of the deployed contract if I just happened to have not grabbed it from the output when I deployed the contract?

I got pulled away to do something else right at that point, then lost that screen before I was able to get back to it. 0

Thank you.

Deployment of the contract

Migrations are being created in a quite smooth way, but whenever it comes to the process of deploying it on the network - it simply hangs & stops working

Solution:
npm install --save truffle-hdwallet-provider@web3-one

Expected parameter 'from' not passed to function.

Issue

Can't deploy to rinkeby network. My command:

export ALCHEMY_KEY="<your_alchemy_project_id>"
export MNEMONIC="<metmask_mnemonic>"
DEPLOY_CREATURES_SALE=1 yarn truffle deploy --network rinkeby

Error log

Compiling your contracts...
===========================
โœ” Fetching solc version list from solc-bin. Attempt #1
> Everything is up to date, there is nothing to compile.

Error: Expected parameter 'from' not passed to function.
    at has (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/expect/dist/src/index.js:10:1)
    at Object.options (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/expect/dist/src/index.js:19:1)
    at Object.fork (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/environment/environment.js:30:1)
    at setupDryRunEnvironmentThenRunMigrations (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:227:1)
    at Object.run (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:215:1)
    at Command.run (~/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/command.js:167:1)
Truffle v5.3.13 (core: 5.3.13)
Node v12.18.4
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Setup

ubuntu 20.04
node 12.18.4
Provider: Alchemy

How can I deploy the CreatureFactory using web3js, not with truffle?

So, if you want to have dynamic owners of the contract, you have to build (solc) and deploy the contract using web3js.

Is it possible to deploy the CreatureFactory like this? How?

Or, is there any other way to mint the token to a different address than the owner of the contract?

'npm install' always fails - old/broken dependencies?

Hi,
I tried to run ยดnpm installยด on several systems (windows, linux, var. fresh docker containers, etc), but always got lots of errors. I use nvm and node 8.11.2 as suggested, but to no avail.
Could you please check the package dependencies and maybe take the effort to update everything to solidity 0.5? thanks!

Error: Deployment to Rinkeby is not working

I am getting this error when deploying to Rinkeby network

71 verbose stack Error: Command failed: /usr/local/bin/git submodule update -q --init --recursive
71 verbose stack error: could not lock config file .git/config: Permission denied
71 verbose stack error: could not lock config file .git/config: Permission denied
71 verbose stack fatal: Failed to register url for submodule path 'src/wyvern-ethereum'
71 verbose stack
71 verbose stack at ChildProcess.exithandler (child_process.js:294:12)
71 verbose stack at ChildProcess.emit (events.js:189:13)
71 verbose stack at maybeClose (internal/child_process.js:970:16)
71 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
72 verbose cwd /Users/pk/Documents/code/opensea-creatures
73 verbose Darwin 18.2.0
74 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "truffle-hdwallet-provider@web3-one"
75 verbose node v10.15.1
76 verbose npm v6.4.1
77 error code 128
78 error Command failed: /usr/local/bin/git submodule update -q --init --recursive
78 error error: could not lock config file .git/config: Permission denied
78 error error: could not lock config file .git/config: Permission denied
78 error fatal: Failed to register url for submodule path 'src/wyvern-ethereum'
79 verbose exit [ 1, true ]

Stuck on `Compiling your contracts...`

There isn't any output nor are there any errors. When I run truffle deploy --network rinkeby it hangs on Compiling your contracts.

Anyone experience this? Followed the readme verbatim.

Running Ubuntu 18.04

Error: make failed with exit code 2

make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pk/Documents/code/opensea-creatures/node_modules/sha3
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/pk/.npm/_logs/2019-03-06T07_47_54_424Z-debug.log

Can't see Lootbox on my openSea test network

after running truffle migrate --network rinkeby i got this log on console:

Starting migrations...

Network name: 'rinkeby'
Network id: 4
Block gas limit: 10000000 (0x989680)

2_deploy_contracts.js

Deploying 'CreatureAccessory'

transaction hash: 0xb713c9d11e82333d4c7eca64869c385746f670ada6ce416ba742cd6e98cabb62
Blocks: 1 Seconds: 13
contract address: 0x26C7761B64AF692A43BAe519bC80454cF7F5622D
block number: 8818395
block timestamp: 1624512412
account: 0x6358522e789C5a07e4D8C7F606f88ae4d1e5425F
balance: 26.180890536
gas used: 2802499 (0x2ac343)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.05604998 ETH

Deploying 'LootBoxRandomness'

transaction hash: 0x77c3ebd8f65cdb041f60222452334fcabec3c18e897f7c60e24484eaa11851c1
Blocks: 0 Seconds: 5
contract address: 0x86d7EB33B11cf5Ca177EeD1Af57687db776Cff1B
block number: 8818402
block timestamp: 1624512517
account: 0x6358522e789C5a07e4D8C7F606f88ae4d1e5425F
balance: 26.160201376
gas used: 454684 (0x6f01c)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00909368 ETH

Linking

  • Contract: CreatureAccessoryLootBox <--> Library: LootBoxRandomness (at address: 0x86d7EB33B11cf5Ca177EeD1Af57687db776Cff1B)

Deploying 'CreatureAccessoryLootBox'

transaction hash: 0xefc068b81d0730bc00debda91d944388f16c9b5c940b42511ea38a18bd614214
Blocks: 0 Seconds: 5
contract address: 0x32a7beB30e2D6EE0d7b9b8309E8F27B7d8DBe735
block number: 8818403
block timestamp: 1624512532
account: 0x6358522e789C5a07e4D8C7F606f88ae4d1e5425F
balance: 26.084297316
gas used: 3795203 (0x39e903)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.07590406 ETH

Deploying 'CreatureAccessoryFactory'

transaction hash: 0x2b54ab8b5fd8b32ffe44cdd014230c3242b118bbf8afb9c01ddaef25e8090daf
Blocks: 2 Seconds: 17
contract address: 0xEE4E3cAfb341B854A6b17924A2B55A1607e7B947
block number: 8818405
block timestamp: 1624512562
account: 0x6358522e789C5a07e4D8C7F606f88ae4d1e5425F
balance: 26.061947536
gas used: 1117489 (0x110d31)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.02234978 ETH

Saving migration to chain.
Saving artifacts


Total cost: 0.1633975 ETH

Summary

Total deployments: 4
Final cost: 0.1633975 ETH

Done in 4

but i'm not able to see any lootbox on my openSea test network what could be the reason for it?

(node:10604) UnhandledPromiseRejectionWarning: Account not found

When trying to mint, get error:
(node:10604) UnhandledPromiseRejectionWarning: Account not found

I am able to successfully "migrate" the contract onto the rinkeby testnet using the migrate functions:
https://rinkeby.etherscan.io/address/0xea538d569b13aea82cfd04f5cb339f9588869018

However, when I run the "mint" code
https://github.com/ProjectOpenSea/cryptopuff-contracts/blob/master/scripts/mint.js
I get an "Account not found" error at line 36

It appears the hdwallet-provider is the one throwing the error??:
https://github.com/trufflesuite/truffle-hdwallet-provider/blob/def8d45d73c7be77b0b8b3270f5904808d9d2f4d/index.js

When I use the "interact" tab at https://www.withpragma.com/
It successfully mints tokens:
https://rinkeby.etherscan.io/address/0x6b89E8FC4170dF884785faCD29C7700EB3C765b0

Nothing happens after compilation

Hi,
I have done some modifications to the original contract(variable names only). When I try to deploy it gives me error:
compiling your contracts
Everything up to date, there is nothing to compile

nothing happens?

Please help!

ERC1155Tradable test failure

  1. Contract: ERC1155Tradable - ERC 1155
    #setCreator()
    should allow the token creator to set creator to another address:

    AssertionError: expected '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' to equal '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b'

    • expected - actual

    -0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
    +0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b

    at Context. (test/ERC1155Tradable.js:226:17)
    at runMicrotasks ()
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Error: Transaction is reverted by EVM.

Hii, while creating lootbox Iโ€™m getting transaction is reverted by EVM error.

These were my steps:

  1. I deployed lootbox. This is the deployed CreatureAccessoryLootBox Address:- 0xe38990273d24Cd832150dc8647287d48dF5bd7E1.

  2. I ran script scripts/creature-accessories/advanced/mint.js.

While executing script I was getting above mentioned error can you please help me out for that.

And as per your suggestion @TheMaxKim I will required a minting script for that, that is not in this repo. So can you please help to create that script so i can create a lootbox.

Thank you.

"execution reverted" error in browser when buying NFT minted from fresh copy of repo

I'm getting the 'Oops, the Ethereum network rejected this transaction :( The OpenSea devs have been alerted, but this problem is typically due an item being locked or untransferrable. The exact error was "execution reverted..."' error banner when trying to buy a token minted with this repo on the OpenSea site.

All I did was check out the repo and run the following (putting my wallet and API keys in env variables):

yarn
DEPLOY_CREATURES=1 truffle deploy --network rinkeby
NFT_CONTRACT_ADDRESS=0xb52c917D402Ff760218E8c17FB696b7a6179e93c node scripts/mint.js

The token mints properly, I set up a sale, but can't buy it. Here's the token: https://testnets.opensea.io/assets/0xb52c917d402ff760218e8c17fb696b7a6179e93c/1

Deploying contract from a copy of the repo at commit d681edc (before update of openzeppelin-solidity from v2 to v4) works, but I'd rather use v4 contracts!

Pastebin with JS console from the browser: https://pastebin.com/XPByJtXw

Buyer's not able to buy factory creature.

Hey, I created a factory with option id 0 but when i sold that buyer's are not able to buy that factory and nothing is minted on their accounts. I'm getting this error:

image
This is the factory contract address: 0x8a2f1066b2049dfb12d2505aaa1b20bad9a4460e.
Any help would be appreciated.

I got an error message "Transaction was not mined within 750 seconds"

I deployed to mainnet as follows.
DEPLOY_CREATURES_SALE=1 yarn truffle deploy --network live

However, I got the following error.
"Migrations" -- Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!.

With rinkeby it was successful.

Is it right to deploy to the mainnet when I do the above?

[Question] How to understand ContextMixin?

Thank you for the example. I searched on Google but only got contract code and I have some questions on the ContextMixin:

pragma solidity ^0.8.0;

abstract contract ContextMixin {
    function msgSender()
        internal
        view
        returns (address payable sender)
    {
        if (msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
                // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(
                    mload(add(array, index)),
                    0xffffffffffffffffffffffffffffffffffffffff
                )
            }
        } else {
            sender = payable(msg.sender);
        }
        return sender;
    }
}

I know msg.sender == address(this) means the function is called by another function in the same contract and and(mload(add(array, index)), 0xf...ff) stuff is to get the address, but why the sender address is at msg.data[msg.data.length:]? And in which cases on Opensea it'll enter the if branch?

Gas free minting on CreatureFactory doesn't work

Everything works kind of ok. Compiling and deploying the contracts are also managed quite ok.

Then, using mint.js I can mint one Creature to my own address. All good. But when I do mint again, it will cost me gas, even if the proxy contract from OpenSea is there. What are we missing here?

Please help :octocat:

install the dependence package by yarn

While I installed the dependence package by yarn with the right tarn version and node version, it runned in error in resolving packages at is-utf8@^0.2.0 that: Couldn't find match for "fa06e39e56786ba541c180061dbf2c0a5bbf951c" in "refs/heads/develop,refs/heads/master,refs/pull/1/head,refs/pull/2/head,refs/pull/3/head,refs/pull/3/merge,refs/pull/4/head,refs/pull/5/head,refs/tags/v0.1.0,refs/tags/v0.2.0,refs/tags/v0.2.1,refs/tags/v0.2.2,refs/tags/v0.2.3" for "https://github.com/ahultgren/async-eventemitter.git". What's that means and how can I resolve it? There is another question that whether the version of node can be changing to >15.7.0.

Error ownable caller is not the owner

Hello, I cannot minting (scripts/mint.js) of the smart contract "Creature" as I get the following error: "Ownable: caller is not the owner". I am sure I am using the same account in deploy and minting. Can it be related in the openzeppelin V4 to V2 rollback?

Minting token by other addresses than contract owner

Can NFT be minted by other adress than owner of contract?
I see in CreatureFactory.sol:

function mint(uint256 _optionId, address _toAddress) public {
        // Must be sent from the owner proxy or owner.
        ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
        assert(
            address(proxyRegistry.proxies(owner())) == msg.sender ||
                owner() == msg.sender ||
                msg.sender == lootBoxNftAddress
        );
        ...

Of course, I can simply remove the assert, however, could someone give me potential issues related to that?
Thanks!

Error Deploying to Mainnet

When I tried to deploy to Mainnet it get stuck in the Contract Creation. I don't know if itยดs the gas, the gasPrice or the network. I use:

gas: 9721975, gasPrice: 6000000000

No tests for Creature.sol, CreatureFactory.sol, and others

It looks like there's a lot of missing tests for what looks like sensitive code pertaining to ownership.

This may be a separate issue but I've seen functions that mention hacks. These aren't tested and it would be comforting to know in detail why these aren't following the standard.

    /**
     * Hack to get things to work automatically on OpenSea.
     * Use transferFrom so the frontend doesn't have to worry about different method names.
     */
    function transferFrom(
        address _from,
        address _to,
        uint256 _tokenId
    ) public {
        mint(_tokenId, _to);
    }

    /**
     * Hack to get things to work automatically on OpenSea.
     * Use isApprovedForAll so the frontend doesn't have to worry about different method names.
     */
    function isApprovedForAll(address _owner, address _operator)
        public
        view
        returns (bool)
    {
        if (owner() == _owner && _owner == _operator) {
            return true;
        }

        ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
        if (
            owner() == _owner &&
            address(proxyRegistry.proxies(_owner)) == _operator
        ) {
            return true;
        }

        return false;
    }

    /**
     * Hack to get things to work automatically on OpenSea.
     * Use isApprovedForAll so the frontend doesn't have to worry about different method names.
     */
    function ownerOf(uint256 _tokenId) public view returns (address _owner) {
        return owner();
    }

Error: npm install

Getting this error...

npm ERR! code 128
npm ERR! Command failed: /usr/local/bin/git checkout HEAD
npm ERR! git-lfs filter-process: git-lfs: command not found
npm ERR! fatal: the remote end hung up unexpectedly
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/pk/.npm/_logs/2019-03-06T07_19_31_282Z-debug.log

mint.js "Fail with error 'Ownable: caller is not the owner'"

Hi first of all thanks for your tutorial really helpfull i used your repo and created a simple nft conract and a nft factory conract
and i deployed them into rinkeby testnet and verified them but when i try to use the mint.js script the script crashed with error:

(node:15292) UnhandledPromiseRejectionWarning: Error: Transaction has been reverted by the EVM:

and in the etherscan:

Fail with error 'Ownable: caller is not the owner'

i checked my wallet address for million times and even i lowerd cased them and i have no clue to solve this please help.thanks

Error: Invalid JSON RPC response: 502 Bad Gateway

Using latest master.

Truffle v5.1.48 (core: 5.1.48)
Node v12.18.4

Exporting the key is valid. Using alchemyapi.

Command:
DEPLOY_ACCESSORIES_SALE=1 yarn truffle migrate --network rinkeby

  Deploying 'CreatureAccessoryFactory'
   ------------------------------------
   > transaction hash:    0x437aa3516819e2af379665e9b8fa6ab03ff33b64de38a3d76555992c313951ef
   > Blocks: 1            Seconds: 9
   > contract address:    0xE218634e4758b9cC38C9A80f5017efbb2Fa27680
   > block number:        8325238
   > block timestamp:     1617112072
   > account:             0x33dFd54B5cD88d2f5def394012c78C56Fc549a8B
   > balance:             2.26147138
   > gas used:            1806673 (0x1b9151)
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.03613346 ETH

Error: Invalid JSON RPC response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"
    at Object.InvalidResponse (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-core-helpers/src/errors.js:42:1)
    at e.InvalidResponse [as onreadystatechange] (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-providers-http/src/index.js:92:1)
    at e._a [as dispatchEvent] (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:27:61)
    at e.dispatchEvent [as _setReadyState] (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)
    at e._setReadyState [as _onHttpResponseEnd] (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:318:1)
    at IncomingMessage._onHttpResponseEnd (/Users/go/keys/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:289:47)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

One punch mรจme

pragma solidity ^0.5.0;

import "./TradeableERC721Token.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";

/**

  • @title Creature
  • Creature - a contract for my non-fungible creatures.
    */
    contract Creature is TradeableERC721Token {
    constructor(address _proxyRegistryAddress) TradeableERC721Token("Creature", "OSC", _proxyRegistryAddress) public { }

function baseTokenURI() public view returns (string memory) {
return "https://opensea-creatures-api.herokuapp.com/api/creature/";
}

update .env.sample

Would be good when.env.sample lists the ALCHEMY_KEY var?

Perhaps also list:

  • DEPLOY_ACCESSORIES_SALE
  • DEPLOY_ACCESSORIES
  • DEPLOY_CREATURES_SALE
  • DEPLOY_CREATURES
  • DEPLOY_ALL

gas free minting not working after factory contract is initialized

When creating the factory contract it will mint NUM_OPTIONS creatures for no gas price; however, after the factory contract is made there is no way (at least not anywhere I can find) to add a new option/mint a creature without paying for gas.

For reference I would like to use the factory contract and have it start off with 1 option. Every time I finish making my media I would like to add it as an option and then mint it, and list on open sea without gas.

Error: Invalid JSON RPC response

Hello

Thanks for your all your efforts. I stumbled across the following error when deploying the contract.
The dry run runs fine, this error pop-ups in in the second run during the deployment.
Anybody that has encountered this before and/or has a solution to this?

The error it throws is too large to copy, but basically happens right about here


Deploying 'Creature'
   --------------------
   > transaction hash:    0x8382b0697a64f6fd6880b49df255eb221f8222523d88ccd85b91d9d9f2b5e312
   โ ง Blocks: 0            Seconds: 0Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-core-helpers/src/errors.js:42:1)
    at e.InvalidResponse [as onreadystatechange] (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-providers-http/src/index.js:92:1)
    at e._a [as dispatchEvent] (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:27:61)
    at e.dispatchEvent [as _setReadyState] (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)
    at e._setReadyState [as _onHttpRequestError] (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:349:1)
    at ClientRequest._onHttpRequestError (/Users/m/opensea/opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:252:47)

Managed to catch the following errors:

abort(Error: Invalid JSON RPC response: ""). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module '/Users/m/opensea/opensea-creatures/...'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Thrown at:
    at Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Module._load (internal/modules/cjs/loader.js:841:27)
    at executeUserEntryPoint (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

Thanks in advance

Initial sale does not work. ''Request was throttled"

Hello,

Trying to run a crowdsale with the initial_sale.js script but I'm getting this error:

(node:1866887) UnhandledPromiseRejectionWarning: Error: API Error 429: Message: {"detail":"Request was throttled. Expected available in 1 second."}

I guess I need the API KEY to run this? Even for test env?
Thanks..

Compiler Error for Proxy Accounts.

There is no explanation how to set this up in the docs. I get the following error when compiling. It would be nice to see how you setup the constructor and metadata. I'm using Remix.

browser/erc1155.sol:216:12: TypeError: Member "isApprovedForAll" not found or not visible after argument-dependent lookup in type(contract ERC1155). return ERC1155.isApprovedForAll(_owner, _operator); ^----------------------^

  function isApprovedForAll(
    address _owner,
    address _operator
  ) public view returns (bool isOperator) {
    // Whitelist OpenSea proxy contract for easy trading.
    ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
    if (address(proxyRegistry.proxies(_owner)) == _operator) {
      return true;
    }

    return ERC1155.isApprovedForAll(_owner, _operator);
  }

scripts/mint.js returns UnhandledPromiseRejectionWarning: Error: Transaction has been reverted by the EVM:

(node:79963) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
(node:79963) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is it really that all blocks are created in 750 seconds for migration?

How many blocks are created in the mainnet to complete the migration?
Is it really that all blocks are created in 750 seconds for migration?

Two days ago, over 800 blocks were created for migrations, but it did not complete and an error occurred. It took 2 hours before the error occurred. When I run it again today, I get an error message saying that it has exceeded 750 seconds again.

Should gas cost be higher to complete the migration? If I have to pay more for gas, how much more do I have to pay?

sender doesn't have enough funds to send tx.

I ran into the following error when running DEPLOY_CREATURES_SALE=1 yarn truffle deploy --network rinkeby.

Error:  *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds
   * Account:  0xdbdaEc9734a614285DBAb3BEd8D1a97ba7xxxxxx
   * Balance:  0 wei
   * Message:  sender doesn't have enough funds to send tx. The upfront cost is: 10000000000000000 and the sender's account only has: 0
   * Try:
      + Using an adequately funded account
      + If you are using a local Geth node, verify that your node is synced.

    at /home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Migration._deploy (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
    at Migration._load (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
    at Migration.run (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
    at Object.runMigrations (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.run (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
    at runMigrations (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
    at setupDryRunEnvironmentThenRunMigrations (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:251:1)
    at Object.run (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:220:1)
    at Command.run (/home/ec2-user/opensea-creatures/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.5 (core: 5.2.5)
Node v12.21.0
error Command failed with exit code 1.

Anyone knows why this happen?

Does the error mean that it needs to send some ethereum coins from my wallet?

Proxy address in 2_deploy_contracts.js

It's more question than an issue.
I wonder if I can change the proxy value in 2_deploy_contracts.js here:

// OpenSea proxy registry addresses for rinkeby and mainnet.
  let proxyRegistryAddress = "";
  if (network === 'rinkeby') {
    proxyRegistryAddress = "0xf57b2c51ded3a29e6891aba85459d600256cf317"; // <- this one
  } else {
    proxyRegistryAddress = "0xa5409ec958c83c3f309868babaca7c86dcb077c1";
  }

I'm trying to understand how opensea makes the margin on transactions. I think the above connection is an answer, however, I'm not sure about that. It would be great to have an explanation for that.
Thanks!

Issue with "wyvern-js/src/wyvern-ethereum/test/aux.js" on Windows 10

Getting the following error when trying to "npm install" on Windows 10:

npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b v3.0.2 git://github.com/ProjectOpenSea/wyvern-js.git C:\Users\frede\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-dae6f3a7 --config core.longpaths=true
npm ERR! warning: templates not found C:\Users\frede\AppData\Local\Temp\pacote-git-template-tmp\git-clone-3e664c2a
npm ERR! Note: checking out '1cbed592e7440f097817bcb1a3c789d2b3adc081'.
npm ERR!
npm ERR! You are in 'detached HEAD' state. You can look around, make experimental
npm ERR! changes and commit them, and you can discard any commits you make in this
npm ERR! state without impacting any branches by performing another checkout.
npm ERR!
npm ERR! If you want to create a new branch to retain commits you create, you may
npm ERR! do so (now or later) by using -b with the checkout command again. Example:
npm ERR!
npm ERR!   git checkout -b <new-branch-name>
npm ERR!
npm ERR! error: unable to create file src/wyvern-ethereum/test/aux.js: No such file or directory
npm ERR! fatal: unable to checkout working tree
npm ERR! warning: Clone succeeded, but checkout failed.
npm ERR! You can inspect what was checked out with 'git status'
npm ERR! and retry the checkout with 'git checkout -f HEAD'
npm ERR!
npm ERR!

Maybe related to the fact "aux" is a reserved filename in Windows?
gajus/react-aux#10

Thanks for your support!

Can't install on node 15

Not sure if this is related to be using M1 chip (arm64 architecture), but i couldn't install the package with Node 15.4.0, switching to Node 14.16.1 fixed it.

Error log:

$ npm install --save opensea-js
npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/fabiano/.nvm/versions/node/v15.4.0/bin/node /Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/fabiano/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm ERR! npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm ERR! npm WARN deprecated [email protected]: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
npm ERR! npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm ERR! npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/fabiano/.npm/_cacache/tmp/git-clone-517297b4/node_modules/sha3
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR! npm ERR! CXX(target) Release/obj.target/sha3/src/addon.o
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using [email protected]
npm ERR! npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! npm ERR! gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args   '/Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! npm ERR! gyp info spawn args   '-f',
npm ERR! npm ERR! gyp info spawn args   'make',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/fabiano/.npm/_cacache/tmp/git-clone-517297b4/node_modules/sha3/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/fabiano/Library/Caches/node-gyp/15.4.0/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/fabiano/Library/Caches/node-gyp/15.4.0',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/fabiano/Library/Caches/node-gyp/15.4.0/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/fabiano/.npm/_cacache/tmp/git-clone-517297b4/node_modules/sha3',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args   '--depth=.',
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! npm ERR! gyp info spawn args   '--generator-output',
npm ERR! npm ERR! gyp info spawn args   'build',
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! In file included from ../src/addon.cpp:4:
npm ERR! npm ERR! In file included from ../node_modules/nan/nan.h:2818:
npm ERR! npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
npm ERR! npm ERR!       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! npm ERR!                                           ^
npm ERR! npm ERR! /Users/fabiano/Library/Caches/node-gyp/15.4.0/include/node/v8.h:5317:3: note: 'GetContents' has been explicitly marked deprecated here
npm ERR! npm ERR!   V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
npm ERR! npm ERR!   ^
npm ERR! npm ERR! /Users/fabiano/Library/Caches/node-gyp/15.4.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
npm ERR! npm ERR! # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
npm ERR! npm ERR!                                       ^
npm ERR! npm ERR! In file included from ../src/addon.cpp:9:
npm ERR! npm ERR! In file included from ../src/KeccakNISTInterface.h:17:
npm ERR! npm ERR! ../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
npm ERR! npm ERR! #define ALIGN __attribute__ ((aligned(32)))
npm ERR! npm ERR!         ^
npm ERR! npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/param.h:59:9: note: previous definition is here
npm ERR! npm ERR! #define ALIGN(p)        __DARWIN_ALIGN(p)
npm ERR! npm ERR!         ^
npm ERR! npm ERR! ../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
npm ERR! npm ERR!                 target->Set(className, f);
npm ERR! npm ERR!                 ~~~~~~~~^~~
npm ERR! npm ERR! /Users/fabiano/Library/Caches/node-gyp/15.4.0/include/node/v8.h:3716:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! /Users/fabiano/Library/Caches/node-gyp/15.4.0/include/node/v8.h:3719:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! 2 warnings and 1 error generated.
npm ERR! npm ERR! make: *** [Release/obj.target/sha3/src/addon.o] Error 1
npm ERR! npm ERR! gyp ERR! build error
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
npm ERR! npm ERR! gyp ERR! System Darwin 20.2.0
npm ERR! npm ERR! gyp ERR! command "/Users/fabiano/.nvm/versions/node/v15.4.0/bin/node" "/Users/fabiano/.nvm/versions/node/v15.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! npm ERR! gyp ERR! cwd /Users/fabiano/.npm/_cacache/tmp/git-clone-517297b4/node_modules/sha3
npm ERR! npm ERR! gyp ERR! node -v v15.4.0
npm ERR! npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! npm ERR! gyp ERR! not ok
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/fabiano/.npm/_logs/2021-04-16T21_51_46_297Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fabiano/.npm/_logs/2021-04-16T21_51_48_187Z-debug.log

Invalid JSON RPC response: " "

Following readme. Able to connect to the test network etc and then suddenly can't deploy the contracts themselves.

I've triple checked that all of my exports are correctly set and that my wallet on the rinkeby network has funds.

ยฑ |master โœ“| โ†’ DEPLOY_CREATURES_SALE=1 yarn truffle deploy --network rinkeby
yarn run v1.22.10
$ /Users/johnlshankman/Documents/workspace/opensea-creatures/node_modules/.bin/truffle deploy --network rinkeby

Compiling your contracts...
===========================
โœ” Fetching solc version list from solc-bin. Attempt #1
> Everything is up to date, there is nothing to compile.



Migrations dry-run (simulation)
===============================
> Network name:    'rinkeby-fork'
> Network id:      4
> Block gas limit: 10000000 (0x989680)


1_initial_migrations.js
=======================
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-core-helpers/src/errors.js:42:1)
    at t.InvalidResponse [as onreadystatechange] (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/web3/node_modules/web3-providers-http/src/index.js:92:1)
    at t._a [as dispatchEvent] (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:27:61)
    at t.dispatchEvent [as _setReadyState] (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)
    at t._setReadyState [as _onHttpRequestError] (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:349:1)
    at ClientRequest._onHttpRequestError (/Users/.../opensea-creatures/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/gnidan/src/work/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:252:47)
    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketErrorListener (_http_client.js:427:9)
    at TLSSocket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Error: make failed with exit code 2

gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/shabanshaame/.nvm/versions/node/v8.11.4/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/me/.nvm/versions/node/v8.11.4/bin/node" "/Users/me/.nvm/versions/node/v8.11.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/me/htdocs/path/node_modules/ganache-core/node_modules/sha3
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/ganache-core/node_modules/scrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

On OSX
node -v v8.11.4

It's the same issue as here
#8

Thanks for you help !

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.