Skip to content
Open
Show file tree
Hide file tree
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
70 changes: 64 additions & 6 deletions content/confidential-contracts/api/finance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For convenience, this directory also includes:

## `BatcherConfidential`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/finance/BatcherConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/finance/BatcherConfidential.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -83,6 +83,7 @@ underlying tokens into [`BatcherConfidential.toToken`](#BatcherConfidential-toTo
- [routeDescription()](#BatcherConfidential-routeDescription--)
- [batchState(batchId)](#BatcherConfidential-batchState-uint256-)
- [_claim(batchId, account)](#BatcherConfidential-_claim-uint256-address-)
- [_quit(batchId, account)](#BatcherConfidential-_quit-uint256-address-)
- [_join(to, amount)](#BatcherConfidential-_join-address-euint64-)
- [_executeRoute(batchId, amount)](#BatcherConfidential-_executeRoute-uint256-uint256-)
- [_validateStateBitmap(batchId, allowedStates)](#BatcherConfidential-_validateStateBitmap-uint256-bytes32-)
Expand Down Expand Up @@ -182,7 +183,7 @@ Quit the batch with id `batchId`. Entire deposit is returned to the user.
This can only be called if the batch has not yet been dispatched or if the batch was canceled.

<Callout>
Developers should consider adding additional restrictions to this function
Developers should consider adding additional restrictions to [`BatcherConfidential._quit`](#BatcherConfidential-_quit-uint256-address-)
if maintaining confidentiality of deposits is critical to the application.
</Callout>

Expand Down Expand Up @@ -444,6 +445,39 @@ Returns the current state of a batch. Reverts if the batch does not exist.
Claims `toToken` for `account`'s deposit in batch with id `batchId`. Tokens are always
sent to `account`, enabling third-party relayers to claim on behalf of depositors.

<Callout type="warn">
This function is not protected against reentrancy. External functions built on top of it
must be marked `nonReentrant`, as [`BatcherConfidential.claim`](#BatcherConfidential-claim-uint256-address-) is.
</Callout>

</div>
</div>

<a id="BatcherConfidential-_quit-uint256-address-"></a>

<div className="border rounded-md mb-4">
<div className="bg-secondary flex w-full justify-between px-4">
<p className="font-bold text-sm font-mono">_quit(uint256 batchId, address account) → euint64</p>
<div className="flex flex-row items-center gap-2">
<p className="font-light text-sm">internal</p>
<a className="peer" data-card href="#BatcherConfidential-_quit-uint256-address-">#</a>
</div>
</div>
<div className="px-4">

Quits the batch with id `batchId` for `account`, returning the entire deposit to `account`.
This can only be called if the batch has not yet been dispatched or if the batch was canceled.

<Callout>
Developers should consider adding additional restrictions to this function if maintaining
confidentiality of deposits is critical to the application.
</Callout>

<Callout type="warn">
This function is not protected against reentrancy. External functions built on top of it
must be marked `nonReentrant`, as [`BatcherConfidential.quit`](#BatcherConfidential-quit-uint256-) is.
</Callout>

</div>
</div>

Expand Down Expand Up @@ -813,7 +847,7 @@ Intermediate steps must not result in underlying [`BatcherConfidential.toToken`]

## `ERC7821WithExecutor`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/finance/ERC7821WithExecutor.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/finance/ERC7821WithExecutor.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -951,7 +985,7 @@ function _erc7821AuthorizedExecutor(

## `VestingWalletCliffConfidential`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/finance/VestingWalletCliffConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/finance/VestingWalletCliffConfidential.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -1056,6 +1090,12 @@ starts at the vesting start timestamp (see [`VestingWalletConfidential`](#Vestin
<div className="font-mono">
- [VestingWalletCliffConfidentialInvalidCliffDuration(cliffSeconds, durationSeconds)](#VestingWalletCliffConfidential-VestingWalletCliffConfidentialInvalidCliffDuration-uint64-uint64-)
<details>
<summary>VestingWalletConfidential</summary>

- [VestingWalletConfidentialUnauthorizedHandle(handle, token)](#VestingWalletConfidential-VestingWalletConfidentialUnauthorizedHandle-euint64-address-)

</details>
<details>
<summary>ReentrancyGuardTransient</summary>

- [ReentrancyGuardReentrantCall()](#ReentrancyGuardTransient-ReentrancyGuardReentrantCall--)
Expand Down Expand Up @@ -1175,7 +1215,7 @@ The specified cliff duration is larger than the vesting duration.

## `VestingWalletConfidential`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/finance/VestingWalletConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/finance/VestingWalletConfidential.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -1283,6 +1323,7 @@ Confidential vesting wallet contracts can be deployed (as clones) using the [`Ve
<div className="bg-secondary p-4 rounded-md mb-6">
<h3 style={{ marginTop: "0"}}>Errors</h3>
<div className="font-mono">
- [VestingWalletConfidentialUnauthorizedHandle(handle, token)](#VestingWalletConfidential-VestingWalletConfidentialUnauthorizedHandle-euint64-address-)
<details>
<summary>ReentrancyGuardTransient</summary>

Expand Down Expand Up @@ -1497,13 +1538,30 @@ Emitted when releasable vested tokens are released.
</div>
</div>

<a id="VestingWalletConfidential-VestingWalletConfidentialUnauthorizedHandle-euint64-address-"></a>

<div className="border rounded-md mb-4">
<div className="bg-secondary flex w-full justify-between px-4">
<p className="font-bold text-sm font-mono">VestingWalletConfidentialUnauthorizedHandle(euint64 handle, address token)</p>
<div className="flex flex-row items-center gap-2">
<p className="font-light text-sm">error</p>
<a className="peer" data-card href="#VestingWalletConfidential-VestingWalletConfidentialUnauthorizedHandle-euint64-address-">#</a>
</div>
</div>
<div className="px-4">

The `token` is not authorized (via the FHE ACL) to access the encrypted `handle` it returned.

</div>
</div>

<a id="VestingWalletConfidentialFactory"></a>

<div style={{marginTop: "4em"}} className="w-full flex flex-row items-center justify-between">

## `VestingWalletConfidentialFactory`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/finance/VestingWalletConfidentialFactory.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/finance/VestingWalletConfidentialFactory.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down
2 changes: 1 addition & 1 deletion content/confidential-contracts/api/governance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This directory includes primitives for on-chain confidential governance.

## `VotesConfidential`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/governance/utils/VotesConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/governance/utils/VotesConfidential.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down
13 changes: 7 additions & 6 deletions content/confidential-contracts/api/interfaces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ These interfaces are available as `.sol` files and are useful to interact with t

## `IERC7984`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/interfaces/IERC7984.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/interfaces/IERC7984.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -424,7 +424,7 @@ should be able to disclose the amount. This functionality is implementation spec

## `IERC7984ERC20Wrapper`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/interfaces/IERC7984ERC20Wrapper.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/interfaces/IERC7984ERC20Wrapper.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -644,7 +644,7 @@ Emitted when an unwrap request is finalized for a given `receiver`, `unwrapReque

## `IERC7984HookModule`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/interfaces/IERC7984HookModule.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/interfaces/IERC7984HookModule.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -754,7 +754,7 @@ Optionally emitted by a module to indicate the result of its validation (pre-tra

## `IERC7984Receiver`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/interfaces/IERC7984Receiver.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/interfaces/IERC7984Receiver.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down Expand Up @@ -789,7 +789,8 @@ Called upon receiving a confidential token transfer. Returns an encrypted boolea
of the callback. If false is returned, the token contract will attempt to refund the transfer.

<Callout>
The calling contract (token) must be granted ACL allowance to read the confidential return value.
The calling contract (token) must be granted ACL allowance to read the confidential return value if
it is initialized. Uninitialized return values are treated as a false boolean.
</Callout>

<Callout type="warn">
Expand All @@ -805,7 +806,7 @@ Do not manually refund the transfer AND return false, as this can lead to double

## `IERC7984Rwa`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.1/contracts/interfaces/IERC7984Rwa.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.3/contracts/interfaces/IERC7984Rwa.sol">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-github-icon lucide-github"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
</a>

Expand Down
Loading