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
0f5017cc81
commit
5841e51439
|
@ -16,6 +16,9 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
|
|||
mapping(address => uint256) addressesProviders;
|
||||
address[] addressesProvidersList;
|
||||
|
||||
//require error messages
|
||||
string private constant PROVIDER_NOT_REGISTERED = '1'; // 'Provider is not registered'
|
||||
|
||||
/**
|
||||
* @dev returns if an addressesProvider is registered or not
|
||||
* @param provider the addresses provider
|
||||
|
@ -63,7 +66,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
|
|||
* @param provider the pool address to be unregistered
|
||||
**/
|
||||
function unregisterAddressesProvider(address provider) external override onlyOwner {
|
||||
require(addressesProviders[provider] > 0, 'Provider is not registered');
|
||||
require(addressesProviders[provider] > 0, PROVIDER_NOT_REGISTERED);
|
||||
addressesProviders[provider] = 0;
|
||||
emit AddressesProviderUnregistered(provider);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user