Skip to content

Commit

Permalink
style: fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dristpunk committed Feb 21, 2024
1 parent ab49279 commit 59fe8ca
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions solidity/contracts/ConnextVestingWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
address public constant NEXT_TOKEN = 0xFE67A4450907459c3e1FFf623aA927dD4e28c67a; // Mainnet NEXT token address

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_DURATION = ONE_YEAR + ONE_MONTH; // 13 months duration
uint64 public constant UNLOCK_DURATION = ONE_YEAR + ONE_MONTH; // 13 months duration

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_CLIFF_DURATION = ONE_MONTH; // 1 month cliff
uint64 public constant UNLOCK_CLIFF_DURATION = ONE_MONTH; // 1 month cliff

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_OFFSET = ONE_YEAR - ONE_MONTH; // 11 months offset
uint64 public constant UNLOCK_OFFSET = ONE_YEAR - ONE_MONTH; // 11 months offset

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_START = NEXT_TOKEN_LAUNCH + VESTING_OFFSET; // Aug 5th 2024
uint64 public constant UNLOCK_START = NEXT_TOKEN_LAUNCH + UNLOCK_OFFSET; // Sept 5th 2024 - 1 month

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_CLIFF = VESTING_START + VESTING_CLIFF_DURATION; // Sept 5th 2024
uint64 public constant UNLOCK_CLIFF = UNLOCK_START + UNLOCK_CLIFF_DURATION; // Sept 5th 2024

/// @inheritdoc IConnextVestingWallet
uint64 public constant VESTING_END = VESTING_START + VESTING_DURATION; // Sept 5th 2025
uint64 public constant UNLOCK_END = UNLOCK_START + UNLOCK_DURATION; // Sept 5th 2025

/// @inheritdoc IConnextVestingWallet
uint256 public immutable TOTAL_AMOUNT; // Set into constructor
Expand All @@ -64,20 +64,20 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
}

/**
* NOTE: The equivalent vesting schedule has a 13 months duration, with a 1 month cliff,
* NOTE: The equivalent unlock schedule has a 13 months duration, with a 1 month cliff,
* offsetted to start from `Sept 5th 2024 - 1 month`: At Sept 5th 2024 the cliff
* is triggered unlocking 1/13 of the tokens, and then 1/13 of the tokens will
* be linearly unlocked every month after that.
*/

/// @inheritdoc IConnextVestingWallet
function vestedAmount(uint64 _timestamp) public view returns (uint256 _amount) {
if (_timestamp < VESTING_CLIFF) {
if (_timestamp < UNLOCK_CLIFF) {
return 0;
} else if (_timestamp >= VESTING_END) {
} else if (_timestamp >= UNLOCK_END) {
return TOTAL_AMOUNT;
} else {
return (TOTAL_AMOUNT * (_timestamp - VESTING_START)) / VESTING_DURATION;
return (TOTAL_AMOUNT * (_timestamp - UNLOCK_START)) / UNLOCK_DURATION;
}
}

Expand Down
14 changes: 7 additions & 7 deletions solidity/interfaces/IConnextVestingWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,37 @@ interface IConnextVestingWallet {
* @notice Vesting cliff duration
* @return _timedelta The timedelta of the cliff duration
*/
function VESTING_CLIFF_DURATION() external view returns (uint64 _timedelta);
function UNLOCK_CLIFF_DURATION() external view returns (uint64 _timedelta);

/**
* @notice Vesting duration including cliff duration
* @return _timedelta The timedelta of the vesting duration
*/
function VESTING_DURATION() external view returns (uint64 _timedelta);
function UNLOCK_DURATION() external view returns (uint64 _timedelta);

/**
* @notice Vesting warmup time
* @return _timedelta The timedelta of the warmup time
*/
function VESTING_OFFSET() external view returns (uint64 _timedelta);
function UNLOCK_OFFSET() external view returns (uint64 _timedelta);

/**
* @notice Vesting start date
* @return _timestamp The timestamp of the start date
*/
function VESTING_START() external view returns (uint64 _timestamp);
function UNLOCK_START() external view returns (uint64 _timestamp);

/**
* @notice Vesting cliff date
* @return _timestamp The timestamp of the cliff date
*/
function VESTING_CLIFF() external view returns (uint64 _timestamp);
function UNLOCK_CLIFF() external view returns (uint64 _timestamp);

/**
* @notice Vesting end date
* @return _timestamp The timestamp of the end date
*/
function VESTING_END() external view returns (uint64 _timestamp);
function UNLOCK_END() external view returns (uint64 _timestamp);

/*///////////////////////////////////////////////////////////////
STORAGE
Expand All @@ -116,7 +116,7 @@ interface IConnextVestingWallet {
function released() external view returns (uint256 _released);

/*///////////////////////////////////////////////////////////////
VESTING LOGIC
UNLOCK LOGIC
//////////////////////////////////////////////////////////////*/

/**
Expand Down
4 changes: 2 additions & 2 deletions solidity/test/integration/ConnextVestingWallet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ contract UnitConnextVestingWallet is Test, Constants {
vm.prank(payer);
_llamaVest = IVestingEscrowSimple(
_llamaVestFactory.deploy_vesting_contract(
NEXT_TOKEN_ADDRESS, address(_connextVestingWallet), TOTAL_AMOUNT, VESTING_DURATION, AUG_01_2022, 0
NEXT_TOKEN_ADDRESS, address(_connextVestingWallet), TOTAL_AMOUNT, UNLOCK_DURATION, AUG_01_2022, 0
)
);

// set total amount as 13 ether
_connextVestingWallet = new ConnextVestingWallet(owner, 13 ether);
_connextVestingWalletAddress = address(_connextVestingWallet);
_connextTokenLaunch = uint64(_connextVestingWallet.NEXT_TOKEN_LAUNCH());
_firstMilestoneTimestamp = uint64(_connextVestingWallet.VESTING_CLIFF());
_firstMilestoneTimestamp = uint64(_connextVestingWallet.UNLOCK_CLIFF());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/integration/IntegrationBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract IntegrationBase is Test, Constants, Deploy {
vm.prank(payer);
_llamaVest = IVestingEscrowSimple(
_llamaVestFactory.deploy_vesting_contract(
NEXT_TOKEN_ADDRESS, address(_connextVestingWallet), TOTAL_AMOUNT, VESTING_DURATION, AUG_01_2022, 0
NEXT_TOKEN_ADDRESS, address(_connextVestingWallet), TOTAL_AMOUNT, UNLOCK_DURATION, AUG_01_2022, 0
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/utils/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract Constants {
// Vesting info
uint64 public constant AUG_01_2022 = 1_659_312_000; // vesting start date
uint64 public constant SEP_05_2023 = 1_693_872_000; // launch date
uint64 public constant VESTING_DURATION = 365 days * 4;
uint64 public constant UNLOCK_DURATION = 365 days * 4;

// Time
uint64 public constant YEAR = 365 days;
Expand Down

0 comments on commit 59fe8ca

Please sign in to comment.