Use this skill to run the gator CLI from the repo and to choose the correct command/flags for delegation workflows.
npm install -g @metamask/gator-cli
gatordefault~/.gator-cli/permissions.json (or ~/.gator-cli/profiles/.json )~/.gator-cli/delegations/.json when storage not configuredEdit the profile config after gator init:
{
"delegationStorage": {
"apiKey": "your-api-key",
"apiKeyId": "your-api-key-id"
},
"rpcUrl": "https://your-rpc-url.com"
}
delegationStorage is optional; when missing, delegations are stored locally.rpcUrl is required for on-chain actions.Generate a private key and save config. Errors if the profile already exists.
gator init [--chain ] [--profile ] --chain values: base (default), baseSepolia, sepolia--profile default: defaultUpgrade an EOA to an EIP-7702 smart account. Uses the chain in your profile config.
gator create [--profile ] Display the EOA address for a profile.
gator show [--profile ] Check config and on-chain account status.
gator status [--profile ] Show native balance and optional ERC-20 balance.
gator balance [--tokenAddress ] [--profile ] --tokenAddress is provided, prints ERC-20 balance and decimals-derived units.Create, sign, and store a delegation with a predefined scope.
gator grant --to --scope [scope flags] [--profile ] Scope flags:
--tokenAddress , --maxAmount , --tokenId --periodAmount , --periodDuration , --startDate --amountPerSecond , --initialAmount , --startTime --targets , --selectors , --valueLte --contractAddress Supported scopes:
erc20TransferAmounterc20PeriodTransfererc20Streamingerc721TransfernativeTokenTransferAmountnativeTokenPeriodTransfernativeTokenStreamingfunctionCallownershipTransferGrant flags per scope:
| Scope | Required Flags | Optional Flags |
|---|---|---|
| --------------------------- | ----------------------------------------------------------------------- | ---------------- |
erc20TransferAmount | --tokenAddress, --maxAmount | |
erc20PeriodTransfer | --tokenAddress, --periodAmount, --periodDuration | --startDate |
erc20Streaming | --tokenAddress, --amountPerSecond, --initialAmount, --maxAmount | --startTime |
erc721Transfer | --tokenAddress, --tokenId | |
nativeTokenTransferAmount | --maxAmount | |
nativeTokenPeriodTransfer | --periodAmount, --periodDuration | --startDate |
nativeTokenStreaming | --amountPerSecond, --initialAmount, --maxAmount | --startTime |
functionCall | --targets, --selectors | --valueLte |
ownershipTransfer | --contractAddress |
--startDate and --startTime default to the current time (unix seconds) when omitted.--valueLte sets the max native token value per call for functionCall scopes.Redeem a stored delegation using a specific action type.
gator redeem --from --action [action flags] [--profile ] Supported action types: erc20Transfer, erc721Transfer, nativeTransfer, functionCall, ownershipTransfer, raw
Action-specific flags:
erc20Transfer: --tokenAddress, --to, --amounterc721Transfer: --tokenAddress, --to, --tokenIdnativeTransfer: --to, --amountfunctionCall: --target, --function, --args, --valueownershipTransfer: --contractAddress, --toraw: --target, --callData, --valueRevoke a delegation on-chain. Revokes the first matching delegation.
gator revoke --to [--profile ] Inspect delegations for your account.
gator inspect [--from ] [--to ] [--profile ] | Action | Required Flags |
|---|---|
| ------------------- | ------------------------------------- |
erc20Transfer | --tokenAddress, --to, --amount |
erc721Transfer | --tokenAddress, --to, --tokenId |
nativeTransfer | --to, --amount |
functionCall | --target, --function, --args |
ownershipTransfer | --contractAddress, --to |
raw | --target, --callData |
Initialize and upgrade:
gator init --profile <profile-name>
gator create --profile <profile-name>
Grant an ERC-20 transfer delegation:
gator grant --profile <profile-name> --to <to-address> --scope erc20TransferAmount \
--tokenAddress <token-address> --maxAmount 50
Redeem an ERC-20 transfer:
gator redeem --profile <profile-name> --from <from-address> --action erc20Transfer \
--tokenAddress <token-address> --to <to-address> --amount 10
Redeem a native transfer:
gator redeem --profile <profile-name> --from <from-address> --action nativeTransfer \
--to <to-address> --amount 0.5
Redeem in raw mode:
gator redeem --profile <profile-name> --from <from-address> --action raw \
--target <contract-address> --callData 0xa9059cbb...
Inspect delegations:
gator inspect --profile <profile-name>
gator inspect --profile <profile-name> --from <from-address>
gator inspect --profile <profile-name> --to <to-address>
Revoke a delegation:
gator revoke --profile <profile-name> --to <to-address>
--from refers to the delegator address; --to refers to the delegate/recipient.--targets and --selectors are comma-separated lists.--function accepts a human-readable Solidity function signature like "approve(address,uint256)". Do not pass a 4-byte selector (e.g. 0x095ea7b3) — the CLI derives the selector from the signature automatically.--startDate and --startTime accept unix timestamps in seconds. When omitted, they default to the current time.--action is required for redeem and must be one of: erc20Transfer, erc721Transfer, nativeTransfer, functionCall, ownershipTransfer, raw.--chain in gator init: base (default), baseSepolia, sepolia.共 1 个版本