Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ TEST_ACCOUNT_2_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
TEST_ACCOUNT_3_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
TEST_ACCOUNT_4_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
TEST_ACCOUNT_5_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]

# gho profiles private keys
GHO_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
GHO_CONFIG_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
GHO_ACL_PRIVATE_KEY=[YOUR PROFILE ACCOUNT PRIVATE KEY]
16 changes: 16 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ env:
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
AAVE_DATA_FEEDS_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_FEEDS_PRIVATE_KEY }}
AAVE_PLATFORM_PRIVATE_KEY: ${{ secrets.GH_AAVE_PLATFORM_PRIVATE_KEY }}
GHO_PRIVATE_KEY: ${{ secrets.GH_GHO_PRIVATE_KEY }}
GHO_CONFIG_PRIVATE_KEY: ${{ secrets.GH_GHO_CONFIG_PRIVATE_KEY }}
GHO_ACL_PRIVATE_KEY: ${{ secrets.GH_GHO_ACL_PRIVATE_KEY }}

jobs:
build-docs:
Expand All @@ -35,6 +38,19 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Auth for private HTTPS git deps
run: |
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Install Aptos CLI
uses: ./.github/actions/install-aptos-cli
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Auth for private HTTPS git deps
run: |
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Install Aptos CLI
uses: ./.github/actions/install-aptos-cli
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/move-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env:
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
AAVE_DATA_FEEDS_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_FEEDS_PRIVATE_KEY }}
AAVE_PLATFORM_PRIVATE_KEY: ${{ secrets.GH_AAVE_PLATFORM_PRIVATE_KEY }}
GHO_PRIVATE_KEY: ${{ secrets.GH_GHO_PRIVATE_KEY }}
GHO_CONFIG_PRIVATE_KEY: ${{ secrets.GH_GHO_CONFIG_PRIVATE_KEY }}
GHO_ACL_PRIVATE_KEY: ${{ secrets.GH_GHO_ACL_PRIVATE_KEY }}

jobs:
unit-tests:
Expand All @@ -36,6 +39,15 @@ jobs:
DEFAULT_FUNDER_PRIVATE_KEY: ${{ secrets.GH_DEFAULT_FUNDER_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Install latest Aptos CLI
run: |
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/move-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env:
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
AAVE_DATA_FEEDS_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_FEEDS_PRIVATE_KEY }}
AAVE_PLATFORM_PRIVATE_KEY: ${{ secrets.GH_AAVE_PLATFORM_PRIVATE_KEY }}
GHO_PRIVATE_KEY: ${{ secrets.GH_GHO_PRIVATE_KEY }}
GHO_CONFIG_PRIVATE_KEY: ${{ secrets.GH_GHO_CONFIG_PRIVATE_KEY }}
GHO_ACL_PRIVATE_KEY: ${{ secrets.GH_GHO_ACL_PRIVATE_KEY }}

jobs:
unit-tests:
Expand All @@ -36,6 +39,15 @@ jobs:
DEFAULT_FUNDER_PRIVATE_KEY: ${{ secrets.GH_DEFAULT_FUNDER_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Install latest Aptos CLI
run: |
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/testnet-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Auth for private HTTPS git deps
run: |
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/typescript-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ env:
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
AAVE_DATA_FEEDS_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_FEEDS_PRIVATE_KEY }}
AAVE_PLATFORM_PRIVATE_KEY: ${{ secrets.GH_AAVE_PLATFORM_PRIVATE_KEY }}
GHO_PRIVATE_KEY: ${{ secrets.GH_GHO_PRIVATE_KEY }}
GHO_CONFIG_PRIVATE_KEY: ${{ secrets.GH_GHO_CONFIG_PRIVATE_KEY }}
GHO_ACL_PRIVATE_KEY: ${{ secrets.GH_GHO_ACL_PRIVATE_KEY }}

# test profiles
TEST_ACCOUNT_0_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_0_PRIVATE_KEY }}
Expand All @@ -47,6 +50,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Auth for private HTTPS git deps
run: |
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Install dependencies
run: |
sudo apt-get update -y
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ env:
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
AAVE_DATA_FEEDS_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_FEEDS_PRIVATE_KEY }}
AAVE_PLATFORM_PRIVATE_KEY: ${{ secrets.GH_AAVE_PLATFORM_PRIVATE_KEY }}
GHO_PRIVATE_KEY: ${{ secrets.GH_GHO_PRIVATE_KEY }}
GHO_CONFIG_PRIVATE_KEY: ${{ secrets.GH_GHO_CONFIG_PRIVATE_KEY }}
GHO_ACL_PRIVATE_KEY: ${{ secrets.GH_GHO_ACL_PRIVATE_KEY }}

