-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UAM Command Schema with CanCall Implementation (#244)
Co-authored-by: Brandon Chatham <[email protected]>
- Loading branch information
Showing
31 changed files
with
914 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package admin | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/urfave/cli/v2" | ||
"sort" | ||
) | ||
|
||
func AcceptCmd() *cli.Command { | ||
acceptCmd := &cli.Command{ | ||
Name: "accept-admin", | ||
Usage: "user admin accept-admin --account-address <AccountAddress>", | ||
UsageText: "Accepts a user to become admin who is currently pending admin acceptance.", | ||
Description: ` | ||
Accepts a user to become admin who is currently pending admin acceptance. | ||
`, | ||
After: telemetry.AfterRunAction(), | ||
Flags: acceptFlags(), | ||
} | ||
|
||
return acceptCmd | ||
} | ||
|
||
func acceptFlags() []cli.Flag { | ||
cmdFlags := []cli.Flag{ | ||
&flags.VerboseFlag, | ||
&AccountAddressFlag, | ||
} | ||
sort.Sort(cli.FlagsByName(cmdFlags)) | ||
return append(cmdFlags, flags.GetSignerFlags()...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package admin | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/urfave/cli/v2" | ||
"sort" | ||
) | ||
|
||
func AddPendingCmd() *cli.Command { | ||
addPendingCmd := &cli.Command{ | ||
Name: "add-pending-admin", | ||
Usage: "user admin add-pending-admin --account-address <AccountAddress> --admin-address <AdminAddress>", | ||
UsageText: "Add an admin to be pending until accepted.", | ||
Description: ` | ||
Add an admin to be pending until accepted. | ||
`, | ||
After: telemetry.AfterRunAction(), | ||
Flags: addPendingFlags(), | ||
} | ||
|
||
return addPendingCmd | ||
} | ||
|
||
func addPendingFlags() []cli.Flag { | ||
cmdFlags := []cli.Flag{ | ||
&flags.VerboseFlag, | ||
&AccountAddressFlag, | ||
&AdminAddressFlag, | ||
} | ||
sort.Sort(cli.FlagsByName(cmdFlags)) | ||
return append(cmdFlags, flags.GetSignerFlags()...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package admin | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func AdminCmd() *cli.Command { | ||
adminCmd := &cli.Command{ | ||
Name: "admin", | ||
Usage: "user admin <command>", | ||
UsageText: "Manage admin users.", | ||
Description: ` | ||
Manage admin users. | ||
`, | ||
After: telemetry.AfterRunAction(), | ||
Flags: []cli.Flag{ | ||
&flags.VerboseFlag, | ||
}, | ||
Subcommands: []*cli.Command{ | ||
AcceptCmd(), | ||
AddPendingCmd(), | ||
IsAdminCmd(), | ||
IsPendingCmd(), | ||
ListCmd(), | ||
ListPendingCmd(), | ||
RemoveCmd(), | ||
RemovePendingCmd(), | ||
}, | ||
} | ||
|
||
return adminCmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package admin | ||
|
||
import "github.com/urfave/cli/v2" | ||
|
||
var ( | ||
AccountAddressFlag = cli.StringFlag{ | ||
Name: "account-address", | ||
Aliases: []string{"aa"}, | ||
Usage: "user admin ... --account-address \"0x...\"", | ||
EnvVars: []string{"ACCOUNT_ADDRESS"}, | ||
} | ||
AdminAddressFlag = cli.StringFlag{ | ||
Name: "admin-address", | ||
Aliases: []string{"aa"}, | ||
Usage: "user admin ... --admin-address \"0x...\"", | ||
EnvVars: []string{"ADMIN_ADDRESS"}, | ||
} | ||
CallerAddressFlag = cli.StringFlag{ | ||
Name: "caller-address", | ||
Aliases: []string{"ca"}, | ||
Usage: "user admin ... --caller-address \"0x...\"", | ||
EnvVars: []string{"CALLER_ADDRESS"}, | ||
} | ||
PendingAdminAddressFlag = cli.StringFlag{ | ||
Name: "pending-admin-address", | ||
Aliases: []string{"paa"}, | ||
Usage: "user admin ... --pending-admin-address \"0x...\"", | ||
EnvVars: []string{"PENDING_ADMIN_ADDRESS"}, | ||
} | ||
PermissionControllerAddressFlag = cli.StringFlag{ | ||
Name: "permission-controller-address", | ||
Aliases: []string{"pca"}, | ||
Usage: "user admin ... --permission-controller-address \"0x...\"", | ||
EnvVars: []string{"PERMISSION_CONTROLLER_ADDRESS"}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package admin | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func IsAdminCmd() *cli.Command { | ||
isAdmin := &cli.Command{ | ||
Name: "is-admin", | ||
Usage: "user admin is-admin --account-address <AccountAddress> --caller-address <CallerAddress>", | ||
UsageText: "Checks if a user is an admin.", | ||
Description: ` | ||
Checks if a user is an admin. | ||
`, | ||
After: telemetry.AfterRunAction(), | ||
Flags: []cli.Flag{ | ||
&flags.VerboseFlag, | ||
&AccountAddressFlag, | ||
&CallerAddressFlag, | ||
}, | ||
} | ||
|
||
return isAdmin | ||
} |
Oops, something went wrong.