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

@circles/circles-contracts

v3.3.2

Published

<div align="center"> <img width="80" src="https://raw.githubusercontent.com/CirclesUBI/.github/main/assets/logo.svg" /> </div>

Downloads

17

Readme

Ethereum Smart Contracts for the Circles UBI system: A decentralised Universal Basic Income platform based on personal currencies.

Basic design

There are several components:

Token contract

This is derived from standard ERC20 implementations, with two main differences: The ability to mint UBI to the token owner, and the hubTransfer function that allows transitive transfers. Token contracts store the address of the Hub that deployed them, and can only transact transitively with tokens from the same hub. Tokens have owners, which can be an external account or any kind of contract - in our deployment, they are Gnosis Safes.

Hub contract

This is the location of system-wide variables and the trust graph. It has special permissions on all tokens that were deployed through it and have authorized it to perform transitive exchanges. All the parameters in a Hub are immutable and it has no owner.

Circles contract diagram

Illustrated here are some of the main available calls:

  • signup method of the Hub deploys a Circles token
  • Safe or external accounts make trust connections within the hub with the trust method
  • Users send transitive transactions with the hub, which has special permissions on tokens

Installation

npm i @circles/circles-contracts

Requires Node version 14.

Development

Requires Node version 14. You can change your node version to the tested version with nvm use.

Install all required dependencies via npm install.

npm test will re-build the contracts / tests and run all of the tests in the test directory.

Tests are executed with the help of Truffle and written in javascript using Mocha with the Chai assertion library.

When you run npm test a new local blockchain will be started with ganache-cli (unless you already have one running). The contracts will be deployed and the javascript tests will make transactions to this chain.

Helper functions defined in test/helpers provides functionality for more complicated tests such as: reading the event log, or checking for an EVM "revert / throw", or changing the blockstamp times.

Note that: We commit the build dir on purpose, because the rest of our stack pulls this repo in from npm and gets the abis from them.

License

GNU Affero General Public License v3.0 AGPL-3.0