diff --git a/docs/architecture/cairo-precompiles.md b/docs/architecture/cairo-precompiles.md index edae356..0f6a324 100644 --- a/docs/architecture/cairo-precompiles.md +++ b/docs/architecture/cairo-precompiles.md @@ -66,31 +66,17 @@ library CairoLib { uint256 functionSelector, uint256[] memory data ) internal view returns (bytes memory returnData); - - - /// @dev Performs a low-level call to a Cairo class declared on the Starknet appchain. - /// @param classHash The class hash of the Cairo class. - /// @param functionSelector The function selector of the Cairo class function to be called. - /// @param data The input data for the Cairo class function. - /// @return returnData The return data from the Cairo class function. - function libraryCall( - uint256 classHash, - uint256 functionSelector, - uint256[] memory data - ) internal view returns (bytes memory returnData); } ``` -It contains three functions, `callContract`, `staticcallContract` and -`libraryCall` that allow the user to call a Cairo contract or class deployed on +It contains two functions, `callContract` and `staticcallContract`, that allow the user to call a Cairo contract or class deployed on the Starknet appchain. The method takes three arguments: -- `contractAddress` or `classHash`: The address of the Cairo contract to call / - class hash to call +- `contractAddress` : The address of the Cairo contract to call - `functionSelector`: The selector of the function to call, as the `sn_keccak` of the entrypoint name: `keccak("entrypoint_name") % 2^250` -- `data`: The calldata to pass to the Cairo contract, as individual bytes. +- `data`: The calldata to pass to the Cairo contract, as individual bytes Contract developers can use this library to interact with the Cairo precompiles. Let's take an example of a contract that calls a Cairo contract to increment a