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

Rename of deposit and withdraw circuits #123

Merged
merged 2 commits into from
Jan 30, 2025
Merged
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
7 changes: 3 additions & 4 deletions solidity/contracts/lib/zeto_fungible.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// limitations under the License.
pragma solidity ^0.8.27;

import {Groth16Verifier_CheckHashesValue} from "../verifiers/verifier_check_hashes_value.sol";
import {Groth16Verifier_CheckNullifierValue} from "../verifiers/verifier_check_nullifier_value.sol";
import {Groth16Verifier_Deposit} from "../verifiers/verifier_deposit.sol";
import {Commonlib} from "./common.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
Expand All @@ -28,14 +27,14 @@ abstract contract ZetoFungible is OwnableUpgradeable {
// _depositVerifier library for checking UTXOs against a claimed value.
// this can be used in the optional deposit calls to verify that
// the UTXOs match the deposited value
Groth16Verifier_CheckHashesValue internal _depositVerifier;
Groth16Verifier_Deposit internal _depositVerifier;

error WithdrawArrayTooLarge(uint256 maxAllowed);

IERC20 internal _erc20;

function __ZetoFungible_init(
Groth16Verifier_CheckHashesValue depositVerifier
Groth16Verifier_Deposit depositVerifier
) public onlyInitializing {
_depositVerifier = depositVerifier;
}
Expand Down
17 changes: 8 additions & 9 deletions solidity/contracts/lib/zeto_fungible_withdraw.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// limitations under the License.
pragma solidity ^0.8.27;

import {Groth16Verifier_CheckHashesValue} from "../verifiers/verifier_check_hashes_value.sol";
import {Groth16Verifier_CheckInputsOutputsValue} from "../verifiers/verifier_check_inputs_outputs_value.sol";
import {Groth16Verifier_CheckInputsOutputsValueBatch} from "../verifiers/verifier_check_inputs_outputs_value_batch.sol";
import {Groth16Verifier_Deposit} from "../verifiers/verifier_deposit.sol";
import {Groth16Verifier_Withdraw} from "../verifiers/verifier_withdraw.sol";
import {Groth16Verifier_WithdrawBatch} from "../verifiers/verifier_withdraw_batch.sol";
import {ZetoFungible} from "./zeto_fungible.sol";
import {Commonlib} from "./common.sol";

Expand All @@ -31,14 +31,13 @@ abstract contract ZetoFungibleWithdraw is ZetoFungible {
// nullifierVerifier library for checking nullifiers against a claimed value.
// this can be used in the optional withdraw calls to verify that the nullifiers
// match the withdrawn value
Groth16Verifier_CheckInputsOutputsValue internal _withdrawVerifier;
Groth16Verifier_CheckInputsOutputsValueBatch
internal _batchWithdrawVerifier;
Groth16Verifier_Withdraw internal _withdrawVerifier;
Groth16Verifier_WithdrawBatch internal _batchWithdrawVerifier;

function __ZetoFungibleWithdraw_init(
Groth16Verifier_CheckHashesValue depositVerifier,
Groth16Verifier_CheckInputsOutputsValue withdrawVerifier,
Groth16Verifier_CheckInputsOutputsValueBatch batchWithdrawVerifier
Groth16Verifier_Deposit depositVerifier,
Groth16Verifier_Withdraw withdrawVerifier,
Groth16Verifier_WithdrawBatch batchWithdrawVerifier
) public onlyInitializing {
__ZetoFungible_init(depositVerifier);
_withdrawVerifier = withdrawVerifier;
Expand Down
16 changes: 8 additions & 8 deletions solidity/contracts/lib/zeto_fungible_withdraw_nullifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// limitations under the License.
pragma solidity ^0.8.27;

import {Groth16Verifier_CheckHashesValue} from "../verifiers/verifier_check_hashes_value.sol";
import {Groth16Verifier_CheckNullifierValue} from "../verifiers/verifier_check_nullifier_value.sol";
import {Groth16Verifier_CheckNullifierValueBatch} from "../verifiers/verifier_check_nullifier_value_batch.sol";
import {Groth16Verifier_Deposit} from "../verifiers/verifier_deposit.sol";
import {Groth16Verifier_WithdrawNullifier} from "../verifiers/verifier_withdraw_nullifier.sol";
import {Groth16Verifier_WithdrawNullifierBatch} from "../verifiers/verifier_withdraw_nullifier_batch.sol";
import {ZetoFungible} from "./zeto_fungible.sol";
import {Commonlib} from "./common.sol";

Expand All @@ -31,13 +31,13 @@ abstract contract ZetoFungibleWithdrawWithNullifiers is ZetoFungible {
// nullifierVerifier library for checking nullifiers against a claimed value.
// this can be used in the optional withdraw calls to verify that the nullifiers
// match the withdrawn value
Groth16Verifier_CheckNullifierValue internal _withdrawVerifier;
Groth16Verifier_CheckNullifierValueBatch internal _batchWithdrawVerifier;
Groth16Verifier_WithdrawNullifier internal _withdrawVerifier;
Groth16Verifier_WithdrawNullifierBatch internal _batchWithdrawVerifier;

function __ZetoFungibleWithdrawWithNullifiers_init(
Groth16Verifier_CheckHashesValue depositVerifier,
Groth16Verifier_CheckNullifierValue withdrawVerifier,
Groth16Verifier_CheckNullifierValueBatch batchWithdrawVerifier
Groth16Verifier_Deposit depositVerifier,
Groth16Verifier_WithdrawNullifier withdrawVerifier,
Groth16Verifier_WithdrawNullifierBatch batchWithdrawVerifier
) internal onlyInitializing {
__ZetoFungible_init(depositVerifier);
_withdrawVerifier = withdrawVerifier;
Expand Down
210 changes: 0 additions & 210 deletions solidity/contracts/verifiers/verifier_check_nullifiers_value.sol

This file was deleted.

Loading
Loading