alto-io / nft-minter

Mint non-fungible tokens via a web server
http://nft-minter.herokuapp.com/
79 stars 34 forks source link

[nft-minter by OP Games] : Add support for NFT tokens minted on NEAR Protocol #2

Open polats opened 3 years ago

polats commented 3 years ago

[nft-minter by OPGames]: Add support for NFT tokens minted on NEAR Protocol

Prize Bounty

Up to $3000 USD in NEAR (with matching grants) One grand prize and two runner up prizes

Challenge Description

nft-minter is an open-source framework for minting NFTs, currently using IPFS and the Ethereum blockchain. We would love for it to be built upon by hackers so it will eventually become blockchain agnostic.

The challenge is to provide an option to users of nft-minter to mint their tokens on NEAR protocol instead of on the Ethereum blockchain, in the most developer friendly way possible.

The first step is probably to create an npm script similar to yarn contract:deploy:rinkeby that will deploy the contracts on NEAR instead of Ethereum. Once done, hackers should then update the frontend on packages/client to allow developers to create and mint the tokens via the web form.

This could be a stretch goal for the challenge, but we envision the ideal flow to be as simple as just changing an variable in the .env files. For example, adding a "blockchain=near" .env variable will automatically deploy the contract to the desired blockchain.

Submission Requirements

Hackers should create a pull request for this challenge, tagging this issue for reference. The completed submission should include the updated code (backend and frontend) and an updated README.md file discussing how to use nft-minter for NEAR tokens.

The application must be (1) the original work of the individual participant or the participating team; (2) third-party technology used by the individual participant or the participating team must be subject to valid perpetual, irrevocable licenses.

By submitting an application, the individual participant and each member of a participating team, jointly and severally, represent and warrant that the application, and all components thereof, will not violate any rights of any person or entity, including without limitation, any copyright, trademark, patent or other intellectual property rights, or violate any applicable national, federal, state, or local laws, regulations, or policies, including those relating to export control.

Judging Criteria

  1. Robustness and completeness of solution
  2. Developer experience (the more documented and the less steps for developers needed, the better)
  3. Potential reusability across blockchains (how well the solution is able to abstract away blockchain specific code)

Helpful References

NEAR NFT discussions

Other Links

Winner Announcement Date

April 9th 10am PST

More Info

For questions, please comment on this issue. For more long-form discussions, we can also use Github Discussions.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 3000.0 DAI (3000.0 USD @ $1.0/DAI) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 51 minutes from now. Please review their action plans below:

1) bardinpetr has started work.

The goal is to add support in nft-minter for NEAR blockchain by creating an unified solution which allows developers to add support for any blockchain with ease 2) secretshardul has started work.

Add support for Near NFT smart contracts. It will be possible to choose between Rust or WebAssembly contract variants through environment variables. 3) brianspha has started work.

Mint NFTs on NEAR 4) lyledavids has started work.

nft minter with option for near 5) sekmet has started work.

A NFT minter for ethereum and Near Network

Learn more on the Gitcoin Issue Details page.

secretshardul commented 3 years ago

There are two possible solutions:

  1. Migrate existing solidity code to Near. Near EVM is in active development and is available on betanet. Or
  2. Write fresh AssemblyScript / Rust contracts

What solution are you looking for? The latter option has some caveats:

AssemblyScript / Rust contract caveats

ERC1155 multi token contract compatibility issue with NEP-4

nft-miner uses the ERC1155 multi-token standard. This standard lets you mint both:

Near protocol has a standard spec NEP-4 for NFTs, but there isn't a multi-token spec yet. From the NEP-4 page:

A multi-token standard was considered, as well a standard that allowed for the transfer of any type of token along with the assets associated with this contract. This was foregone for the sake of decoupling the market contracts from the token contract

Implementing NEP-4 would require frontend changes for the following operations:

  1. Create new token: This will create a new NEP-4 contract with the user as owner. Owner and initial supply fields will be absent.
  2. Mint token: No token ID and quantity fields.
  3. Check token balance: No token ID field

Metadata issue

The NEP-4 spec leaves out metadata storage:

Finally, in the original draft, metadata was included in the model for tokens. It was clear through some basic implementations that this is not ideal since users may want to store metadata elsewhere. This could be entirely offchain, or in a separate contract.

There is a recent proposal on metadata storage but it has not been finalized.

