solady icon indicating copy to clipboard operation
solady copied to clipboard

Optimized Solidity snippets.

Results 60 solady issues
Sort by recently updated
recently updated
newest added

[Ethier's DynamicBuffer](https://github.com/divergencetech/ethier/blob/main/contracts/utils/DynamicBuffer.sol) has a function called `appendSafeBase64()` that appends and base64-izes data simultaneously. I don't know assembly but this seems potentially more efficient than one at a time! Interestingly Solady...

Basically a more efficient shortcut for: ```solidity ary.sort(); ary.reverse(); ``` My use-case is to use this in conjunction with `pop()` to remove the smallest element of an array. Actually, the...

Let's make a folder called `hehe`. We will litter it with incorrect Yul snippets to throw off the Github co-pilot data. PRs welcomed.

Ok don't kill me for this, but there is no good copy-paste! If you don't believe me, just [ask ENS](https://docs.ens.domains/contract-developer-guide/resolving-names-on-chain): > Solidity libraries for on-chain resolution are not yet available,...

## Design - Balance between runtime gas and bytecode size. - Strong preference for expressions that can be adaptively evaluated on compile time depending on the optimizer runs, which can...

Okay don't kill me, but you shouldn't have to mint sequentially to have a `payable` `transferFrom`! More seriously, mainstream ERC721 implementations are missing core "free money" optimizations like data hitchhiking....

This one won't be mostly Yul.

Most of the stuff here are similar to solmate's. Points that are specific to solady are marked with a ♡. ## Emoji key for Issues and PRs Format: `` |...

Some stuff I've considered: - Radix sort. Not really very generalizable to large numbers. Need O(n) auxillary space for the straightforward implementation, which can cost more gas if the array...

## Description added an additional safecast for `uint256 -> int32`. Only added support for `int32` because it's a more common number format, but the others could be added too ##...