Vesting contract with multiple beneficiaries, tokens, and lock schedules.

Overview

⚠️ This code has not been audited, use at your own risk

Vesting Contract

This contract handles the vesting of ERC20 tokens for multiple beneficiaries. Custody of multiple tokens can be given to this contract, which will release the token to the beneficiaries following a given vesting schedule.

Tokens should be added to the contract through addBenefit function, any token externally transferred will be retrievable with the dust collector functionality.

The owner of the contract has the ability to change the vesting schedules, or to remove the benefits for a particular beneficiary. Anyhow, the correspondent tokens prior to any modification will be released to the beneficiary keeping the prior vesting schedule.

Disclaimer: non-standard ERC20s

This contract does not support non-standard ERC20 implementations where the transferred amount is not equal to the requested amount in the transfer params (tokens with inherent fees).

Disclaimer: malicious ERC20s

This contract expects a whitelisted selection of ERC20s, it naively trusts the safeTransfer will not revert, malicious implementations could affect the functionality of looped functions, like for example removeBeneficiary calls could be forced to revert.

How to use

Owner can use any of the 2 functions to vest a benefit in the contract:

  • addBenefit(token, beneficiary, amount, startDate, duration)
  • addBenefits(token, beneficiaries[], amounts[], startDate, duration)

He must have previously approved the ERC20 spending of the amount, or the sum of amounts[].

Beneficiaries, at any given point, can claim their rewards using any of the following functions to release their tokens:

  • release(token, beneficiary)
  • release(tokens[], beneficiary)
  • release(token) (uses msg.sender as beneficiary)
  • release(tokens[]) (uses msg.sender as beneficiary)
  • releaseAll() (uses msg.sender as beneficiary)
  • releaseAll(beneficiary)

The contract will calculate, at the given timestamp, the amount of releasable tokens and transfer them to the rightful beneficiary. This functions have no access control, allowing anyone to use their gas for the release of the tokens.

At any given point, the owner can choose to remove the benefits to a particular beneficiary, releasing first the correspondant amount of tokens to him, and transferring the remaining amount to the owner.

  • removeBenefit(token, beneficiary)
  • removeBeneficiary(beneficiary)
You might also like...

Spiner bot to buy and sell tokens on ETH and ERC compatible chains as soon as liquidity is added and trade is enabled.

Spiner bot to buy and sell tokens on ETH and ERC compatible chains as soon as liquidity is added and trade is enabled.

An open-source defi sniper. open-sniper is free to download. Premium Services Now Available While open-sniper is free and open-source, if you want the

Apr 21, 2022

Ethereum Smart Contracts for locking your Ether and ERC20 tokens based on time and price conditions

SmartHold - a simple way to lock and hold your ETH or ERC20 in a smart contract This is a BETA software that has not been audited for security. USE AT

May 5, 2022

Multi-chain sniper bot to buy and sell tokens on ETH compatible chains. Features include instant or mempool sniping, rug protection, and sell management.

Multi-chain sniper bot to buy and sell tokens on ETH compatible chains. Features include instant or mempool sniping, rug protection, and sell management.

An open-source defi sniper. defi-sniper is free to download. NEW Community telegram group: https://t.me/+aBLUmP1UnypiNTVh Premium Services Now Availab

May 3, 2022

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes. Now we will be stepping into the world of games with NFTs where a user has to play games with their character being an NFT which has unique powers, unique traits etc etc.

Oct 1, 2022

Subgraph to query Doodles NFT tokens along with the traits and owners.

Doodles Subgraph API Subgraph to query Doodles NFT tokens along with the traits and owners. How to use the API Try it out here Example query: { toke

Sep 19, 2022

Pull sensitive data from users on windows including discord tokens and chrome data.

Pull sensitive data from users on windows including discord tokens and chrome data.

⭐ For a 🍪 Pegasus Pull sensitive data from users on windows including discord tokens and chrome data. Features 🟩 Discord tokens 🟩 Geolocation data

Dec 24, 2022

🎯 Wallet Lite is a Quick and Simple way to use your Tokens of Lunes Blockchain in a light Chrome extension

Lunes Wallet Lite Offered by: Lunes Installing Web store: Lunes Lite will be available on Chrome Web Store Build: Requisites NodeJS (16 or higher) Git

Oct 25, 2022

A utility that mutates and transforms a style-dictionary object into something Figma Tokens plugin understands

A utility that mutates and transforms a style-dictionary object into something Figma Tokens plugin understands

Brought to you by Style Dictionary To Figma A utility that transforms a style-dictionary object into something Figma Tokens plugin understands. Used b

Jan 4, 2023

Ethereum chain sniperbot for tokens. This bot sniffs the mempool for pending transactions for trading enabled and also liquidity add functions.

Ethereum chain sniperbot for tokens. This bot sniffs the mempool for pending transactions for trading enabled and also liquidity add functions.

Dec 5, 2022
Owner
DeFi Wonderland
DeFi Wonderland
Parses natural language to date schedules.

DateParrot DateParrot parses natural language into a unified schedule object or ISO date. This package is in a very early stage and not yet production

Jörg Bayreuther 7 Aug 3, 2022
Receive crypto payments from anywhere around the world, options including native tokens (MATIC, ETHER,BUSD), Tokens (USDT,BUSD), NFTs and more.

Receive payments for service rendered in crypto using different options. Go borderless with bonpay, gain access to varities of crypto assets, safe and

Johnson awah Alfred 6 Nov 11, 2022
A simple multilateral escrow smart contract for ETH and ERC-20 tokens governed by Cobie.

Multilateral Escrow Smart Contract Governed by Cobie Test Deployments Cobie's address: 0x4Cbe68d825d21cB4978F56815613eeD06Cf30152 Rinkeby: 0xFfE420602

Pascal Marco Caversaccio 28 Dec 15, 2022
Provides Lock and RwLock synchronization primitives.

Lock Provides Lock and RWLock (read write lock) synchronization primitives for protecting in-memory state across multiple tasks and/or microtasks. Ins

Rocicorp 4 Apr 27, 2022
A simple lock-and-release eventually-consistent DB to be consumed by multi-threaded applications in node.

worsen - a persistence store for quick prototyping A simple lock-and-release eventually-consistent DB to be consumed by multi-threaded applications in

Aniket Biprojit Chowdhury 2 Oct 1, 2022
Deduplication tool for pnpm-lock.yaml files

pnpm-deduplicate Remove duplicate dependencies from pnpm-lock.yaml. This project is simple and not have many features. I see it as a temporary solutio

null 62 Jan 3, 2023
Deno's first lightweight, secure distributed lock manager utilizing the Redlock algorithm

Deno-Redlock Description This is an implementation of the Redlock algorithm in Deno. It is a secure, lightweight solution to control resource access i

OSLabs Beta 223 Dec 31, 2022
A pointer lock movement manager for customizing your own creative UI.

Pointer Lock Movement A pointer lock movement manager for customizing your own creative UI. Inspired by Figma's number input element: Dragging on an i

Zheeeng 8 Nov 4, 2022
True P2P concept for your p2p powered website/app/client. MSC/MEP (Multiple Strategy Concept/Multiple Entry Points)

TRUE P2P CONCEPT - Lets redecentralize the web This repo is just conceptual. Active development of the endproduct (TRUE P2P) happens here https://gith

Bo 6 Mar 29, 2022
⚡🚀 Call multiple view functions, from multiple Smart Contracts, in a single RPC query!

ethers-multicall ⚡ ?? Call multiple view functions, from multiple Smart Contracts, in a single RPC query! Querying an RPC endpoint can be very costly

Morpho Labs 20 Dec 30, 2022