fix constructor

This commit is contained in:
Ricardo Guilherme Schmidt 2023-06-25 11:44:12 -03:00
parent 2f6fe21682
commit ef9cf77c3a
No known key found for this signature in database
GPG Key ID: 3F95A3AD0B607030

View File

@ -14,23 +14,26 @@ contract StakeVault is Ownable {
ERC20 stakedToken;
constructor(address _owner) {
_transferOwnership(_owner);
}
function join(uint256 _amount, uint256 _time) external onlyOwner {
function stake(uint256 _amount, uint256 _time) external onlyOwner {
stakedToken.transferFrom(msg.sender, address(this), _amount);
stakeManager.join(_amount, _time);
stakeManager.stake(_amount, _time);
}
function lock(uint256 _time) external onlyOwner {
stakeManager.lock(_time);
}
function leave(uint256 _amount) external onlyOwner {
stakeManager.leave(_amount);
function unstake(uint256 _amount) external onlyOwner {
stakeManager.unstake(_amount);
stakedToken.transferFrom(address(this), msg.sender, _amount);
}
/**
* @notice Opt-in migration to a new StakeManager contract.
*/
function updateManager() external onlyOwner {
StakeManager migrated = stakeManager.migrate();
require(address(migrated) != address(0), "Migration not available.");