foundry-rs / foundry-rs/foundry
feat(`cheatcodes`): add `vm.ec{Add, Mul?, AddP256, MulP256?}` (elliptic-curve cryptography)
Open
A-cheatcodes
T-feature
- Dominant language
- Rust
- Stars
- 10.6k
- Forks
- 2.6k
- Avg merge
- 18h 20m
- Merged PRs (30d)
- 510
Description
### Component
Forge
### Describe the feature you would like
It would be great to have such methods in `vm` since in rollups we could see more complex smart contracts that use secp256k1 / secp256r1 elliptic-curves. Intended use case - multi-signature schemes, ECDH on-chain, etc.
### Additional context
`Mul` is marked with a question mark because we already have `vm.createWallet(uint256 privateKey)` and `vm.publicKeyP256(uint256 privateKey)`, but we don't have any generic method like `add/mul` that returns `struct PublicKey { uint256 x, y; }`.
Contributor guide
Assessment
This issue has not been assessed yet.