-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Context
We want to implement a command to sign an authorization tuple from EIP-7702
Description
The command authorize should take a private-key as a parameter, the address of the authority the authorization tuple delegates to, the chain-id optional parameter and the nonce optional parameter
The command should call the rpc endpoint to get the nonce for the authorization tuple or use the one passed as a parameter so that the user can create authorization tuples even if offline
It is also required to extend the rex send command to use this authorization tuple to create an eip-2718 type 0x04 transaction that includes this authorization tuple
Expected Usage of rex authorize
rex authorize <AUTHORITY_ADDRESS> [RPC_URL] <PRIVATE_KEY> --chain-id [id] --nonce [nonce]rex l2 authorize <AUTHORITY_ADDRESS> [RPC_URL] <PRIVATE_KEY> --chain-id [id] --nonce [nonce]Expected Usage of rex send
rex send <TO> <VALUE> <PRIVATE_KEY> [RPC_URL] --auth-tuple [auth-tuple]rex l2 send <TO> <VALUE> <PRIVATE_KEY> [RPC_URL] --auth-tuple [auth-tuple]Note
- Keep consistency.
- The CLI is a frontend of the SDK. The main logic must live in the SDK, and the CLI should have minimal logic.
- If a command exists for the L1 and could also exist for the L2, revise the existing commands and follow the same approach to do this to avoid repeating code unnecessarily.
- All RPC requests should be added as methods of the SDK's
EthClient.
- Focus on UX
- There are minor subtleties that improve the UX, such as making arguments positional, allowing you to skip writing the whole flag (e.g., instead of writing
--some-flag <value>, you just write<value>). This is achieved by avoiding adding theshortandlongopts to the flag configuration. - Keep commands and flags well documented. For flags, we have
helpandlong_help, andaboutfor commands. - Keep commands and flags well aliased. For commands we have
visible_aliasandvisible_aliases, and for flags we haveshortto enable adding the flag just using one dash and the first letter of the flag's name (e.g.-eis the short of--explorer),longto enable adding flags by using double dash (e.g.--explorer) and none of them to avoid using dashes at all (read two bullets above for more details on this).
- There are minor subtleties that improve the UX, such as making arguments positional, allowing you to skip writing the whole flag (e.g., instead of writing
- Test
Metadata
Metadata
Assignees
Labels
No labels