{"_id":"@bananapus/ownable-v5","_rev":"2-48a151ddf66e73b9e453a707de099975","name":"@bananapus/ownable-v5","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@bananapus/ownable-v5","version":"0.0.1","license":"MIT","_id":"@bananapus/ownable-v5@0.0.1","maintainers":[{"name":"simplemachine","email":"justinpulley92@gmail.com"},{"name":"me.jango","email":"me.jango@protonmail.com"},{"name":"filipviz","email":"f@filip.world"}],"homepage":"https://github.com/jbx-protocol/nana-ownable#readme","bugs":{"url":"https://github.com/jbx-protocol/nana-ownable/issues"},"dist":{"shasum":"291435517c7129644903945b3441eb70e8a44790","tarball":"https://registry.npmjs.org/@bananapus/ownable-v5/-/ownable-v5-0.0.1.tgz","fileCount":25,"integrity":"sha512-VHuAoo1f4Mcpt+Q89wpE1xUa031GCJanvqDPfVvxGLbh0VZ+QQMBQ1W4c++591ZVeC3uH80qi80SpSYOe8J+wg==","signatures":[{"sig":"MEUCIQCVDzwgtZ0AGTbsG431DuGSwv7VL2RmyQAY53HAxQWVBgIgVTw1D3fnjoGmHuSfo4abvxcXwVaXXP2D69z7Dh0bdk0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64861},"gitHead":"3ef60a0d594ded7f11e62d7b56d4ddf1104069d1","scripts":{"test":"forge test","coverage:integration":"forge coverage --match-path \"./src/*.sol\" --report lcov --report summary"},"_npmUser":{"name":"me.jango","email":"me.jango@protonmail.com"},"repository":{"url":"git+https://github.com/jbx-protocol/nana-ownable.git","type":"git"},"_npmVersion":"11.5.1","description":"A Bananapus variation on OpenZeppelin [`Ownable`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) to enable owner-based access control incorporating Juicebox project ownership and `JBPermissions`.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@bananapus/core-v5":"^0.0.1","@openzeppelin/contracts":"^5.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ownable-v5_0.0.1_1757287305803_0.07605982603612294","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bananapus/ownable-v5","version":"0.0.2","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jbx-protocol/nana-ownable.git"},"dependencies":{"@bananapus/core-v5":"^0.0.1","@openzeppelin/contracts":"^5.0.2"},"scripts":{"test":"forge test","coverage:integration":"forge coverage --match-path \"./src/*.sol\" --report lcov --report summary"},"_id":"@bananapus/ownable-v5@0.0.2","gitHead":"dad233076ca0bb4698a56dcc8efef8117d5a4115","description":"A Bananapus variation on OpenZeppelin [`Ownable`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) to enable owner-based access control incorporating Juicebox project ownership and `JBPermissions`.","bugs":{"url":"https://github.com/jbx-protocol/nana-ownable/issues"},"homepage":"https://github.com/jbx-protocol/nana-ownable#readme","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-p319DrqHKIyQ1YQObYgNfbNqljSCQ5/aSjh0uQgJlm1vSWHaBu0CnlVkg73J6PWnUhIdORPx330Swdbt1wqusA==","shasum":"f7bc4fcd5fa1488c0cc466bf106297574bff37a8","tarball":"https://registry.npmjs.org/@bananapus/ownable-v5/-/ownable-v5-0.0.2.tgz","fileCount":25,"unpackedSize":64861,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAqjqUnBP69mra60269Eh3yrCm+1eBqWrMTG9FRGMO/IAiB7MaNB4BUxGbnANMMLopCLIDPK0Sz/cqn8/LUH5euWHA=="}]},"_npmUser":{"name":"me.jango","email":"me.jango@protonmail.com"},"directories":{},"maintainers":[{"name":"simplemachine","email":"justinpulley92@gmail.com"},{"name":"me.jango","email":"me.jango@protonmail.com"},{"name":"filipviz","email":"f@filip.world"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ownable-v5_0.0.2_1757509980296_0.02219969105941222"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-07T23:21:45.675Z","modified":"2025-09-10T13:13:00.713Z","0.0.1":"2025-09-07T23:21:46.003Z","0.0.2":"2025-09-10T13:13:00.486Z"},"bugs":{"url":"https://github.com/jbx-protocol/nana-ownable/issues"},"license":"MIT","homepage":"https://github.com/jbx-protocol/nana-ownable#readme","repository":{"type":"git","url":"git+https://github.com/jbx-protocol/nana-ownable.git"},"description":"A Bananapus variation on OpenZeppelin [`Ownable`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) to enable owner-based access control incorporating Juicebox project ownership and `JBPermissions`.","maintainers":[{"name":"simplemachine","email":"justinpulley92@gmail.com"},{"name":"me.jango","email":"me.jango@protonmail.com"},{"name":"filipviz","email":"f@filip.world"}],"readme":"# Bananapus Ownable\n\nA Bananapus variation on OpenZeppelin [`Ownable`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) to enable owner-based access control incorporating Juicebox project ownership and `JBPermissions`.\n\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li><a href=\"#repository-layout\">Repository Layout</a></li>\n    <li><a href=\"#usage\">Usage</a></li>\n  <ul>\n    <li><a href=\"#install\">Install</a></li>\n    <li><a href=\"#develop\">Develop</a></li>\n    <li><a href=\"#scripts\">Scripts</a></li>\n    <li><a href=\"#tips\">Tips</a></li>\n    </ul>\n  </ul>\n  </ol>\n</details>\n\nThis implementation adds:\n\n- The ability to transfer contract ownership to a Juicebox Project instead of a specific address.\n- The ability to grant other addresses `OnlyOwner` access using `JBPermissions`.\n- Includes the `JBPermissioned` modifiers with support for OpenZeppelin [`Context`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol). This enables optional meta-transaction support.\n\nAll features are backwards compatible with OpenZeppelin `Ownable`. This should be a drop-in replacement.\n\nThis repo contains 2 contracts:\n\n1. If your contract does not already use `Ownable` or access controls, use `JBOwnable`.\n2. If your contract extends a contract you cannot easily modify (e.g. a core dependency), and that contract inherits from OpenZeppelin `Ownable`, use `JBOwnableOverride`.\n\n**NOTICE:** Only use `JBOwnableOverride` if you are overriding OpenZeppelin `Ownable` v4.7.0 or higher. Otherwise, `JBPermissions` functionality for `onlyOwner` will not work.\n\nThis repo was forked from [`jbx-protocol/juice-ownable`](https://github.com/jbx-protocol/juice-ownable).\n\n_If you're having trouble understanding this contract, take a look at the [core protocol contracts](https://github.com/Bananapus/nana-core) and the [documentation](https://docs.juicebox.money/) first. If you have questions, reach out on [Discord](https://discord.com/invite/ErQYmth4dS)._\n\n## Repository Layout\n\nThe root directory contains this README, an MIT license, and config files.\n\n```\nnana-ownable/\n├── src/ - The Solidity source code for the contracts.\n│   ├── JBOwnable.sol - Implements ownable access control for Juicebox projects/permissions.\n│   ├── JBOwnableOverrides.sol - Abstract base contract used by JBOwnable.\n│   ├── interfaces/ - Contract interfaces.\n│   │   └── IJBOwnable.sol - Interface used by JBOwnableOverrides.\n│   └── structs/ - Structs.\n│       └── JBOwner.sol - Owner information for a given instance of JBOwnableOverrides.\n├── test/ - Forge tests and testing utilities. Top level contains the main test files.\n│   ├── handlers/ - Custom handlers for tests.\n│   ├── mock/ - Mocking utilities.\n│   ├── Ownable.t.sol - Main tests.\n│   └── OwnableInvariantTests.t.sol - Invariant test.\n└── .github/\n    └── workflows/ - CI/CD workflows.\n```\n\n## Usage\n\n### Install\n\nHow to install `nana-ownable` in another project.\n\nFor projects using `npm` to manage dependencies (recommended):\n\n```bash\nnpm install @bananapus/ownable\n```\n\nFor projects using `forge` to manage dependencies (not recommended):\n\n```bash\nforge install Bananapus/nana-ownable\n```\n\nIf you're using `forge` to manage dependencies, add `@bananapus/ownable/=lib/nana-ownable/` to `remappings.txt`. You'll also need to install `nana-ownable`'s dependencies and add similar remappings for them.\n\n### Develop\n\n`nana-ownable` uses [npm](https://www.npmjs.com/) (version >=20.0.0) for package management and the [Foundry](https://github.com/foundry-rs/foundry) development toolchain for builds, tests, and deployments. To get set up, [install Node.js](https://nodejs.org/en/download) and install [Foundry](https://github.com/foundry-rs/foundry):\n\n```bash\ncurl -L https://foundry.paradigm.xyz | sh\n```\n\nYou can download and install dependencies with:\n\n```bash\nnpm ci && forge install\n```\n\nIf you run into trouble with `forge install`, try using `git submodule update --init --recursive` to ensure that nested submodules have been properly initialized.\n\nSome useful commands:\n\n| Command               | Description                                         |\n| --------------------- | --------------------------------------------------- |\n| `forge build`         | Compile the contracts and write artifacts to `out`. |\n| `forge fmt`           | Lint.                                               |\n| `forge test`          | Run the tests.                                      |\n| `forge build --sizes` | Get contract sizes.                                 |\n| `forge coverage`      | Generate a test coverage report.                    |\n| `foundryup`           | Update foundry. Run this periodically.              |\n| `forge clean`         | Remove the build artifacts and cache directories.   |\n\nTo learn more, visit the [Foundry Book](https://book.getfoundry.sh/) docs.\n\n### Scripts\n\nFor convenience, several utility commands are available in `package.json`.\n\n| Command                           | Description                            |\n| --------------------------------- | -------------------------------------- |\n| `npm test`                        | Run local tests.                       |\n| `npm run test:fork`               | Run fork tests (for use in CI).        |\n| `npm run coverage`           | Generate an LCOV test coverage report. |\n\n### Tips\n\nTo view test coverage, run `npm run coverage` to generate an LCOV test report. You can use an extension like [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) to view coverage in your editor.\n\nIf you're using Nomic Foundation's [Solidity](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity) extension in VSCode, you may run into LSP errors because the extension cannot find dependencies outside of `lib`. You can often fix this by running:\n\n```bash\nforge remappings >> remappings.txt\n```\n\nThis makes the extension aware of default remappings.\n","readmeFilename":"README.md"}