foundry-rs / foundry-rs/foundry
feat(`cast`): consolidate conversion commands
- Dominant language
- Rust
- Stars
- 10.6k
- Forks
- 2.6k
- Avg merge
- 18h 20m
- Merged PRs (30d)
- 510
Description
### Component
Cast
### Describe the feature you would like
## Motivation
Cast is getting bloated with excessive conversion commands, increasing cognitive load when trying to remember/find the right one.
## Proposal
Create a `cast convert` subcommand to group all conversion-related commands, similar to how `cast wallet` groups wallet operations.
**Before:**
```bash
cast to-wei 1 ether
cast from-utf8 "hello"
```
**After:**
```bash
cast convert to-wei 1 ether
cast convert from-utf8 "hello"
```
### Additional context
Proposed (26) commands to consolidate under `cast convert`
- `from-wei`, `to-wei`, `to-unit`
- `from-fixed-point`, `to-fixed-point`
- `format-units`, `parse-units`
- `to-hex`, `to-dec`, `to-base`
- `to-int256`, `to-uint256`
- `from-utf8`, `to-utf8`, `to-ascii`, `from-bin`
- `to-bytes32`, `to-hexdata`
- `format-bytes32-string`, `parse-bytes32-string`, `parse-bytes32-address`
- `to-check-sum-address`, `concat-hex`, `pad`
- `to-rlp`, `from-rlp`
Contributor guide
Assessment
This issue has not been assessed yet.