Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auth-manager-deployer #264

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
26 changes: 26 additions & 0 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@
--rpc-url $RPC_GOERLI $@
'';
}
{
category = "deployments";
name = "deploy-auth-manager";
help = "Deploy the AuthManager";
command = ''
forge script $PRJ_ROOT/script/AuthManager.s.sol:AuthManagerDeployScript \
--chain-id 1 \
--rpc-url $RPC_MAINNET \
--broadcast \
--private-key $PRIVATE_KEY \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY \
-vvvvv
'';
}
{
category = "deployments";
name = "deploy-auth-manager-test";
help = "Deploy the AuthManager test";
command = ''
forge script $PRJ_ROOT/script/AuthManager.s.sol:AuthManagerDeployScript \
--chain-id 1 \
--fork-url $RPC_MAINNET \
-vvvvv
'';
}
{
category = "deployments";
name = "deploy-arbitrum";
Expand Down
25 changes: 25 additions & 0 deletions script/AuthManager.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;

import "forge-std/Script.sol";
import { IAuth } from "src/interfaces/IAuth.sol";
import { AuthManager } from "src/libraries/AuthManager.sol";

contract AuthManagerDeployScript is Script {
function run() public {
address safe = 0x617c8dE5BdE54ffbb8d92716CC947858cA38f582;
address authority = safe;
address mevEth = 0x24Ae2dA0f361AA4BE46b48EB19C91e02c5e4f27E;
address initialShareVault = safe;
address initialStakingModule = 0xc5920c99d09E5444C079C01F06763b5d6AB09CbB;

vm.startBroadcast();
// deploy AuthManager
AuthManager authManager = new AuthManager(authority, mevEth, initialShareVault, initialStakingModule);
// set AuthManager as admin
IAuth(mevEth).addAdmin(address(authManager));
IAuth(initialStakingModule).addAdmin(address(authManager));

vm.stopBroadcast();
}
}