-
Notifications
You must be signed in to change notification settings - Fork 82
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
refactor: prepare SingleRequestFactory
for deployment with Request Deployer
#1473
refactor: prepare SingleRequestFactory
for deployment with Request Deployer
#1473
Conversation
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Outside diff range comments (1)
packages/smart-contracts/test/contracts/SingleRequestProxyFactory.test.ts (1)
Line range hint
1-214
: LGTM! Consider adding a test for the new constructor parameter.The test file provides comprehensive coverage of the
SingleRequestProxyFactory
functionalities, including proxy creation, fee proxy updates, and ownership management. The existing tests align well with the contract's features and the recent changes.For consistency and to fully cover the recent changes, consider adding a specific test case for the new constructor parameter. This test should verify that attempting to deploy the
SingleRequestProxyFactory
with an invalid owner address (e.g., zero address) results in a revert. For example:it('should revert when deploying with zero address as owner', async () => { const SingleRequestProxyFactoryFactory = await ethers.getContractFactory( 'SingleRequestProxyFactory', ); await expect( SingleRequestProxyFactoryFactory.deploy( ethereumFeeProxy.address, erc20FeeProxy.address, ethers.constants.AddressZero ) ).to.be.revertedWith('Owner address cannot be zero'); });This addition would ensure that the new constructor parameter is thoroughly tested, including its error handling.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (4)
- packages/smart-contracts/scripts-create2/constructor-args.ts (1 hunks)
- packages/smart-contracts/scripts-create2/verify.ts (1 hunks)
- packages/smart-contracts/src/contracts/SingleRequestProxyFactory.sol (1 hunks)
- packages/smart-contracts/test/contracts/SingleRequestProxyFactory.test.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/smart-contracts/src/contracts/SingleRequestProxyFactory.sol (1)
Learnt from: MantisClone PR: RequestNetwork/requestNetwork#1453 File: packages/smart-contracts/src/contracts/SingleRequestProxyFactory.sol:0-0 Timestamp: 2024-09-27T11:42:01.062Z Learning: In the `createEthereumSingleRequestProxy` function, it's acceptable for `_feeAddress` to be the zero address, as setting the fee address to zero is a common practice. Adding zero address checks is unnecessary and adds extra gas cost.
🔇 Additional comments (1)
packages/smart-contracts/src/contracts/SingleRequestProxyFactory.sol (1)
Line range hint
44-120
: LGTM! Unchanged parts are consistent with previous learnings.The rest of the file remains unchanged, which is consistent with the PR objectives. I noticed that the
createEthereumSingleRequestProxy
function allows_feeAddress
to be zero, which aligns with the previous learning:In the
createEthereumSingleRequestProxy
function, it's acceptable for_feeAddress
to be the zero address, as setting the fee address to zero is a common practice. Adding zero address checks is unnecessary and adds extra gas cost.This approach maintains consistency and optimizes gas usage.
packages/smart-contracts/test/contracts/SingleRequestProxyFactory.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work resolving the CodeRabbit comments with explanations!
Refactor the
SingleRequestProxyFactory
to be deployed by using the Request Deployer.transferOwnership
to construct to have the correct owner of smart contract instead of Request Deployer.SingleRequestProxyFactory
to verify methodSummary by CodeRabbit
New Features
SingleRequestProxyFactory
contract now includes an owner parameter for improved ownership management.SingleRequestProxyFactory
.Bug Fixes
Tests