Skip to content

Commit

Permalink
style: change token type to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
dristpunk committed Dec 29, 2023
1 parent c904a62 commit 7ef4bac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions solidity/contracts/Unlock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ contract Unlock is Ownable2Step, IUnlock {

uint256 public immutable startTime;
uint256 public withdrawnSupply;
address public immutable vestingToken;
IERC20 public immutable vestingToken;

constructor(uint256 _startTime, address _owner, address _vestingToken, uint256 _totalAmount) Ownable(_owner) {
startTime = _startTime;
totalAmount = _totalAmount;
vestingToken = _vestingToken;
vestingToken = IERC20(_vestingToken);
}

function _unlockedSupply(uint256 _timestamp) internal view returns (uint256 _unlockedSupplyAmount) {
Expand Down Expand Up @@ -47,11 +47,11 @@ contract Unlock is Ownable2Step, IUnlock {
if (msg.sender != owner()) revert Unauthorized();

uint256 _amount = _unlockedSupply(block.timestamp) - withdrawnSupply;
uint256 _balance = IERC20(vestingToken).balanceOf(address(this));
uint256 _balance = vestingToken.balanceOf(address(this));

if (_amount > _balance) _amount = _balance;

withdrawnSupply += _amount;
IERC20(vestingToken).transfer(_receiver, _amount);
vestingToken.transfer(_receiver, _amount);
}
}

0 comments on commit 7ef4bac

Please sign in to comment.