Skip to content

Commit

Permalink
Merge branch 'dev' into feat/timestamp-check
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase authored Mar 25, 2024
2 parents 3ec4524 + 66ed82f commit 2a9323b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions solidity/contracts/ConnextVestingWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
uint64 public constant NEXT_TOKEN_LAUNCH = SEPT_05_2023; // Equals to Sept 5th 2023

/// @inheritdoc IConnextVestingWallet
address public constant NEXT_TOKEN = 0xFE67A4450907459c3e1FFf623aA927dD4e28c67a; // Mainnet NEXT token address
IERC20 public constant NEXT_TOKEN = IERC20(0xFE67A4450907459c3e1FFf623aA927dD4e28c67a); // Mainnet NEXT token address

/// @inheritdoc IConnextVestingWallet
uint64 public constant UNLOCK_DURATION = ONE_YEAR + ONE_MONTH; // 13 months duration
Expand Down Expand Up @@ -85,14 +85,14 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
function release() public {
uint256 _amount = releasable();
released += _amount;
IERC20(NEXT_TOKEN).transfer(owner(), _amount);
emit ERC20Released(NEXT_TOKEN, _amount);
NEXT_TOKEN.transfer(owner(), _amount);
emit ERC20Released(address(NEXT_TOKEN), _amount);
}

/// @inheritdoc IConnextVestingWallet
function releasable() public view returns (uint256 _amount) {
_amount = vestedAmount(uint64(block.timestamp)) - released;
uint256 _balance = IERC20(NEXT_TOKEN).balanceOf(address(this));
uint256 _balance = NEXT_TOKEN.balanceOf(address(this));
_amount = _balance < _amount ? _balance : _amount;
}

Expand All @@ -103,7 +103,7 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
function sendDust(IERC20 _token, uint256 _amount, address _to) external onlyOwner {
if (_to == address(0)) revert ZeroAddress();

if (_token == IERC20(NEXT_TOKEN) && (released != TOTAL_AMOUNT || block.timestamp < UNLOCK_END)) {
if (_token == NEXT_TOKEN && (released != TOTAL_AMOUNT || block.timestamp < UNLOCK_END)) {
revert NotAllowed();
}

Expand All @@ -118,7 +118,7 @@ contract ConnextVestingWallet is Ownable2Step, IConnextVestingWallet {
* @inheritdoc IConnextVestingWallet
* @dev This func is needed because only the recipients can claim
*/
function claim(address _llamaVestAddress) external {
IVestingEscrowSimple(_llamaVestAddress).claim(address(this));
function claim(IVestingEscrowSimple _llamaVest) external {
_llamaVest.claim(address(this));
}
}
7 changes: 4 additions & 3 deletions solidity/interfaces/IConnextVestingWallet.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {IVestingEscrowSimple} from './IVestingEscrowSimple.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IConnextVestingWallet {
Expand Down Expand Up @@ -37,7 +38,7 @@ interface IConnextVestingWallet {
* @notice NEXT token address
* @return _nextToken The address of the NEXT token
*/
function NEXT_TOKEN() external view returns (address _nextToken);
function NEXT_TOKEN() external view returns (IERC20 _nextToken);

/**
* @notice Token launch date
Expand Down Expand Up @@ -121,9 +122,9 @@ interface IConnextVestingWallet {

/**
* @notice Claim tokens from Llama Vesting contract
* @param _llamaVestAddress The address of the Llama Vesting contract
* @param _llamaVest The address of the Llama Vesting contract
*/
function claim(address _llamaVestAddress) external;
function claim(IVestingEscrowSimple _llamaVest) external;

/**
* @notice Collect dust from the contract
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/integration/LlamaVesting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract IntegrationLlamaVesting is IntegrationBase {
*/
function _warpAndWithdraw(uint256 _timestamp) internal {
vm.warp(_timestamp);
_connextVestingWallet.claim(address(_llamaVest));
_connextVestingWallet.claim(_llamaVest);
_connextVestingWallet.release();
}

Expand Down

0 comments on commit 2a9323b

Please sign in to comment.