warden-protocol / wardenprotocol

Monorepo for the Warden Protocol.
https://wardenprotocol.org
Apache License 2.0
1.1k stars 112 forks source link

Orders deploy script #1094

Closed mn13 closed 2 days ago

mn13 commented 3 days ago

Summary by CodeRabbit

coderabbitai[bot] commented 3 days ago
📝 Walkthrough ## Walkthrough The changes introduce a new module for Solidity commands in the `justfile`, enhancing command flexibility with a default label for contract deployment. A new Justfile for managing tasks related to the `orders` directory is created, defining several commands for building, linting, testing, and deploying. Additionally, the `.env.example` file is updated with new environment variables for blockchain connectivity, while the `.gitignore` file modifies exclusion patterns. New JSON files document deployment transactions, and a new Solidity contract for deployment logic is added, replacing an abstract contract that was removed. ## Changes | File | Change Summary | |-------------------------------------------|---------------------------------------------------------------------------------------------------------| | `justfile` | - New module added: `mod solidity`
- Updated command: `deploy-contract` with default label "default" | | `solidity/justfile` | - Variables added: `shulgin_mnemonic`, `shulgin`
- Commands added: `orders`, `build-orders`, `lint-orders`, `test-orders`, `localnet-orders` | | `solidity/orders/.env.example` | - Variables added: `RPC_URL`, `CHAIN_ID`, `SCHEDULER_ADDRESS`, `FACTORY_OWNER_ADDRESS`, `REGISTRY_ADDRESS`
- Updated `MNEMONIC` with sensitivity warning | | `solidity/orders/.gitignore` | - Updated ignore rule for `broadcast` directory from `broadcast/*/31337/` to `broadcast/*/1337/` | | `solidity/orders/broadcast/Deploy.s.sol/12345/run-latest.json` | - New file documenting deployment transactions for `Registry` and `OrderFactory` contracts | | `solidity/orders/foundry.toml` | - Removed blank line at the end of the file | | `solidity/orders/package.json` | - New script added: `"deploy"` for contract deployment | | `solidity/orders/script/Base.s.sol` | - Abstract contract `BaseScript` removed | | `solidity/orders/script/Deploy.s.sol` | - New contract `Deploy` added for managing deployment logic | | `solidity/orders/broadcast/Deploy.s.sol/12345/run-1732289555.json` | - New file containing transaction data for `Registry` and `OrderFactory` deployments | ## Possibly related PRs - **#661**: This PR reorganizes commands in the `justfile`, which is relevant to the changes made in the main PR regarding the `justfile` and the introduction of the `mod solidity` module. - **#818**: This PR includes updates related to EVM contracts, which aligns with the main PR's focus on Solidity commands for building and deploying contracts. - **#1014**: This PR sets up a Solidity contracts project, which may relate to the overall structure and organization of Solidity commands introduced in the main PR. - **#1039**: This PR adds a layer to work with blockchains, which could be relevant to the deployment and management of Solidity contracts as described in the main PR. - **#1069**: This PR focuses on the scheduler for automated orders, which may relate to the deployment commands introduced in the main PR. - **#1072**: This PR introduces a basic order contract, which is relevant to the Solidity commands for deploying contracts mentioned in the main PR. - **#1078**: This PR updates the automated orders to use new libraries, which may connect to the changes in the main PR regarding Solidity commands. - **#1080**: This PR introduces a registry contract, which is relevant to the management of contracts and could relate to the deployment commands in the main PR. - **#1084**: This PR adds a transactions relayer, which may connect to the overall functionality of deploying and managing contracts as described in the main PR. ## Suggested labels `basic-automated-orders`, `protobuf` ## Suggested reviewers - backsapc - artur-abliazimov

[!WARNING]

Rate limit exceeded

@mn13 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue? After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.
🚦 How do rate limits work? CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://docs.coderabbit.ai/faq) for further information.
📥 Commits Reviewing files that changed from the base of the PR and between a79a422987ee2c77d5cb7abc48560f0df86dada5 and 72de3b36b31a73172ca9e4e19e90f7b546b1d9de.

