
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@giveth/lpp-milestones
Advanced tools

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.
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.
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.
reviewer != address(0):
You must call changeRecipient(address newRecipient) in order to change the recipient.
The following rules apply:
recipient == address(0), only the manager can set the recipientrecipient != address(0), only the current recipient can change the recipientNOTE: 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.
This entity is responsible for "managing" the milestone.
recipientrecipient == address(0):
recipientreviewer != address(0):
NOTE: This can be the recipient, the Giveth campaign manager, etc.
state = MilestoneState.COMPLETEDmanger or recipient requests a review by calling requestReview()reviewer can either accept (approveCompleted()) or reject (rejectCompleted()) the milestone as complete
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 recipientIn 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.
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.
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.
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.
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.
git clone https://github.com/GITHUB_USERNAME/lpp-milestones.git
cd lpp-milestones
Make sure you have NodeJS (v8.4.0 or higher) and npm (5.4.1 or higher) installed.
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
This plugin is currently being used by the Giveth dapp. Follow the instructions on the readme.
Reach out to us on slack/riot for any help or to share ideas.
FAQs
LiquidPledging milestone contracts
We found that @giveth/lpp-milestones demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.