-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbHermesVotes.sol
43 lines (35 loc) · 1.24 KB
/
bHermesVotes.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20} from "solmate/tokens/ERC20.sol";
import {Ownable} from "solady/auth/Ownable.sol";
import {ERC20MultiVotes} from "@ERC20/ERC20MultiVotes.sol";
import {IbHermesUnderlying} from "../interfaces/IbHermesUnderlying.sol";
/**
* @title bHermesVotes: Have power over Hermes' governance
* @author Maia DAO (https://github.com/Maia-DAO)
* @notice Represents the underlying governance power of a bHermes token.
*/
contract bHermesVotes is ERC20MultiVotes, IbHermesUnderlying {
/// @inheritdoc IbHermesUnderlying
address public immutable bHermes;
constructor(address _owner) ERC20("bHermes Votes", "bHERMES-V", 18) {
_initializeOwner(_owner);
bHermes = msg.sender;
}
/// @inheritdoc IbHermesUnderlying
function mint(address to, uint256 amount) external onlybHermes {
_mint(to, amount);
}
/**
* @notice Burns bHermes gauge tokens
* @param from account to burn tokens from
* @param amount amount of tokens to burn
*/
function burn(address from, uint256 amount) external onlybHermes {
_burn(from, amount);
}
modifier onlybHermes() {
if (msg.sender != bHermes) revert NotbHermes();
_;
}
}