update documentation

This commit is contained in:
hueso
2024-02-13 16:35:16 -03:00
parent f02dad07c8
commit 1ffa9c6b5c
23 changed files with 1240 additions and 1328 deletions

38
docs/lib/utils/ECDSA.md Normal file
View File

@@ -0,0 +1,38 @@
# Solidity API
## ECDSA
Gas optimized ECDSA wrapper.
### InvalidSignature
```solidity
error InvalidSignature()
```
_The signature is invalid._
### recoverCalldata
```solidity
function recoverCalldata(bytes32 hash, bytes signature) internal view returns (address result)
```
_Recovers the signer's address from a message digest `hash`,
and the `signature`.
This function does NOT accept EIP-2098 short form signatures.
Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098
short form signatures instead._
### toEthSignedMessageHash
```solidity
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result)
```
_Returns an Ethereum Signed Message, created from a `hash`.
This produces a hash corresponding to the one signed with the
[`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
JSON-RPC method as part of EIP-191._

View File

@@ -1,5 +1,14 @@
# MerkleProofLib
# Solidity API
_Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol)_
## MerkleProofLib
Gas optimized verification of proof of inclusion for a leaf in a Merkle tree.
### verify
```solidity
function verify(bytes32[] proof, bytes32 root, bytes32 leaf) internal pure returns (bool isValid)
```
_Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`._

View File

@@ -0,0 +1,50 @@
# Solidity API
## Multicall
Contract that batches view function calls and aggregates their results.
### CallFailed
```solidity
error CallFailed(string reason)
```
_0x_
### Call
```solidity
struct Call {
address target;
bytes callData;
}
```
### Result
```solidity
struct Result {
bool success;
bytes returnData;
}
```
### constructor
```solidity
constructor() public payable
```
### mtc1
```solidity
function mtc1(struct Multicall.Call[] calls) external returns (uint256, bytes[])
```
### mtc2
```solidity
function mtc2(struct Multicall.Call[] calls) external returns (uint256, bytes32, struct Multicall.Result[])
```

View File

@@ -1,13 +1,34 @@
# ReentrancyGuard
# Solidity API
_z0r0z.ethModified from Seaport (https://github.com/ProjectOpenSea/seaport/blob/main/contracts/lib/ReentrancyGuard.sol)Modified from Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)_
## ReentrancyGuard
Reentrancy protection for smart contracts.
## Errors
### Reentrancy
```solidity
error Reentrancy()
```
### nonReentrant
```solidity
modifier nonReentrant()
```
### setReentrancyGuard
```solidity
function setReentrancyGuard() internal virtual
```
_Check guard sentinel value and set it._
### clearReentrancyGuard
```solidity
function clearReentrancyGuard() internal virtual
```
_Unset sentinel value._

View File

@@ -1,7 +1,62 @@
# SafeTransferLib
# Solidity API
_Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)_
## SafeTransferLib
Safe ETH and ERC20 transfer library that gracefully handles missing return values.
_Caution! This library won't check that a token has code, responsibility is delegated to the caller._
_Caution! This library won't check that a token has code, responsibility is delegated to the caller._
### ETHTransferFailed
```solidity
error ETHTransferFailed()
```
_The ETH transfer has failed._
### TransferFromFailed
```solidity
error TransferFromFailed()
```
_The ERC20 `transferFrom` has failed._
### TransferFailed
```solidity
error TransferFailed()
```
_The ERC20 `transfer` has failed._
### safeTransferETH
```solidity
function safeTransferETH(address to, uint256 amount) internal
```
_Sends `amount` (in wei) ETH to `to`.
Reverts upon failure._
### safeTransferFrom
```solidity
function safeTransferFrom(contract ERC20 token, address from, address to, uint256 amount) internal
```
_Sends `amount` of ERC20 `token` from `from` to `to`.
Reverts upon failure.
The `from` account must have at least `amount` approved for
the current contract to manage._
### safeTransfer
```solidity
function safeTransfer(contract ERC20 token, address to, uint256 amount) internal
```
_Sends `amount` of ERC20 `token` from the current contract to `to`.
Reverts upon failure._