Skip to content

Commit

Permalink
fix: Update visibility of tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Oct 1, 2021
1 parent 00c2e66 commit 128a947
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 62 deletions.
8 changes: 4 additions & 4 deletions contracts/protocol/tokenization/AToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -229,28 +229,28 @@ contract AToken is
}

/// @inheritdoc IScaledBalanceToken
function getPreviousIndex(address user) public view virtual override returns (uint256) {
function getPreviousIndex(address user) external view virtual override returns (uint256) {
return _userState[user].additionalData;
}

/**
* @notice Returns the address of the Aave treasury, receiving the fees on this aToken
* @return Address of the Aave treasury
**/
function RESERVE_TREASURY_ADDRESS() public view override returns (address) {
function RESERVE_TREASURY_ADDRESS() external view override returns (address) {
return _treasury;
}

/// @inheritdoc IAToken
function UNDERLYING_ASSET_ADDRESS() public view override returns (address) {
function UNDERLYING_ASSET_ADDRESS() external view override returns (address) {
return _underlyingAsset;
}

/**
* @notice Returns the address of the pool where this aToken is used
* @return Address of the pool
**/
function POOL() public view returns (IPool) {
function POOL() external view returns (IPool) {
return _pool;
}

Expand Down
18 changes: 9 additions & 9 deletions contracts/protocol/tokenization/IncentivizedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/// @inheritdoc IERC20Detailed
function name() public view override returns (string memory) {
function name() external view override returns (string memory) {
return _name;
}

/// @inheritdoc IERC20Detailed
function symbol() public view override returns (string memory) {
function symbol() external view override returns (string memory) {
return _symbol;
}

/// @inheritdoc IERC20Detailed
function decimals() public view override returns (uint8) {
function decimals() external view override returns (uint8) {
return _decimals;
}

Expand All @@ -79,15 +79,15 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/// @inheritdoc IERC20
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
function transfer(address recipient, uint256 amount) external virtual override returns (bool) {
uint128 castAmount = Helpers.castUint128(amount);
_transfer(_msgSender(), recipient, castAmount);
return true;
}

/// @inheritdoc IERC20
function allowance(address owner, address spender)
public
external
view
virtual
override
Expand All @@ -97,7 +97,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/// @inheritdoc IERC20
function approve(address spender, uint256 amount) public virtual override returns (bool) {
function approve(address spender, uint256 amount) external virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
Expand All @@ -107,7 +107,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
) external virtual override returns (bool) {
uint128 castAmount = Helpers.castUint128(amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - castAmount);
_transfer(sender, recipient, castAmount);
Expand All @@ -120,7 +120,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
* @param addedValue The amount being added to the allowance
* @return `true`
**/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
Expand All @@ -132,7 +132,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
* @return `true`
**/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
external
virtual
returns (bool)
{
Expand Down
12 changes: 6 additions & 6 deletions contracts/protocol/tokenization/StableDebtToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
string memory debtTokenName,
string memory debtTokenSymbol,
bytes calldata params
) public override initializer {
) external override initializer {
uint256 chainId;

//solium-disable-next-line
Expand Down Expand Up @@ -282,7 +282,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {

/// @inheritdoc IStableDebtToken
function getSupplyData()
public
external
view
override
returns (
Expand All @@ -297,7 +297,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
}

/// @inheritdoc IStableDebtToken
function getTotalSupplyAndAvgRate() public view override returns (uint256, uint256) {
function getTotalSupplyAndAvgRate() external view override returns (uint256, uint256) {
uint256 avgRate = _avgStableRate;
return (_calcTotalSupply(avgRate), avgRate);
}
Expand All @@ -308,7 +308,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
}

/// @inheritdoc IStableDebtToken
function getTotalSupplyLastUpdated() public view override returns (uint40) {
function getTotalSupplyLastUpdated() external view override returns (uint40) {
return _totalSupplyTimestamp;
}

Expand All @@ -321,15 +321,15 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @notice Returns the address of the underlying asset of this debtToken (E.g. WETH for aWETH)
* @return The address of the underlying asset
**/
function UNDERLYING_ASSET_ADDRESS() public view returns (address) {
function UNDERLYING_ASSET_ADDRESS() external view returns (address) {
return _underlyingAsset;
}

/**
* @notice Returns the address of the pool where this debtToken is used
* @return The address of the Pool
**/
function POOL() public view returns (IPool) {
function POOL() external view returns (IPool) {
return _pool;
}

Expand Down
10 changes: 5 additions & 5 deletions contracts/protocol/tokenization/VariableDebtToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
string memory debtTokenName,
string memory debtTokenSymbol,
bytes calldata params
) public override initializer {
) external override initializer {
uint256 chainId;

//solium-disable-next-line
Expand Down Expand Up @@ -145,7 +145,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
}

/// @inheritdoc IScaledBalanceToken
function scaledBalanceOf(address user) public view virtual override returns (uint256) {
function scaledBalanceOf(address user) external view virtual override returns (uint256) {
return super.balanceOf(user);
}

Expand All @@ -170,23 +170,23 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
}

/// @inheritdoc IScaledBalanceToken
function getPreviousIndex(address user) public view virtual override returns (uint256) {
function getPreviousIndex(address user) external view virtual override returns (uint256) {
return _userState[user].additionalData;
}

/**
* @notice Returns the address of the underlying asset of this debtToken (E.g. WETH for aWETH)
* @return The address of the underlying asset
**/
function UNDERLYING_ASSET_ADDRESS() public view returns (address) {
function UNDERLYING_ASSET_ADDRESS() external view returns (address) {
return _underlyingAsset;
}

/**
* @notice Returns the address of the pool where this debtToken is used
* @return The address of the Pool
**/
function POOL() public view returns (IPool) {
function POOL() external view returns (IPool) {
return _pool;
}

Expand Down
47 changes: 9 additions & 38 deletions contracts/protocol/tokenization/base/DebtTokenBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,60 +100,31 @@ abstract contract DebtTokenBase is
* @dev Being non transferrable, the debt token does not implement any of the
* standard ERC20 functions for transfer and allowance.
**/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
recipient;
amount;
function transfer(address, uint256) external virtual override returns (bool) {
revert('TRANSFER_NOT_SUPPORTED');
}

function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
owner;
spender;
function allowance(address, address) external view virtual override returns (uint256) {
revert('ALLOWANCE_NOT_SUPPORTED');
}

function approve(address spender, uint256 amount) public virtual override returns (bool) {
spender;
amount;
function approve(address, uint256) external virtual override returns (bool) {
revert('APPROVAL_NOT_SUPPORTED');
}

function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
sender;
recipient;
amount;
address,
address,
uint256
) external virtual override returns (bool) {
revert('TRANSFER_NOT_SUPPORTED');
}

function increaseAllowance(address spender, uint256 addedValue)
public
virtual
override
returns (bool)
{
spender;
addedValue;
function increaseAllowance(address, uint256) external virtual override returns (bool) {
revert('ALLOWANCE_NOT_SUPPORTED');
}

function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
override
returns (bool)
{
spender;
subtractedValue;
function decreaseAllowance(address, uint256) external virtual override returns (bool) {
revert('ALLOWANCE_NOT_SUPPORTED');
}

Expand Down

0 comments on commit 128a947

Please sign in to comment.