Skip to content

Commit

Permalink
add whitelist token
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Aug 21, 2024
1 parent ae39ce9 commit 556858a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions contracts/AdhocVoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ contract AdhocVoter is IAdhocVoter, Initializable {
mapping(address => uint256) public weights;
uint256 public totalWeight;

mapping(address => bool) public isWhitelistedToken;

function initialize() public initializer {
governor = msg.sender;
weekly = 100_000 * 1e18;
Expand Down Expand Up @@ -97,6 +99,16 @@ contract AdhocVoter is IAdhocVoter, Initializable {
}
}

function whitelistToken(address _token, bool _bool) external {
require(msg.sender == governor, "Not Governor");
_whitelistToken(_token, _bool);
}

function _whitelistToken(address _token, bool _bool) internal {
isWhitelistedToken[_token] = _bool;
emit WhitelistToken(msg.sender, _token, _bool);
}

function changeWeight(address _gauge, uint256 _weight) external {
require(_weight >= 10 && _weight <= 100, "invalid weight");
require(msg.sender == governor, "Not Governor");
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IAdhocVoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ pragma solidity ^0.8.0;
import {IVoter} from "./IVoter.sol";

interface IAdhocVoter {

event Emission(address indexed sender, uint256 weekly);
event WeeklyChanged(uint256 weekly);
event WeightChanged(address gauge, uint256 weight);
event GovernorChanged(address indexed governor);
event Donation(address indexed donor, address indexed token, uint256 amount);
event Withdraw(address indexed operator, address indexed token, address indexed recipcient, uint256 amount);
event WhitelistToken(address indexed whitelister, address indexed token, bool indexed _bool);

/// @notice Standard OZ IGovernor using ve for vote weights.
function governor() external view returns (address);
Expand Down

0 comments on commit 556858a

Please sign in to comment.