Skip to content

Commit

Permalink
fix: Remove IERC20Burnable and IERC20Mintable from GhoToken (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf authored Jul 4, 2023
1 parent fc08657 commit 790e6d2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 45 deletions.
19 changes: 4 additions & 15 deletions src/contracts/gho/GhoToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ contract GhoToken is ERC20, AccessControl, IGhoToken {
_setupRole(DEFAULT_ADMIN_ROLE, admin);
}

/**
* @notice Mints the requested amount of tokens to the account address.
* @dev Only facilitators with enough bucket capacity available can mint.
* @dev The bucket level is increased upon minting.
* @param account The address receiving the GHO tokens
* @param amount The amount to mint
*/
function mint(address account, uint256 amount) external override {
/// @inheritdoc IGhoToken
function mint(address account, uint256 amount) external {
require(amount > 0, 'INVALID_MINT_AMOUNT');
Facilitator storage f = _facilitators[msg.sender];

Expand All @@ -51,13 +45,8 @@ contract GhoToken is ERC20, AccessControl, IGhoToken {
emit FacilitatorBucketLevelUpdated(msg.sender, currentBucketLevel, newBucketLevel);
}

/**
* @notice Burns the requested amount of tokens from the account address.
* @dev Only active facilitators (bucket level > 0) can burn.
* @dev The bucket level is decreased upon burning.
* @param amount The amount to burn
*/
function burn(uint256 amount) external override {
/// @inheritdoc IGhoToken
function burn(uint256 amount) external {
require(amount > 0, 'INVALID_BURN_AMOUNT');

Facilitator storage f = _facilitators[msg.sender];
Expand Down
13 changes: 0 additions & 13 deletions src/contracts/gho/interfaces/IERC20Burnable.sol

This file was deleted.

14 changes: 0 additions & 14 deletions src/contracts/gho/interfaces/IERC20Mintable.sol

This file was deleted.

21 changes: 18 additions & 3 deletions src/contracts/gho/interfaces/IGhoToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ pragma solidity ^0.8.0;

import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IAccessControl} from '@openzeppelin/contracts/access/IAccessControl.sol';
import {IERC20Burnable} from './IERC20Burnable.sol';
import {IERC20Mintable} from './IERC20Mintable.sol';

/**
* @title IGhoToken
* @author Aave
*/
interface IGhoToken is IERC20Burnable, IERC20Mintable, IERC20, IAccessControl {
interface IGhoToken is IERC20, IAccessControl {
struct Facilitator {
uint128 bucketCapacity;
uint128 bucketLevel;
Expand Down Expand Up @@ -71,6 +69,23 @@ interface IGhoToken is IERC20Burnable, IERC20Mintable, IERC20, IAccessControl {
*/
function BUCKET_MANAGER_ROLE() external pure returns (bytes32);

/**
* @notice Mints the requested amount of tokens to the account address.
* @dev Only facilitators with enough bucket capacity available can mint.
* @dev The bucket level is increased upon minting.
* @param account The address receiving the GHO tokens
* @param amount The amount to mint
*/
function mint(address account, uint256 amount) external;

/**
* @notice Burns the requested amount of tokens from the account address.
* @dev Only active facilitators (bucket level > 0) can burn.
* @dev The bucket level is decreased upon burning.
* @param amount The amount to burn
*/
function burn(uint256 amount) external;

/**
* @notice Add the facilitator passed with the parameters to the facilitators list.
* @dev Only accounts with `FACILITATOR_MANAGER_ROLE` role can call this function
Expand Down

0 comments on commit 790e6d2

Please sign in to comment.