Skip to content

Commit

Permalink
feat: update xToken interface
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavaparoksham committed Jan 15, 2025
1 parent 63d501f commit 22197c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/interfaces/IXToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// author: bhargavaparoksham

pragma solidity ^0.8.20;

import {IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/IERC20.sol';
import {IAssetOracle} from './IAssetOracle.sol';

interface IXToken {
interface IXToken is IERC20 {
/**
* @dev Thrown when a caller is not the pool contract
*/
Expand Down
4 changes: 2 additions & 2 deletions src/protocol/xToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ contract xToken is IXToken, ERC20, ERC20Permit {
* @param amount The amount of tokens to transfer (in 18 decimal precision)
* @return success True if the transfer succeeded
*/
function transfer(address recipient, uint256 amount) public override(ERC20) returns (bool) {
function transfer(address recipient, uint256 amount) public override(ERC20, IERC20) returns (bool) {
if (recipient == address(0)) revert ZeroAddress();
uint256 balance = balanceOf(msg.sender);
if (balance < amount) revert InsufficientBalance();
Expand All @@ -132,7 +132,7 @@ contract xToken is IXToken, ERC20, ERC20Permit {
address sender,
address recipient,
uint256 amount
) public override(ERC20) returns (bool) {
) public override(ERC20, IERC20) returns (bool) {
if (recipient == address(0)) revert ZeroAddress();
uint256 currentAllowance = allowance(sender, msg.sender);
if (currentAllowance < amount) revert InsufficientAllowance();
Expand Down

0 comments on commit 22197c0

Please sign in to comment.