Skip to content

Commit 8d69cca

Browse files
committed
feat: add oYFI minter operator
1 parent 9f0ec1f commit 8d69cca

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

contracts/OYfi.sol

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
55
import "@openzeppelin/contracts/access/Ownable.sol";
66

77
contract 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

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)