diff --git a/contracts/protocol/tokenization/AToken.sol b/contracts/protocol/tokenization/AToken.sol index fdca41a31..e983942a7 100644 --- a/contracts/protocol/tokenization/AToken.sol +++ b/contracts/protocol/tokenization/AToken.sol @@ -229,7 +229,7 @@ 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; } @@ -237,12 +237,12 @@ contract AToken is * @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; } @@ -250,7 +250,7 @@ contract AToken is * @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; } diff --git a/contracts/protocol/tokenization/IncentivizedERC20.sol b/contracts/protocol/tokenization/IncentivizedERC20.sol index 71dbaf3ce..15e17f88f 100644 --- a/contracts/protocol/tokenization/IncentivizedERC20.sol +++ b/contracts/protocol/tokenization/IncentivizedERC20.sol @@ -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; } @@ -79,7 +79,7 @@ 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; @@ -87,7 +87,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { /// @inheritdoc IERC20 function allowance(address owner, address spender) - public + external view virtual override @@ -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; } @@ -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); @@ -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; } @@ -132,7 +132,7 @@ abstract contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { * @return `true` **/ function decreaseAllowance(address spender, uint256 subtractedValue) - public + external virtual returns (bool) { diff --git a/contracts/protocol/tokenization/StableDebtToken.sol b/contracts/protocol/tokenization/StableDebtToken.sol index 38f4a42c7..1da1c2dd4 100644 --- a/contracts/protocol/tokenization/StableDebtToken.sol +++ b/contracts/protocol/tokenization/StableDebtToken.sol @@ -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 @@ -282,7 +282,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { /// @inheritdoc IStableDebtToken function getSupplyData() - public + external view override returns ( @@ -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); } @@ -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; } @@ -321,7 +321,7 @@ 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; } @@ -329,7 +329,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { * @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; } diff --git a/contracts/protocol/tokenization/VariableDebtToken.sol b/contracts/protocol/tokenization/VariableDebtToken.sol index 8bceb1864..50488d879 100644 --- a/contracts/protocol/tokenization/VariableDebtToken.sol +++ b/contracts/protocol/tokenization/VariableDebtToken.sol @@ -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 @@ -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); } @@ -170,7 +170,7 @@ 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; } @@ -178,7 +178,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { * @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; } @@ -186,7 +186,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { * @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; } diff --git a/contracts/protocol/tokenization/base/DebtTokenBase.sol b/contracts/protocol/tokenization/base/DebtTokenBase.sol index 24276487a..37be50c55 100644 --- a/contracts/protocol/tokenization/base/DebtTokenBase.sol +++ b/contracts/protocol/tokenization/base/DebtTokenBase.sol @@ -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'); }