Skip to content

Latest commit

 

History

History
376 lines (336 loc) · 12.5 KB

VestingFactory.md

File metadata and controls

376 lines (336 loc) · 12.5 KB

Vesting Factory: Contract to deploy vesting contracts

of two types: vesting (TokenHolder) and team vesting (Multisig). (VestingFactory.sol)

View Source: contracts/governance/Vesting/VestingFactory.sol

↗ Extends: IVestingFactory, Ownable

VestingFactory contract

Factory pattern allows to create multiple instances of the same contract and keep track of them easier.

Contract Members

Constants & Variables

address public vestingLogic;

Functions


constructor

function (address _vestingLogic) public nonpayable

Arguments

Name Type Description
_vestingLogic address
Source Code
constructor(address _vestingLogic) public {
        require(_vestingLogic != address(0), "invalid vesting logic address");
        vestingLogic = _vestingLogic;
    }

deployVesting

⤾ overrides IVestingFactory.deployVesting

Deploys Vesting contract.

function deployVesting(address _SOV, address _staking, address _tokenOwner, uint256 _cliff, uint256 _duration, address _feeSharing, address _vestingOwner) external nonpayable onlyOwner 
returns(address)

Arguments

Name Type Description
_SOV address the address of SOV token.
_staking address The address of staking contract.
_tokenOwner address The owner of the tokens.
_cliff uint256 The time interval to the first withdraw in seconds.
_duration uint256 The total duration in seconds.
_feeSharing address The address of fee sharing contract.
_vestingOwner address The address of an owner of vesting contract.

Returns

The vesting contract address.

Source Code
function deployVesting(
        address _SOV,
        address _staking,
        address _tokenOwner,
        uint256 _cliff,
        uint256 _duration,
        address _feeSharing,
        address _vestingOwner
    )
        external
        onlyOwner /// @dev owner - VestingRegistry
        returns (address)
    {
        address vesting =
            address(
                new Vesting(
                    vestingLogic,
                    _SOV,
                    _staking,
                    _tokenOwner,
                    _cliff,
                    _duration,
                    _feeSharing
                )
            );
        Ownable(vesting).transferOwnership(_vestingOwner);
        return vesting;
    }

deployTeamVesting

⤾ overrides IVestingFactory.deployTeamVesting

Deploys Team Vesting contract.

function deployTeamVesting(address _SOV, address _staking, address _tokenOwner, uint256 _cliff, uint256 _duration, address _feeSharing, address _vestingOwner) external nonpayable onlyOwner 
returns(address)

Arguments

Name Type Description
_SOV address The address of SOV token.
_staking address The address of staking contract.
_tokenOwner address The owner of the tokens.
_cliff uint256 The time interval to the first withdraw in seconds.
_duration uint256 The total duration in seconds.
_feeSharing address The address of fee sharing contract.
_vestingOwner address The address of an owner of vesting contract.

Returns

The vesting contract address.

Source Code
function deployTeamVesting(
        address _SOV,
        address _staking,
        address _tokenOwner,
        uint256 _cliff,
        uint256 _duration,
        address _feeSharing,
        address _vestingOwner
    )
        external
        onlyOwner //owner - VestingRegistry
        returns (address)
    {
        address vesting =
            address(
                new TeamVesting(
                    vestingLogic,
                    _SOV,
                    _staking,
                    _tokenOwner,
                    _cliff,
                    _duration,
                    _feeSharing
                )
            );
        Ownable(vesting).transferOwnership(_vestingOwner);
        return vesting;
    }

Contracts