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

@terminal-fi/savingscelo

v3.4.1

Published

SavingsCELO contracts and @celo/contractkit based SDK

Downloads

3

Readme

SavingsCELO

SavingsCELO is a fully fungible ERC-20 compliant representation for an interest bearing Locked CELO.

In human speak:

  • User deposits CELO in SavingsCELO contract to receive SavingsCELO (sCELO) tokens.
  • After some time passes, the user can return sCELO tokens to the SavingsCELO contract and receive more CELO back than they deposited.
  • While deposits are instant, retrievals are delayed by the unlocking period (3 days).
  • sCELO tokens can be transferred from one account to another without any restrictions and all sCELO tokens in circulation are equivalent to each other.

Smart Contract architecture

SavingsCELO.sol

SavingsCELO is the primary contract that manages deposits and withdrawals and implements the ERC20 standard for the sCELO tokens.

SavingsCELO contract is un-upgradable, but it does have an admin/owner with extra privileges:

  • Owner can authorize a contract that can vote on behalf of the Locked CELO that is stored in the contract.
  • Owner can also authorize a standard vote signer. This functionality exists mainly as an emergency hatch, in case there is some backwards-incompatible change in core Celo contracts that breaks regular proxy voting.
  • Owner does not have any privileges to transfer out any of the CELO locked in the contract. However, a malicious owner could potentially block withdrawals through complex steps of continuously creating new governance proposals and upvoting those proposals using CELO locked in the contract. Constant upvoting on these Governance proposals would essentially block withdrawals.
  • Final step for finalizing the SavingsCELO project is to transfer its ownership to GovernanceProxy (i.e. regular Celo governance).

SavingsCELOVoterV1.sol

SavingsCELOVoterV1 is the first version of the SavingsCELO voter contract. It supports voting for only one group at a time, and does not support any governance voting.

Owner/admin of SavingsCELOVoterV1 is called the "Group Manager" and is responsible for choosing the group that SavingsCELO votes for.

  • By default, the voted group will be the deployed SavingsCELOVGroup contract.
  • Group Manager can change the voted group in case of an emergency (i.e. if the currently voted group gets slashed, or if there is no longer enough CELO in the contract to keep the group elected)

SavingsCELOVGroup.sol

SavingsCELOVGroup implements a special type of validator group. The owner of this group is the same "Group Manager".

Group Manager has the following privileges:

  • Can deposit/withdraw/lock/unlock CELO for the group.
  • Can authorize a vote signer.
  • Can authorize a validator signer to manage group members and its commission.

Group Manager doesn't have access to the cUSD rewards. cUSD rewards that accumulate on SavingsCELOVGroup can only be converted to CELO and deposited back into SavingsCELO contract.

Usage

You can interact with the SavingsCELO contracts using a command-line interface.

> npm install -g savingscelo-cli@latest
> savingscli --help

SavingsCELO contracts are deployed on Baklava and Alfajores testnets too and savingscli supports interacting with those out of the box. Example:

> savingscli -n https://baklava-forno.celo-testnet.org --ledger-idx 0 balance

SDK - SavingsKit

savingscelo npm package comes with the typescript libraries that can be used to easily interact with the SavingsCELO contracts. These libraries are based on @celo/contractkit. Checkout source for savingscli tool for example usage: savingscelo-cli