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

Change CommonLib functions to 'internal' #39

Merged
merged 1 commit into from
Aug 16, 2024
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
6 changes: 4 additions & 2 deletions solidity/contracts/lib/common.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ library Commonlib {
uint[2] pC;
}

function getProofHash(Proof calldata proof) public pure returns (bytes32) {
function getProofHash(
Proof calldata proof
) internal pure returns (bytes32) {
uint[8] memory inputs = [
proof.pA[0],
proof.pA[1],
Expand All @@ -44,7 +46,7 @@ library Commonlib {
// until it's available in a new release
function sort(
uint256[] memory array
) public pure returns (uint256[] memory) {
) internal pure returns (uint256[] memory) {
bytes32[] memory bytes32Array = _castToBytes32Array(array);
_quickSort(_begin(bytes32Array), _end(bytes32Array), _defaultComp);
return array;
Expand Down
7 changes: 1 addition & 6 deletions solidity/ignition/modules/zeto_anon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ export default buildModule("Zeto_Anon", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_Anon', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
Commonlib: commonlib,
},
});
const zeto = m.contract('Zeto_Anon', [depositVerifier, withdrawVerifier, verifier]);

return { zeto };
});
7 changes: 1 addition & 6 deletions solidity/ignition/modules/zeto_anon_enc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ export default buildModule("Zeto_AnonEnc", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_AnonEnc', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
Commonlib: commonlib,
},
});
const zeto = m.contract('Zeto_AnonEnc', [depositVerifier, withdrawVerifier, verifier]);

return { zeto };
});
2 changes: 0 additions & 2 deletions solidity/ignition/modules/zeto_anon_enc_nullifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ export default buildModule("Zeto_AnonEncNullifier", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawNullifierVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_AnonEncNullifier', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
SmtLib: smtLib,
PoseidonUnit3L: poseidon3,
Commonlib: commonlib,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ export default buildModule("Zeto_AnonEncNullifierNonRepudiation", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawNullifierVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_AnonEncNullifierNonRepudiation', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
SmtLib: smtLib,
PoseidonUnit3L: poseidon3,
Commonlib: commonlib,
},
});

Expand Down
2 changes: 0 additions & 2 deletions solidity/ignition/modules/zeto_anon_nullifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ export default buildModule("Zeto_AnonNullifier", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawNullifierVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_AnonNullifier', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
SmtLib: smtLib,
PoseidonUnit3L: poseidon3,
Commonlib: commonlib,
},
});

Expand Down
2 changes: 0 additions & 2 deletions solidity/ignition/modules/zeto_anon_nullifier_kyc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ export default buildModule("Zeto_AnonNullifierKyc", (m) => {
const { verifier } = m.useModule(VerifierModule);
const { verifier: depositVerifier } = m.useModule(DepositVerifierModule);
const { verifier: withdrawVerifier } = m.useModule(WithdrawNullifierVerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_AnonNullifierKyc', [depositVerifier, withdrawVerifier, verifier], {
libraries: {
SmtLib: smtLib,
PoseidonUnit2L: poseidon2,
PoseidonUnit3L: poseidon3,
Commonlib: commonlib,
},
});

Expand Down
7 changes: 1 addition & 6 deletions solidity/ignition/modules/zeto_nf_anon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ const VerifierModule = buildModule("Groth16Verifier_NfAnon", (m) => {

export default buildModule("Zeto_NfAnon", (m) => {
const { verifier } = m.useModule(VerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_NfAnon', [verifier], {
libraries: {
Commonlib: commonlib,
},
});
const zeto = m.contract('Zeto_NfAnon', [verifier]);

return { zeto };
});
2 changes: 0 additions & 2 deletions solidity/ignition/modules/zeto_nf_anon_nullifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ const VerifierModule = buildModule("Groth16Verifier_NfAnonNullifier", (m) => {
export default buildModule("Zeto_NfAnonNullifier", (m) => {
const { smtLib, poseidon3 } = m.useModule(SmtLibModule);
const { verifier } = m.useModule(VerifierModule);
const commonlib = m.library('Commonlib');

const zeto = m.contract('Zeto_NfAnonNullifier', [verifier], {
libraries: {
SmtLib: smtLib,
PoseidonUnit3L: poseidon3,
Commonlib: commonlib,
},
});

Expand Down
Loading