Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for simplified flow deps add syntax #914

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/tools/flow-cli/dependency-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ If you know the address and name of the contract you want to install (this can u

`flow dependencies add testnet://7e60df042a9c0868.FlowToken`

For core contracts, you can add them to your project using a simplified syntax using only the contract name (learn more about core contracts [here](../../build/core-contracts/index.md)), for example:

`flow dependencies add FlowToken`

Th command will default to using Flow Mainnet as the source network (i.e. this command is functionally equivalent to `flow dependencies add mainnet://1654653399040a61.FlowToken`).

> Note: You can also use the shorthand `deps`
>

In this command, the string that will be used as the `source` in the `flow.json` after installation is `testnet://7e60df042a9c0868.FlowToken`. This can be broken down into three sections for formatting it yourself for another contract:

Expand Down Expand Up @@ -69,4 +74,4 @@ This will look at all the dependencies you have in your `flow.json`, install the
- After installation, you will have a local folder named `imports` that you should add to `.gitignore`. This folder is where your dependencies will be stored locally.
- If your contracts change on the network, the Dependency Manager will ask if you want to update the local dependencies in your `imports` folder. The hash saved in the dependency object is used for this check, so don't remove it.
- Dependencies will function just like contracts. For instance, you can add them to [`deployments` in your `flow.json`](./deployment/deploy-project-contracts.md) and run `flow project deploy`, as well as import them in your scripts, transactions, and contracts just as you would with a contract you added yourself (e.g., `import "FlowToken"`).
- Core contract aliases will be automatically added for you across all networks.
- Core contract aliases will be automatically added for you across all networks.
Loading