Skip to content

Commit 651cddf

Browse files
committed
added add-risk-admin to v1 data
1 parent e9a60a4 commit 651cddf

File tree

5 files changed

+135
-43
lines changed

5 files changed

+135
-43
lines changed

Deployment.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ be triggered by a second transaction that executes the approved proposal.
5353
./deploy.py testnet --deployer "<deployer_profile_name>" setup-configure-reserves
5454
./deploy.py testnet --deployer "<deployer_profile_name>" setup-configure-interest-rates
5555
./deploy.py testnet --deployer "<deployer_profile_name>" setup-configure-price-feeds
56-
57-
(optional if gho reserve is to be configured too)
58-
./deploy.py testnet --deployer "<deployer_profile_name>" setup-gho-reserve
59-
60-
(optional if changes to the data values are being made one needs to reset too)
61-
./deploy.py testnet --deployer "<deployer_profile_name>" admin-reset-data
6256
```
6357

6458
### Transfer Package Ownerships
@@ -117,3 +111,23 @@ or reusing an existing one.
117111
After that, package publishing and the setup steps will be executed by
118112
themselves. Setup also goes through a multisig account on localnet, but no
119113
additional approval is needed and the proposal execution is automated as well.
114+
115+
### GHO reserve deployment
116+
117+
If the protocol is already deployed, one has to first run to re-initialize the initial deployer config for the gho configuration to be made available for the `setup-gho-reserve` method
118+
119+
```bash
120+
./deploy.py testnet --deployer "<deployer_profile_name>" admin-reset-data
121+
```
122+
123+
Then, adding the gho reserve to the protocol is simply a matter of running:
124+
125+
```bash
126+
./deploy.py testnet --deployer "<deployer_profile_name>" setup-gho-reserve
127+
```
128+
129+
Finally, the direct minter address (whether it is an object or account) has to be given the risk admin role via:
130+
131+
```bash
132+
./deploy.py testnet --deployer "<deployer_profile_name>" --gho-direct-minter "<gho_direct_minter_address>" add-risk-admin
133+
```

aave-core/aave-data/sources/v1_deployment.move

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,16 @@ module aave_data::v1_deployment {
11651165
)
11661166
);
11671167
}
1168+
1169+
/// @notice Method to add a new risk admin to the Aave protocol
1170+
/// @param account The signer account executing the method (must be a default admin)
1171+
/// @param risk_admin The address of the new risk admin to be added
1172+
public entry fun add_risk_admin(account: &signer, risk_admin: address) {
1173+
// Verify the script is executed by someone who has the default admin role
1174+
assert!(acl_manage::is_default_admin(signer::address_of(account)));
1175+
if (!acl_manage::is_risk_admin(risk_admin)) {
1176+
acl_manage::add_risk_admin(account, risk_admin);
1177+
assert!(acl_manage::is_risk_admin(risk_admin), DEPLOYMENT_SUCCESS);
1178+
}
1179+
}
11681180
}

deploy.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,22 @@ def setup_gho_reserve(
12321232
[f"string:{network}"],
12331233
)
12341234

1235+
1236+
def add_risk_admin(
1237+
deployer: str, fullnode: str, multisig_aave_acl: str, new_risk_admin: str
1238+
) -> int:
1239+
logging.info("Setup: add new risk admin")
1240+
1241+
aave_data_address = _get_deployed_address("aave_data")
1242+
return _create_multisig_transaction(
1243+
deployer,
1244+
fullnode,
1245+
multisig_aave_acl,
1246+
f"{aave_data_address}::v1_deployment::add_risk_admin",
1247+
[f"address:{new_risk_admin}"],
1248+
)
1249+
1250+
12351251
def setup_all_localnet(
12361252
deployer: str, fullnode: str, multisig_pool_admin: str, network: str
12371253
) -> None:
@@ -1667,6 +1683,11 @@ def main() -> None:
16671683
default="0x108e14107cfe3d6d706fd208654e26ecc8b7a7f06ee82c4535477ba13aa03b52",
16681684
help="Multisig account AaveData address",
16691685
)
1686+
parser_testnet.add_argument(
1687+
"--gho-direct-minter",
1688+
default="0x0",
1689+
help="Multisig account GhoDirectMinter address",
1690+
)
16701691

16711692
parser_testnet_command = parser_testnet.add_subparsers(dest="testnet_command")
16721693

@@ -1741,6 +1762,10 @@ def main() -> None:
17411762
"setup-gho-reserve",
17421763
help="add GHO reserve for the initial launch",
17431764
)
1765+
parser_testnet_command.add_parser(
1766+
"add-risk-admin",
1767+
help="add a new risk admin",
1768+
)
17441769

17451770
parser_testnet_command.add_parser(
17461771
"change-owner-config",
@@ -1871,6 +1896,11 @@ def main() -> None:
18711896
default="0xd68e3dbbc1295081bffce9a530ac5e17c37707e818512131f7e5078b9a59e6cb",
18721897
help="Multisig account AaveData address",
18731898
)
1899+
parser_mainnet.add_argument(
1900+
"--gho-direct-minter",
1901+
default="0x0",
1902+
help="Multisig account GhoDirectMinter address",
1903+
)
18741904

18751905
parser_mainnet_command = parser_mainnet.add_subparsers(dest="mainnet_command")
18761906

@@ -1945,6 +1975,10 @@ def main() -> None:
19451975
"setup-gho-reserve",
19461976
help="add GHO reserve for the initial launch",
19471977
)
1978+
parser_mainnet_command.add_parser(
1979+
"add-risk-admin",
1980+
help="add a new risk admin",
1981+
)
19481982

19491983
parser_mainnet_command.add_parser(
19501984
"change-owner-config",
@@ -2144,6 +2178,13 @@ def main() -> None:
21442178
args.multisig_pool_admin,
21452179
"testnet",
21462180
)
2181+
elif args.testnet_command == "add-risk-admin":
2182+
add_risk_admin(
2183+
args.deployer,
2184+
args.fullnode,
2185+
args.multisig_aave_acl,
2186+
args.gho_direct_minter,
2187+
)
21472188

21482189
# handle ownership commands
21492190
elif args.testnet_command == "change-owner-config":
@@ -2341,6 +2382,13 @@ def main() -> None:
23412382
args.multisig_pool_admin,
23422383
"mainnet",
23432384
)
2385+
elif args.mainnet_command == "add-risk-admin":
2386+
add_risk_admin(
2387+
args.deployer,
2388+
args.fullnode,
2389+
args.multisig_aave_acl,
2390+
args.gho_direct_minter,
2391+
)
23442392

23452393
# handle ownership commands
23462394
elif args.mainnet_command == "change-owner-config":

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"devDependencies": {
1313
"@commitlint/config-conventional": "^20.0.0",
1414
"commitlint": "^20.1.0",
15-
"markdownlint": "^0.39.0",
15+
"markdownlint": "^0.40.0",
1616
"markdownlint-cli": "^0.46.0",
17-
"prettier": "^3.5.3",
17+
"prettier": "^3.7.4",
1818
"prettier-plugin-sh": "^0.18.0",
19-
"prettier-plugin-toml": "^2.0.4"
19+
"prettier-plugin-toml": "^2.0.6"
2020
}
2121
}

0 commit comments

Comments
 (0)