npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wemintart-contracts

v1.0.1

Published

**URI minter template**

Downloads

4

Readme

URI minter template

this is a simple tamplete based off a contract I deployed that worked for my needs. Please understand fully what it does and what it doesn't do before deploying on mainnet. Feel free to reach out to @mimnermosart on twitter or [email protected] for questions.

What it does: the contract can grant a minter role to an address, which than is able to mint multiple tokens in the contract by specifing the receiving address and the token URI for metadata. Some manual effort is required to substitute names and whatnot.

What it doesn't do: anything else. Royalties, listing, etc. is all demanded to external platforms. What is tested at the time of writing is just a simple sale on opensea.

This project doesn't come with a website, so minting must be done through etherscan.io after having verified the source code (minting through code is possible I guess, but wasn't tested)

Steps to try it:

  • clone this repository locally
  • install truffle with npm install -g truffle
  • run npm install to install dependencies
  • change inside contracts/URIMinter.sol the contract name and ticker symbol
  • create a .env file containing:
RINKEBY_PKEY="your private key on the rinkeby network"
RINKEBY_RPC_URL="rinkeby url (I used infura)"
MAINNET_PKEY="your mainnet private key (be sure to keep this file locally and set this only when necessary)"
MAINNET_URL="mainnet url (I used infura)"
  • create something like metadata.json for each token you want. Inside there must be a link to the actual artwork of the token
  • pin both the metadata file and the artwork file on ipfs. Either use something https://pinata.cloud or ipfs-desktop
  • run truffle compile

everything should go well, if so you've compiled your contract. Now for deploying it's best to first test it on a test network like rinkeby (only one supported out of the box right now).

  • be sure to have set your rinkeby url and private key in the .env file before proceeding
  • get some test eth from https://www.rinkeby.io/#faucet, use the same address which private key you put in the file
  • run truffle deploy --network rinkeby

Don't worry if you get some error, check when the transaction completes on etherscna.io (the rinkeby one). It should succeed.

Now to verify on etherscan (and then mint):

  • go to your contract on etherscan.io, then click on "Verify and publish" under the contract tab.
  • install truffle-flattener from this repo (main one has an issue currently that breaks with our dependencies)
  • run ./flatten.sh. This creates a file named etherscan-verify.sol
  • in etherscan, select single file verification, 0.8.0 as compiler and paste the content of the file generated earlier where it wants the contract source code.
  • follow what etherscan says until published
  • go again to your contract etherscan page, now you should be able to interact with the contract
  • under "write contract" select the mint function
  • first parameter is the receiving address of the token (usually yours), second one the ipfs hash of the metadata you've pinned earlier with the ipfs:// prefix
  • mint, then visit www.opensea.io/assets//0 and you should see your freshly minted token!

For mainnet do the same you did for rinkeby, except run truffle deploy --network mainnet

I will update this guide to make it better depending on requests, so if there's something you don't get or doesn't work, feel free to open issues or write me!