jobs:
unit-tests:
Expand All @@ -38,6 +41,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_ACTIONS_APP_ID }}
private-key: ${{ secrets.GH_ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "aptos-aave-gho"

- name: Auth for private HTTPS git deps
run: |
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Install Aptos CLI
uses: ./.github/actions/install-aptos-cli
with:
Expand Down
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ repos:
args:
- --baseline
- .secrets.baseline
- --exclude-lines
- '\bgho_[a-z_]+\b'
- 'get_e[a-z_]+\b'
exclude: |
(?x)^(
\.secrets\.baseline|
Expand All @@ -73,7 +76,10 @@ repos:
\.git/.*|
coverage/.*|
build/.*|
dist/.*
dist/.*|
.*\.move$|
docker-compose.*\.yml$|
docker-compose.*\.yaml$
)$

# Note: TruffleHog runs in CI/CD pipeline via GitHub Actions
Expand Down
26 changes: 8 additions & 18 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.regex.should_exclude_line",
"pattern": [
"\\bgho_[a-z_]+\\b"
]
}
],
"results": {
Expand All @@ -133,7 +139,7 @@
"filename": "aave-core/aave-config/sources/error_config.move",
"hashed_secret": "ba29d6bfac4cd7b866a3d05103c38031a921ba88",
"is_verified": false,
"line_number": 1160
"line_number": 1176
}
],
"aave-core/aave-config/tests/error_tests.move": [
Expand All @@ -145,22 +151,6 @@
"line_number": 112
}
],
"aave-core/chainlink-data-feeds/Move.toml": [
{
"type": "Hex High Entropy String",
"filename": "aave-core/chainlink-data-feeds/Move.toml",
"hashed_secret": "624a21385c45fc68021078b856bdb7ef77f792e7",
"is_verified": false,
"line_number": 7
},
{
"type": "Hex High Entropy String",
"filename": "aave-core/chainlink-data-feeds/Move.toml",
"hashed_secret": "5836c8421a57080f8fed06b76343a66ba79eb007",
"is_verified": false,
"line_number": 9
}
],
"aave-core/chainlink-platform/Move.toml": [
{
"type": "Hex High Entropy String",
Expand Down Expand Up @@ -11151,5 +11141,5 @@
}
]
},
"generated_at": "2025-08-22T08:39:13Z"
"generated_at": "2025-09-04T14:21:40Z"
}
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ AAVE_BASE_PROFILES_KEY_MAP = aave_acl=$(AAVE_ACL_PRIVATE_KEY) \
aave_pool=$(AAVE_POOL_PRIVATE_KEY) \
aave_large_packages=$(AAVE_LARGE_PACKAGES_PRIVATE_KEY) \
aave_mock_underlyings=$(AAVE_MOCK_UNDERLYING_TOKENS_PRIVATE_KEY) \
aave_data=$(AAVE_DATA_PRIVATE_KEY)
aave_data=$(AAVE_DATA_PRIVATE_KEY) \
gho=$(GHO_PRIVATE_KEY) \
gho_config=$(GHO_CONFIG_PRIVATE_KEY) \
gho_acl=$(GHO_ACL_PRIVATE_KEY)

ifeq ($(APTOS_NETWORK), local)
AAVE_PROFILES_KEY_MAP = $(AAVE_BASE_PROFILES_KEY_MAP) data_feeds=$(AAVE_DATA_FEEDS_PRIVATE_KEY) platform=$(AAVE_PLATFORM_PRIVATE_KEY)
Expand Down Expand Up @@ -694,7 +697,6 @@ compile-pool:
cd aave-core && aptos move compile \
--included-artifacts $(ARTIFACTS_LEVEL) \
--save-metadata \
--skip-fetch-latest-git-deps \
--language-version "$(MOVE_VERSION)" \
--compiler-version "$(COMPILER_VERSION)" \
--named-addresses "${AAVE_NAMED_ADDRESSES}"
Expand Down
4 changes: 4 additions & 0 deletions aave-core/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ authors = []

[addresses]
aave_pool = '_'
gho = "_"
gho_config = "_"
gho_acl = "_"

[dev-addresses]

