This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CvgSDT.sol
52 lines (47 loc) · 1.86 KB
/
CvgSDT.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// SPDX-License-Identifier: MIT
/**
_____
/ __ \
| / \/ ___ _ ____ _____ _ __ __ _ ___ _ __ ___ ___
| | / _ \| '_ \ \ / / _ \ '__/ _` |/ _ \ '_ \ / __/ _ \
| \__/\ (_) | | | \ V / __/ | | (_| | __/ | | | (_| __/
\____/\___/|_| |_|\_/ \___|_| \__, |\___|_| |_|\___\___|
__/ |
|___/
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../interfaces/ICvgControlTower.sol";
/// @title Cvg Finance - CvgSDT
/// @notice Liquid locker of StakeDao (SDT) token.
/// Holding 1 CvgSDT is equivalent to holds 1veSDT.
contract CvgSDT is ERC20 {
ICvgControlTower public immutable cvgControlTower;
IERC20 public immutable sdt;
constructor(ICvgControlTower _cvgControlTower) ERC20("Convergence-SDT", "cvgSDT") {
cvgControlTower = _cvgControlTower;
IERC20 _sdt = _cvgControlTower.sdt();
/// @dev Verifies that SDT has been setup into the CvgControlTower
require(address(_sdt) != address(0), "SDT_ZERO");
sdt = _sdt;
}
/**
* @notice Mint an amount of CvgSdt to the account in exchange of the same amount in SDT.
* All SDT are transferred to the veSDTMultisig that will lock for MAXTIME the SDT into veSDT.
* @param account receiver of the minted CvgSdt
* @param amount to mint to the receiver, is also the amount of SDT that will be taken from the msg.sender
*
**/
function mint(address account, uint256 amount) external {
sdt.transferFrom(msg.sender, cvgControlTower.veSdtMultisig(), amount);
_mint(account, amount);
}
/**
* @notice Burns an amount of CvgSDT to the caller of this function
* @param amount to burn to the msg.sender
*
**/
function burn(uint256 amount) external {
_burn(msg.sender, amount);
}
}