token vesting escrow with cliff and clawback

Overview

Yearn Vesting Escrow

A modified version of Curve Vesting Escrow contracts with added functionality:

  • An escrow can have a start_date in the past.
  • The first unlock can be delayed using cliff_length.
  • An ability to claim partial amounts or use a different beneficiary account.
  • An ability to terminate an escrow and clawback all the unvested tokens using rug_pull. The recipient is still entitled to the vested portion.
  • Factory admin controls removed, anyone can deploy escrows, funds are pulled instead of pushed.
  • Factory emits an event which allows finding all the escrows deployed from it.

Contracts

Usage

$ brownie console --network mainnet
funder = accounts.load(name)
factory = VestingEscrowFactory.at('0xF124534bfa6Ac7b89483B401B4115Ec0d27cad6A', owner=funder)
factory.deploy_vesting_contract(token, recipient, amount, vesting_duration, vesting_start, cliff_length)

Ethereum mainnet deployment

You might also like...
A free and open-source chess improvement app that combines the power of Lichess and Anki.
A free and open-source chess improvement app that combines the power of Lichess and Anki.

A free and open-source chess improvement app that combines the power of Lichess and Anki. Chessli Project Activity & Issue Tracking PyPI Build & Healt

HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And Android(Termux)
HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And Android(Termux)

HPomb v2020.02 Coming Soon Created By Secanonm HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And An

TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner.
TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner.

TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner

Code and yara rules to detect and analyze Cobalt Strike

Cobalt Strike Resources This repository contains: analyze.py: a script to analyze a Cobalt Strike beacon (python analyze.py BEACON) extract.py; extrac

Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.

Boltons boltons should be builtins. Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously mis

A Python utility belt containing simple tools, a stdlib like feel, and extra batteries. Hashing, Caching, Timing, Progress, and more made easy!
A Python utility belt containing simple tools, a stdlib like feel, and extra batteries. Hashing, Caching, Timing, Progress, and more made easy!

Ubelt is a small library of robust, tested, documented, and simple functions that extend the Python standard library. It has a flat API that all behav

A free and powerful system for awareness and research of the American judicial system.

CourtListener Started in 2009, CourtListener.com is the main initiative of Free Law Project. The goal of CourtListener.com is to provide high quality

Participants of Bertelsmann Technology Scholarship created an awesome list of resources and they want to share it with the world, if you find illegal resources please report to us and we will remove.

Participants of Bertelsmann Technology Scholarship created an awesome list of resources and they want to share it with the world, if you find illegal

Comments
  • Add escrow tracking and vesting_duration assert

    Add escrow tracking and vesting_duration assert

    Changes only affect factory

    All the changes are applied only in the factory contract, but all the logic that holds and handles money is in the other contract, VestingEscrowSimple.vy, thus the changes are extremely safe since factory only handles instantiation of new contracts.

    vesting_duration assert

    As mentioned by 0xalpharush from TrailOfBits on twitter, there's a very extreme edge_case where if vesting_duration is 0 and admin renounces ownership, funds would get locked in the contract. This update prevents that by adding a check on new escrow creation to force vesting_duration > 0 since it makes no sense for it to be 0, as then funds can only be clawed back by admin and they will never vest.

    escrows tracking

    There are chains where getting all events that have been emitted in the lifespan of a contract is very difficult or takes a lot of time, so to help in those cases we add an array that tracks all instantiated escrows, making it possible to query everything needed from state.

    opened by 0xngmi 1
  • feat: add ability to change recipient (in case of key loss)

    feat: add ability to change recipient (in case of key loss)

    This PR adds the ability for the admin to change the recipient, in case they lose access to their claiming keys, or a number of other reasons why they might not be able to call claim anymore.

    This has similiar security properties as rug_pull for the recipient role, with the added benefit of not losing access to what they have already been vested when rug_pull gets called. However, this method can be abused by the admin to steal more funds than what rug_pull can do, so a 1 week delay is added to prevent governance from being able to take more than what they can get from rug_pull.

    opened by fubuloubu 1
  • refactor: upgrade some of the language and formulas

    refactor: upgrade some of the language and formulas

    This PR just simplifies/clarifies some of the formulas.

    I thought there was a potential bug, but turns out it was okay once I refactored it to be clearer.

    opened by fubuloubu 0
  • Suggestion: add sweep function for potential stucked tokens

    Suggestion: add sweep function for potential stucked tokens

    This is from experience with current version of vesting contract.

    Some vested tokens could be accidentally claimed to same vesting contract and the lack of sweep function doesn't allow to recover them.

    Also can be useful in case other tokens are sent to the contract accidentally.

    This sweep can be called by the recipient of the vesting, since it should not have access to locked balance, only balanceOf of erc20 provided through argument address.

    opened by storming0x 0
Owner
core dev, yearn.finance
null
Tucan Discord Token Generator - Remastered

TucanGEN-SRC Tucan Discord Token Generator - Remastered Tucan source made better by me. -- idk if it works anymore Includes: hCaptcha Bypass Automatic

Vast 8 Nov 4, 2022
Block the annoying Token Grabbers on your discord

General We have seen that in the last time many discord servers are infected by fake discord nitro links we want to put an end to this and have develo

BadTiger Network 2 Jul 16, 2022
An Agora Python Flask token generation server

A Flask Starter Application with Login and Registration About A token generation Server using the factory pattern and Blueprints. A forked stripped do

Nii Ayi 1 Jan 21, 2022
Agora-token-helper - Some help tools for AgoraToken

Agora Token Helper Support AgoraToken version 001 - 006. But for security reason

imagora 1 Jan 26, 2022
An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to art and design.

Awesome AI for Art & Design An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to a

Margaret Maynard-Reid 20 Dec 21, 2022
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

guess-the-numbers Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Number guessing game

Amir Hussein Sharifnezhad 5 Oct 9, 2021
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

password-generator Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Password generator

Amir Hussein Sharifnezhad 3 Oct 9, 2021
Cirq is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators

Cirq is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators. Install

quantumlib 3.6k Jan 7, 2023
A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

null 2 Nov 27, 2021
🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.

Boltons boltons should be builtins. Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously mis

Mahmoud Hashemi 6k Jan 6, 2023