mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Updated require message errors with constant string numbers to reduce gas
This commit is contained in:
parent
abe967c707
commit
0f5017cc81
|
@ -3,6 +3,7 @@
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.sol",
|
"files": "*.sol",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -25,6 +25,10 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
||||||
using SafeMath for uint256;
|
using SafeMath for uint256;
|
||||||
using ReserveConfiguration for ReserveConfiguration.Map;
|
using ReserveConfiguration for ReserveConfiguration.Map;
|
||||||
|
|
||||||
|
//require error messages
|
||||||
|
string private constant CALLER_NOT_LENDING_POOL_MANAGER = '1'; // 'The caller must be a lending pool manager'
|
||||||
|
string private constant RESERVE_LIQUIDITY_NOT_0 = '2'; // 'The liquidity of the reserve needs to be 0'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev emitted when a reserve is initialized.
|
* @dev emitted when a reserve is initialized.
|
||||||
* @param asset the address of the reserve
|
* @param asset the address of the reserve
|
||||||
|
@ -178,7 +182,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
||||||
modifier onlyLendingPoolManager {
|
modifier onlyLendingPoolManager {
|
||||||
require(
|
require(
|
||||||
addressesProvider.getLendingPoolManager() == msg.sender,
|
addressesProvider.getLendingPoolManager() == msg.sender,
|
||||||
'The caller must be a lending pool manager'
|
CALLER_NOT_LENDING_POOL_MANAGER
|
||||||
);
|
);
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
@ -425,7 +429,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
||||||
) = pool.getReserveData(asset);
|
) = pool.getReserveData(asset);
|
||||||
require(
|
require(
|
||||||
availableLiquidity == 0 && totalBorrowsStable == 0 && totalBorrowsVariable == 0,
|
availableLiquidity == 0 && totalBorrowsStable == 0 && totalBorrowsVariable == 0,
|
||||||
'The liquidity of the reserve needs to be 0'
|
RESERVE_LIQUIDITY_NOT_0
|
||||||
);
|
);
|
||||||
|
|
||||||
ReserveConfiguration.Map memory currentConfig = pool.getConfiguration(asset);
|
ReserveConfiguration.Map memory currentConfig = pool.getConfiguration(asset);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user