📜 Recent review details **Configuration used: .coderabbit.yaml** **Review profile: CHILL**
📥 Commits Reviewing files that changed from the base of the PR and between a79a422987ee2c77d5cb7abc48560f0df86dada5 and 72de3b36b31a73172ca9e4e19e90f7b546b1d9de.
📒 Files selected for processing (2) * `solidity/orders/broadcast/Deploy.s.sol/12345/run-1732289555.json` (1 hunks) * `solidity/orders/broadcast/Deploy.s.sol/12345/run-latest.json` (1 hunks)
✅ Files skipped from review due to trivial changes (1) * solidity/orders/broadcast/Deploy.s.sol/12345/run-1732289555.json
🔇 Additional comments (4)
solidity/orders/broadcast/Deploy.s.sol/12345/run-latest.json (4) `3-20`: **Registry contract deployment looks good.** The deployment transaction for the Registry contract was successful with reasonable gas limits and proper bytecode. --- `44-92`: **Transaction receipts confirm successful deployments.** Both contracts were deployed successfully: - Registry: Used 610,164 gas - OrderFactory: Used 3,864,733 gas with proper ownership transfer to 0xb342A793bE112dfB4526AaFbFbE55bc3Ef74c2a1 --- `94-100`: **Verify the deployment environment.** The deployment was performed on chain ID 12345, which appears to be a testnet. Please verify: 1. Is this the intended deployment environment? 2. The timestamp indicates a future date (2024) - ensure this is expected for your deployment schedule.
✅ Verification successful Based on the search results, I can now provide a final response since I found clear evidence about the chain ID configuration in the codebase: **Chain ID 12345 is correctly configured as the devnet environment** The deployment environment is correctly set to chain ID 12345 (0x3039), which is explicitly defined as the devnet in the codebase: - Confirmed in `spaceward/src/App.tsx`: "0x3039(12345) - devnet" - Matches chain configuration in `spaceward/src/config/chains.ts`: "chain_id: devnet_12345-1" The future timestamp is expected as this is a deployment broadcast file generated during the deployment process.
🏁 Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Search for chain ID configuration in the codebase # Search for chain ID references echo "Searching for chain ID configuration..." rg -A 5 "12345|0x3039" ``` Length of output: 16355
--- `21-42`: **Verify the roles of constructor arguments.** While the deployment was successful and the Registry address is correctly passed as the first argument, please verify the roles and permissions of the other two addresses: - 0x03506D9a00fD1E2c9176454A267424285EdA18aC - 0xb342A793bE112dfB4526AaFbFbE55bc3Ef74c2a1
✅ Verification successful Let me search for the contract code to understand the constructor arguments' roles. --- Let me try searching for the contract file and constructor implementation using a different approach. --- Let me examine the OrderFactory contract file directly. --- **OrderFactory deployment constructor arguments verified** The constructor arguments match their intended roles: 1. Registry (0x0f25Ef0425E15b0d843Ed542CC4fA7F4636727BD): Stores IExecution contracts 2. Scheduler (0x03506D9a00fD1E2c9176454A267424285EdA18aC): Manages order scheduling 3. Owner (0xb342A793bE112dfB4526AaFbFbE55bc3Ef74c2a1): Receives Ownable admin rights The deployment is correct with proper non-zero addresses for all required roles.
🏁 Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Search for references to these addresses in the codebase to understand their roles # Search for address references in the codebase echo "Searching for references to the second constructor argument..." rg -A 5 "0x03506[dD]9a00f[dD]1[eE]2[cC]9176454[aA]267424285[eE][dD][aA]18a[cC]" echo "Searching for references to the third constructor argument..." rg -A 5 "0x[bB]342[aA]793[bB][eE]112[dD]f[bB]4526[aA]a[fF]b[fF][bB][eE]55[bB][cC]3[eE]f74[cC]2[aA]1" ``` Length of output: 2822 --- Script: ```shell #!/bin/bash # Search for OrderFactory contract implementation ast-grep --pattern 'contract OrderFactory { $$$ constructor($_, $_, $_) { $$$ } $$$ }' ``` Length of output: 100 --- Script: ```shell #!/bin/bash # Find OrderFactory contract file fd OrderFactory # Search for constructor implementation in solidity files rg -A 20 "constructor.*\(" --type solidity ``` Length of output: 132 --- Script: ```shell #!/bin/bash # Read the OrderFactory contract implementation cat solidity/orders/src/OrderFactory.sol ``` Length of output: 2967

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **warden-help-center** | ⬜️ Ignored ([Inspect](https://vercel.com/qrdo-foundation/warden-help-center/6Wq66jAZsPueeo4RU3U5qLj8b9PJ)) | [Visit Preview](https://warden-help-center-git-orders-deploy-script-qrdo-foundation.vercel.app) | | Nov 22, 2024 3:35pm |