I suggest leaving out on-chain metadata for now. Changes can be made once the above proposal is accepted.

polats commented 3 years ago

Thank you for the interest @secretshardul. We would prefer option 2 for now, as we were hoping for the code to be usable by more NEAR developers.

Instead of using NEP-4, is it possible to use the ERC-721 format used by Mintable as a reference instead? https://github.com/Mintbase/near-nft-standards/blob/main/ERC721_reference.md#rust-equivalent

There's also a new proposal still being finalized over at https://github.com/near/NEPs/discussions/171 that might be useful, and that might get it closer to the ERC-1155. I admit I still need to read through it though.

secretshardul commented 3 years ago

Mintbase ERC721 only defines function signatures, with the actual implementation is left out. Same can be said about NEP#171. Plus it's a working draft that is yet to be finalized.

I can can try implementing the contract but it may be hacky. What do you say?

polats commented 3 years ago

Hacky for now is fine, we can start with that and steadily improve it as NEP#171 becomes finalized. Looking forward to it!

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3000.0 DAI (3000.0 USD @ $1.0/DAI) has been submitted by:


Brianspha commented 3 years ago

Hello @polats is it possible to get an extension i just need more time to test i have something but its not working so great

polats commented 3 years ago

It seems doable @Brianspha , i'll check if we can extend it

Brianspha commented 3 years ago

@polats any feedback?

polats commented 3 years ago

Hey @Brianspha we can extend it for one more week, is that enough time?

Brianspha commented 3 years ago

Yeah more than enough

Brianspha commented 3 years ago

Starting when? I had already stopped

polats commented 3 years ago

Just extended it now @Brianspha until next Sunday

Brianspha commented 3 years ago

@polats just an update because of my lack of experience with react I'm creating a new package which will use a vue front end

Brianspha commented 3 years ago

@polats the files in the temp_meta_data are missing

Brianspha commented 3 years ago

Been trying to figure out why the contracts are deploying

polats commented 3 years ago

Hi @Brianspha here's the one that I use: temp_metadata.zip . The scripts should generate temp_metadata automatically though, I'll take a look

Brianspha commented 3 years ago

Alright nah it doesn't it fails but thank you for the file

Brianspha commented 3 years ago

@polats this folder seems to be missing as well contracts.json as required in the nftutils.ts file I'm not sure if I'm meant to create this file and what is the structure of this file?

Brianspha commented 3 years ago

@polats

polats commented 3 years ago

Hey @Brianspha, contracts.json is created by the contract:deploy:rinkeby step by hardhat.

It's a json file containing the contract ABI and looks like: { "name": "rinkeby", "chainId": "4", "contracts": { "ERC1155Opensea": { "address": "...", "abi": ... } } }

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3000.0 DAI (3000.00 USD @ $1.0/DAI) has been submitted by:

  1. @sekmet

@polats please take a look at the submitted work:


Brianspha commented 3 years ago

@polats I will be updating the forked repo later on in the day I'm just a bit tired now this is what I've done

  1. Created an equivalent erc721 token near
  2. Unit tested functions
  3. Created a new package since I'm not familiar with react that uses vue only to test mint NEAR nfts
  4. Edited and commented out the web3 code on the nftutils.ts file I couldn't get the files to work mainly due to missing documentation of how the files referenced are generated
Brianspha commented 3 years ago

@polats I did my best there so many limitations when working with near

polats commented 3 years ago

Thank you @Brianspha i'll be checking out the repo today

Brianspha commented 3 years ago

@polats cool I ran out of stamina to document everything because of the issues with near which I did report to their team

polats commented 3 years ago

Hey @Brianspha , can you write out some steps on how I can test? I see the new scripts on package.json, how would I mint the NFTs and view them?

Brianspha commented 3 years ago

Hey @polats i didnt develop the front end for that but please look at the unit tests here: https://github.com/Brianspha/nft-minter/blob/master/packages/near-contracts/assembly/__tests__/main.spec.ts

Brianspha commented 3 years ago

I was only to develop the minting option on the front end but due to near returning an error at times wasm execution failed with error: FunctionCallError(CompilationError(PrepareError(Deserialization))) I gave up continuing you don't have to accept the solution anyone else can continue. I spent most of the time trying to figure out why this error was occuring

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 3000.0 DAI (3000.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter