-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6937af8
commit 083dcf1
Showing
86 changed files
with
8,761 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# ERC6909 | ||
[Git Source](https://github.com/uniswap/v4-core/blob/1141642f8ba4665a50660886a8a8401526677045/src/ERC6909.sol) | ||
| Generated with [forge doc](https://book.getfoundry.sh/reference/forge/forge-doc) | ||
|
||
**Inherits:** | ||
[IERC6909Claims](contracts/v4/reference/core/interfaces/IERC6909Claims.md) | ||
|
||
**Author:** | ||
Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC6909.sol) | ||
|
||
Minimalist and gas efficient standard ERC6909 implementation. | ||
|
||
*Copied from the commit at 4b47a19038b798b4a33d9749d25e570443520647* | ||
|
||
*This contract has been modified from the implementation at the above link.* | ||
|
||
|
||
## State Variables | ||
### isOperator | ||
|
||
```solidity | ||
mapping(address owner => mapping(address operator => bool isOperator)) public isOperator; | ||
``` | ||
|
||
|
||
### balanceOf | ||
|
||
```solidity | ||
mapping(address owner => mapping(uint256 id => uint256 balance)) public balanceOf; | ||
``` | ||
|
||
|
||
### allowance | ||
|
||
```solidity | ||
mapping(address owner => mapping(address spender => mapping(uint256 id => uint256 amount))) public allowance; | ||
``` | ||
|
||
|
||
## Functions | ||
### transfer | ||
|
||
|
||
```solidity | ||
function transfer(address receiver, uint256 id, uint256 amount) public virtual returns (bool); | ||
``` | ||
|
||
### transferFrom | ||
|
||
|
||
```solidity | ||
function transferFrom(address sender, address receiver, uint256 id, uint256 amount) public virtual returns (bool); | ||
``` | ||
|
||
### approve | ||
|
||
|
||
```solidity | ||
function approve(address spender, uint256 id, uint256 amount) public virtual returns (bool); | ||
``` | ||
|
||
### setOperator | ||
|
||
|
||
```solidity | ||
function setOperator(address operator, bool approved) public virtual returns (bool); | ||
``` | ||
|
||
### supportsInterface | ||
|
||
|
||
```solidity | ||
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool); | ||
``` | ||
|
||
### _mint | ||
|
||
|
||
```solidity | ||
function _mint(address receiver, uint256 id, uint256 amount) internal virtual; | ||
``` | ||
|
||
### _burn | ||
|
||
|
||
```solidity | ||
function _burn(address sender, uint256 id, uint256 amount) internal virtual; | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# ERC6909Claims | ||
[Git Source](https://github.com/uniswap/v4-core/blob/1141642f8ba4665a50660886a8a8401526677045/src/ERC6909Claims.sol) | ||
| Generated with [forge doc](https://book.getfoundry.sh/reference/forge/forge-doc) | ||
|
||
**Inherits:** | ||
[ERC6909](contracts/v4/reference/core/ERC6909.md) | ||
|
||
ERC6909Claims inherits ERC6909 and implements an internal burnFrom function | ||
|
||
|
||
## Functions | ||
### _burnFrom | ||
|
||
Burn `amount` tokens of token type `id` from `from`. | ||
|
||
*if sender is not `from` they must be an operator or have sufficient allowance.* | ||
|
||
|
||
```solidity | ||
function _burnFrom(address from, uint256 id, uint256 amount) internal; | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`from`|`address`|The address to burn tokens from.| | ||
|`id`|`uint256`|The currency to burn.| | ||
|`amount`|`uint256`|The amount to burn.| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Extsload | ||
[Git Source](https://github.com/uniswap/v4-core/blob/1141642f8ba4665a50660886a8a8401526677045/src/Extsload.sol) | ||
| Generated with [forge doc](https://book.getfoundry.sh/reference/forge/forge-doc) | ||
|
||
**Inherits:** | ||
[IExtsload](contracts/v4/reference/core/interfaces/IExtsload.md) | ||
|
||
Enables public storage access for efficient state retrieval by external contracts. | ||
https://eips.ethereum.org/EIPS/eip-2330#rationale | ||
|
||
|
||
## Functions | ||
### extsload | ||
|
||
Called by external contracts to access granular pool state | ||
|
||
|
||
```solidity | ||
function extsload(bytes32 slot) external view returns (bytes32); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`slot`|`bytes32`|Key of slot to sload| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bytes32`|value The value of the slot as bytes32| | ||
|
||
|
||
### extsload | ||
|
||
Called by external contracts to access granular pool state | ||
|
||
|
||
```solidity | ||
function extsload(bytes32 startSlot, uint256 nSlots) external view returns (bytes32[] memory); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`startSlot`|`bytes32`|| | ||
|`nSlots`|`uint256`|| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bytes32[]`|value The value of the slot as bytes32| | ||
|
||
|
||
### extsload | ||
|
||
Called by external contracts to access granular pool state | ||
|
||
|
||
```solidity | ||
function extsload(bytes32[] calldata slots) external view returns (bytes32[] memory); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`slots`|`bytes32[]`|| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bytes32[]`|value The value of the slot as bytes32| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Exttload | ||
[Git Source](https://github.com/uniswap/v4-core/blob/1141642f8ba4665a50660886a8a8401526677045/src/Exttload.sol) | ||
| Generated with [forge doc](https://book.getfoundry.sh/reference/forge/forge-doc) | ||
|
||
**Inherits:** | ||
[IExttload](contracts/v4/reference/core/interfaces/IExttload.md) | ||
|
||
Enables public transient storage access for efficient state retrieval by external contracts. | ||
https://eips.ethereum.org/EIPS/eip-2330#rationale | ||
|
||
|
||
## Functions | ||
### exttload | ||
|
||
Called by external contracts to access transient storage of the contract | ||
|
||
|
||
```solidity | ||
function exttload(bytes32 slot) external view returns (bytes32); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`slot`|`bytes32`|Key of slot to tload| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bytes32`|value The value of the slot as bytes32| | ||
|
||
|
||
### exttload | ||
|
||
Called by external contracts to access transient storage of the contract | ||
|
||
|
||
```solidity | ||
function exttload(bytes32[] calldata slots) external view returns (bytes32[] memory); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`slots`|`bytes32[]`|| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bytes32[]`|value The value of the slot as bytes32| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# NoDelegateCall | ||
[Git Source](https://github.com/uniswap/v4-core/blob/1141642f8ba4665a50660886a8a8401526677045/src/NoDelegateCall.sol) | ||
| Generated with [forge doc](https://book.getfoundry.sh/reference/forge/forge-doc) | ||
|
||
Base contract that provides a modifier for preventing delegatecall to methods in a child contract | ||
|
||
|
||
## State Variables | ||
### original | ||
*The original address of this contract* | ||
|
||
|
||
```solidity | ||
address private immutable original; | ||
``` | ||
|
||
|
||
## Functions | ||
### constructor | ||
|
||
|
||
```solidity | ||
constructor(); | ||
``` | ||
|
||
### checkNotDelegateCall | ||
|
||
*Private method is used instead of inlining into modifier because modifiers are copied into each method, | ||
and the use of immutable means the address bytes are copied in every place the modifier is used.* | ||
|
||
|
||
```solidity | ||
function checkNotDelegateCall() private view; | ||
``` | ||
|
||
### noDelegateCall | ||
|
||
Prevents delegatecall into the modified method | ||
|
||
|
||
```solidity | ||
modifier noDelegateCall(); | ||
``` | ||
|
||
## Errors | ||
### DelegateCallNotAllowed | ||
|
||
```solidity | ||
error DelegateCallNotAllowed(); | ||
``` | ||
|
Oops, something went wrong.