Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/governance/Staking/interfaces/IStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ interface IStaking {
function numVestingCheckpoints(uint256 date) external view returns (uint32 checkpointsQty);

///@notice vesting registry contract PROXY address
function vestingRegistryLogic() external view returns (address);
function vestingRegistry() external view returns (address);

/// @dev user => flag whether user has pauser role.
function pausers(address isPauser) external view returns (bool);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ contract StakingStorageModule is IFunctionsList, StakingStorageShared {
functionsList[24] = this.vestingCodeHashes.selector;
functionsList[25] = this.vestingCheckpoints.selector;
functionsList[26] = this.numVestingCheckpoints.selector;
functionsList[27] = this.vestingRegistryLogic.selector;
functionsList[27] = this.vestingRegistry.selector;
functionsList[28] = this.pausers.selector;
functionsList[29] = this.paused.selector;
functionsList[30] = this.frozen.selector;
Expand Down
6 changes: 3 additions & 3 deletions contracts/governance/Staking/modules/StakingVestingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract StakingVestingModule is IFunctionsList, StakingShared {
* various other functionalities without the necessity of linking it with Vesting Registry
*/
function setVestingRegistry(address _vestingRegistryProxy) external onlyOwner whenNotFrozen {
vestingRegistryLogic = IVestingRegistry(_vestingRegistryProxy);
vestingRegistry = IVestingRegistry(_vestingRegistryProxy);
}

/**
Expand Down Expand Up @@ -278,8 +278,8 @@ contract StakingVestingModule is IFunctionsList, StakingShared {
function isVestingContract(address stakerAddress) external view returns (bool) {
bool isVesting;
bytes32 codeHash = _getCodeHash(stakerAddress);
if (address(vestingRegistryLogic) != address(0)) {
isVesting = vestingRegistryLogic.isVestingAddress(stakerAddress);
if (address(vestingRegistry) != address(0)) {
isVesting = vestingRegistry.isVestingAddress(stakerAddress);
}

if (isVesting) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ contract StakingWithdrawModule is IFunctionsList, StakingShared, CheckpointsShar
uint256 startFrom
) external onlyAuthorized whenNotFrozen {
/// require the caller only for team vesting contract.
require(vestingRegistryLogic.isTeamVesting(vesting), "Only team vesting allowed");
require(vestingRegistry.isTeamVesting(vesting), "Only team vesting allowed");

_cancelTeamVesting(vesting, receiver, startFrom);
}
Expand Down Expand Up @@ -340,7 +340,7 @@ contract StakingWithdrawModule is IFunctionsList, StakingShared, CheckpointsShar
address vesting,
address receiver
) public onlyAuthorized whenNotFrozen {
require(vestingRegistryLogic.isTeamVesting(vesting), "Only team vesting allowed");
require(vestingRegistry.isTeamVesting(vesting), "Only team vesting allowed");

ITeamVesting teamVesting = ITeamVesting(vesting);
uint256 teamVestingStartDate = teamVesting.startDate();
Expand Down
4 changes: 2 additions & 2 deletions contracts/governance/Staking/modules/shared/StakingShared.sol
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ contract StakingShared is StakingStorageShared, SafeMath96 {
assembly {
codeHash := extcodehash(stakerAddress)
}
if (address(vestingRegistryLogic) != address(0)) {
isVesting = vestingRegistryLogic.isVestingAddress(stakerAddress);
if (address(vestingRegistry) != address(0)) {
isVesting = vestingRegistry.isVestingAddress(stakerAddress);
}

if (isVesting) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ contract StakingStorageShared is Ownable {
mapping(uint256 => uint32) public numVestingCheckpoints;

///@notice vesting registry contract
IVestingRegistry public vestingRegistryLogic;
IVestingRegistry public vestingRegistry;

/// @dev user => flag whether user has pauser role.
mapping(address => bool) public pausers;
Expand Down
14 changes: 7 additions & 7 deletions contracts/governance/Vesting/VestingCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pragma solidity ^0.5.17;

import "../../interfaces/IERC20.sol";
import "../../utils/AdminRole.sol";
import "./VestingRegistryLogic.sol";
import "./VestingRegistry.sol";
import "./VestingLogic.sol";
import "../../openzeppelin/SafeMath.sol";

Expand All @@ -19,7 +19,7 @@ contract VestingCreator is AdminRole {
IERC20 public SOV;

///@notice the vesting registry contract
VestingRegistryLogic public vestingRegistryLogic;
VestingRegistry public vestingRegistry;

///@notice Holds Vesting Data
struct VestingData {
Expand All @@ -44,7 +44,7 @@ contract VestingCreator is AdminRole {
require(_vestingRegistryProxy != address(0), "Vesting registry address invalid");

SOV = IERC20(_SOV);
vestingRegistryLogic = VestingRegistryLogic(_vestingRegistryProxy);
vestingRegistry = VestingRegistry(_vestingRegistryProxy);
}

/**
Expand Down Expand Up @@ -245,15 +245,15 @@ contract VestingCreator is AdminRole {
VestingData memory vestingData
) internal returns (address vesting) {
if (vestingData.governanceControl) {
vestingRegistryLogic.createTeamVesting(
vestingRegistry.createTeamVesting(
vestingData.tokenOwner,
vestingData.amount,
vestingData.cliff,
vestingData.duration,
vestingData.vestingCreationType
);
} else {
vestingRegistryLogic.createVestingAddr(
vestingRegistry.createVestingAddr(
vestingData.tokenOwner,
vestingData.amount,
vestingData.cliff,
Expand Down Expand Up @@ -282,14 +282,14 @@ contract VestingCreator is AdminRole {
uint256 _vestingCreationType
) internal view returns (address vestingAddress) {
if (_governanceControl) {
vestingAddress = vestingRegistryLogic.getTeamVesting(
vestingAddress = vestingRegistry.getTeamVesting(
_tokenOwner,
_cliff,
_duration,
_vestingCreationType
);
} else {
vestingAddress = vestingRegistryLogic.getVestingAddr(
vestingAddress = vestingRegistry.getVestingAddr(
_tokenOwner,
_cliff,
_duration,
Expand Down
Loading