TokenVesting.sol

contract TokenVesting

is Ownable

This contract manages pre-sale tokens with particular vesting periods.Source: DutchAuction/TokenVesting.solAuthor: Connor Howe - ConnorBlockchain

Index

Reference

Events

  • AuctionAddressAssigned

    event AuctionAddressAssigned(address auctionAddress)

    Parameters:auctionAddress - address

  • EmergencyDrain

    event EmergencyDrain(address emergencyAddress, uint amount)

    Parameters:emergencyAddress - addressamount - uint

  • LockUpdated

    event LockUpdated(bool lockActive)

    Parameters:lockActive - bool

  • Registration

    event Registration(address who, uint256 cliff, uint256 duration)

    Parameters:who - addresscliff - uint256duration - uint256

  • Released

    event Released(uint256 amount)

    Parameters:amount - uint256

  • Revoked

    event Revoked()

  • TokenVestingRevoked

    event TokenVestingRevoked(address who, uint256 amount)

    Parameters:who - addressamount - uint256

  • TokensRecieved

    event TokensRecieved(address who, uint256 amount, uint256 timestamp)

    Parameters:who - addressamount - uint256timestamp - uint256

  • TokensReleased

    event TokensReleased(address who, uint256 amount)

    Parameters:who - addressamount - uint256

Modifiers

  • notEmptyAddress

    modifier notEmptyAddress(address _who)

    Parameters:_who - address

  • notEmptyUint

    modifier notEmptyUint(uint _uint)

    Parameters:_uint - uint

  • notLocked

    modifier notLocked()

  • notRegistered

    modifier notRegistered(address _who)

    Parameters:_who - address

Functions

  • emergencyDrain

    function emergencyDrain(address _emergencyAddress) public

    Owner can drain all remaining unreleased pre-sale tokens incase a vulnerability is found.Modifiers:onlyOwnerParameters:_emergencyAddress - Address where total unrealeased tokens will be transferred too.

  • fallback

    function (address _tokenWOM) public

    Initializes instance of Token Contract and assigns address.Modifiers:notEmptyAddressParameters:_tokenWOM - Address of ERC20 token contract for WOM.

  • getCliff

    function getCliff(address _who) public view returns (uint256)

    Parameters:_who - addressReturns:Epoch seconds of users Cliff.

  • getDuration

    function getDuration(address _who) public view returns (uint256)

    Parameters:_who - addressReturns:The duration of the token vesting.

  • getFinalized

    function getFinalized() public view returns (bool)

    Returns:If all pre-sale tokens have been released/claimed..

  • getReleased

    function getReleased(address _who) public view returns (uint256)

    Parameters:_who - addressReturns:The amount of tokens released.

  • getRevocable

    function getRevocable(address _who) public view returns (bool)

    Parameters:_who - addressReturns:True if the vesting is revocable.

  • getStart

    function getStart(address _who) public view returns (uint256)

    Parameters:_who - addressReturns:The start time of token vesting.

  • getUnreleased

    function getUnreleased(address _who) public view returns (uint256)

    Parameters:_who - addressReturns:The amount of tokens unreleased.

  • receiveApproval

    function receiveApproval(address from, uint tokens, address token, bytes data) public

    Called once SecondPriceAuction finalise() called, and then the ERC20 calls this function.Parameters:from - SecondPriceAuction address.tokens - Amount of tokens that has been approved.token - Address of ERC20 token.data - Bytes conversion of pre-sale members address.

  • registerPresaleVest

    function registerPresaleVest(bool _revocable, address _who, uint128 _cliff, uint64 _duration) public

    Owner registers pre-sale amount and agreed vesting terms.Modifiers:notLocked onlyOwner notEmptyUint notEmptyUint notEmptyAddress notRegisteredParameters:_revocable - Whether owner can revoke unreleased tokens if a breach in vesting contract._who - The persons address._cliff - Epoch seconds for cliff time._duration - Epoch seconds for duration of vest.

  • release

    function release() public

    Pre-sale members release their locked up funds.

  • revoke

    function revoke(address _who, address _emergencyAddress) public

    Owner revokes users remaining unreleased funds, and transfers to an emergency address.Modifiers:onlyOwner notLockedParameters:_who - Pre-sale members address to revoke future releases._emergencyAddress - Address remainder of pre-sale users unreleased tokens will be transfered to.

  • setAuctionAddress

    function setAuctionAddress(address _auctionAddress) public

    Owner assigns SecondPriceAuction address for lookups and transfers.Modifiers:onlyOwnerParameters:_auctionAddress - SecondPriceAuction address.

  • setLock

    function setLock(bool _lock) public

    Owner can lock the contract incase a vulnerability is found.Modifiers:onlyOwnerParameters:_lock - Bool assign lock.

Last updated

Was this helpful?