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

@frankencoin/zchf

v0.2.15

Published

It shall support a wide range of collateralized minting methods that are governed by a democratic process.

Downloads

724

Readme

FrankenCoin

This is the source code repository for the smart contracts of the oracle-free, collateralized stablecoin Frankencoin.

There also is a public frontend, a documentation page, an outdated Frankencoin Research Paper, and a more recent chapter of a pending phd thesis.

Source Code

The source code can be found in the contracts folder. The following are the most important contracts.

| Contract | Description | | -------------------- | ----------------------------------------------- | | Frankencoin.sol | The Frankencoin (ZCHF) ERC20 token | | Equity.sol | The Frankencoin Pool Shares (FPS) ERC20 token | | MintingHub.sol | Plugin for oracle-free collateralized minting | | Position.sol | A borrowed minting position holding collateral | | PositionRoller.sol | A module to roll positions into new ones | | StablecoinBridge.sol | Plugin for 1:1 swaps with other CHF stablecoins | | Savings.sol | A module to pay out interest to ZCHF holders |

Compiling and Testing

The project is setup to be compiled and tested with hardhat. Given node.js and hardhat are installed, you can compile or compile and test using these two commands:

npx hardhat compile
npx hardhat test
npx hardhat coverage

With tsc-watch (auto refresh commands)

npx tsc-watch --onCompilationComplete "npx hardhat test ./test/RollerTests.ts"

Deployment

Define the private key from your deployer address and etherscan api key as an environment variable in .env file.

PK=0x123456
APIKEY=123456

Then run a deployment script with tags and network params (e.g., sepolia that specifies the network)

Recommanded commands for sepolia network.

hh deploy --network sepolia --tags MockTokens
hh deploy --network sepolia --tags Frankencoin
hh deploy --network sepolia --tags PositionFactory
hh deploy --network sepolia --tags MintingHub
hh deploy --network sepolia --tags MockCHFToken
hh deploy --network sepolia --tags XCHFBridge
hh deploy --network sepolia --tags positions

The networks are configured in hardhat.config.ts.

npx hardhat verify "0x..." --network sepolia

Publish for NPM Pkg

NPM Package: @frankencoin/zchf

"build": "tsup"

Publish: You need to be logged in and execute npm publish --access public

Edit: index.ts for all pkg exports.

@dev: how to transpile package into bundled apps

E.g. for NextJs using the next.config.js in root of project.

/** @type {import('next').NextConfig} */
const nextConfig = {
	reactStrictMode: true,
	transpilePackages: ['@.../core', '@.../api'],
};

module.exports = nextConfig;