Skip to content

feat(docs): add tabs for deploying contract with cli and aztec.js#1703

Merged
rahul-kothari merged 4 commits into
masterfrom
rk/contract_docs
Aug 22, 2023
Merged

feat(docs): add tabs for deploying contract with cli and aztec.js#1703
rahul-kothari merged 4 commits into
masterfrom
rk/contract_docs

Conversation

@rahul-kothari

Copy link
Copy Markdown
Contributor

Fix #1608

@rahul-kothari rahul-kothari requested a review from benesjan August 21, 2023 16:05
@Maddiaa0 Maddiaa0 changed the title add tabs for deploying contract with cli and aztec.js feat(docs): add tabs for deploying contract with cli and aztec.js Aug 21, 2023
Comment thread docs/docs/dev_docs/getting_started/sandbox.md Outdated

@benesjan benesjan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just added a few suggestions. Will approve once you address them.

Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md
@rahul-kothari rahul-kothari requested a review from benesjan August 22, 2023 09:31
@rahul-kothari rahul-kothari enabled auto-merge (squash) August 22, 2023 09:32

@LHerskind LHerskind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some nits here

Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
</TabItem>
<TabItem value="js" label="Aztec.js">

Pre-requisite - Generate type-safe typescript classes for your contract when compiling:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to do this from aztec js as well? Ideally, want to support doing it fully programatically with aztec js and not having to touch the cli for some tests etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/docs/dev_docs/contracts/deploying.md
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
Comment thread docs/docs/dev_docs/contracts/deploying.md Outdated
<TabItem value="js" label="Aztec.js">

```ts
contract = await PrivateTokenContract.deploy(wallet, initialBalance, owner).send({ contractAddressSalt: Fr.fromString("0x123") }).deployed();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More api wise, but why are we not just calling it a salt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure 🤷

<TabItem value="js" label="Aztec.js">

```ts
contract = await PrivateTokenContract.deploy(wallet, initialBalance, owner).send({ contractAddressSalt: Fr.fromString("0x123") }).deployed();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contract = await PrivateTokenContract.deploy(wallet, initialBalance, owner).send({ contractAddressSalt: Fr.fromString("0x123") }).deployed();
const contract = await PrivateTokenContract.deploy(wallet, initialBalance, owner).send({ contractAddressSalt: Fr.fromString("0x123") }).deployed();

@LHerskind LHerskind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rahul-kothari rahul-kothari merged commit d2a284d into master Aug 22, 2023
@rahul-kothari rahul-kothari deleted the rk/contract_docs branch August 22, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Document how to deploy contracts using aztec.js

4 participants