-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
D-easyDifficulty: easyDifficulty: easyT-featureType: featureType: featurefirst issueA good way to start contributingA good way to start contributing
Description
Component
Forge
Describe the feature you would like
Motivation
Base64 encoding has become relevant in Solidity development for reasons like on-chain metadata (NFTs), and seems there's an upcoming demand for Base64-URL encoding driven by passkey-based authentication (relying on WebAuthn).
As of OZ Contracts, we're working on a Base64URL implementation and we'd love to fuzz the implementation. It'd be great if the Vm.sol
had a set of functions for Base64 encoding.
Proposal
Consider adding the following function signatures to Vm.sol
:
// crates/cheatcodes/spec/src/vm.rs
// ======== Utilities ========
...
// -------- Base64 --------
#[cheatcode(group = Base64)]
function toBase64(bytes calldata data) external pure returns (string memory);
#[cheatcode(group = Base64)]
function toBase64(string calldata data) external pure returns (string memory);
#[cheatcode(group = Base64)]
function toBase64URL(bytes calldata data) external pure returns (string memory);
#[cheatcode(group = Base64)]
function toBase64URL(string calldata data) external pure returns (string memory);
Such functions can be implemented using this Base64 create, which would provide a reference implementation to fuzz the Solidity version against.
Additional context
No response
Evalir
Metadata
Metadata
Assignees
Labels
D-easyDifficulty: easyDifficulty: easyT-featureType: featureType: featurefirst issueA good way to start contributingA good way to start contributing
Type
Projects
Status
Done