Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 29 additions & 6 deletions contracts/timelock/base/BaseToken.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";

import "../../libs/TokenSaver.sol";

abstract contract BaseToken is ERC20Votes, AccessControl, TokenSaver {
abstract contract BaseToken is
ERC20Permit,
ERC20Votes,
AccessControl,
TokenSaver
{
using SafeERC20 for IERC20;
using SafeCast for uint256;
using SafeCast for int256;
Expand All @@ -31,15 +37,32 @@ abstract contract BaseToken is ERC20Votes, AccessControl, TokenSaver {
}
}


constructor(
string memory _name,
string memory _symbol,
address _depositToken
) ERC20Permit(_name) ERC20(_name, _symbol) {
require(_depositToken != address(0), "BasePool.constructor: Deposit token must be set");
require(
_depositToken != address(0),
"BasePool.constructor: Deposit token must be set"
);
depositToken = IERC20(_depositToken);
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}

}
// The following functions are overrides required by Solidity.

function _update(
address from,
address to,
uint256 value
) internal override(ERC20, ERC20Votes) {
super._update(from, to, value);
}

function nonces(
address owner
) public view override(ERC20Permit, Nonces) returns (uint256) {
return super.nonces(owner);
}
}
8 changes: 8 additions & 0 deletions scripts/arguments/stakingArguments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = [
'Staked VIRTUAL',
'VAI',
process.env.BRIDGED_TOKEN,
100000000000, // maxBonus
1000, // maxLockDuration
[1, 1] // curve
];
17 changes: 17 additions & 0 deletions scripts/deployTimeLock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ethers } from "hardhat";
const deployArguments = require("./arguments/stakingArguments");

(async () => {
try {
const contract = await ethers.deployContract(
"TimeLockStaking",
deployArguments
);

await contract.waitForDeployment();

console.log(`Staking Contract deployed to ${contract.target}`);
} catch (e) {
console.log(e);
}
})();