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

@ecobioca/smart-traceability

v1.0.3

Published

This project enables traceability of supply chains using EVM smart contracts and comes with the smart contracts, a test for that contracts and a sample script that deploys that contract.

Downloads

16

Readme

Tracebility EVM Smart Contracts

This project enables traceability of supply chains using EVM smart contracts and comes with the smart contracts, a test for that contracts and a sample script that deploys that contract.

Suppliers can create products and their respective batches, recording the transactions of this batch on blockchain.

Each batch created represents a token. The standard token used is the ERC1155 NFT standard and all the metadata should be stored in IPFS.

Each supplier can give permission to a list of managers' addresses to create and transact the batch, in addition to transferring it to other links in the chain.

Install dependencies:

yarn install

Compile and run tests:

yarn hardhat coverage

Deployment

Deploy to Alfajores (Celo Testnet):

yarn hardhat deploy --network alfajores

Deploy to Celo Mainnet:

yarn hardhat deploy --network celo

Deploy to Mumbai (Polygon Testnet):

yarn hardhat deploy --network mumbai

Deploy to Polygon Mainnet:

yarn hardhat deploy --network polygon

Then, copy the deployment address and start using it in your client application!

Tasks

Add Supplier

Usage:

hardhat --network <NETWORK> add-supplier --contract <STRING> --holder <STRING> --manager <STRING> --metadata <STRING>

OPTIONS:

  • contract: Contract address
  • holder: Holder address, can be a contract
  • manager: Addresses of managers, separated by commas
  • metadata: Metadata IPFS hash

Example:

yarn hardhat --network alfajores add-supplier --contract 0x5d7D5AEBFe64E72Bd571d24Fc2d8547A2E657cfC --metadata bafybeif5i3ov3n7xjwdeg3gnreeoy7kmumsedu64qd5juzer7pmn47z3oi --manager 0x208eAE2D4f048F35FD7974216f5fa409Dd70d2E1 --holder 0x7cE9254F2c643e2BFD5306361529Db622873A8D8

# Response:
Added supplier, Id: 1

Get Supplier

Usage:

hardhat --network <NETWORK> get-supplier --contract <STRING> --supplier <INT>

OPTIONS:

  • contract: Contract address
  • supplier: Supplier Id

Example:

yarn hardhat --network alfajores get-supplier --contract 0x5d7D5AEBFe64E72Bd571d24Fc2d8547A2E657cfC --supplier 1

# Response:
id: 1
metadata: bafybeif5i3ov3n7xjwdeg3gnreeoy7kmumsedu64qd5juzer7pmn47z3oi
managers: 0xb10c1E57379aBbA9F54AdAD33681abe4F4Fb0faC
holder: 0x7cE9254F2c643e2BFD5306361529Db622873A8D8
role: Supplier

Add Product

yarn hardhat --network alfajores add-product --contract 0x5d7D5AEBFe64E72Bd571d24Fc2d8547A2E657cfC --supplier 1 --code 0123456789123 --metadata bafybeiar26nqkdtiyrzbaxwcdm7zkr2o36xljqskdvg6z6ugwlmpkdhamy

Get Product

yarn hardhat --network alfajores get-product --contract 0x5d7D5AEBFe64E72Bd571d24Fc2d8547A2E657cfC --id 1

Add Batch

yarn hardhat --network alfajores add-batch --contract 0x8a17A7bB33040E6FF8aF645b67d7154c1B241AeA --supplier 1 --product 1 --code "2022-2" --metadata bafybeiar26nqkdtiyrzbaxwcdm7zkr2o36xljqskdvg6z6ugwlmpkdhamy

Contributing

If you want to contribute to the project, lint code before git pushing / open a pull request.

yarn eslint '**/*.{js,ts}'
yarn eslint '**/*.{js,ts}' --fix
yarn prettier '**/*.{json,sol,md}' --check
yarn prettier '**/*.{json,sol,md}' --write
yarn solhint 'contracts/**/*.sol'
yarn solhint 'contracts/**/*.sol' --fix