{"repo":"foundry-rs/forge-std","free":true,"listed":false,"github":"https://github.com/foundry-rs/forge-std","clone":"git clone https://github.com/foundry-rs/forge-std.git","description":"A collection of helpful contracts and libraries for use with Forge and Foundry","language":"Solidity","stars":1054,"topics":["cheatcodes","ethereum","evm","forge","foundry","solc","solidity","std"],"license":"Apache-2.0","category":"blockchain-web3","readme_excerpt":"Forge Standard Library • Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry. It leverages Forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. Learn how to use Forge-Std with the 📖 Foundry Book (Forge-Std Guide). Install Contracts stdError This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the expectRevert cheatcode, as it provides all compiler built-in errors. See the contract itself for all error codes. Example usage stdStorage This is a rather large contract due to all of the overloading to make the UX decent. Primarily, it is a wrapper around the record and accesses cheatcodes. It can always find and write the storage slot(s) associated with a particular variable without knowing the storage layout. By default, writing to packed storage variables is not supported and will throw an error. However, you can enable packed slot support by calling enable packed slots() before using find() or checked write() . This works by recording all SLOAD s and SSTORE s during a function call. If there is a single slot read or written to, it immediately returns the slot. Otherwise, behind the scenes, we iterate through and check each one (assuming the user passed in a depth parameter). If the variable is a struct, you can pass in a depth parameter which is basically the field depth. I.e.: Example usage stdCheats This is a wrapper around miscel","default_branch":null,"files":null,"tree":[],"storefront":"/r/foundry-rs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/foundry-rs/forge-std/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}