From e8f485017ceaa5b25922e55df991d92919f64ea7 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Mon, 30 Oct 2023 10:46:43 +0100 Subject: [PATCH] Create TokenStaking contract A token staking contract for a specified standard ERC20 token. A holder of the specified token can stake its tokens to this contract and recover the stake after undelegation period is over. --- core/contracts/staking/TokenStaking.sol | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 core/contracts/staking/TokenStaking.sol diff --git a/core/contracts/staking/TokenStaking.sol b/core/contracts/staking/TokenStaking.sol new file mode 100644 index 000000000..defd83e1a --- /dev/null +++ b/core/contracts/staking/TokenStaking.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.9; + +/// @title TokenStaking +/// @notice A token staking contract for a specified standard ERC20 token. A +/// holder of the specified token can stake its tokens to this contract +/// and recover the stake after undelegation period is over. +contract TokenStaking { + // TODO: use IERC20 contract as type + address internal immutable token; + + constructor(address _token) { + require( + address(_token) != address(0), + "Token can not be the zero address" + ); + + token = _token; + } +}