Skip to content
Closed
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
52 changes: 44 additions & 8 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.4.0/contracts/finance/BatcherConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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 All @@ -36,8 +36,8 @@ import "@openzeppelin/confidential-contracts/finance/BatcherConfidential.sol";
```

`BatcherConfidential` is a batching primitive that enables routing between two [`ERC7984ERC20Wrapper`](/confidential-contracts/api/token#ERC7984ERC20Wrapper) contracts
via a non-confidential route. Users deposit [`BatcherConfidential.fromToken`](#BatcherConfidential-fromToken--) into the batcher and receive [`BatcherConfidential.toToken`](#BatcherConfidential-toToken--) in exchange. Deposits are
made by using `ERC7984` transfer and call functions such as [`ERC7984.confidentialTransferAndCall`](/confidential-contracts/api/token#ERC7984-confidentialTransferAndCall-address-euint64-bytes-).
(with distinct underlying tokens) via a non-confidential route. Users deposit [`BatcherConfidential.fromToken`](#BatcherConfidential-fromToken--) into the batcher and receive
[`BatcherConfidential.toToken`](#BatcherConfidential-toToken--) in exchange. Deposits are made by using `ERC7984` transfer and call functions such as [`ERC7984.confidentialTransferAndCall`](/confidential-contracts/api/token#ERC7984-confidentialTransferAndCall-address-euint64-bytes-).

Developers must implement the virtual function [`BatcherConfidential._executeRoute`](#BatcherConfidential-_executeRoute-uint256-uint256-) to perform the batch's route. This function is called
once the batch deposits are unwrapped into the underlying tokens. The function should swap the underlying [`BatcherConfidential.fromToken`](#BatcherConfidential-fromToken--) for
Expand Down Expand Up @@ -119,6 +119,8 @@ underlying tokens into [`BatcherConfidential.toToken`](#BatcherConfidential-toTo
- [InvalidExchangeRate(batchId, totalDeposits, exchangeRate)](#BatcherConfidential-InvalidExchangeRate-uint256-uint256-uint64-)
- [Unauthorized()](#BatcherConfidential-Unauthorized--)
- [InvalidWrapperToken(token)](#BatcherConfidential-InvalidWrapperToken-address-)
- [DuplicateUnderlyingTokens()](#BatcherConfidential-DuplicateUnderlyingTokens--)
- [IntermediateStepToTokenBalanceChanged(batchId)](#BatcherConfidential-IntermediateStepToTokenBalanceChanged-uint256-)
<details>
<summary>ReentrancyGuardTransient</summary>

Expand Down Expand Up @@ -485,7 +487,7 @@ the balance of the underlying [`BatcherConfidential.toToken`](#BatcherConfidenti
<Callout>
[`BatcherConfidential.dispatchBatchCallback`](#BatcherConfidential-dispatchBatchCallback-uint256-uint64-bytes-) (and in turn [`BatcherConfidential._executeRoute`](#BatcherConfidential-_executeRoute-uint256-uint256-)) can be repeatedly called until the route execution is complete.
If a multi-step route is necessary, intermediate steps should return `ExecuteOutcome.Partial`. Intermediate steps *must* not
result in underlying [`BatcherConfidential.toToken`](#BatcherConfidential-toToken--) being transferred into the batcher.
result in underlying [`BatcherConfidential.toToken`](#BatcherConfidential-toToken--) being transferred to or from the batcher.
</Callout>

<Callout type="warn">
Expand Down Expand Up @@ -771,13 +773,47 @@ The given `token` does not support `IERC7984ERC20Wrapper` via `ERC165`.
</div>
</div>

<a id="BatcherConfidential-DuplicateUnderlyingTokens--"></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">DuplicateUnderlyingTokens()</p>
<div className="flex flex-row items-center gap-2">
<p className="font-light text-sm">error</p>
<a className="peer" data-card href="#BatcherConfidential-DuplicateUnderlyingTokens--">#</a>
</div>
</div>
<div className="px-4">

The underlying wrapper tokens are the same.

</div>
</div>

<a id="BatcherConfidential-IntermediateStepToTokenBalanceChanged-uint256-"></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">IntermediateStepToTokenBalanceChanged(uint256 batchId)</p>
<div className="flex flex-row items-center gap-2">
<p className="font-light text-sm">error</p>
<a className="peer" data-card href="#BatcherConfidential-IntermediateStepToTokenBalanceChanged-uint256-">#</a>
</div>
</div>
<div className="px-4">

Intermediate steps must not result in underlying [`BatcherConfidential.toToken`](#BatcherConfidential-toToken--) being transferred to or from the batcher.

</div>
</div>

<a id="ERC7821WithExecutor"></a>

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

## `ERC7821WithExecutor`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.4.0/contracts/finance/ERC7821WithExecutor.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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 @@ -915,7 +951,7 @@ function _erc7821AuthorizedExecutor(

## `VestingWalletCliffConfidential`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.4.0/contracts/finance/VestingWalletCliffConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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 @@ -1139,7 +1175,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.4.0/contracts/finance/VestingWalletConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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 @@ -1467,7 +1503,7 @@ Emitted when releasable vested tokens are released.

## `VestingWalletConfidentialFactory`

<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.4.0/contracts/finance/VestingWalletConfidentialFactory.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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
4 changes: 2 additions & 2 deletions 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.4.0/contracts/governance/utils/VotesConfidential.sol">
<a target="_blank" style={{marginTop: "1.5em"}} href="https://github.com/OpenZeppelin/openzeppelin-confidential-contracts/blob/v0.5.0/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 Expand Up @@ -61,7 +61,7 @@ to activate checkpoints and have their voting power tracked.
<summary>HandleAccessManager</summary>

- [getHandleAllowance(handle, account, persistent)](#HandleAccessManager-getHandleAllowance-bytes32-address-bool-)
- [_validateHandleAllowance(handle)](#HandleAccessManager-_validateHandleAllowance-bytes32-)
- [_validateHandleAllowance()](#HandleAccessManager-_validateHandleAllowance-bytes32-)

</details>
<details>
Expand Down
Loading