Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion contracts/OYfi.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract OYfi is ERC20, Ownable {
mapping(address => bool) public minters;
event MinterUpdated(address minter, bool allowed);

constructor() ERC20("OYFI", "OYFI") {}

function mint(address _to, uint256 _amount) external onlyOwner {
function setMinter(address _minter, bool _allowed) external onlyOwner {
minters[_minter] = _allowed;
emit MinterUpdated(_minter, _allowed);
}

function mint(address _to, uint256 _amount) external {
assert(minters[msg.sender]);
_mint(_to, _amount);
}

Expand Down
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def reward_pool(ve_yfi_and_reward_pool):


@pytest.fixture(scope="session")
def o_yfi(accounts, project):
yield project.OYfi.deploy(sender=accounts[0])
def o_yfi(gov, project):
o_yfi = project.OYfi.deploy(sender=gov)
o_yfi.setMinter(gov, True, sender=gov)
yield o_yfi


@pytest.fixture(scope="session")
Expand Down