Skip to content

Latest commit

 

History

History
299 lines (273 loc) · 11 KB

File metadata and controls

299 lines (273 loc) · 11 KB

Four Year Vesting Contract.

  • (FourYearVesting.sol)

View Source: contracts/governance/Vesting/fouryear/FourYearVesting.sol

↗ Extends: FourYearVestingStorage, UpgradableProxy

FourYearVesting contract

A four year vesting contract. *

Functions


constructor

Setup the vesting schedule.

function (address _logic, address _SOV, address _stakingAddress, address _tokenOwner, address _feeSharingCollector, uint256 _extendDurationFor) public nonpayable

Arguments

Name Type Description
_logic address The address of logic contract.
_SOV address The SOV token address.
_stakingAddress address
_tokenOwner address The owner of the tokens.
_feeSharingCollector address Fee sharing proxy address.
_extendDurationFor uint256 Duration till the unlocked tokens are extended.
Source Code
constructor(
        address _logic,
        address _SOV,
        address _stakingAddress,
        address _tokenOwner,
        address _feeSharingCollector,
        uint256 _extendDurationFor
    ) public {
        require(Address.isContract(_logic), "_logic not a contract");
        require(_SOV != address(0), "SOV address invalid");
        require(Address.isContract(_SOV), "_SOV not a contract");
        require(_stakingAddress != address(0), "staking address invalid");
        require(Address.isContract(_stakingAddress), "_stakingAddress not a contract");
        require(_tokenOwner != address(0), "token owner address invalid");
        require(_feeSharingCollector != address(0), "feeSharingCollector address invalid");
        require(Address.isContract(_feeSharingCollector), "_feeSharingCollector not a contract");
        require((_extendDurationFor % FOUR_WEEKS) == 0, "invalid duration");

        _setImplementation(_logic);
        SOV = IERC20(_SOV);
        staking = IStaking(_stakingAddress);
        tokenOwner = _tokenOwner;
        feeSharingCollector = IFeeSharingCollector(_feeSharingCollector);
        maxInterval = 18 * FOUR_WEEKS;
        extendDurationFor = _extendDurationFor;
    }

setImplementation

⤾ overrides UpgradableProxy.setImplementation

Set address of the implementation - vesting owner.

function setImplementation(address _implementation) public nonpayable onlyProxyOwner 

Arguments

Name Type Description
_implementation address Address of the implementation. Must match with what is set by token owner.
Source Code
function setImplementation(address _implementation) public onlyProxyOwner {
        require(Address.isContract(_implementation), "_implementation not a contract");
        require(newImplementation == _implementation, "address mismatch");
        _setImplementation(_implementation);
        newImplementation = address(0);
    }

Contracts