@@ -185,6 +185,26 @@ interface VmSafe {
185185 function parseJson (string calldata json , string calldata key ) external pure returns (bytes memory abiEncodedData );
186186 function parseJson (string calldata json ) external pure returns (bytes memory abiEncodedData );
187187
188+ // The following parseJson cheatcodes will do type coercion, for the type that they indicate.
189+ // For example, parseJsonUint will coerce all values to a uint256. That includes stringified numbers '12'
190+ // and hex numbers '0xEF'.
191+ // Type coercion works ONLY for discrete values or arrays. That means that the key must return a value or array, not
192+ // a JSON object.
193+ function parseJsonUint (string calldata , string calldata ) external returns (uint256 );
194+ function parseJsonUintArray (string calldata , string calldata ) external returns (uint256 [] memory );
195+ function parseJsonInt (string calldata , string calldata ) external returns (int256 );
196+ function parseJsonIntArray (string calldata , string calldata ) external returns (int256 [] memory );
197+ function parseJsonBool (string calldata , string calldata ) external returns (bool );
198+ function parseJsonBoolArray (string calldata , string calldata ) external returns (bool [] memory );
199+ function parseJsonAddress (string calldata , string calldata ) external returns (address );
200+ function parseJsonAddressArray (string calldata , string calldata ) external returns (address [] memory );
201+ function parseJsonString (string calldata , string calldata ) external returns (string memory );
202+ function parseJsonStringArray (string calldata , string calldata ) external returns (string [] memory );
203+ function parseJsonBytes (string calldata , string calldata ) external returns (bytes memory );
204+ function parseJsonBytesArray (string calldata , string calldata ) external returns (bytes [] memory );
205+ function parseJsonBytes32 (string calldata , string calldata ) external returns (bytes32 );
206+ function parseJsonBytes32Array (string calldata , string calldata ) external returns (bytes32 [] memory );
207+
188208 // Serialize a key and value to a JSON object stored in-memory that can be later written to a file
189209 // It returns the stringified version of the specific JSON file up to that moment.
190210 function serializeBool (string calldata objectKey , string calldata valueKey , bool value )
0 commit comments