Skip to content

Commit

Permalink
Merge pull request #123 from hyperledger-labs/rename
Browse files Browse the repository at this point in the history
Rename of deposit and withdraw circuits
  • Loading branch information
jimthematrix authored Jan 30, 2025
2 parents f962f1c + 7979985 commit 365739b
Show file tree
Hide file tree
Showing 32 changed files with 108 additions and 653 deletions.
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

0 comments on commit 365739b

Please sign in to comment.