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

@giveth/lpp-milestones

v2.0.0-beta.4

Published

LiquidPledging milestone contracts

Downloads

11

Readme

LPP Milestones

Contracts for LiquidPledging milestone plugins

Welcome to the code for the milestone plugins for liquid pledging. These contracts set the rules for milestones on the Giveth dapp.

Table of contents

Milestone Contracts

BridgedMilestone

This milestone is intended to work with the bridged version of LiquidPledging. Upon withdraw/disbursement of funds, they will be sent directly to the giveth-bridge contract to be bridge to the home network. After the HomeBridge payment timeout has passed, the funds will transferred to the recipient.

Recipient

This entity which will receive the milestone donations. This can be unset (address(0)) upon deploy. If recipient == address(0), then the manager can follow Changing the recipient to set the recipient.

Available Actions:
  • withdraw the funds
  • if reviewer != address(0):
    • request a review of the milestone
Changing the recipient

You must call changeRecipient(address newRecipient) in order to change the recipient.

The following rules apply:

  • If recipient == address(0), only the manager can set the recipient
  • If recipient != address(0), only the current recipient can change the recipient

NOTE: This is done is a single call, instead of a more fail-proof 2 step propose/accept process. If a mistake is made when setting/changing the recipient, the milestone will need to be canceled and re-created.

Manager

This entity is responsible for "managing" the milestone.

Available Actions:
  • canceling the milestone
  • disbursing the funds to the recipient
  • if recipient == address(0):
    • set the recipient
  • if reviewer != address(0):
    • request a review of the milestone

NOTE: This can be the recipient, the Giveth campaign manager, etc.

Reviewer (optional)

Constraints imposed if set:
  • milestone can only be withdrawn if state = MilestoneState.COMPLETED
  • milestone flow is as follows:
    1. manger or recipient requests a review by calling requestReview()
    2. reviewer can either accept (approveCompleted()) or reject (rejectCompleted()) the milestone as complete
      1. If the milestone is rejected, go back to step 1
    3. manager or recipient can disburse/withdraw the funds by calling withdraw(uint64 idPledge, uint amount) or mWithdraw(uint[] pledgesAmounts). The funds will always be sent to the recipient
Available Actions:
  • canceling the milestone
  • accept the milestone as completed
Changing the reviewer

In order to change the address, the current reviewer needs to call changeReviewer(address newReviewer).

NOTE: This is done is a single call, instead of a more fail-proof 2 step propose/accept process. If a mistake is made when changing the reviewer, the milestone will need to be canceled and re-created.

Funding/Withdraw

Upon initialization, the milestone can decide to limit donations to a single token (acceptedToken = token_address), the native currency (acceptedToken = address(0)), or any token (acceptedToken = address(-1)).

Donations can only be withdrawn if a recipient has been set.

Depending on the behavior of the LiquidPledging app, withdraw may be a 2-step process. When calling withdraw(uint64 idPledge, uint amount, address token) or mWithdraw(uint[] pledgesAmounts, address[] tokens) an attempt will be made to disburse the payment to the recipient. If there is a delay between withdrawing from LiquidPledging and the funds being sent, then a 2nd call to disburse(address token) or mDisburse(address[] tokens) will need to be made to send the funds to the recipient.

NOTE: This milestone can continue to receive funds indefinetly.

LPMilestone

This milestone is intended to raise funds for an exsting LiquidPledging admin. Any raised funds can only be transferred transfered directly to the LiquidPledging admin.

All behavior is the same as the BridgedMilestone except as noted below.

Recipient

This is the adminId of the LiquidPledging admin who will receive the funds from this milestone. Only the manager will be able to execute the actions mentioned in BridgedMilestone - Available Actions.

Withdraw/Disbursement

As noted above, the funds will never leave the LiquidPledging contract.

NOTE: If the recipient is canceled this milestone will not be withdrawable and any withdrawn pledges may be under the control of this milestone again. This milestone must be canceled to roll-back any remaining pledges to the previous owner.

Development

Install

  1. Click Star on this repo near the top-right corner of this web page (if you want to).
  2. Join our community if you haven't already.
  3. Fork this repo by clicking Fork button in top-right corner of this web page. Continue to follow instruction steps from your own lpp-milestones repo.
  4. The rest of these steps must be done from your machine's command line. Clone your own "lpp-milestones" repo:
    git clone https://github.com/GITHUB_USERNAME/lpp-milestones.git
  5. Change directories to lpp-milestones:
    cd lpp-milestones

Requirements

Make sure you have NodeJS (v8.4.0 or higher) and npm (5.4.1 or higher) installed.

Package

The lpp-milestones contracts are published as an npm package for developer convenience. To include it as a dependency in your package.json run this from your apps root dirctory.

 npm install lpp-milestones --save

Run demo

This plugin is currently being used by the Giveth dapp. Follow the instructions on the readme.

Help

Reach out to us on slack/riot for any help or to share ideas.