Skip to content

Commit

Permalink
feat: add frontend & rename directory from profile.io to profile.io-s…
Browse files Browse the repository at this point in the history
…ocial-cipher
  • Loading branch information
tabledK committed Nov 1, 2024
1 parent 1cbcd6b commit 4cb9e5f
Show file tree
Hide file tree
Showing 24 changed files with 7,233 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# dependencies
/node_modules


# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem


# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

*storybook.log
storybook-static/*
.next*

profile.io/frontend/.next/*
.vscode/settings.json
File renamed without changes.
File renamed without changes.
160 changes: 160 additions & 0 deletions profile.io-social-cipher/aztec/src/artifacts/Profile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@

/* Autogenerated file, do not edit! */

/* eslint-disable */
import {
type AbiType,
AztecAddress,
type AztecAddressLike,
CompleteAddress,
Contract,
type ContractArtifact,
ContractBase,
ContractFunctionInteraction,
type ContractInstanceWithAddress,
type ContractMethod,
type ContractStorageLayout,
type ContractNotes,
decodeFromAbi,
DeployMethod,
EthAddress,
type EthAddressLike,
EventSelector,
type FieldLike,
Fr,
type FunctionSelectorLike,
L1EventPayload,
loadContractArtifact,
type NoirCompiledContract,
NoteSelector,
Point,
type PublicKey,
type UnencryptedL2Log,
type Wallet,
type WrappedFieldLike,
} from '@aztec/aztec.js';
import ProfileContractArtifactJson from '../../target/zkpTestContract-Profile.json' assert { type: 'json' };
export const ProfileContractArtifact = loadContractArtifact(ProfileContractArtifactJson as NoirCompiledContract);



/**
* Type-safe interface for contract Profile;
*/
export class ProfileContract extends ContractBase {

private constructor(
instance: ContractInstanceWithAddress,
wallet: Wallet,
) {
super(instance, ProfileContractArtifact, wallet);
}



/**
* Creates a contract instance.
* @param address - The deployed contract's address.
* @param wallet - The wallet to use when interacting with the contract.
* @returns A promise that resolves to a new Contract instance.
*/
public static async at(
address: AztecAddress,
wallet: Wallet,
) {
return Contract.at(address, ProfileContract.artifact, wallet) as Promise<ProfileContract>;
}


/**
* Creates a tx to deploy a new instance of this contract.
*/
public static deploy(wallet: Wallet, initial_supply: (bigint | number), owner: AztecAddressLike, outgoing_viewer: AztecAddressLike) {
return new DeployMethod<ProfileContract>(Fr.ZERO, wallet, ProfileContractArtifact, ProfileContract.at, Array.from(arguments).slice(1));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified public keys hash to derive the address.
*/
public static deployWithPublicKeysHash(publicKeysHash: Fr, wallet: Wallet, initial_supply: (bigint | number), owner: AztecAddressLike, outgoing_viewer: AztecAddressLike) {
return new DeployMethod<ProfileContract>(publicKeysHash, wallet, ProfileContractArtifact, ProfileContract.at, Array.from(arguments).slice(2));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified constructor method.
*/
public static deployWithOpts<M extends keyof ProfileContract['methods']>(
opts: { publicKeysHash?: Fr; method?: M; wallet: Wallet },
...args: Parameters<ProfileContract['methods'][M]>
) {
return new DeployMethod<ProfileContract>(
opts.publicKeysHash ?? Fr.ZERO,
opts.wallet,
ProfileContractArtifact,
ProfileContract.at,
Array.from(arguments).slice(1),
opts.method ?? 'constructor',
);
}



/**
* Returns this contract's artifact.
*/
public static get artifact(): ContractArtifact {
return ProfileContractArtifact;
}


public static get storage(): ContractStorageLayout<'balances' | 'is_adult' | 'profile_nfts'> {
return {
balances: {
slot: new Fr(1n),
},
is_adult: {
slot: new Fr(2n),
},
profile_nfts: {
slot: new Fr(3n),
}
} as ContractStorageLayout<'balances' | 'is_adult' | 'profile_nfts'>;
}


public static get notes(): ContractNotes<'ProfileNFT' | 'ValueNote'> {
return {
ProfileNFT: {
id: new NoteSelector(4239572523),
},
ValueNote: {
id: new NoteSelector(1038582377),
}
} as ContractNotes<'ProfileNFT' | 'ValueNote'>;
}


/** Type-safe wrappers for the public methods exposed by the contract. */
public declare methods: {

/** compute_note_hash_and_optionally_a_nullifier(contract_address: struct, nonce: field, storage_slot: field, note_type_id: field, compute_nullifier: boolean, serialized_note: array) */
compute_note_hash_and_optionally_a_nullifier: ((contract_address: AztecAddressLike, nonce: FieldLike, storage_slot: FieldLike, note_type_id: FieldLike, compute_nullifier: boolean, serialized_note: FieldLike[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** constructor(initial_supply: integer, owner: struct, outgoing_viewer: struct) */
constructor: ((initial_supply: (bigint | number), owner: AztecAddressLike, outgoing_viewer: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** get_profile_nfts(owner: struct, page_index: integer) */
get_profile_nfts: ((owner: AztecAddressLike, page_index: (bigint | number)) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** mint(amount: integer, owner: struct, outgoing_viewer: struct) */
mint: ((amount: (bigint | number), owner: AztecAddressLike, outgoing_viewer: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** mintNFT(to: struct, token_id: field, is_adult: boolean) */
mintNFT: ((to: AztecAddressLike, token_id: FieldLike, is_adult: boolean) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** update_is_adult(amount: integer, owner: struct, recipient: struct) */
update_is_adult: ((amount: (bigint | number), owner: AztecAddressLike, recipient: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
};


}
File renamed without changes.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions profile.io-social-cipher/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions profile.io-social-cipher/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
36 changes: 36 additions & 0 deletions profile.io-social-cipher/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
15 changes: 15 additions & 0 deletions profile.io-social-cipher/frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { dev, isServer }) => {
// ignore 'fs' on client-side
if (!isServer) {
config.resolve.fallback = {
fs: false,
};
}

return config;
},
}

module.exports = nextConfig
Loading

0 comments on commit 4cb9e5f

Please sign in to comment.