Expand All @@ -15,6 +18,7 @@ AaveAcl = { local = "./aave-acl" }
AaveConfig = { local = "./aave-config" }
AaveMath = { local = "./aave-math" }
AaveOracle = { local = "./aave-oracle" }
Gho_Token = { git = "https://github.com/aave/aptos-aave-gho", subdir = "Gho", rev = "main" }

[dev-dependencies]
AaveMockUnderlyings = { local = "./aave-mock-underlyings" }
37 changes: 37 additions & 0 deletions aave-core/aave-acl/sources/acl_manage.move
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module aave_acl::acl_manage {
const EMISSION_ADMIN_ROLE: vector<u8> = b"EMISSION_ADMIN";
const ADMIN_CONTROLLED_ECOSYSTEM_RESERVE_FUNDS_ADMIN_ROLE: vector<u8> = b"ADMIN_CONTROLLED_ECOSYSTEM_RESERVE_FUNDS_ADMIN";
const REWARDS_CONTROLLER_ADMIN_ROLE: vector<u8> = b"REWARDS_CONTROLLER_ADMIN";
const GHO_GUARDIAN_ROLE: vector<u8> = b"GHO_GUARDIAN";

// Structs
#[event]
Expand Down Expand Up @@ -217,6 +218,14 @@ module aave_acl::acl_manage {
has_role(get_rewards_controller_admin_role(), admin)
}

#[view]
/// @notice Checks if the address is a GHO guardian role
/// @param admin Address to check
/// @return Boolean indicating if the address is a GHO guardina role
public fun is_gho_guardian(admin: address): bool acquires Roles {
has_role(get_gho_guardian_role(), admin)
}

#[view]
/// @notice Returns the pool admin role string
/// @return Pool admin role as a String
Expand Down Expand Up @@ -280,6 +289,13 @@ module aave_acl::acl_manage {
string::utf8(REWARDS_CONTROLLER_ADMIN_ROLE)
}

#[view]
/// @notice Returns the gho guardina role string
/// @return GHO guardian role as a String
public fun get_gho_guardian_role(): String {
string::utf8(GHO_GUARDIAN_ROLE)
}

// Public entry functions
/// @notice Sets `admin_role` as ``role``'s admin role
/// @param admin Signer with permissions to set role admin
Expand Down Expand Up @@ -504,6 +520,20 @@ module aave_acl::acl_manage {
revoke_role(admin, get_rewards_controller_admin_role(), user);
}

/// @notice Adds a gho guardian role to the specified address
/// @param admin Signer with permissions to grant roles
/// @param user Address to grant the gho guardian role to
public entry fun add_gho_guardian(admin: &signer, user: address) acquires Roles {
grant_role(admin, get_gho_guardian_role(), user);
}

/// @notice Removes the gho guardina role from the specified address
/// @param admin Signer with permissions to revoke roles
/// @param user Address to revoke the gho guardina role from
public entry fun remove_gho_guardian(admin: &signer, user: address) acquires Roles {
revoke_role(admin, get_gho_guardian_role(), user);
}

// Private/Internal functions
/// @dev Initializes the module and grants the default admin role to the admin signer
/// @param admin Signer that will be granted the default admin role
Expand Down Expand Up @@ -677,4 +707,11 @@ module aave_acl::acl_manage {
public fun get_rewards_controller_admin_role_for_testing(): String {
string::utf8(REWARDS_CONTROLLER_ADMIN_ROLE)
}

#[test_only]
/// @dev Returns the gho guardian role string for testing
/// @return Gho guardian role as a String
public fun get_gho_guardian_role_for_testing(): String {
string::utf8(GHO_GUARDIAN_ROLE)
}
}
10 changes: 10 additions & 0 deletions aave-core/aave-acl/tests/acl_manage_tests.move
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ module aave_acl::acl_manage_tests {
get_rewards_controller_admin_role_for_testing,
get_risk_admin_role,
get_risk_admin_role_for_testing,
get_gho_guardian_role,
get_gho_guardian_role_for_testing,
grant_role,
has_role,
is_admin_controlled_ecosystem_reserve_funds_admin,
Expand Down Expand Up @@ -97,6 +99,14 @@ module aave_acl::acl_manage_tests {
assert!(get_risk_admin_role() == get_risk_admin_role_for_testing(), TEST_SUCCESS);
}

#[test]
fun test_get_gho_guardian_role() {
assert!(
get_gho_guardian_role() == get_gho_guardian_role_for_testing(),
TEST_SUCCESS
);
}

#[test]
fun test_get_emergency_admin_role() {
assert!(
Expand Down
Loading
Loading