Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch authored and alexghr committed Feb 22, 2024
1 parent a78ea0d commit 27e0ccd
Show file tree
Hide file tree
Showing 9 changed files with 33,953 additions and 33,998 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ impl Token {
amount: Field,
nonce: Field
) {
context.call_public_function(
let _ = context.call_public_function(
self.address,
FunctionSelector::from_signature("transfer_public((Field),(Field),Field,Field)"),
[from.to_field(), to.to_field(), amount, nonce]
);
}

pub fn mint_public(self: Self, context: PublicContext, to: AztecAddress, amount: Field) {
context.call_public_function(
let _ = context.call_public_function(
self.address,
FunctionSelector::from_signature("mint_public((Field),Field)"),
[to.to_field(), amount]
Expand All @@ -41,7 +41,7 @@ impl Token {
amount: Field,
nonce: Field
) {
context.call_public_function(
let _ = context.call_public_function(
self.address,
FunctionSelector::from_signature("burn_public((Field),Field,Field)"),
[from.to_field(), amount, nonce]
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec.js/src/fee/private_fee_payment_method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { FunctionSelector } from '@aztec/foundation/abi';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { Fr } from '@aztec/foundation/fields';

import { AccountWalletWithPrivateKey, computeAuthWitMessageHash } from '../index.js';
import { computeAuthWitMessageHash } from '../utils/authwit.js';
import { AccountWalletWithPrivateKey } from '../wallet/account_wallet_with_private_key.js';
import { FeePaymentMethod } from './fee_payment_method.js';

/**
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec.js/src/fee/public_fee_payment_method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { FunctionSelector } from '@aztec/foundation/abi';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { Fr } from '@aztec/foundation/fields';

import { AccountWalletWithPrivateKey, computeAuthWitMessageHash } from '../index.js';
import { computeAuthWitMessageHash } from '../utils/authwit.js';
import { AccountWalletWithPrivateKey } from '../wallet/account_wallet_with_private_key.js';
import { FeePaymentMethod } from './fee_payment_method.js';

/**
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/end-to-end/src/cli_docs_sandbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Rollup Address: 0x0dcd1bf9a1b36ce34237eeafef220932846bcd82
const docs = `
// docs:start:example-contracts
% aztec-cli example-contracts
AppSubscriptionContractContractArtifact
BananaFPCContractArtifact
BenchmarkingContractArtifact
CardGameContractArtifact
ChildContractArtifact
Expand Down
39 changes: 1 addition & 38 deletions yarn-project/entrypoints/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1 @@
# Accounts

Accounts is a client library that provides implementations for some common account flavors. Use it to acquire a `Wallet` object that corresponds to an account, and use that together with `@aztec/aztec.js` to interact with the network.

## Installing

```
npm install @aztec/accounts
```

## Account types

- **Schnorr**: Uses an Grumpkin private key with Schnorr signatures for authentication, and a separate Grumpkin private key for encryption. Recommended for most use cases.
- **ECDSA**: Uses an ECDSA private key for authentication, and a Grumpkin private key for encryption. Recommended for building integrations with Ethereum wallets.
- **SingleKey**: Uses a single Grumpkin private key for both authentication and encryption. Recommended for testing purposes only.

## Usage

### Deploy a new account

```typescript
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
import { GrumpkinPrivateKey } from '@aztec/circuit-types';

const encryptionPrivateKey = GrumpkinPrivateKey.random();
const signingPrivateKey = GrumpkinPrivateKey.random();
const wallet = getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitDeploy();
console.log(`New account deployed at ${wallet.getAddress()}`);
```

### Create a wallet object from an already deployed account

```typescript
import { getSchnorrAccount } from '@aztec/accounts/schnorr';

const wallet = getSchnorrWallet(pxe, encryptionPrivateKey);
console.log(`Wallet for ${wallet.getAddress()} ready`);
```
# Account Entrypoints
5 changes: 2 additions & 3 deletions yarn-project/entrypoints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"tsconfig": "./tsconfig.json"
},
"scripts": {
"build": "yarn clean && yarn build:copy-contracts && tsc -b",
"build": "yarn clean && tsc -b",
"build:dev": "tsc -b --watch",
"build:ts": "tsc -b",
"clean": "rm -rf ./dest .tsbuildinfo ./src/artifacts",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests",
"build:copy-contracts": "./scripts/copy-contracts.sh"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
},
"inherits": [
"../package.common.json",
Expand Down
11 changes: 0 additions & 11 deletions yarn-project/entrypoints/scripts/copy-contracts.sh

This file was deleted.

Loading

0 comments on commit 27e0ccd

Please sign in to comment.