Skip to content

Commit

Permalink
chore: add a noir workspace in noir-contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Sep 6, 2023
1 parent a4167e7 commit a3b1ae1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions yarn-project/noir-contracts/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[workspace]
members = [
"src/contracts/child_contract",
"src/contracts/docs_example_contract",
"src/contracts/easy_private_token_contract",
"src/contracts/ecdsa_account_contract",
"src/contracts/escrow_contract",
# "src/contracts/example_public_state_increment_BROKE",
"src/contracts/import_test_contract",
"src/contracts/lending_contract",
"src/contracts/multi_transfer_contract",
"src/contracts/native_token_contract",
"src/contracts/non_native_token_contract",
"src/contracts/parent_contract",
"src/contracts/pending_commitments_contract",
"src/contracts/pokeable_token_contract",
"src/contracts/price_feed_contract",
"src/contracts/private_token_airdrop_contract",
"src/contracts/private_token_contract",
"src/contracts/public_token_contract",
"src/contracts/schnorr_account_contract",
"src/contracts/schnorr_hardcoded_account_contract",
"src/contracts/schnorr_single_key_account_contract",
"src/contracts/test_contract",
"src/contracts/uniswap_contract",
]
6 changes: 3 additions & 3 deletions yarn-project/noir-contracts/src/scripts/copy_output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,18 @@ const main = () => {
if (!name) throw new Error(`Missing argument contract name`);

const projectName = `${snakeCase(name)}_contract`;
const projectDirPath = `src/contracts/${projectName}`;

const contractName = upperFirst(camelCase(name));
const artifactFile = `${projectName}-${contractName}.json`;

const buildJsonFilePath = `${projectDirPath}/target/${artifactFile}`;
const buildJsonFilePath = `./target/${artifactFile}`;
const buildJson = JSON.parse(readFileSync(buildJsonFilePath).toString());

const debugArtifactFile = `debug_${artifactFile}`;
let debug = undefined;

try {
const debugJsonFilePath = `${projectDirPath}/target/${debugArtifactFile}`;
const debugJsonFilePath = `./target/${debugArtifactFile}`;
const debugJson = JSON.parse(readFileSync(debugJsonFilePath).toString());
if (debugJson) {
debug = debugJson;
Expand Down Expand Up @@ -91,6 +90,7 @@ const main = () => {

// Write a .nr contract interface, for consumption by other Noir Contracts
if (INTERFACE_CONTRACTS.includes(name)) {
const projectDirPath = `src/contracts/${projectName}`;
const noirInterfaceDestFilePath = `${projectDirPath}/src/interface.nr`;
try {
writeFileSync(noirInterfaceDestFilePath, generateNoirContractInterface(artifactJson));
Expand Down

0 comments on commit a3b1ae1

Please sign in to comment.