nft-minter
nft-minter copied to clipboard
[nft-minter by OP Games] : Add support for NFT tokens minted on NEAR Protocol
[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
- Robustness and completeness of solution
- Developer experience (the more documented and the less steps for developers needed, the better)
- Potential reusability across blockchains (how well the solution is able to abstract away blockchain specific code)
Helpful References
NEAR NFT discussions
- https://gov.near.org/t/nft-standard-discussion/853/14
- https://github.com/Mintbase/near-nft-standards/blob/main/ERC721_reference.md#rust-equivalent
- https://github.com/near/NEPs/discussions/171
Other Links
- Opensea erc1155 format used by nft-minter: https://github.com/ProjectOpenSea/opensea-erc1155
- Example deployment: http://nft-minter.herokuapp.com/
- Observable Article: https://observablehq.com/@polats/web-3-0-explorable-3-nfts-game-items-with-real-world-value
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.
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.
- If you would like to work on this issue you can 'start work' on the Gitcoin Issue Details page.
- Want to chip in? Add your own contribution here.
- Questions? Checkout Gitcoin Help or the Gitcoin's Discord
- $1,493,478.74 more funded OSS Work available on the Gitcoin Issue Explorer
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.
There are two possible solutions:
- Migrate existing solidity code to Near. Near EVM is in active development and is available on betanet. Or
- 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:
- Fungible tokens (ERC20-like): By minting multiple tokens for a given token ID
- NFTs: By minting a single token for a token ID.
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:
- Create new token: This will create a new NEP-4 contract with the user as owner. Owner and initial supply fields will be absent.
- Mint token: No token ID and quantity fields.
- 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.
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.
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?
Hacky for now is fine, we can start with that and steadily improve it as NEP#171 becomes finalized. Looking forward to it!
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:
- Learn more on the Gitcoin Issue Details page
- Want to chip in? Add your own contribution here.
- Questions? Checkout Gitcoin Help or the Gitcoin's Discord
- $1,821,244.11 more funded OSS Work available on the Gitcoin Issue Explorer
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
It seems doable @Brianspha , i'll check if we can extend it
@polats any feedback?
Hey @Brianspha we can extend it for one more week, is that enough time?
Yeah more than enough
Starting when? I had already stopped
Just extended it now @Brianspha until next Sunday
@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
@polats the files in the temp_meta_data are missing
Been trying to figure out why the contracts are deploying
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
Alright nah it doesn't it fails but thank you for the file
@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?
@polats
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": ... } } }
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:
@polats please take a look at the submitted work:
- PR by @sekmet
- Learn more on the Gitcoin Issue Details page
- Want to chip in? Add your own contribution here.
- Questions? Checkout Gitcoin Help or the Gitcoin's Discord
- $1,975,958.34 more funded OSS Work available on the Gitcoin Issue Explorer
@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
- Created an equivalent erc721 token near
- Unit tested functions
- Created a new package since I'm not familiar with react that uses vue only to test mint NEAR nfts
- 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
@polats I did my best there so many limitations when working with near
Thank you @Brianspha i'll be checking out the repo today
@polats cool I ran out of stamina to document everything because of the issues with near which I did report to their team
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?
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
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