From 05573a7c4503b1d018ceb26a96c0ba62c69d429e Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 11 Dec 2024 15:35:54 -0300 Subject: [PATCH 1/3] update readme --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 32b84d4..68139f1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ # Defender Deploy Plugin -Plugin to deploy smart contracts using OpenZeppelin Defender. For documentation about usage in Remix please visit the [Defender Docs](https://docs.openzeppelin.com/defender/remix-plugin). +Plugin to deploy smart contracts using OpenZeppelin Defender. Currently supported in: + +- [Remix IDE](https://remix.ethereum.org/) - As a plugin listed in plugins directory, for more information please visit [our docs](https://docs.openzeppelin.com/defender/remix-plugin). +- [Contracts Wizard](https://wizard.openzeppelin.com/) - Integrated in code editor, for more information please visit [our docs](https://docs.openzeppelin.com/defender/remix-plugin). ## Getting Started @@ -16,7 +19,7 @@ pnpm install pnpm dev ``` -The interface is ugly, but don't worry! it's not meant to be used directly, it's used embedded in an iframe instead, and adopts the parent styles. +NOTE: This project is meant to be embedded in other UIs, just running the project won't be enough to see and debug it. You must embed the UI on an external iframe. ## Testing in Remix @@ -31,4 +34,38 @@ Url: http://localhost:5173 # or live version https://defeder-remix-deploy.netlif Type of connection: Iframe Location in Remix: Side Panel ``` -5. You should see the plugin added to the sidebar (new icon with ? symbol). \ No newline at end of file +5. You should see the plugin added to the sidebar (new icon with ? symbol). + +## Testing in Contracts Wizard + +For testing in Contracts Wizard, you must also run the Contracts Wizard UI locally to point to your local plugin. + +1. Run Contracts Wizard locally. + a. Go to (https://github.com/OpenZeppelin/contracts-wizard)[Contracts Wizard Repo]. + b. Clone the latest `master` branch and follow steps to setup the project. + c. Move to `pacakges/ui` and run it with `yarn dev`. +2. In another terminal, run this project using `pnpm dev`, make sure the app is served in `http://localhost:5173`. +3. Open Contracts Wizard local UI, generally in `http://localhost:8080`. +4. Click on "Deploy with Defender" button, you should be able to see embedded the local plugin. + +## Development + +Many parts of codebase are shared across plugins (server side code, state definition, ethereum interactions, etc.), but UI components have a separated implementation to make them more flexible and prevent side-effects. + +We have some bootstrap logic to expose one UI or another depending on the parent iframe domain. + +### Remix +The entrypoint for Remix plugin is `src/routes/remix.svelte`. Its components mainly use [bootstrap](https://getbootstrap.com/) for styling, Remix UI injects bootstrap dependency as a html tag when embedded. + +### Wizard +The entrypoint for Contracts Wizard plugin is `src/routes/wizard.svelte`. Its components mainly use [tailwind CSS](https://tailwindcss.com/) for styling, this is mainly for convenience, since Contracts Wizard was made using this CSS framework. + +## Release + +The repo has a CI/CD connected to our netlify account, when we merge `main` to some of the release branches, a new version of the plugin is released to live. Branches: + +- Remix IDE Plugin - `release-remix` +- Contracts Wizard Plugin - `release-wizard` + +> [!WARNING] +> We use `main` branch as the single source of truth and it's the only branch allowed to be merged to release branches. It should be tested carefully before triggering a new release. \ No newline at end of file From 27780bfa2d097445a3985831467677222a25098b Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 11 Dec 2024 15:40:33 -0300 Subject: [PATCH 2/3] fix list sub items --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68139f1..e66809d 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Location in Remix: Side Panel For testing in Contracts Wizard, you must also run the Contracts Wizard UI locally to point to your local plugin. 1. Run Contracts Wizard locally. - a. Go to (https://github.com/OpenZeppelin/contracts-wizard)[Contracts Wizard Repo]. - b. Clone the latest `master` branch and follow steps to setup the project. - c. Move to `pacakges/ui` and run it with `yarn dev`. + - a. Go to (https://github.com/OpenZeppelin/contracts-wizard)[Contracts Wizard Repo]. + - b. Clone the latest `master` branch and follow steps to setup the project. + - c. Move to `pacakges/ui` and run it with `yarn dev`. 2. In another terminal, run this project using `pnpm dev`, make sure the app is served in `http://localhost:5173`. 3. Open Contracts Wizard local UI, generally in `http://localhost:8080`. 4. Click on "Deploy with Defender" button, you should be able to see embedded the local plugin. From 854b8a01ccbe3d8c827024a526550528e1e2682d Mon Sep 17 00:00:00 2001 From: Marcos Carlomagno Date: Wed, 11 Dec 2024 21:21:20 -0300 Subject: [PATCH 3/3] Update README.md Co-authored-by: Eric Lau --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e66809d..dad5efa 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Location in Remix: Side Panel For testing in Contracts Wizard, you must also run the Contracts Wizard UI locally to point to your local plugin. 1. Run Contracts Wizard locally. - - a. Go to (https://github.com/OpenZeppelin/contracts-wizard)[Contracts Wizard Repo]. + - a. Go to [https://github.com/OpenZeppelin/contracts-wizard](Contracts Wizard Repo). - b. Clone the latest `master` branch and follow steps to setup the project. - c. Move to `pacakges/ui` and run it with `yarn dev`. 2. In another terminal, run this project using `pnpm dev`, make sure the app is served in `http://localhost:5173`.