relevant tag icon
LinearVestingHub Contract
copy icon
ERC20
Token

LinearVestingHub Contract

LinearVestingHub is a smart contract that enables a streamlined and secure token vesting process. It allows for customizable vesting schedules, supports multiple beneficiaries, and ensures a transparent distribution of tokens over time, fostering trust and commitment among stakeholders. (autogenerated description)

*Visit desktop site to download or deploy

Last Publish

3/18/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
getAllActiveVestings() :
for off-chain reading only as very gas-intensive if eventually too gas intensive even for off-chain reading
getTotalNumberOfActiveVestings() :
for off-chain use only, might require pagination
getTotalNumberOfVestings() :
for off-chain use only, might require pagination
paused() :
Returns true if the contract is paused, and false otherwise.
initialize() :
This function initializes the contract with ReentrancyGuard and Pausable features. It ensures the contract is secure and can be paused if needed. (autogenerated documentation)
pause() :
This function pauses the contract and can only be called by the proxy admin. (autogenerated documentation)
unpause() :
This function unpauses the contract by calling the _unpause() function, allowing normal operations to resume. (autogenerated documentation)
withdrawAllTokens() :
This function withdraws all tokens from the contract and transfers them to a designated treasury address. (autogenerated documentation)
addVestings() :
This function adds multiple vesting schedules, transfers tokens to contract, and emits events. (autogenerated documentation)
addVesting() :
This function adds a new vesting schedule and transfers tokens to it from a treasury. Only the proxy admin can call it. (autogenerated documentation)
removeVesting(address,uint8) :
This function removes a vesting schedule for a receiver and transfers the remaining tokens to a treasury. (autogenerated documentation)
increaseVestingBalance(address,uint256,uint256) :
This function increases the token balance of a vesting contract for a specific receiver by a specified amount. It checks that the vesting exists, the addend is greater than 0, and the vesting is not completed. It then transfers the tokens from the vesting treasury to the contract and emits an event. (autogenerated documentation)
decreaseVestingBalance(address,uint256,uint256) :
This function decreases the token balance of a vesting contract and transfers the subtracted tokens to a treasury. (autogenerated documentation)
changeVestingStartTime(uint256,address,uint256) :
This function changes the start time of a vesting contract for a specific receiver. Only the proxy admin can call it. (autogenerated documentation)
changeVestingCliffDuration(uint256,address,uint256) :
This function changes the cliff duration of a vesting contract for a specific receiver. It updates the vesting object and emits an event. (autogenerated documentation)
changeVestingDuration(uint256,address,uint256) :
This function changes the duration of a vesting plan for a specific receiver. It updates the duration in the Vesting struct and emits an event. (autogenerated documentation)
replaceVestingWithNewReceiver(uint8[],address,uint8[],address) :
This function replaces vesting contracts assigned to an old receiver with new receiver addresses. It loops through the old vesting IDs, deletes them from the old receiver's vesting list, updates the receiver and ID, adds the updated vesting to the new receiver's list, and emits an event. Finally, it tries to remove the old receiver from the list of receivers if they no longer have any vesting contracts. (autogenerated documentation)
withdraw(address,uint256,address,uint256) :
This function allows a receiver to withdraw tokens from their vesting contract, as long as the vesting period has passed. (autogenerated documentation)
isReceiver(address) :
This function checks if an address is a receiver by checking if it exists in a set of receivers. (autogenerated documentation)
receiverAt(uint256) :
This function returns the address of the receiver at the specified index in a collection. It uses the "at" function from the underlying data structure. (autogenerated documentation)
receivers() :
This function returns an array of addresses representing the receivers of a contract, by iterating over a set of addresses. (autogenerated documentation)
numberOfReceivers() :
This function returns the number of receivers in an array by calling the length() function. (autogenerated documentation)
getAllActiveVestings() :
This function returns an array of all active vestings by iterating through all receivers and their vestings. (autogenerated documentation)
getTotalNumberOfVestings() :
This function returns the total number of vestings for all receivers by calling _getTotalNumberOfVestings with the list of receiver addresses. (autogenerated documentation)
getTotalNumberOfActiveVestings() :
This function returns the total number of active vestings by calling another function with an array of receiver addresses. (autogenerated documentation)
_addVesting() :
This function adds a new vesting schedule to a receiver's list of vestings, checking for validity and incrementing the next vesting ID. (autogenerated documentation)
_addVestingFromMemory() :
This function adds a vesting schedule to a receiver's list of vestings, checking for validity and incrementing the next vesting ID. (autogenerated documentation)
_tryRemoveReceiver(address) :
This function removes a receiver from a list if they have no active vestings. It iterates through vestings and removes if none are found. (autogenerated documentation)
_getTotalNumberOfVestings() :
This function calculates the total number of vestings for a given array of addresses by summing the length of their respective vesting arrays. (autogenerated documentation)
_getTotalNumberOfActiveVestings() :
This function counts the total number of active vestings for a list of receivers by iterating through their vesting arrays. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconNo-Code Deploy
copy iconDownload Source
copy iconnpx cookbookdev i LinearVestingHub
copy icon

Bytecode

Download

Verification

Download

Last Publish

3/18/2023

Solidity Compiler

v0.8.17+commit.8df45f5f

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.