File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,18 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
55import "@openzeppelin/contracts/access/Ownable.sol " ;
66
77contract OYfi is ERC20 , Ownable {
8+ mapping (address => bool ) public minters;
9+ event MinterUpdated (address minter , bool allowed );
10+
811 constructor () ERC20 ("OYFI " , "OYFI " ) {}
912
10- function mint (address _to , uint256 _amount ) external onlyOwner {
13+ function setMinter (address _minter , bool _allowed ) external onlyOwner {
14+ minters[_minter] = _allowed;
15+ emit MinterUpdated (_minter, _allowed);
16+ }
17+
18+ function mint (address _to , uint256 _amount ) external {
19+ assert (minters[msg .sender ]);
1120 _mint (_to, _amount);
1221 }
1322
Original file line number Diff line number Diff line change @@ -41,8 +41,10 @@ def reward_pool(ve_yfi_and_reward_pool):
4141
4242
4343@pytest .fixture (scope = "session" )
44- def o_yfi (accounts , project ):
45- yield project .OYfi .deploy (sender = accounts [0 ])
44+ def o_yfi (gov , project ):
45+ o_yfi = project .OYfi .deploy (sender = gov )
46+ o_yfi .setMinter (gov , sender = gov )
47+ yield o_yfi
4648
4749
4850@pytest .fixture (scope = "session" )
You can’t perform that action at this time.
0 commit comments