{"id":19607094,"url":"https://github.com/jbx-protocol/juice-contract-template","last_synced_at":"2025-10-17T03:20:41.008Z","repository":{"id":103564049,"uuid":"593626601","full_name":"jbx-protocol/juice-contract-template","owner":"jbx-protocol","description":"Template used to code juicy solidity stuff - includes forge, libs, etc","archived":false,"fork":false,"pushed_at":"2023-10-03T04:33:32.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T09:26:17.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbx-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-26T13:33:21.000Z","updated_at":"2024-06-06T06:41:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"04a208b7-13f6-497a-a3ff-1956f0e12afc","html_url":"https://github.com/jbx-protocol/juice-contract-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-contract-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-contract-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-contract-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-contract-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbx-protocol","download_url":"https://codeload.github.com/jbx-protocol/juice-contract-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240895011,"owners_count":19874911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:08:49.263Z","updated_at":"2025-10-17T03:20:35.950Z","avatar_url":"https://github.com/jbx-protocol.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# juice-contract-template\n\n`juice-contract-template` is a starting point for building Solidity extensions to the [Juicebox protocol](https://docs.juicebox.money/dev/). This template includes `forge` and dependencies, and may help you avoid submodule-related dependency issues down the road.\n\nDo not push straight on main. Create a new branch and open a PR – your reviewer will love you for this.\n\n## Dependencies\n\n`juice-contract-template` uses the Foundry smart contract development toolchain. To install Foundry, open your terminal and run the following command:\n\n```bash\ncurl -L https://foundry.paradigm.xyz | bash\n```\n\nOnce you have Foundry installed, run `foundryup` to update to the latest versions of `forge`, `cast`, `anvil`, and `chisel`. More detailed instructions can be found in the [Foundry Book](https://book.getfoundry.sh/getting-started/installation).\n\n`juice-contract-template` also uses [NPM](https://nodejs.org/en) to manage NPM dependencies.\n\nTo install `forge` and `npm` dependencies, run:\n\n```bash\nforge install \u0026\u0026 npm install\n```\n\n## Adding NPM Dependencies\n\nTo add an NPM dependency to `package.json`, run:\n\n```bash\nnpm add \u003cpackage-name\u003e\n```\n\nWhere `\u003cpackage-name\u003e` is the name of the dependency you'd like to add. Add dependencies to `remappings.txt` by running `forge remappings \u003e\u003e remappings.txt`. For example, the NPM package `jbx-protocol` is remapped as `@jbx-protocol/=node_modules/@jbx-protocol/`.\n\nTo upgrade an NPM dependency in `package.json`, run:\n\n```bash\nnpm upgrade \u003cpackage\u003e\n```\n\n## Adding forge Dependencies\n\nIf the dependency you would like to install does not have an up-to-date NPM package, run:\n\n```bash\nforge install \u003cdependency-url\u003e\n```\n\nwhere `\u003cdependency-url\u003e` is the dependency's Git URL or GitHub path. This will install the dependency to `/lib`. Forge manages dependencies using git submodules. Learn more about `forge install` in the [Foundry Book](https://book.getfoundry.sh/reference/forge/forge-install).\n\nIf nested dependencies are not installing, try running:\n\n```bash\ngit submodule update --init --recursive --force\n```\n\nNested dependencies are dependencies of other dependencies you have installed.\n\nRun `forge remappings \u003e remappings.txt` to write the dependencies to `remappings.txt`. Note that this will overwrite that file. Learn about remappings in the [Foundry Book](https://book.getfoundry.sh/reference/forge/forge-remappings).\n\nTo update forge dependencies, run one or more of the following commands:\n\n```bash\nfoundryup # Update forge\nforge update \u003cdependency-name\u003e # Update one dependency\nforge update # Update all dependencies\n```\n\n## Scripts\n\n| Command                  | Description                                                                                       |\n| ------------------------ | ------------------------------------------------------------------------------------------------- |\n| `npm run build`          | Build contracts using `forge`.                                                                    |\n| `npm run test`           | Run `forge` tests.                                                                                |\n| `npm run test:fork`      | Run tests in CI mode (including slower mainnet fork tests).                                       |\n| `npm run size`           | Check contract size.                                                                              |\n| `npm run doc`            | Generate natspec docs.                                                                            |\n| `npm run lint`           | Lint the code.                                                                                    |\n| `npm run tree`           | Generate a Solidity dependency tree.                                                              |\n| `npm run deploy:mainnet` | Deploy and verify on mainnet (see .env.example for required env vars, using a ledger by default). |\n| `npm run deploy:goerli`  | Deploy and verify on goerli (see .env.example for required env vars, using a ledger by default).  |\n| `npm run coverage`       | Display a code coverage summary and generate a LCOV report.                                       |\n\nYou can also run `forge` commands. See the [Foundry Book](https://book.getfoundry.sh/reference/forge/) for a description.\n\n## Editor\n\nWe recommend using [VSCode](https://code.visualstudio.com/) with Juan Blanco's [solidity](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity) extension. To display code coverage in VSCode, install [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) (Ryan Luker). In VSCode, press `F1` and run \"Coverage Gutters: Display Coverage\". Coverage will be displayed as colored markdown lines in the left gutter, after the line numbers.\n\n## PR\n\nGithub CI flow will run both unit and forked tests, log the contracts size (with the tests) and check linting compliance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbx-protocol%2Fjuice-contract-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbx-protocol%2Fjuice-contract-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbx-protocol%2Fjuice-contract-template/lists"}