diff --git a/Makefile b/Makefile
index defd403..4bb137b 100644
--- a/Makefile
+++ b/Makefile
@@ -409,4 +409,4 @@ clean-all:
# fmt & lint all directories
fmt-all:
- movefmt --config-path=./movefmt.toml --emit "files" -v
\ No newline at end of file
+ movefmt --config-path=./movefmt.toml --emit "overwrite" -v
\ No newline at end of file
diff --git a/aave-core/Move.toml b/aave-core/Move.toml
index df7af3b..1cf873f 100644
--- a/aave-core/Move.toml
+++ b/aave-core/Move.toml
@@ -10,7 +10,7 @@ aave_pool = '_'
[dev-addresses]
[dependencies]
-AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "main" }
+AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "mainnet" }
AaveAcl = { local = "./aave-acl" }
AaveConfig = { local = "./aave-config" }
AaveMath = { local = "./aave-math" }
diff --git a/aave-core/aave-acl/Move.toml b/aave-core/aave-acl/Move.toml
index 2fb44fe..2dd588c 100644
--- a/aave-core/aave-acl/Move.toml
+++ b/aave-core/aave-acl/Move.toml
@@ -10,6 +10,6 @@ aave_acl = '_'
[dev-addresses]
[dependencies]
-AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "main" }
+AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "mainnet" }
[dev-dependencies]
\ No newline at end of file
diff --git a/aave-core/aave-acl/doc/acl_manage.md b/aave-core/aave-acl/doc/acl_manage.md
index 58fdaaf..933bcfd 100644
--- a/aave-core/aave-acl/doc/acl_manage.md
+++ b/aave-core/aave-acl/doc/acl_manage.md
@@ -1,74 +1,170 @@
-
+
+
+# Module `0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9::acl_manage`
+
+@title ACLManager
+@author Aave
+@notice Access Control List Manager. Main registry of system roles and permissions.
+
+Roles are referred to by their vector<u8>
identifier. These should be exposed
+in the external API and be unique. The best way to achieve this is by
+using const
hash digests:
+```
+const MY_ROLE = b"MY_ROLE";
+```
+Roles can be used to represent a set of permissions. To restrict access to a
+function call, use {has_role}:
+```
+public fun foo() {
+assert!(has_role(MY_ROLE, error_code::ENOT_MANAGEMENT));
+...
+}
+```
+Roles can be granted and revoked dynamically via the {grant_role} and
+{revoke_role} functions. Each role has an associated admin role, and only
+accounts that have a role's admin role can call {grant_role} and {revoke_role}.
+
+By default, the admin role for all roles is DEFAULT_ADMIN_ROLE
, which means
+that only accounts with this role will be able to grant or revoke other
+roles. More complex role relationships can be created by using
+{set_role_admin}.
+
+WARNING: The DEFAULT_ADMIN_ROLE
is also its own admin: it has permission to
+grant and revoke this role. Extra precautions should be taken to secure
+accounts that have been granted it.
+
+
+- [Struct `RoleAdminChanged`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_RoleAdminChanged)
+- [Struct `RoleGranted`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_RoleGranted)
+- [Struct `RoleRevoked`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_RoleRevoked)
+- [Struct `RoleData`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_RoleData)
+- [Resource `Roles`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_Roles)
+- [Constants](#@Constants_0)
+- [Function `grant_default_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_grant_default_admin_role)
+- [Function `default_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_default_admin_role)
+- [Function `get_role_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_role_admin)
+- [Function `set_role_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_set_role_admin)
+- [Function `has_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_has_role)
+- [Function `grant_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_grant_role)
+- [Function `renounce_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_renounce_role)
+- [Function `revoke_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_revoke_role)
+- [Function `add_pool_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_pool_admin)
+- [Function `remove_pool_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_pool_admin)
+- [Function `is_pool_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_pool_admin)
+- [Function `add_emergency_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_emergency_admin)
+- [Function `remove_emergency_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_emergency_admin)
+- [Function `is_emergency_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_emergency_admin)
+- [Function `add_risk_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_risk_admin)
+- [Function `remove_risk_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_risk_admin)
+- [Function `is_risk_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_risk_admin)
+- [Function `add_flash_borrower`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_flash_borrower)
+- [Function `remove_flash_borrower`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_flash_borrower)
+- [Function `is_flash_borrower`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_flash_borrower)
+- [Function `add_bridge`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_bridge)
+- [Function `remove_bridge`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_bridge)
+- [Function `is_bridge`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_bridge)
+- [Function `add_asset_listing_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_asset_listing_admin)
+- [Function `remove_asset_listing_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_asset_listing_admin)
+- [Function `is_asset_listing_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_asset_listing_admin)
+- [Function `add_funds_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_funds_admin)
+- [Function `remove_funds_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_funds_admin)
+- [Function `is_funds_admin`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_funds_admin)
+- [Function `add_emission_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_emission_admin_role)
+- [Function `remove_emission_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_emission_admin_role)
+- [Function `is_emission_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_emission_admin_role)
+- [Function `add_admin_controlled_ecosystem_reserve_funds_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_admin_controlled_ecosystem_reserve_funds_admin_role)
+- [Function `remove_admin_controlled_ecosystem_reserve_funds_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_admin_controlled_ecosystem_reserve_funds_admin_role)
+- [Function `is_admin_controlled_ecosystem_reserve_funds_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_admin_controlled_ecosystem_reserve_funds_admin_role)
+- [Function `add_rewards_controller_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_add_rewards_controller_admin_role)
+- [Function `remove_rewards_controller_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_remove_rewards_controller_admin_role)
+- [Function `is_rewards_controller_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_is_rewards_controller_admin_role)
+- [Function `get_pool_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_pool_admin_role)
+- [Function `get_emergency_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_emergency_admin_role)
+- [Function `get_risk_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_risk_admin_role)
+- [Function `get_flash_borrower_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_flash_borrower_role)
+- [Function `get_bridge_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_bridge_role)
+- [Function `get_asset_listing_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_asset_listing_admin_role)
+- [Function `get_funds_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_funds_admin_role)
+- [Function `get_emission_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_emission_admin_role)
+- [Function `get_admin_controlled_ecosystem_reserve_funds_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_admin_controlled_ecosystem_reserve_funds_admin_role)
+- [Function `get_rewards_controller_admin_role`](#0xd329b8b371bf56fdbfbb66f441a8463f3605ecb27ee0c484f85a4cf88883d2f9_acl_manage_get_rewards_controller_admin_role)
+
+
+
use 0x1::event;
+use 0x1::signer;
+use 0x1::smart_table;
+use 0x1::string;
+
-# Module `0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753::acl_manage`
+
-- [Resource `Role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_Role)
-- [Constants](#@Constants_0)
-- [Function `default_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_default_admin_role)
-- [Function `get_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_role)
-- [Function `has_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_has_role)
-- [Function `grant_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_grant_role)
-- [Function `revoke_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_revoke_role)
-- [Function `add_pool_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_pool_admin)
-- [Function `remove_pool_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_pool_admin)
-- [Function `is_pool_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_pool_admin)
-- [Function `add_emergency_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_emergency_admin)
-- [Function `remove_emergency_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_emergency_admin)
-- [Function `is_emergency_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_emergency_admin)
-- [Function `add_risk_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_risk_admin)
-- [Function `remove_risk_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_risk_admin)
-- [Function `is_risk_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_risk_admin)
-- [Function `add_flash_borrower`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_flash_borrower)
-- [Function `remove_flash_borrower`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_flash_borrower)
-- [Function `is_flash_borrower`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_flash_borrower)
-- [Function `add_bridge`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_bridge)
-- [Function `remove_bridge`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_bridge)
-- [Function `is_bridge`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_bridge)
-- [Function `add_asset_listing_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_asset_listing_admin)
-- [Function `remove_asset_listing_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_asset_listing_admin)
-- [Function `is_asset_listing_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_asset_listing_admin)
-- [Function `add_funds_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_funds_admin)
-- [Function `remove_funds_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_funds_admin)
-- [Function `is_funds_admin`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_funds_admin)
-- [Function `add_emission_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_emission_admin_role)
-- [Function `remove_emission_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_emission_admin_role)
-- [Function `is_emission_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_emission_admin_role)
-- [Function `add_admin_controlled_ecosystem_reserve_funds_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_admin_controlled_ecosystem_reserve_funds_admin_role)
-- [Function `remove_admin_controlled_ecosystem_reserve_funds_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_admin_controlled_ecosystem_reserve_funds_admin_role)
-- [Function `is_admin_controlled_ecosystem_reserve_funds_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_admin_controlled_ecosystem_reserve_funds_admin_role)
-- [Function `add_rewards_controller_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_add_rewards_controller_admin_role)
-- [Function `remove_rewards_controller_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_remove_rewards_controller_admin_role)
-- [Function `is_rewards_controller_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_is_rewards_controller_admin_role)
-- [Function `get_pool_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_pool_admin_role)
-- [Function `get_emergency_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_emergency_admin_role)
-- [Function `get_risk_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_risk_admin_role)
-- [Function `get_flash_borrower_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_flash_borrower_role)
-- [Function `get_bridge_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_bridge_role)
-- [Function `get_asset_listing_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_asset_listing_admin_role)
-- [Function `get_funds_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_funds_admin_role)
-- [Function `get_emission_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_emission_admin_role)
-- [Function `get_admin_controlled_ecosystem_reserve_funds_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_admin_controlled_ecosystem_reserve_funds_admin_role)
-- [Function `get_rewards_controller_admin_role`](#0x1c0b45bb18cf14bcb0b4caaa8e875dfb5eff6d9d8f5b181de3d3e0107f099753_acl_manage_get_rewards_controller_admin_role)
-
-
-use 0x1::signer;
-use 0x1::smart_table;
-use 0x1::string;
-use 0x1::vector;
+## Struct `RoleAdminChanged`
+
+@dev Emitted when newAdminRole
is set as ```role```'s admin role, replacing previousAdminRole
+
+DEFAULT_ADMIN_ROLE
is the starting admin for all roles, despite
+{RoleAdminChanged} not being emitted signaling this.
+
+
+#[event]
+struct RoleAdminChanged has drop, store
+
+
+
+
+
+
+## Struct `RoleGranted`
+
+@dev Emitted when account
is granted role
.
+
+sender
is the account that originated the contract call, an admin role
+
+
+#[event]
+struct RoleGranted has drop, store
+
+
+
+
+
+
+## Struct `RoleRevoked`
+
+@dev Emitted when account
is revoked role
.
+
+sender
is the account that originated the contract call:
+- if using revoke_role
, it is the admin role bearer
+- if using renounce_role
, it is the role bearer (i.e. account
)
+
+
+#[event]
+struct RoleRevoked has drop, store
-
+
-## Resource `Role`
+## Struct `RoleData`
-struct Role has store, key
+struct RoleData has store
+
+
+
+
+
+
+## Resource `Roles`
+
+
+
+struct Roles has key
@@ -78,635 +174,716 @@
## Constants
-
+
+
+
+
+const ADMIN_CONTROLLED_ECOSYSTEM_RESERVE_FUNDS_ADMIN_ROLE: vector<u8> = [65, 68, 77, 73, 78, 95, 67, 79, 78, 84, 82, 79, 76, 76, 69, 68, 95, 69, 67, 79, 83, 89, 83, 84, 69, 77, 95, 82, 69, 83, 69, 82, 86, 69, 95, 70, 85, 78, 68, 83, 95, 65, 68, 77, 73, 78];
+
+
+
+
+
-const ADMIN_CONTROLLED_ECOSYSTEM_RESERVE_FUNDS_ADMIN_ROLE: vector<u8> = [65, 68, 77, 73, 78, 95, 67, 79, 78, 84, 82, 79, 76, 76, 69, 68, 95, 69, 67, 79, 83, 89, 83, 84, 69, 77, 95, 82, 69, 83, 69, 82, 86, 69, 95, 70, 85, 78, 68, 83, 95, 65, 68, 77, 73, 78];
+const ASSET_LISTING_ADMIN_ROLE: vector<u8> = [65, 83, 83, 69, 84, 95, 76, 73, 83, 84, 73, 78, 71, 95, 65, 68, 77, 73, 78];
-
+
-const ASSET_LISTING_ADMIN_ROLE: vector<u8> = [65, 83, 83, 69, 84, 95, 76, 73, 83, 84, 73, 78, 71, 95, 65, 68, 77, 73, 78];
+const BRIDGE_ROLE: vector<u8> = [66, 82, 73, 68, 71, 69];
-
+
-const BRIDGE_ROLE: vector<u8> = [66, 82, 73, 68, 71, 69];
+const DEFAULT_ADMIN_ROLE: vector<u8> = [68, 69, 70, 65, 85, 76, 84, 95, 65, 68, 77, 73, 78];
-
+
-const EMERGENCY_ADMIN_ROLE: vector<u8> = [69, 77, 69, 82, 71, 69, 78, 67, 89, 95, 65, 68, 77, 73, 78];
+const EMERGENCY_ADMIN_ROLE: vector<u8> = [69, 77, 69, 82, 71, 69, 78, 67, 89, 95, 65, 68, 77, 73, 78];
-
+
-const EMISSION_ADMIN_ROLE: vector<u8> = [69, 77, 73, 83, 83, 73, 79, 78, 95, 65, 68, 77, 73, 78, 95, 82, 79, 76, 69];
+const EMISSION_ADMIN_ROLE: vector<u8> = [69, 77, 73, 83, 83, 73, 79, 78, 95, 65, 68, 77, 73, 78, 95, 82, 79, 76, 69];
-
+
-const ENOT_MANAGEMENT: u64 = 1;
+const ENOT_MANAGEMENT: u64 = 1;
-
+
-const EROLE_ALREADY_EXISTS: u64 = 2;
+const EROLE_CAN_ONLY_RENOUNCE_SELF: u64 = 4;
-
+
-const EROLE_NOT_EXISTS: u64 = 3;
+const EROLE_NOT_ADMIN: u64 = 3;
-
+
-const FLASH_BORROWER_ROLE: vector<u8> = [70, 76, 65, 83, 72, 95, 66, 79, 82, 82, 79, 87, 69, 82];
+const EROLE_NOT_EXISTS: u64 = 2;
-
+
-const FUNDS_ADMIN_ROLE: vector<u8> = [70, 85, 78, 68, 83, 95, 65, 68, 77, 73, 78];
+const FLASH_BORROWER_ROLE: vector<u8> = [70, 76, 65, 83, 72, 95, 66, 79, 82, 82, 79, 87, 69, 82];
-
+
-const POOL_ADMIN_ROLE: vector<u8> = [80, 79, 79, 76, 95, 65, 68, 77, 73, 78];
+const FUNDS_ADMIN_ROLE: vector<u8> = [70, 85, 78, 68, 83, 95, 65, 68, 77, 73, 78];
-
+
-const REWARDS_CONTROLLER_ADMIN_ROLE: vector<u8> = [82, 69, 87, 65, 82, 68, 83, 95, 67, 79, 78, 84, 82, 79, 76, 76, 69, 82, 95, 65, 68, 77, 73, 78, 95, 82, 79, 76, 69];
+const POOL_ADMIN_ROLE: vector<u8> = [80, 79, 79, 76, 95, 65, 68, 77, 73, 78];
-
+
-const RISK_ADMIN_ROLE: vector<u8> = [82, 73, 83, 75, 95, 65, 68, 77, 73, 78];
+const REWARDS_CONTROLLER_ADMIN_ROLE: vector<u8> = [82, 69, 87, 65, 82, 68, 83, 95, 67, 79, 78, 84, 82, 79, 76, 76, 69, 82, 95, 65, 68, 77, 73, 78, 95, 82, 79, 76, 69];
-
+
+
+
+
+const RISK_ADMIN_ROLE: vector<u8> = [82, 73, 83, 75, 95, 65, 68, 77, 73, 78];
+
+
+
+
+
+
+## Function `grant_default_admin_role`
+
+
+
+public entry fun grant_default_admin_role(admin: &signer)
+
+
+
+
+
## Function `default_admin_role`
#[view]
-public fun default_admin_role(): address
+public fun default_admin_role(): string::String
-
+
-## Function `get_role`
+## Function `get_role_admin`
+@dev Returns the admin role that controls role
.
#[view]
-public fun get_role(role: string::String, user: address): vector<address>
+public fun get_role_admin(role: string::String): string::String
+
+
+
+
+
+
+## Function `set_role_admin`
+
+@dev Sets adminRole
as ```role```'s admin role.
+Emits a {RoleAdminChanged} event.
+
+
+public entry fun set_role_admin(admin: &signer, role: string::String, admin_role: string::String)
-
+
## Function `has_role`
+@dev Returns true
if account
has been granted role
.
#[view]
-public fun has_role(role: string::String, user: address): bool
+public fun has_role(role: string::String, user: address): bool
-
+
## Function `grant_role`
+@dev Grants role
to account
.
+
+If account
had not been already granted role
, emits a {RoleGranted}
+event.
+
+Requirements:
+- the caller must have ```role```'s admin role.
-public entry fun grant_role(admin: &signer, role: string::String, user: address)
+
+public entry fun grant_role(admin: &signer, role: string::String, user: address)
-
+
+
+## Function `renounce_role`
+
+@dev Revokes role
from the calling account.
+Roles are often managed via {grant_role} and {revoke_role}: this function's
+purpose is to provide a mechanism for accounts to lose their privileges
+if they are compromised (such as when a trusted device is misplaced).
+
+If the calling account had been granted role
, emits a {role_revoked}
+event.
+
+Requirements:
+
+- the caller must be account
.
+
+
+public entry fun renounce_role(admin: &signer, role: string::String, user: address)
+
+
+
+
+
## Function `revoke_role`
+@dev Revokes role
from account
.
+
+If account
had been granted role
, emits a {RoleRevoked} event.
+
+Requirements:
+
+- the caller must have ```role```'s admin role.
-public entry fun revoke_role(admin: &signer, role: string::String, user: address)
+public entry fun revoke_role(admin: &signer, role: string::String, user: address)
-
+
## Function `add_pool_admin`
-public entry fun add_pool_admin(admin: &signer, user: address)
+public entry fun add_pool_admin(admin: &signer, user: address)
-
+
## Function `remove_pool_admin`
-public entry fun remove_pool_admin(admin: &signer, user: address)
+public entry fun remove_pool_admin(admin: &signer, user: address)
-
+
## Function `is_pool_admin`
#[view]
-public fun is_pool_admin(admin: address): bool
+public fun is_pool_admin(admin: address): bool
-
+
## Function `add_emergency_admin`
-public entry fun add_emergency_admin(admin: &signer, user: address)
+public entry fun add_emergency_admin(admin: &signer, user: address)
-
+
## Function `remove_emergency_admin`
-public entry fun remove_emergency_admin(admin: &signer, user: address)
+public entry fun remove_emergency_admin(admin: &signer, user: address)
-
+
## Function `is_emergency_admin`
#[view]
-public fun is_emergency_admin(admin: address): bool
+public fun is_emergency_admin(admin: address): bool
-
+
## Function `add_risk_admin`
-public entry fun add_risk_admin(admin: &signer, user: address)
+public entry fun add_risk_admin(admin: &signer, user: address)
-
+
## Function `remove_risk_admin`
-public entry fun remove_risk_admin(admin: &signer, user: address)
+public entry fun remove_risk_admin(admin: &signer, user: address)
-
+
## Function `is_risk_admin`
#[view]
-public fun is_risk_admin(admin: address): bool
+public fun is_risk_admin(admin: address): bool
-
+
## Function `add_flash_borrower`
-public entry fun add_flash_borrower(admin: &signer, borrower: address)
+public entry fun add_flash_borrower(admin: &signer, borrower: address)
-
+
## Function `remove_flash_borrower`
-public entry fun remove_flash_borrower(admin: &signer, borrower: address)
+public entry fun remove_flash_borrower(admin: &signer, borrower: address)
-
+
## Function `is_flash_borrower`
#[view]
-public fun is_flash_borrower(borrower: address): bool
+public fun is_flash_borrower(borrower: address): bool
-
+
## Function `add_bridge`
-public entry fun add_bridge(admin: &signer, bridge: address)
+public entry fun add_bridge(admin: &signer, bridge: address)
-
+
## Function `remove_bridge`
-public entry fun remove_bridge(admin: &signer, bridge: address)
+public entry fun remove_bridge(admin: &signer, bridge: address)
-
+
## Function `is_bridge`
#[view]
-public fun is_bridge(bridge: address): bool
+public fun is_bridge(bridge: address): bool
-
+
## Function `add_asset_listing_admin`
-public entry fun add_asset_listing_admin(admin: &signer, user: address)
+public entry fun add_asset_listing_admin(admin: &signer, user: address)
-
+
## Function `remove_asset_listing_admin`
-public entry fun remove_asset_listing_admin(admin: &signer, user: address)
+public entry fun remove_asset_listing_admin(admin: &signer, user: address)
-
+
## Function `is_asset_listing_admin`
#[view]
-public fun is_asset_listing_admin(admin: address): bool
+public fun is_asset_listing_admin(admin: address): bool
-
+
## Function `add_funds_admin`
-public entry fun add_funds_admin(admin: &signer, user: address)
+public entry fun add_funds_admin(admin: &signer, user: address)
-
+
## Function `remove_funds_admin`
-public entry fun remove_funds_admin(admin: &signer, user: address)
+public entry fun remove_funds_admin(admin: &signer, user: address)
-
+
## Function `is_funds_admin`
#[view]
-public fun is_funds_admin(admin: address): bool
+public fun is_funds_admin(admin: address): bool
-
+
## Function `add_emission_admin_role`
-public entry fun add_emission_admin_role(admin: &signer, user: address)
+public entry fun add_emission_admin_role(admin: &signer, user: address)
-
+
## Function `remove_emission_admin_role`
-public entry fun remove_emission_admin_role(admin: &signer, user: address)
+public entry fun remove_emission_admin_role(admin: &signer, user: address)
-
+
## Function `is_emission_admin_role`
#[view]
-public fun is_emission_admin_role(admin: address): bool
+public fun is_emission_admin_role(admin: address): bool
-
+
## Function `add_admin_controlled_ecosystem_reserve_funds_admin_role`
-public entry fun add_admin_controlled_ecosystem_reserve_funds_admin_role(admin: &signer, user: address)
+public entry fun add_admin_controlled_ecosystem_reserve_funds_admin_role(admin: &signer, user: address)
-
+
## Function `remove_admin_controlled_ecosystem_reserve_funds_admin_role`
-public entry fun remove_admin_controlled_ecosystem_reserve_funds_admin_role(admin: &signer, user: address)
+public entry fun remove_admin_controlled_ecosystem_reserve_funds_admin_role(admin: &signer, user: address)
-
+
## Function `is_admin_controlled_ecosystem_reserve_funds_admin_role`
#[view]
-public fun is_admin_controlled_ecosystem_reserve_funds_admin_role(admin: address): bool
+public fun is_admin_controlled_ecosystem_reserve_funds_admin_role(admin: address): bool
-
+
## Function `add_rewards_controller_admin_role`
-public entry fun add_rewards_controller_admin_role(admin: &signer, user: address)
+public entry fun add_rewards_controller_admin_role(admin: &signer, user: address)
-
+
## Function `remove_rewards_controller_admin_role`
-public entry fun remove_rewards_controller_admin_role(admin: &signer, user: address)
+public entry fun remove_rewards_controller_admin_role(admin: &signer, user: address)
-
+
## Function `is_rewards_controller_admin_role`
#[view]
-public fun is_rewards_controller_admin_role(admin: address): bool
+public fun is_rewards_controller_admin_role(admin: address): bool
-
+
## Function `get_pool_admin_role`
#[view]
-public fun get_pool_admin_role(): string::String
+public fun get_pool_admin_role(): string::String
-
+
## Function `get_emergency_admin_role`
#[view]
-public fun get_emergency_admin_role(): string::String
+public fun get_emergency_admin_role(): string::String
-
+
## Function `get_risk_admin_role`
#[view]
-public fun get_risk_admin_role(): string::String
+public fun get_risk_admin_role(): string::String
-
+
## Function `get_flash_borrower_role`
#[view]
-public fun get_flash_borrower_role(): string::String
+public fun get_flash_borrower_role(): string::String
-
+
## Function `get_bridge_role`
#[view]
-public fun get_bridge_role(): string::String
+public fun get_bridge_role(): string::String
-
+
## Function `get_asset_listing_admin_role`
#[view]
-public fun get_asset_listing_admin_role(): string::String
+public fun get_asset_listing_admin_role(): string::String
-
+
## Function `get_funds_admin_role`
#[view]
-public fun get_funds_admin_role(): string::String
+public fun get_funds_admin_role(): string::String
-
+
## Function `get_emission_admin_role`
#[view]
-public fun get_emission_admin_role(): string::String
+public fun get_emission_admin_role(): string::String
-
+
## Function `get_admin_controlled_ecosystem_reserve_funds_admin_role`
#[view]
-public fun get_admin_controlled_ecosystem_reserve_funds_admin_role(): string::String
+public fun get_admin_controlled_ecosystem_reserve_funds_admin_role(): string::String
-
+
## Function `get_rewards_controller_admin_role`
#[view]
-public fun get_rewards_controller_admin_role(): string::String
+public fun get_rewards_controller_admin_role(): string::String
diff --git a/aave-core/aave-acl/sources/acl_manage.move b/aave-core/aave-acl/sources/acl_manage.move
index c40fc7a..fc9f555 100644
--- a/aave-core/aave-acl/sources/acl_manage.move
+++ b/aave-core/aave-acl/sources/acl_manage.move
@@ -1,9 +1,40 @@
+/// @title ACLManager
+/// @author Aave
+/// @notice Access Control List Manager. Main registry of system roles and permissions.
+///
+/// Roles are referred to by their `vector` identifier. These should be exposed
+/// in the external API and be unique. The best way to achieve this is by
+/// using `const` hash digests:
+/// ```
+/// const MY_ROLE = b"MY_ROLE";
+/// ```
+/// Roles can be used to represent a set of permissions. To restrict access to a
+/// function call, use {has_role}:
+/// ```
+/// public fun foo() {
+/// assert!(has_role(MY_ROLE, error_code::ENOT_MANAGEMENT));
+/// ...
+/// }
+/// ```
+/// Roles can be granted and revoked dynamically via the {grant_role} and
+/// {revoke_role} functions. Each role has an associated admin role, and only
+/// accounts that have a role's admin role can call {grant_role} and {revoke_role}.
+///
+/// By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
+/// that only accounts with this role will be able to grant or revoke other
+/// roles. More complex role relationships can be created by using
+/// {set_role_admin}.
+///
+/// WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
+/// grant and revoke this role. Extra precautions should be taken to secure
+/// accounts that have been granted it.
module aave_acl::acl_manage {
use std::signer;
- use std::vector;
use std::string::{Self, String};
use aptos_std::smart_table::{Self, SmartTable};
+ use aptos_framework::event;
+ const DEFAULT_ADMIN_ROLE: vector = b"DEFAULT_ADMIN";
const POOL_ADMIN_ROLE: vector = b"POOL_ADMIN";
const EMERGENCY_ADMIN_ROLE: vector = b"EMERGENCY_ADMIN";
const RISK_ADMIN_ROLE: vector = b"RISK_ADMIN";
@@ -17,216 +48,357 @@ module aave_acl::acl_manage {
// You are not an administrator and cannot initialize resources.
const ENOT_MANAGEMENT: u64 = 1;
- // Role already exists.
- const EROLE_ALREADY_EXISTS: u64 = 2;
// Role does not exist.
- const EROLE_NOT_EXISTS: u64 = 3;
-
- struct Role has key, store {
- acl_instance: SmartTable>
+ const EROLE_NOT_EXISTS: u64 = 2;
+ // The role must be admin
+ const EROLE_NOT_ADMIN: u64 = 3;
+ // can only renounce roles for self
+ const EROLE_CAN_ONLY_RENOUNCE_SELF: u64 = 4;
+
+ #[event]
+ /// @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
+ ///
+ /// `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
+ /// {RoleAdminChanged} not being emitted signaling this.
+ struct RoleAdminChanged has store, drop {
+ role: String,
+ previous_admin_role: String,
+ new_admin_role: String
+ }
+
+ #[event]
+ /// @dev Emitted when `account` is granted `role`.
+ ///
+ /// `sender` is the account that originated the contract call, an admin role
+ struct RoleGranted has store, drop {
+ role: String,
+ account: address,
+ sender: address
+ }
+
+ #[event]
+ /// @dev Emitted when `account` is revoked `role`.
+ ///
+ /// `sender` is the account that originated the contract call:
+ /// - if using `revoke_role`, it is the admin role bearer
+ /// - if using `renounce_role`, it is the role bearer (i.e. `account`)
+ struct RoleRevoked has store, drop {
+ role: String,
+ account: address,
+ sender: address
+ }
+
+ struct RoleData has store {
+ members: SmartTable,
+ admin_role: String
+ }
+
+ struct Roles has key {
+ acl_instance: SmartTable
}
#[test_only]
- public fun test_init_module(user: &signer) {
+ public fun test_init_module(user: &signer) acquires Roles {
init_module(user);
+ grant_default_admin_role(user);
}
- fun init_module(user: &signer) {
- check_super_admin(signer::address_of(user));
+ fun init_module(admin: &signer) {
+ let admin_address = signer::address_of(admin);
+ check_super_admin(admin_address);
+ move_to(admin, Roles { acl_instance: smart_table::new() });
+ }
- move_to(user, Role { acl_instance: smart_table::new>() })
+ public entry fun grant_default_admin_role(admin: &signer) acquires Roles {
+ let admin_address = signer::address_of(admin);
+ check_super_admin(admin_address);
+ grant_role_internal(admin, default_admin_role(), admin_address);
}
- fun check_super_admin(user: address) {
- assert!(user == @aave_acl, ENOT_MANAGEMENT);
+ fun check_super_admin(admin: address) {
+ assert!(admin == @aave_acl, ENOT_MANAGEMENT);
+ }
+
+ fun only_role(role: String, user: address) acquires Roles {
+ assert!(has_role(role, user), EROLE_NOT_ADMIN);
}
#[view]
- public fun default_admin_role(): address {
- @aave_acl
+ public fun default_admin_role(): String {
+ string::utf8(DEFAULT_ADMIN_ROLE)
}
#[view]
- public fun get_role(role: String, user: address): vector acquires Role {
- check_super_admin(user);
- let role_res = borrow_global(@aave_acl);
+ /// @dev Returns the admin role that controls `role`.
+ public fun get_role_admin(role: String): String acquires Roles {
+ let roles = borrow_global(@aave_acl);
+ if (!smart_table::contains(&roles.acl_instance, role)) {
+ return string::utf8(DEFAULT_ADMIN_ROLE)
+ };
- *smart_table::borrow(&role_res.acl_instance, role)
+ smart_table::borrow(&roles.acl_instance, role).admin_role
+ }
+
+ /// @dev Sets `adminRole` as ``role``'s admin role.
+ /// Emits a {RoleAdminChanged} event.
+ public entry fun set_role_admin(
+ admin: &signer, role: String, admin_role: String
+ ) acquires Roles {
+ only_role(default_admin_role(), signer::address_of(admin));
+ let previous_admin_role = get_role_admin(role);
+
+ let role_res = borrow_global_mut(@aave_acl);
+ assert!(smart_table::contains(&mut role_res.acl_instance, role), EROLE_NOT_EXISTS);
+
+ let role_data = smart_table::borrow_mut(&mut role_res.acl_instance, role);
+ role_data.admin_role = admin_role;
+
+ event::emit(
+ RoleAdminChanged { role, previous_admin_role, new_admin_role: admin_role }
+ );
}
#[view]
- public fun has_role(role: String, user: address): bool acquires Role {
- let role_res = borrow_global(@aave_acl);
+ /// @dev Returns `true` if `account` has been granted `role`.
+ public fun has_role(role: String, user: address): bool acquires Roles {
+ let role_res = borrow_global(@aave_acl);
if (!smart_table::contains(&role_res.acl_instance, role)) {
return false
};
- let role_addr_list = smart_table::borrow(&role_res.acl_instance, role);
-
- vector::contains(role_addr_list, &user)
- }
-
- public entry fun grant_role(admin: &signer, role: String, user: address) acquires Role {
- check_super_admin(signer::address_of(admin));
- let role_res = borrow_global_mut(@aave_acl);
- if (!smart_table::contains(&mut role_res.acl_instance, role)) {
- let vector_addr_list = vector[];
- vector::push_back(&mut vector_addr_list, user);
- smart_table::add(&mut role_res.acl_instance, role, vector_addr_list);
- } else {
- let role_addr_list = smart_table::borrow_mut(&mut role_res.acl_instance, role);
- assert!(!vector::contains(role_addr_list, &user), EROLE_ALREADY_EXISTS);
- let role_addr_list = smart_table::borrow_mut(&mut role_res.acl_instance, role);
- vector::push_back(role_addr_list, user);
+ let role_data = smart_table::borrow(&role_res.acl_instance, role);
+ if (!smart_table::contains(&role_data.members, user)) {
+ return false
+ };
+
+ *smart_table::borrow(&role_data.members, user)
+ }
+
+ /// @dev Grants `role` to `account`.
+ ///
+ /// If `account` had not been already granted `role`, emits a {RoleGranted}
+ /// event.
+ ///
+ /// Requirements:
+ ///
+ /// - the caller must have ``role``'s admin role.
+ public entry fun grant_role(
+ admin: &signer, role: String, user: address
+ ) acquires Roles {
+ let admin_address = signer::address_of(admin);
+ only_role(get_role_admin(role), admin_address);
+ grant_role_internal(admin, role, user);
+ }
+
+ fun grant_role_internal(admin: &signer, role: String, user: address) acquires Roles {
+ if (!has_role(role, user)) {
+ let role_res = borrow_global_mut(@aave_acl);
+ if (!smart_table::contains(&role_res.acl_instance, role)) {
+ let members = smart_table::new();
+ smart_table::add(&mut members, user, true);
+ let role_data = RoleData { members, admin_role: default_admin_role() };
+ smart_table::add(&mut role_res.acl_instance, role, role_data);
+ } else {
+ let role_data = smart_table::borrow_mut(&mut role_res.acl_instance, role);
+ smart_table::upsert(&mut role_data.members, user, true);
+ };
+
+ event::emit(
+ RoleGranted { role, account: user, sender: signer::address_of(admin) }
+ );
}
}
- public entry fun revoke_role(admin: &signer, role: String, user: address) acquires Role {
- check_super_admin(signer::address_of(admin));
- assert!(has_role(role, user), EROLE_NOT_EXISTS);
-
- let role_res = borrow_global_mut(@aave_acl);
- let role_addr_list = smart_table::borrow_mut(&mut role_res.acl_instance, role);
-
- let _ = vector::remove_value(role_addr_list, &user);
+ /// @dev Revokes `role` from the calling account.
+ /// Roles are often managed via {grant_role} and {revoke_role}: this function's
+ /// purpose is to provide a mechanism for accounts to lose their privileges
+ /// if they are compromised (such as when a trusted device is misplaced).
+ ///
+ /// If the calling account had been granted `role`, emits a {role_revoked}
+ /// event.
+ ///
+ /// Requirements:
+ ///
+ /// - the caller must be `account`.
+ public entry fun renounce_role(
+ admin: &signer, role: String, user: address
+ ) acquires Roles {
+ assert!(signer::address_of(admin) == user, EROLE_CAN_ONLY_RENOUNCE_SELF);
+ revoke_role_internal(admin, role, user);
+ }
+
+ /// @dev Revokes `role` from `account`.
+ ///
+ /// If `account` had been granted `role`, emits a {RoleRevoked} event.
+ ///
+ /// Requirements:
+ ///
+ /// - the caller must have ``role``'s admin role.
+ ///
+ public entry fun revoke_role(
+ admin: &signer, role: String, user: address
+ ) acquires Roles {
+ let admin_address = signer::address_of(admin);
+ only_role(get_role_admin(role), admin_address);
+ revoke_role_internal(admin, role, user);
+ }
+
+ fun revoke_role_internal(admin: &signer, role: String, user: address) acquires Roles {
+ if (has_role(role, user)) {
+ let role_res = borrow_global_mut(@aave_acl);
+ let role_data = smart_table::borrow_mut(&mut role_res.acl_instance, role);
+ smart_table::upsert(&mut role_data.members, user, false);
+
+ event::emit(
+ RoleRevoked { role, account: user, sender: signer::address_of(admin) }
+ );
+ }
}
- public entry fun add_pool_admin(admin: &signer, user: address) acquires Role {
+ public entry fun add_pool_admin(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_pool_admin_role(), user);
}
- public entry fun remove_pool_admin(admin: &signer, user: address) acquires Role {
+ public entry fun remove_pool_admin(admin: &signer, user: address) acquires Roles {
revoke_role(admin, get_pool_admin_role(), user);
}
#[view]
- public fun is_pool_admin(admin: address): bool acquires Role {
+ public fun is_pool_admin(admin: address): bool acquires Roles {
has_role(get_pool_admin_role(), admin)
}
- public entry fun add_emergency_admin(admin: &signer, user: address) acquires Role {
+ public entry fun add_emergency_admin(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_emergency_admin_role(), user);
}
- public entry fun remove_emergency_admin(admin: &signer, user: address) acquires Role {
+ public entry fun remove_emergency_admin(admin: &signer, user: address) acquires Roles {
revoke_role(admin, get_emergency_admin_role(), user);
}
#[view]
- public fun is_emergency_admin(admin: address): bool acquires Role {
+ public fun is_emergency_admin(admin: address): bool acquires Roles {
has_role(get_emergency_admin_role(), admin)
}
- public entry fun add_risk_admin(admin: &signer, user: address) acquires Role {
+ public entry fun add_risk_admin(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_risk_admin_role(), user);
}
- public entry fun remove_risk_admin(admin: &signer, user: address) acquires Role {
+ public entry fun remove_risk_admin(admin: &signer, user: address) acquires Roles {
revoke_role(admin, get_risk_admin_role(), user);
}
#[view]
- public fun is_risk_admin(admin: address): bool acquires Role {
+ public fun is_risk_admin(admin: address): bool acquires Roles {
has_role(get_risk_admin_role(), admin)
}
- public entry fun add_flash_borrower(admin: &signer, borrower: address) acquires Role {
+ public entry fun add_flash_borrower(admin: &signer, borrower: address) acquires Roles {
grant_role(admin, get_flash_borrower_role(), borrower);
}
- public entry fun remove_flash_borrower(admin: &signer, borrower: address) acquires Role {
+ public entry fun remove_flash_borrower(
+ admin: &signer, borrower: address
+ ) acquires Roles {
revoke_role(admin, get_flash_borrower_role(), borrower);
}
#[view]
- public fun is_flash_borrower(borrower: address): bool acquires Role {
+ public fun is_flash_borrower(borrower: address): bool acquires Roles {
has_role(get_flash_borrower_role(), borrower)
}
- public entry fun add_bridge(admin: &signer, bridge: address) acquires Role {
+ public entry fun add_bridge(admin: &signer, bridge: address) acquires Roles {
grant_role(admin, get_bridge_role(), bridge);
}
- public entry fun remove_bridge(admin: &signer, bridge: address) acquires Role {
+ public entry fun remove_bridge(admin: &signer, bridge: address) acquires Roles {
revoke_role(admin, get_bridge_role(), bridge);
}
#[view]
- public fun is_bridge(bridge: address): bool acquires Role {
+ public fun is_bridge(bridge: address): bool acquires Roles {
has_role(get_bridge_role(), bridge)
}
- public entry fun add_asset_listing_admin(admin: &signer, user: address) acquires Role {
+ public entry fun add_asset_listing_admin(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_asset_listing_admin_role(), user);
}
- public entry fun remove_asset_listing_admin(admin: &signer, user: address) acquires Role {
+ public entry fun remove_asset_listing_admin(
+ admin: &signer, user: address
+ ) acquires Roles {
revoke_role(admin, get_asset_listing_admin_role(), user);
}
#[view]
- public fun is_asset_listing_admin(admin: address): bool acquires Role {
+ public fun is_asset_listing_admin(admin: address): bool acquires Roles {
has_role(get_asset_listing_admin_role(), admin)
}
- public entry fun add_funds_admin(admin: &signer, user: address) acquires Role {
+ public entry fun add_funds_admin(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_funds_admin_role(), user);
}
- public entry fun remove_funds_admin(admin: &signer, user: address) acquires Role {
+ public entry fun remove_funds_admin(admin: &signer, user: address) acquires Roles {
revoke_role(admin, get_funds_admin_role(), user);
}
#[view]
- public fun is_funds_admin(admin: address): bool acquires Role {
+ public fun is_funds_admin(admin: address): bool acquires Roles {
has_role(get_funds_admin_role(), admin)
}
- public entry fun add_emission_admin_role(admin: &signer, user: address) acquires Role {
+ public entry fun add_emission_admin_role(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_emission_admin_role(), user);
}
- public entry fun remove_emission_admin_role(admin: &signer, user: address) acquires Role {
+ public entry fun remove_emission_admin_role(
+ admin: &signer, user: address
+ ) acquires Roles {
revoke_role(admin, get_emission_admin_role(), user);
}
#[view]
- public fun is_emission_admin_role(admin: address): bool acquires Role {
+ public fun is_emission_admin_role(admin: address): bool acquires Roles {
has_role(get_emission_admin_role(), admin)
}
public entry fun add_admin_controlled_ecosystem_reserve_funds_admin_role(
admin: &signer, user: address
- ) acquires Role {
+ ) acquires Roles {
grant_role(admin, get_admin_controlled_ecosystem_reserve_funds_admin_role(), user);
}
public entry fun remove_admin_controlled_ecosystem_reserve_funds_admin_role(
admin: &signer, user: address
- ) acquires Role {
- revoke_role(admin, get_admin_controlled_ecosystem_reserve_funds_admin_role(), user);
+ ) acquires Roles {
+ revoke_role(
+ admin, get_admin_controlled_ecosystem_reserve_funds_admin_role(), user
+ );
}
#[view]
public fun is_admin_controlled_ecosystem_reserve_funds_admin_role(
admin: address
- ): bool acquires Role {
+ ): bool acquires Roles {
has_role(get_admin_controlled_ecosystem_reserve_funds_admin_role(), admin)
}
public entry fun add_rewards_controller_admin_role(
admin: &signer, user: address
- ) acquires Role {
+ ) acquires Roles {
grant_role(admin, get_rewards_controller_admin_role(), user);
}
public entry fun remove_rewards_controller_admin_role(
admin: &signer, user: address
- ) acquires Role {
+ ) acquires Roles {
revoke_role(admin, get_rewards_controller_admin_role(), user);
}
#[view]
- public fun is_rewards_controller_admin_role(admin: address): bool acquires Role {
+ public fun is_rewards_controller_admin_role(admin: address): bool acquires Roles {
has_role(get_rewards_controller_admin_role(), admin)
}
@@ -309,4 +481,24 @@ module aave_acl::acl_manage {
public fun get_asset_listing_admin_role_for_testing(): String {
string::utf8(ASSET_LISTING_ADMIN_ROLE)
}
+
+ #[test_only]
+ public fun get_funds_admin_role_for_testing(): String {
+ string::utf8(FUNDS_ADMIN_ROLE)
+ }
+
+ #[test_only]
+ public fun get_emissions_admin_role_for_testing(): String {
+ string::utf8(EMISSION_ADMIN_ROLE)
+ }
+
+ #[test_only]
+ public fun get_admin_controlled_ecosystem_reserve_funds_admin_role_for_testing(): String {
+ string::utf8(ADMIN_CONTROLLED_ECOSYSTEM_RESERVE_FUNDS_ADMIN_ROLE)
+ }
+
+ #[test_only]
+ public fun get_rewards_controller_admin_role_for_testing(): String {
+ string::utf8(REWARDS_CONTROLLER_ADMIN_ROLE)
+ }
}
diff --git a/aave-core/aave-acl/tests/acl_manage_tests.move b/aave-core/aave-acl/tests/acl_manage_tests.move
index 27b6ee7..f0f8f30 100644
--- a/aave-core/aave-acl/tests/acl_manage_tests.move
+++ b/aave-core/aave-acl/tests/acl_manage_tests.move
@@ -1,53 +1,64 @@
#[test_only]
module aave_acl::acl_manage_tests {
use std::signer;
+ use std::string::utf8;
+
use aave_acl::acl_manage::{
- test_init_module,
- add_pool_admin,
+ add_admin_controlled_ecosystem_reserve_funds_admin_role,
add_asset_listing_admin,
- has_role,
- grant_role,
- is_pool_admin,
- is_asset_listing_admin,
- remove_risk_admin,
- is_risk_admin,
- add_risk_admin,
- remove_flash_borrower,
- is_flash_borrower,
- add_flash_borrower,
- is_emergency_admin,
- remove_emergency_admin,
- add_emergency_admin,
- is_bridge,
- remove_bridge,
add_bridge,
- remove_asset_listing_admin,
- revoke_role,
+ add_emergency_admin,
+ add_emission_admin_role,
+ add_flash_borrower,
+ add_funds_admin,
+ add_pool_admin,
+ add_rewards_controller_admin_role,
+ add_risk_admin,
get_asset_listing_admin_role,
+ get_asset_listing_admin_role_for_testing,
get_bridge_role,
+ get_bridge_role_for_testing,
get_emergency_admin_role,
+ get_emergency_admin_role_for_testing,
get_flash_borrower_role,
+ get_flash_borrower_role_for_testing,
get_pool_admin_role,
- get_risk_admin_role,
- remove_pool_admin,
get_pool_admin_role_for_testing,
- get_emergency_admin_role_for_testing,
+ get_risk_admin_role,
get_risk_admin_role_for_testing,
- get_flash_borrower_role_for_testing,
- get_bridge_role_for_testing,
- get_asset_listing_admin_role_for_testing,
- add_funds_admin,
- remove_funds_admin,
- is_funds_admin,
- add_emission_admin_role,
- remove_emission_admin_role,
+ grant_role,
+ has_role,
+ is_admin_controlled_ecosystem_reserve_funds_admin_role,
+ is_asset_listing_admin,
+ is_bridge,
+ is_emergency_admin,
is_emission_admin_role,
- add_admin_controlled_ecosystem_reserve_funds_admin_role,
+ is_flash_borrower,
+ is_funds_admin,
+ is_pool_admin,
+ is_rewards_controller_admin_role,
+ is_risk_admin,
remove_admin_controlled_ecosystem_reserve_funds_admin_role,
- is_admin_controlled_ecosystem_reserve_funds_admin_role,
- add_rewards_controller_admin_role,
+ remove_asset_listing_admin,
+ remove_bridge,
+ remove_emergency_admin,
+ remove_emission_admin_role,
+ remove_flash_borrower,
+ remove_funds_admin,
+ remove_pool_admin,
remove_rewards_controller_admin_role,
- is_rewards_controller_admin_role
+ remove_risk_admin,
+ revoke_role,
+ set_role_admin,
+ test_init_module,
+ get_funds_admin_role,
+ get_funds_admin_role_for_testing,
+ get_emission_admin_role,
+ get_emissions_admin_role_for_testing,
+ get_admin_controlled_ecosystem_reserve_funds_admin_role,
+ get_admin_controlled_ecosystem_reserve_funds_admin_role_for_testing,
+ get_rewards_controller_admin_role,
+ get_rewards_controller_admin_role_for_testing
};
const TEST_SUCCESS: u64 = 1;
@@ -56,8 +67,10 @@ module aave_acl::acl_manage_tests {
// ========== TEST: BASIC GETTERS ============
#[test]
fun test_asset_listing_admin_role() {
- assert!(get_asset_listing_admin_role() == get_asset_listing_admin_role_for_testing(),
- TEST_SUCCESS);
+ assert!(
+ get_asset_listing_admin_role() == get_asset_listing_admin_role_for_testing(),
+ TEST_SUCCESS,
+ );
}
#[test]
@@ -67,8 +80,10 @@ module aave_acl::acl_manage_tests {
#[test]
fun test_get_flash_borrower_role() {
- assert!(get_flash_borrower_role() == get_flash_borrower_role_for_testing(),
- TEST_SUCCESS);
+ assert!(
+ get_flash_borrower_role() == get_flash_borrower_role_for_testing(),
+ TEST_SUCCESS,
+ );
}
#[test]
@@ -78,8 +93,10 @@ module aave_acl::acl_manage_tests {
#[test]
fun test_get_emergency_admin_role() {
- assert!(get_emergency_admin_role() == get_emergency_admin_role_for_testing(),
- TEST_SUCCESS);
+ assert!(
+ get_emergency_admin_role() == get_emergency_admin_role_for_testing(),
+ TEST_SUCCESS,
+ );
}
#[test]
@@ -87,15 +104,53 @@ module aave_acl::acl_manage_tests {
assert!(get_pool_admin_role() == get_pool_admin_role_for_testing(), TEST_SUCCESS);
}
+ #[test]
+ fun test_funds_admin_role() {
+ assert!(
+ get_funds_admin_role() == get_funds_admin_role_for_testing(), TEST_SUCCESS
+ );
+ }
+
+ #[test]
+ fun test_emission_admin_role() {
+ assert!(
+ get_emission_admin_role() == get_emissions_admin_role_for_testing(),
+ TEST_SUCCESS,
+ );
+ }
+
+ #[test]
+ fun test_admin_controlled_ecosystem_reserve_funds_admin_role() {
+ assert!(
+ get_admin_controlled_ecosystem_reserve_funds_admin_role()
+ == get_admin_controlled_ecosystem_reserve_funds_admin_role_for_testing(),
+ TEST_SUCCESS,
+ );
+ }
+
+ #[test]
+ fun test_rewards_controller_admin_role() {
+ assert!(
+ get_rewards_controller_admin_role()
+ == get_rewards_controller_admin_role_for_testing(),
+ TEST_SUCCESS,
+ );
+ }
+
// ========== TEST: TEST OWNER HOLDERS ============
#[test(super_admin = @aave_acl, test_addr = @0x01)]
- fun test_is_asset_listing_admin(super_admin: &signer, test_addr: &signer) {
+ fun test_is_asset_listing_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_asset_listing_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin,
+ get_asset_listing_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
// check the address has the role assigned
assert!(is_asset_listing_admin(signer::address_of(test_addr)), TEST_SUCCESS);
}
@@ -105,7 +160,9 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_bridge_role_for_testing(), signer::address_of(test_addr));
+ grant_role(
+ super_admin, get_bridge_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has the role assigned
assert!(is_bridge(signer::address_of(test_addr)), TEST_SUCCESS);
}
@@ -115,8 +172,11 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_flash_borrower_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin,
+ get_flash_borrower_role_for_testing(),
+ signer::address_of(test_addr),
+ );
// check the address has the role assigned
assert!(is_flash_borrower(signer::address_of(test_addr)), TEST_SUCCESS);
}
@@ -126,8 +186,9 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_risk_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin, get_risk_admin_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has the role assigned
assert!(is_risk_admin(signer::address_of(test_addr)), TEST_SUCCESS);
}
@@ -137,8 +198,11 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_emergency_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin,
+ get_emergency_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
// check the address has the role assigned
assert!(is_emergency_admin(signer::address_of(test_addr)), TEST_SUCCESS);
}
@@ -148,12 +212,81 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_pool_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin, get_pool_admin_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has the role assigned
assert!(is_pool_admin(signer::address_of(test_addr)), TEST_SUCCESS);
}
+ #[test(super_admin = @aave_acl, test_addr = @0x01)]
+ fun test_is_funds_admin(super_admin: &signer, test_addr: &signer) {
+ // init the module
+ test_init_module(super_admin);
+ // add the asset listing role to some address
+ grant_role(
+ super_admin,
+ get_funds_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
+ // check the address has the role assigned
+ assert!(is_funds_admin(signer::address_of(test_addr)), TEST_SUCCESS);
+ }
+
+ #[test(super_admin = @aave_acl, test_addr = @0x01)]
+ fun test_is_emission_admin(super_admin: &signer, test_addr: &signer) {
+ // init the module
+ test_init_module(super_admin);
+ // add the asset listing role to some address
+ grant_role(
+ super_admin,
+ get_emissions_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
+ // check the address has the role assigned
+ assert!(is_emission_admin_role(signer::address_of(test_addr)), TEST_SUCCESS);
+ }
+
+ #[test(super_admin = @aave_acl, test_addr = @0x01)]
+ fun test_is_admin_controlled_ecosystem_reserve_funds_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
+ // init the module
+ test_init_module(super_admin);
+ // add the asset listing role to some address
+ grant_role(
+ super_admin,
+ get_admin_controlled_ecosystem_reserve_funds_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
+ // check the address has the role assigned
+ assert!(
+ is_admin_controlled_ecosystem_reserve_funds_admin_role(
+ signer::address_of(test_addr)
+ ),
+ TEST_SUCCESS,
+ );
+ }
+
+ #[test(super_admin = @aave_acl, test_addr = @0x01)]
+ fun test_is_rewards_controller_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
+ // init the module
+ test_init_module(super_admin);
+ // add the asset listing role to some address
+ grant_role(
+ super_admin,
+ get_rewards_controller_admin_role_for_testing(),
+ signer::address_of(test_addr),
+ );
+ // check the address has the role assigned
+ assert!(
+ is_rewards_controller_admin_role(signer::address_of(test_addr)),
+ TEST_SUCCESS,
+ );
+ }
+
// ========== TEST: GRANT ROLE + HAS ROLE ============
#[test(super_admin = @aave_acl, test_addr = @0x01, other_addr = @0x02)]
fun test_has_role(
@@ -162,11 +295,14 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_pool_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin, get_pool_admin_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has no longer the role assigned
- assert!(!has_role(get_pool_admin_role_for_testing(), signer::address_of(other_addr)),
- TEST_SUCCESS);
+ assert!(
+ !has_role(get_pool_admin_role_for_testing(), signer::address_of(other_addr)),
+ TEST_SUCCESS,
+ );
}
// ========== TEST: REVOKE + HAS ROLE ============
@@ -175,21 +311,34 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- grant_role(super_admin, get_pool_admin_role_for_testing(),
- signer::address_of(test_addr));
+ grant_role(
+ super_admin, get_pool_admin_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has the role assigned
assert!(is_pool_admin(signer::address_of(test_addr)), TEST_SUCCESS);
+
+ let role_admin = utf8(b"role_admin");
+ // set role admin
+ set_role_admin(super_admin, get_pool_admin_role_for_testing(), role_admin);
+ // add the asset listing role to some address
+ grant_role(super_admin, role_admin, signer::address_of(test_addr));
+
// now remove the role
- revoke_role(super_admin, get_pool_admin_role_for_testing(),
- signer::address_of(test_addr));
+ revoke_role(
+ test_addr, get_pool_admin_role_for_testing(), signer::address_of(test_addr)
+ );
// check the address has no longer the role assigned
- assert!(!has_role(get_pool_admin_role_for_testing(), signer::address_of(test_addr)),
- TEST_SUCCESS);
+ assert!(
+ !has_role(get_pool_admin_role_for_testing(), signer::address_of(test_addr)),
+ TEST_SUCCESS,
+ );
}
// ============== SPECIAL FUNCTIONS ============ //
#[test(super_admin = @aave_acl, test_addr = @0x01)]
- fun test_add_remove_pool_admin(super_admin: &signer, test_addr: &signer) {
+ fun test_add_remove_pool_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
@@ -267,7 +416,9 @@ module aave_acl::acl_manage_tests {
}
#[test(super_admin = @aave_acl, test_addr = @0x01)]
- fun test_add_remove_risk_admin(super_admin: &signer, test_addr: &signer) {
+ fun test_add_remove_risk_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
@@ -281,7 +432,9 @@ module aave_acl::acl_manage_tests {
}
#[test(super_admin = @aave_acl, test_addr = @0x01)]
- fun test_add_remove_funds_admin(super_admin: &signer, test_addr: &signer) {
+ fun test_add_remove_funds_admin(
+ super_admin: &signer, test_addr: &signer
+ ) {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
@@ -317,19 +470,27 @@ module aave_acl::acl_manage_tests {
// init the module
test_init_module(super_admin);
// add the asset listing role to some address
- add_admin_controlled_ecosystem_reserve_funds_admin_role(super_admin,
- signer::address_of(test_addr));
+ add_admin_controlled_ecosystem_reserve_funds_admin_role(
+ super_admin, signer::address_of(test_addr)
+ );
// check the address has the role assigned
- assert!(is_admin_controlled_ecosystem_reserve_funds_admin_role(signer::address_of(
- test_addr)),
- TEST_SUCCESS);
+ assert!(
+ is_admin_controlled_ecosystem_reserve_funds_admin_role(
+ signer::address_of(test_addr)
+ ),
+ TEST_SUCCESS,
+ );
// remove pool admin
- remove_admin_controlled_ecosystem_reserve_funds_admin_role(super_admin,
- signer::address_of(test_addr));
+ remove_admin_controlled_ecosystem_reserve_funds_admin_role(
+ super_admin, signer::address_of(test_addr)
+ );
// check the address has no longer the role assigned
- assert!(!is_admin_controlled_ecosystem_reserve_funds_admin_role(signer::address_of(
- test_addr)),
- TEST_SUCCESS);
+ assert!(
+ !is_admin_controlled_ecosystem_reserve_funds_admin_role(
+ signer::address_of(test_addr)
+ ),
+ TEST_SUCCESS,
+ );
}
#[test(super_admin = @aave_acl, test_addr = @0x01)]
@@ -341,12 +502,16 @@ module aave_acl::acl_manage_tests {
// add the asset listing role to some address
add_rewards_controller_admin_role(super_admin, signer::address_of(test_addr));
// check the address has the role assigned
- assert!(is_rewards_controller_admin_role(signer::address_of(test_addr)),
- TEST_SUCCESS);
+ assert!(
+ is_rewards_controller_admin_role(signer::address_of(test_addr)),
+ TEST_SUCCESS,
+ );
// remove pool admin
remove_rewards_controller_admin_role(super_admin, signer::address_of(test_addr));
// check the address has no longer the role assigned
- assert!(!is_rewards_controller_admin_role(signer::address_of(test_addr)),
- TEST_SUCCESS);
+ assert!(
+ !is_rewards_controller_admin_role(signer::address_of(test_addr)),
+ TEST_SUCCESS,
+ );
}
}
diff --git a/aave-core/aave-config/Move.toml b/aave-core/aave-config/Move.toml
index bfacb8e..057a7df 100644
--- a/aave-core/aave-config/Move.toml
+++ b/aave-core/aave-config/Move.toml
@@ -10,6 +10,6 @@ aave_config = '_'
[dev-addresses]
[dependencies]
-AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "main" }
+AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "mainnet" }
[dev-dependencies]
diff --git a/aave-core/aave-config/doc/error_config.md b/aave-core/aave-config/doc/error_config.md
index 01244d0..2fe0ec9 100644
--- a/aave-core/aave-config/doc/error_config.md
+++ b/aave-core/aave-config/doc/error_config.md
@@ -1,98 +1,103 @@
-
+
-# Module `0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2::error`
+# Module `0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd::error`
+@title Errors library
+@author Aave
+@notice Defines the error messages emitted by the different contracts of the Aave protocol
- [Constants](#@Constants_0)
-- [Function `get_ecaller_not_pool_admin`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_pool_admin)
-- [Function `get_ecaller_not_emergency_admin`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_emergency_admin)
-- [Function `get_ecaller_not_pool_or_emergency_admin`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_pool_or_emergency_admin)
-- [Function `get_ecaller_not_risk_or_pool_admin`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_risk_or_pool_admin)
-- [Function `get_ecaller_not_asset_listing_or_pool_admin`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_asset_listing_or_pool_admin)
-- [Function `get_ecaller_not_bridge`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_bridge)
-- [Function `get_eaddresses_provider_not_registered`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eaddresses_provider_not_registered)
-- [Function `get_einvalid_addresses_provider_id`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_addresses_provider_id)
-- [Function `get_enot_contract`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_enot_contract)
-- [Function `get_ecaller_not_pool_configurator`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_pool_configurator)
-- [Function `get_ecaller_not_atoken`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_not_atoken)
-- [Function `get_einvalid_addresses_provider`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_addresses_provider)
-- [Function `get_einvalid_flashloan_executor_return`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_flashloan_executor_return)
-- [Function `get_ereserve_already_added`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_already_added)
-- [Function `get_ereserves_storage_count_mismatch`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserves_storage_count_mismatch)
-- [Function `get_eno_more_reserves_allowed`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eno_more_reserves_allowed)
-- [Function `get_eemode_category_reserved`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eemode_category_reserved)
-- [Function `get_einvalid_emode_category_assignment`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_emode_category_assignment)
-- [Function `get_ereserve_liquidity_not_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_liquidity_not_zero)
-- [Function `get_eflashloan_premium_invalid`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eflashloan_premium_invalid)
-- [Function `get_einvalid_reserve_params`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_reserve_params)
-- [Function `get_einvalid_emode_category_params`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_emode_category_params)
-- [Function `get_ebridge_protocol_fee_invalid`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ebridge_protocol_fee_invalid)
-- [Function `get_ecaller_must_be_pool`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecaller_must_be_pool)
-- [Function `get_einvalid_mint_amount`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_mint_amount)
-- [Function `get_einvalid_burn_amount`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_burn_amount)
-- [Function `get_einvalid_amount`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_amount)
-- [Function `get_ereserve_inactive`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_inactive)
-- [Function `get_ereserve_frozen`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_frozen)
-- [Function `get_ereserve_paused`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_paused)
-- [Function `get_eborrowing_not_enabled`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eborrowing_not_enabled)
-- [Function `get_enot_enough_available_user_balance`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_enot_enough_available_user_balance)
-- [Function `get_einvalid_interest_rate_mode_selected`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_interest_rate_mode_selected)
-- [Function `get_ecollateral_balance_is_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecollateral_balance_is_zero)
-- [Function `get_ehealth_factor_lower_than_liquidation_threshold`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ehealth_factor_lower_than_liquidation_threshold)
-- [Function `get_ecollateral_cannot_cover_new_borrow`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecollateral_cannot_cover_new_borrow)
-- [Function `get_ecollateral_same_as_borrowing_currency`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecollateral_same_as_borrowing_currency)
-- [Function `get_eno_debt_of_selected_type`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eno_debt_of_selected_type)
-- [Function `get_eno_explicit_amount_to_repay_on_behalf`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eno_explicit_amount_to_repay_on_behalf)
-- [Function `get_eno_outstanding_variable_debt`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eno_outstanding_variable_debt)
-- [Function `get_eunderlying_balance_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eunderlying_balance_zero)
-- [Function `get_einterest_rate_rebalance_conditions_not_met`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einterest_rate_rebalance_conditions_not_met)
-- [Function `get_ehealth_factor_not_below_threshold`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ehealth_factor_not_below_threshold)
-- [Function `get_ecollateral_cannot_be_liquidated`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ecollateral_cannot_be_liquidated)
-- [Function `get_especified_currency_not_borrowed_by_user`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_especified_currency_not_borrowed_by_user)
-- [Function `get_einconsistent_flashloan_params`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einconsistent_flashloan_params)
-- [Function `get_eborrow_cap_exceeded`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eborrow_cap_exceeded)
-- [Function `get_esupply_cap_exceeded`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_esupply_cap_exceeded)
-- [Function `get_eunbacked_mint_cap_exceeded`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eunbacked_mint_cap_exceeded)
-- [Function `get_edebt_ceiling_exceeded`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_edebt_ceiling_exceeded)
-- [Function `get_eunderlying_claimable_rights_not_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eunderlying_claimable_rights_not_zero)
-- [Function `get_evariable_debt_supply_not_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_evariable_debt_supply_not_zero)
-- [Function `get_eltv_validation_failed`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eltv_validation_failed)
-- [Function `get_einconsistent_emode_category`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einconsistent_emode_category)
-- [Function `get_eprice_oracle_sentinel_check_failed`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eprice_oracle_sentinel_check_failed)
-- [Function `get_easset_not_borrowable_in_isolation`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_easset_not_borrowable_in_isolation)
-- [Function `get_ereserve_already_initialized`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_already_initialized)
-- [Function `get_euser_in_isolation_mode_or_ltv_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_euser_in_isolation_mode_or_ltv_zero)
-- [Function `get_einvalid_ltv`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_ltv)
-- [Function `get_einvalid_liq_threshold`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_liq_threshold)
-- [Function `get_einvalid_liq_bonus`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_liq_bonus)
-- [Function `get_einvalid_decimals`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_decimals)
-- [Function `get_einvalid_reserve_factor`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_reserve_factor)
-- [Function `get_einvalid_borrow_cap`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_borrow_cap)
-- [Function `get_einvalid_supply_cap`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_supply_cap)
-- [Function `get_einvalid_liquidation_protocol_fee`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_liquidation_protocol_fee)
-- [Function `get_einvalid_emode_category`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_emode_category)
-- [Function `get_einvalid_unbacked_mint_cap`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_unbacked_mint_cap)
-- [Function `get_einvalid_debt_ceiling`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_debt_ceiling)
-- [Function `get_einvalid_reserve_index`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_reserve_index)
-- [Function `get_eacl_admin_cannot_be_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eacl_admin_cannot_be_zero)
-- [Function `get_einconsistent_params_length`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einconsistent_params_length)
-- [Function `get_ezero_address_not_valid`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ezero_address_not_valid)
-- [Function `get_einvalid_expiration`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_expiration)
-- [Function `get_einvalid_signature`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_signature)
-- [Function `get_eoperation_not_supported`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eoperation_not_supported)
-- [Function `get_edebt_ceiling_not_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_edebt_ceiling_not_zero)
-- [Function `get_easset_not_listed`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_easset_not_listed)
-- [Function `get_einvalid_optimal_usage_ratio`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_einvalid_optimal_usage_ratio)
-- [Function `get_eunderlying_cannot_be_rescued`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eunderlying_cannot_be_rescued)
-- [Function `get_eaddresses_provider_already_added`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eaddresses_provider_already_added)
-- [Function `get_epool_addresses_do_not_match`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_epool_addresses_do_not_match)
-- [Function `get_esiloed_borrowing_violation`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_esiloed_borrowing_violation)
-- [Function `get_ereserve_debt_not_zero`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_ereserve_debt_not_zero)
-- [Function `get_eflashloan_disabled`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_eflashloan_disabled)
-- [Function `get_euser_not_listed`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_euser_not_listed)
-- [Function `get_esigner_and_on_behalf_of_no_same`](#0x2b375fc8da759f1f7c198ffa5a0bf4466a5eb25564272115a1fa2c30b22657a2_error_get_esigner_and_on_behalf_of_no_same)
+- [Function `get_ecaller_not_pool_admin`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_pool_admin)
+- [Function `get_ecaller_not_emergency_admin`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_emergency_admin)
+- [Function `get_ecaller_not_pool_or_emergency_admin`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_pool_or_emergency_admin)
+- [Function `get_ecaller_not_risk_or_pool_admin`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_risk_or_pool_admin)
+- [Function `get_ecaller_not_asset_listing_or_pool_admin`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_asset_listing_or_pool_admin)
+- [Function `get_ecaller_not_bridge`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_bridge)
+- [Function `get_eaddresses_provider_not_registered`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eaddresses_provider_not_registered)
+- [Function `get_einvalid_addresses_provider_id`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_addresses_provider_id)
+- [Function `get_enot_contract`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_enot_contract)
+- [Function `get_ecaller_not_pool_configurator`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_pool_configurator)
+- [Function `get_ecaller_not_atoken`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_not_atoken)
+- [Function `get_einvalid_addresses_provider`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_addresses_provider)
+- [Function `get_einvalid_flashloan_executor_return`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_flashloan_executor_return)
+- [Function `get_ereserve_already_added`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_already_added)
+- [Function `get_ereserves_storage_count_mismatch`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserves_storage_count_mismatch)
+- [Function `get_eno_more_reserves_allowed`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eno_more_reserves_allowed)
+- [Function `get_eemode_category_reserved`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eemode_category_reserved)
+- [Function `get_einvalid_emode_category_assignment`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_emode_category_assignment)
+- [Function `get_ereserve_liquidity_not_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_liquidity_not_zero)
+- [Function `get_eflashloan_premium_invalid`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eflashloan_premium_invalid)
+- [Function `get_einvalid_reserve_params`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_reserve_params)
+- [Function `get_einvalid_emode_category_params`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_emode_category_params)
+- [Function `get_ebridge_protocol_fee_invalid`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ebridge_protocol_fee_invalid)
+- [Function `get_ecaller_must_be_pool`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecaller_must_be_pool)
+- [Function `get_einvalid_mint_amount`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_mint_amount)
+- [Function `get_einvalid_burn_amount`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_burn_amount)
+- [Function `get_einvalid_amount`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_amount)
+- [Function `get_ereserve_inactive`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_inactive)
+- [Function `get_ereserve_frozen`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_frozen)
+- [Function `get_ereserve_paused`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_paused)
+- [Function `get_eborrowing_not_enabled`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eborrowing_not_enabled)
+- [Function `get_enot_enough_available_user_balance`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_enot_enough_available_user_balance)
+- [Function `get_einvalid_interest_rate_mode_selected`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_interest_rate_mode_selected)
+- [Function `get_ecollateral_balance_is_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecollateral_balance_is_zero)
+- [Function `get_ehealth_factor_lower_than_liquidation_threshold`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ehealth_factor_lower_than_liquidation_threshold)
+- [Function `get_ecollateral_cannot_cover_new_borrow`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecollateral_cannot_cover_new_borrow)
+- [Function `get_ecollateral_same_as_borrowing_currency`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecollateral_same_as_borrowing_currency)
+- [Function `get_eno_debt_of_selected_type`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eno_debt_of_selected_type)
+- [Function `get_eno_explicit_amount_to_repay_on_behalf`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eno_explicit_amount_to_repay_on_behalf)
+- [Function `get_eno_outstanding_variable_debt`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eno_outstanding_variable_debt)
+- [Function `get_eunderlying_balance_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eunderlying_balance_zero)
+- [Function `get_einterest_rate_rebalance_conditions_not_met`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einterest_rate_rebalance_conditions_not_met)
+- [Function `get_ehealth_factor_not_below_threshold`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ehealth_factor_not_below_threshold)
+- [Function `get_ecollateral_cannot_be_liquidated`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ecollateral_cannot_be_liquidated)
+- [Function `get_especified_currency_not_borrowed_by_user`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_especified_currency_not_borrowed_by_user)
+- [Function `get_einconsistent_flashloan_params`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einconsistent_flashloan_params)
+- [Function `get_eborrow_cap_exceeded`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eborrow_cap_exceeded)
+- [Function `get_esupply_cap_exceeded`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_esupply_cap_exceeded)
+- [Function `get_eunbacked_mint_cap_exceeded`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eunbacked_mint_cap_exceeded)
+- [Function `get_edebt_ceiling_exceeded`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_edebt_ceiling_exceeded)
+- [Function `get_eunderlying_claimable_rights_not_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eunderlying_claimable_rights_not_zero)
+- [Function `get_evariable_debt_supply_not_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_evariable_debt_supply_not_zero)
+- [Function `get_eltv_validation_failed`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eltv_validation_failed)
+- [Function `get_einconsistent_emode_category`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einconsistent_emode_category)
+- [Function `get_eprice_oracle_sentinel_check_failed`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eprice_oracle_sentinel_check_failed)
+- [Function `get_easset_not_borrowable_in_isolation`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_easset_not_borrowable_in_isolation)
+- [Function `get_ereserve_already_initialized`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_already_initialized)
+- [Function `get_euser_in_isolation_mode_or_ltv_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_euser_in_isolation_mode_or_ltv_zero)
+- [Function `get_einvalid_ltv`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_ltv)
+- [Function `get_einvalid_liq_threshold`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_liq_threshold)
+- [Function `get_einvalid_liq_bonus`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_liq_bonus)
+- [Function `get_einvalid_decimals`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_decimals)
+- [Function `get_einvalid_reserve_factor`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_reserve_factor)
+- [Function `get_einvalid_borrow_cap`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_borrow_cap)
+- [Function `get_einvalid_supply_cap`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_supply_cap)
+- [Function `get_einvalid_liquidation_protocol_fee`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_liquidation_protocol_fee)
+- [Function `get_einvalid_emode_category`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_emode_category)
+- [Function `get_einvalid_unbacked_mint_cap`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_unbacked_mint_cap)
+- [Function `get_einvalid_debt_ceiling`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_debt_ceiling)
+- [Function `get_einvalid_reserve_index`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_reserve_index)
+- [Function `get_eacl_admin_cannot_be_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eacl_admin_cannot_be_zero)
+- [Function `get_einconsistent_params_length`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einconsistent_params_length)
+- [Function `get_ezero_address_not_valid`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ezero_address_not_valid)
+- [Function `get_einvalid_expiration`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_expiration)
+- [Function `get_einvalid_signature`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_signature)
+- [Function `get_eoperation_not_supported`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eoperation_not_supported)
+- [Function `get_edebt_ceiling_not_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_edebt_ceiling_not_zero)
+- [Function `get_easset_not_listed`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_easset_not_listed)
+- [Function `get_einvalid_optimal_usage_ratio`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_einvalid_optimal_usage_ratio)
+- [Function `get_eunderlying_cannot_be_rescued`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eunderlying_cannot_be_rescued)
+- [Function `get_eaddresses_provider_already_added`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eaddresses_provider_already_added)
+- [Function `get_epool_addresses_do_not_match`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_epool_addresses_do_not_match)
+- [Function `get_esiloed_borrowing_violation`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_esiloed_borrowing_violation)
+- [Function `get_ereserve_debt_not_zero`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_ereserve_debt_not_zero)
+- [Function `get_eflashloan_disabled`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eflashloan_disabled)
+- [Function `get_euser_not_listed`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_euser_not_listed)
+- [Function `get_esigner_and_on_behalf_of_no_same`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_esigner_and_on_behalf_of_no_same)
+- [Function `get_eaccount_does_not_exist`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_eaccount_does_not_exist)
+- [Function `get_flashloan_payer_not_receiver`](#0xe984b3b024d14e7aac51fb0aec8d0fbfbc23a230fe3bd8a87f575d243bc0cedd_error_get_flashloan_payer_not_receiver)
@@ -104,1827 +109,1869 @@
## Constants
-
+
+
+Account does not exist
+
+
+const EACCOUNT_DOES_NOT_EXIST: u64 = 95;
+
+
+
+
+
ACL admin cannot be set to the zero address
-const EACL_ADMIN_CANNOT_BE_ZERO: u64 = 75;
+const EACL_ADMIN_CANNOT_BE_ZERO: u64 = 75;
-
+
Reserve has already been added to reserve list
-const EADDRESSES_PROVIDER_ALREADY_ADDED: u64 = 86;
+const EADDRESSES_PROVIDER_ALREADY_ADDED: u64 = 86;
-
+
Pool addresses provider is not registered
-const EADDRESSES_PROVIDER_NOT_REGISTERED: u64 = 7;
+const EADDRESSES_PROVIDER_NOT_REGISTERED: u64 = 7;
-
+
Asset is not borrowable in isolation mode
-const EASSET_NOT_BORROWABLE_IN_ISOLATION: u64 = 60;
+const EASSET_NOT_BORROWABLE_IN_ISOLATION: u64 = 60;
-
+
Asset is not listed
-const EASSET_NOT_LISTED: u64 = 82;
+const EASSET_NOT_LISTED: u64 = 82;
-
+
Borrowing is not enabled
-const EBORROWING_NOT_ENABLED: u64 = 30;
+const EBORROWING_NOT_ENABLED: u64 = 30;
-
+
Borrow cap is exceeded
-const EBORROW_CAP_EXCEEDED: u64 = 50;
+const EBORROW_CAP_EXCEEDED: u64 = 50;
-
+
Invalid bridge protocol fee
-const EBRIDGE_PROTOCOL_FEE_INVALID: u64 = 22;
+const EBRIDGE_PROTOCOL_FEE_INVALID: u64 = 22;
-
+
The caller of this function must be a pool
-const ECALLER_MUST_BE_POOL: u64 = 23;
+const ECALLER_MUST_BE_POOL: u64 = 23;
-
+
The caller of the function is not an asset listing or pool admin
-const ECALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN: u64 = 5;
+const ECALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN: u64 = 5;
-
+
The caller of the function is not an AToken
-const ECALLER_NOT_ATOKEN: u64 = 11;
+const ECALLER_NOT_ATOKEN: u64 = 11;
-
+
The caller of the function is not a bridge
-const ECALLER_NOT_BRIDGE: u64 = 6;
+const ECALLER_NOT_BRIDGE: u64 = 6;
-
+
The caller of the function is not an emergency admin
-const ECALLER_NOT_EMERGENCY_ADMIN: u64 = 2;
+const ECALLER_NOT_EMERGENCY_ADMIN: u64 = 2;
-
+
The caller of the function is not a pool admin
-const ECALLER_NOT_POOL_ADMIN: u64 = 1;
+const ECALLER_NOT_POOL_ADMIN: u64 = 1;
-
+
The caller of the function is not the pool configurator
-const ECALLER_NOT_POOL_CONFIGURATOR: u64 = 10;
+const ECALLER_NOT_POOL_CONFIGURATOR: u64 = 10;
-
+
The caller of the function is not a pool or emergency admin
-const ECALLER_NOT_POOL_OR_EMERGENCY_ADMIN: u64 = 3;
+const ECALLER_NOT_POOL_OR_EMERGENCY_ADMIN: u64 = 3;
-
+
The caller of the function is not a risk or pool admin
-const ECALLER_NOT_RISK_OR_POOL_ADMIN: u64 = 4;
+const ECALLER_NOT_RISK_OR_POOL_ADMIN: u64 = 4;
-
+
The collateral balance is 0
-const ECOLLATERAL_BALANCE_IS_ZERO: u64 = 34;
+const ECOLLATERAL_BALANCE_IS_ZERO: u64 = 34;
-
+
The collateral chosen cannot be liquidated
-const ECOLLATERAL_CANNOT_BE_LIQUIDATED: u64 = 46;
+const ECOLLATERAL_CANNOT_BE_LIQUIDATED: u64 = 46;
-
+
There is not enough collateral to cover a new borrow
-const ECOLLATERAL_CANNOT_COVER_NEW_BORROW: u64 = 36;
+const ECOLLATERAL_CANNOT_COVER_NEW_BORROW: u64 = 36;
-
+
Collateral is (mostly) the same currency that is being borrowed
-const ECOLLATERAL_SAME_AS_BORROWING_CURRENCY: u64 = 37;
+const ECOLLATERAL_SAME_AS_BORROWING_CURRENCY: u64 = 37;
-
+
Debt ceiling is exceeded
-const EDEBT_CEILING_EXCEEDED: u64 = 53;
+const EDEBT_CEILING_EXCEEDED: u64 = 53;
-
+
Debt ceiling is not zero
-const EDEBT_CEILING_NOT_ZERO: u64 = 81;
+const EDEBT_CEILING_NOT_ZERO: u64 = 81;
-
+
Zero eMode category is reserved for volatile heterogeneous assets
-const EEMODE_CATEGORY_RESERVED: u64 = 16;
+const EEMODE_CATEGORY_RESERVED: u64 = 16;
-
+
FlashLoaning for this asset is disabled
-const EFLASHLOAN_DISABLED: u64 = 91;
+const EFLASHLOAN_DISABLED: u64 = 91;
-
+
+
+Flashloan payer is different from the flashloan receiver
+
+
+const EFLASHLOAN_PAYER_NOT_RECEIVER: u64 = 95;
+
+
+
+
+
Invalid flashloan premium
-const EFLASHLOAN_PREMIUM_INVALID: u64 = 19;
+const EFLASHLOAN_PREMIUM_INVALID: u64 = 19;
-
+
Health factor is lesser than the liquidation threshold
-const EHEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD: u64 = 35;
+const EHEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD: u64 = 35;
-
+
Health factor is not below the threshold
-const EHEALTH_FACTOR_NOT_BELOW_THRESHOLD: u64 = 45;
+const EHEALTH_FACTOR_NOT_BELOW_THRESHOLD: u64 = 45;
-
+
Inconsistent eMode category
-const EINCONSISTENT_EMODE_CATEGORY: u64 = 58;
+const EINCONSISTENT_EMODE_CATEGORY: u64 = 58;
-
+
Inconsistent flashloan parameters
-const EINCONSISTENT_FLASHLOAN_PARAMS: u64 = 49;
+const EINCONSISTENT_FLASHLOAN_PARAMS: u64 = 49;
-
+
Array parameters that should be equal length are not
-const EINCONSISTENT_PARAMS_LENGTH: u64 = 76;
+const EINCONSISTENT_PARAMS_LENGTH: u64 = 76;
-
+
Interest rate rebalance conditions were not met
-const EINTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET: u64 = 44;
+const EINTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET: u64 = 44;
-
+
The address of the pool addresses provider is invalid
-const EINVALID_ADDRESSES_PROVIDER: u64 = 12;
+const EINVALID_ADDRESSES_PROVIDER: u64 = 12;
-
+
Invalid id for the pool addresses provider
-const EINVALID_ADDRESSES_PROVIDER_ID: u64 = 8;
+const EINVALID_ADDRESSES_PROVIDER_ID: u64 = 8;
-
+
Amount must be greater than 0
-const EINVALID_AMOUNT: u64 = 26;
+const EINVALID_AMOUNT: u64 = 26;
-
+
Invalid borrow cap for the reserve
-const EINVALID_BORROW_CAP: u64 = 68;
+const EINVALID_BORROW_CAP: u64 = 68;
-
+
Invalid amount to burn
-const EINVALID_BURN_AMOUNT: u64 = 25;
+const EINVALID_BURN_AMOUNT: u64 = 25;
-
+
Invalid debt ceiling for the reserve
-const EINVALID_DEBT_CEILING: u64 = 73;
+const EINVALID_DEBT_CEILING: u64 = 73;
-
+
Invalid decimals parameter of the underlying asset of the reserve
-const EINVALID_DECIMALS: u64 = 66;
+const EINVALID_DECIMALS: u64 = 66;
-
+
Invalid eMode category for the reserve
-const EINVALID_EMODE_CATEGORY: u64 = 71;
+const EINVALID_EMODE_CATEGORY: u64 = 71;
-
+
Invalid eMode category assignment to asset
-const EINVALID_EMODE_CATEGORY_ASSIGNMENT: u64 = 17;
+const EINVALID_EMODE_CATEGORY_ASSIGNMENT: u64 = 17;
-
+
Invalid risk parameters for the eMode category
-const EINVALID_EMODE_CATEGORY_PARAMS: u64 = 21;
+const EINVALID_EMODE_CATEGORY_PARAMS: u64 = 21;
-
+
Invalid expiration
-const EINVALID_EXPIRATION: u64 = 78;
+const EINVALID_EXPIRATION: u64 = 78;
-
+
Invalid return value of the flashloan executor function
-const EINVALID_FLASHLOAN_EXECUTOR_RETURN: u64 = 13;
+const EINVALID_FLASHLOAN_EXECUTOR_RETURN: u64 = 13;
-
+
Invalid interest rate mode selected
-const EINVALID_INTEREST_RATE_MODE_SELECTED: u64 = 33;
+const EINVALID_INTEREST_RATE_MODE_SELECTED: u64 = 33;
-
+
Invalid liquidation protocol fee for the reserve
-const EINVALID_LIQUIDATION_PROTOCOL_FEE: u64 = 70;
+const EINVALID_LIQUIDATION_PROTOCOL_FEE: u64 = 70;
-
+
Invalid liquidity bonus parameter for the reserve
-const EINVALID_LIQ_BONUS: u64 = 65;
+const EINVALID_LIQ_BONUS: u64 = 65;
-
+
Invalid liquidity threshold parameter for the reserve
-const EINVALID_LIQ_THRESHOLD: u64 = 64;
+const EINVALID_LIQ_THRESHOLD: u64 = 64;
-
+
Invalid ltv parameter for the reserve
-const EINVALID_LTV: u64 = 63;
+const EINVALID_LTV: u64 = 63;
-
+
Invalid amount to mint
-const EINVALID_MINT_AMOUNT: u64 = 24;
+const EINVALID_MINT_AMOUNT: u64 = 24;
-
+
Invalid optimal usage ratio
-const EINVALID_OPTIMAL_USAGE_RATIO: u64 = 83;
+const EINVALID_OPTIMAL_USAGE_RATIO: u64 = 83;
-
+
Invalid reserve factor parameter for the reserve
-const EINVALID_RESERVE_FACTOR: u64 = 67;
+const EINVALID_RESERVE_FACTOR: u64 = 67;
-
+
Invalid reserve index
-const EINVALID_RESERVE_INDEX: u64 = 74;
+const EINVALID_RESERVE_INDEX: u64 = 74;
-
+
Invalid risk parameters for the reserve
-const EINVALID_RESERVE_PARAMS: u64 = 20;
+const EINVALID_RESERVE_PARAMS: u64 = 20;
-
+
Invalid signature
-const EINVALID_SIGNATURE: u64 = 79;
+const EINVALID_SIGNATURE: u64 = 79;
-
+
Invalid supply cap for the reserve
-const EINVALID_SUPPLY_CAP: u64 = 69;
+const EINVALID_SUPPLY_CAP: u64 = 69;
-
+
Invalid unbacked mint cap for the reserve
-const EINVALID_UNBACKED_MINT_CAP: u64 = 72;
+const EINVALID_UNBACKED_MINT_CAP: u64 = 72;
-
+
Ltv validation failed
-const ELTV_VALIDATION_FAILED: u64 = 57;
+const ELTV_VALIDATION_FAILED: u64 = 57;
-
+
Address is not a contract
-const ENOT_CONTRACT: u64 = 9;
+const ENOT_CONTRACT: u64 = 9;
-
+
User cannot withdraw more than the available balance
-const ENOT_ENOUGH_AVAILABLE_USER_BALANCE: u64 = 32;
+const ENOT_ENOUGH_AVAILABLE_USER_BALANCE: u64 = 32;
-
+
For repayment of a specific type of debt, the user needs to have debt that type
-const ENO_DEBT_OF_SELECTED_TYPE: u64 = 39;
+const ENO_DEBT_OF_SELECTED_TYPE: u64 = 39;
-
+
To repay on behalf of a user an explicit amount to repay is needed
-const ENO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF: u64 = 40;
+const ENO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF: u64 = 40;
-
+
Maximum amount of reserves in the pool reached
-const ENO_MORE_RESERVES_ALLOWED: u64 = 15;
+const ENO_MORE_RESERVES_ALLOWED: u64 = 15;
-
+
User does not have outstanding variable rate debt on this reserve
-const ENO_OUTSTANDING_VARIABLE_DEBT: u64 = 42;
+const ENO_OUTSTANDING_VARIABLE_DEBT: u64 = 42;
-
+
Operation not supported
-const EOPERATION_NOT_SUPPORTED: u64 = 80;
+const EOPERATION_NOT_SUPPORTED: u64 = 80;
-
+
The token implementation pool address and the pool address provided by the initializing pool do not match
-const EPOOL_ADDRESSES_DO_NOT_MATCH: u64 = 87;
+const EPOOL_ADDRESSES_DO_NOT_MATCH: u64 = 87;
-
+
Price oracle sentinel validation failed
-const EPRICE_ORACLE_SENTINEL_CHECK_FAILED: u64 = 59;
+const EPRICE_ORACLE_SENTINEL_CHECK_FAILED: u64 = 59;
-
+
Mismatch of reserves count in storage
-const ERESERVES_STORAGE_COUNT_MISMATCH: u64 = 93;
+const ERESERVES_STORAGE_COUNT_MISMATCH: u64 = 93;
-
+
Reserve has already been added to reserve list
-const ERESERVE_ALREADY_ADDED: u64 = 14;
+const ERESERVE_ALREADY_ADDED: u64 = 14;
-
+
Reserve has already been initialized
-const ERESERVE_ALREADY_INITIALIZED: u64 = 61;
+const ERESERVE_ALREADY_INITIALIZED: u64 = 61;
-
+
the total debt of the reserve needs to be 0
-const ERESERVE_DEBT_NOT_ZERO: u64 = 90;
+const ERESERVE_DEBT_NOT_ZERO: u64 = 90;
-
+
Action cannot be performed because the reserve is frozen
-const ERESERVE_FROZEN: u64 = 28;
+const ERESERVE_FROZEN: u64 = 28;
-
+
Action requires an active reserve
-const ERESERVE_INACTIVE: u64 = 27;
+const ERESERVE_INACTIVE: u64 = 27;
-
+
The liquidity of the reserve needs to be 0
-const ERESERVE_LIQUIDITY_NOT_ZERO: u64 = 18;
+const ERESERVE_LIQUIDITY_NOT_ZERO: u64 = 18;
-
+
Action cannot be performed because the reserve is paused
-const ERESERVE_PAUSED: u64 = 29;
+const ERESERVE_PAUSED: u64 = 29;
-
+
The person who signed must be consistent with on_behalf_of
-const ESIGNER_AND_ON_BEHALF_OF_NO_SAME: u64 = 94;
+const ESIGNER_AND_ON_BEHALF_OF_NO_SAME: u64 = 94;
-
+
User is trying to borrow multiple assets including a siloed one
-const ESILOED_BORROWING_VIOLATION: u64 = 89;
+const ESILOED_BORROWING_VIOLATION: u64 = 89;
-
+
User did not borrow the specified currency
-const ESPECIFIED_CURRENCY_NOT_BORROWED_BY_USER: u64 = 47;
+const ESPECIFIED_CURRENCY_NOT_BORROWED_BY_USER: u64 = 47;
-
+
Supply cap is exceeded
-const ESUPPLY_CAP_EXCEEDED: u64 = 51;
+