Skip to content

Commit

Permalink
special treatment for non-fungible tokens
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Zhang <[email protected]>
  • Loading branch information
jimthematrix committed Aug 30, 2024
1 parent 5432c72 commit cda7682
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions solidity/scripts/tokens/Zeto_Anon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
]
};
}
4 changes: 2 additions & 2 deletions solidity/scripts/tokens/Zeto_AnonEnc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
]
};
}
4 changes: 2 additions & 2 deletions solidity/scripts/tokens/Zeto_AnonEncNullifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
],
libraries: {
SmtLib: smtLib.target,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
],
libraries: {
SmtLib: smtLib.target,
Expand Down
4 changes: 2 additions & 2 deletions solidity/scripts/tokens/Zeto_AnonNullifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
],
libraries: {
SmtLib: smtLib.target,
Expand Down
4 changes: 2 additions & 2 deletions solidity/scripts/tokens/Zeto_AnonNullifierKyc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export async function deployDependencies() {
deployer,
args: [
await deployer.getAddress(),
verifier.target,
depositVerifier.target,
withdrawVerifier.target,
verifier.target
withdrawVerifier.target
],
libraries: {
SmtLib: smtLib.target,
Expand Down
12 changes: 7 additions & 5 deletions solidity/test/lib/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,21 @@ export async function deployZeto(tokenName: string) {
const deployFunc = isFungible ? deployFungibleCloneable : deployNonFungibleCloneable;
const result = await deployFunc(tokenName);
({ deployer, zetoImpl, erc20, args } = result as any);
const [deployerAddr, depositVerifier, withdrawVerifier, verifier] = args;
const [deployerAddr, verifier, depositVerifier, withdrawVerifier] = args;

// we want to test the effectiveness of the factory contract
// to create clones of the Zeto implementation contract
const Factory = await ethers.getContractFactory("ZetoTokenFactory");
const factory = await Factory.deploy();
await factory.waitForDeployment();
const tx1 = await factory.connect(deployer).registerImplementation(tokenName, {

const implInfo = {
implementation: zetoImpl.target,
depositVerifier,
withdrawVerifier,
depositVerifier: depositVerifier || verifier,
withdrawVerifier: withdrawVerifier || verifier,
verifier
} as any);
};
const tx1 = await factory.connect(deployer).registerImplementation(tokenName, implInfo as any);
await tx1.wait();
let tx2;
if (isFungible) {
Expand Down

0 comments on commit cda7682

Please sign in to comment.