Skip to content

Latest commit

 

History

History
278 lines (257 loc) · 10.4 KB

FourYearVestingFactory.md

File metadata and controls

278 lines (257 loc) · 10.4 KB

Four Year Vesting Factory: Contract to deploy four year vesting contracts. (FourYearVestingFactory.sol)

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

↗ Extends: IFourYearVestingFactory, Ownable

FourYearVestingFactory contract

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

Events

event FourYearVestingCreated(address indexed tokenOwner, address indexed vestingAddress);

Functions


deployFourYearVesting

⤾ overrides IFourYearVestingFactory.deployFourYearVesting

Deploys four year vesting contract.

function deployFourYearVesting(address _SOV, address _staking, address _tokenOwner, address _feeSharing, address _vestingOwnerMultisig, address _fourYearVestingLogic, uint256 _extendDurationFor) 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.
_feeSharing address The address of fee sharing contract.
_vestingOwnerMultisig address The address of an owner of vesting contract.
_fourYearVestingLogic address The implementation contract.
_extendDurationFor uint256 Duration till the unlocked tokens are extended.

Returns

The four year vesting contract address.

Source Code
function deployFourYearVesting(
        address _SOV,
        address _staking,
        address _tokenOwner,
        address _feeSharing,
        address _vestingOwnerMultisig,
        address _fourYearVestingLogic,
        uint256 _extendDurationFor
    ) external onlyOwner returns (address) {
        address fourYearVesting =
            address(
                new FourYearVesting(
                    _fourYearVestingLogic,
                    _SOV,
                    _staking,
                    _tokenOwner,
                    _feeSharing,
                    _extendDurationFor
                )
            );
        Ownable(fourYearVesting).transferOwnership(_vestingOwnerMultisig);
        emit FourYearVestingCreated(_tokenOwner, fourYearVesting);
        return fourYearVesting;
    }

Contracts