Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove library call from lib documentation #75

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions docs/architecture/cairo-precompiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading