-
Notifications
You must be signed in to change notification settings - Fork 20
add: update ipfs by manager + new registerapp #302
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,14 @@ import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/ac | |
| import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
|
|
||
| import "../Interfaces.sol"; | ||
| import "../GoodCollective/GoodCollectiveSuperApp.sol"; | ||
| import "../GoodCollective/SuperAppBaseFlow.sol"; | ||
|
|
||
| // import "hardhat/console.sol"; | ||
|
|
||
| contract UBIPoolFactory is AccessControlUpgradeable, UUPSUpgradeable { | ||
| error NOT_PROJECT_OWNER(); | ||
| error NOT_PROJECT_MANAGER(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Review error usage for consistency with new access control. Update all revert statements and error handling to use NOT_PROJECT_MANAGER where appropriate, and remove outdated errors that are no longer relevant to the new access control logic. Suggested implementation:
|
||
| error NOT_POOL(); | ||
|
|
||
| event PoolCreated( | ||
|
|
@@ -58,8 +61,8 @@ contract UBIPoolFactory is AccessControlUpgradeable, UUPSUpgradeable { | |
| _; | ||
| } | ||
|
|
||
| modifier onlyPoolOwner(UBIPool pool) { | ||
| if (pool.hasRole(pool.DEFAULT_ADMIN_ROLE(), msg.sender) == false) { | ||
| modifier onlyPoolManager(UBIPool pool) { | ||
| if (pool.hasRole(pool.MANAGER_ROLE(), msg.sender) == false) { | ||
| revert NOT_PROJECT_OWNER(); | ||
| } | ||
|
|
||
|
|
@@ -121,6 +124,9 @@ contract UBIPoolFactory is AccessControlUpgradeable, UUPSUpgradeable { | |
| pool = UBIPool(address(new ERC1967Proxy(impl.implementation(), initCall))); | ||
| } | ||
|
|
||
| // Register the app with the host | ||
| IRegisterSuperapp(address(pool.host())).registerApp(address(pool), SuperAppDefinitions.APP_LEVEL_FINAL); | ||
|
|
||
| //access control to project is determinted by the first pool access control rules | ||
| if (address(projectIdToControlPool[keccak256(bytes(_projectId))]) == address(0)) | ||
| projectIdToControlPool[keccak256(bytes(_projectId))] = pool; | ||
|
|
@@ -134,7 +140,7 @@ contract UBIPoolFactory is AccessControlUpgradeable, UUPSUpgradeable { | |
| emit PoolCreated(address(pool), _projectId, _ipfs, _settings, _limits); | ||
| } | ||
|
|
||
| function changePoolDetails(UBIPool _pool, string memory _ipfs) external onlyPoolOwner(_pool) { | ||
| function changePoolDetails(UBIPool _pool, string memory _ipfs) external onlyPoolManager(_pool) { | ||
| registry[address(_pool)].ipfs = _ipfs; | ||
| emit PoolDetailsChanged(address(_pool), _ipfs); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ const config: HardhatUserConfig = { | |
| 'production-celo': { | ||
| chainId: 42220, | ||
| url: `https://forno.celo.org`, | ||
| gasPrice: 5000000000, | ||
| gasPrice: 25.1e9, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excessive Gas Price Increase
Tell me moreWhat is the issue?The gas price modification from 5000000000 to 25.1e9 for Celo networks represents a significant increase (about 5x) which could lead to unnecessarily expensive transactions. Why this mattersHigher gas prices will result in increased transaction costs for users, potentially making the system prohibitively expensive to use. The original gas price was already sufficient for most Celo transactions. Suggested change ∙ Feature PreviewMaintain the previous gas price or use a more moderate increase. Example: gasPrice: 10000000000, // 10 gweiProvide feedback to improve future suggestions💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
| accounts: [privateKey], | ||
| verify: { | ||
| etherscan: { | ||
|
|
@@ -94,7 +94,7 @@ const config: HardhatUserConfig = { | |
| 'development-celo': { | ||
| chainId: 42220, | ||
| url: `https://forno.celo.org`, | ||
| gasPrice: 5000000000, | ||
| gasPrice: 25.1e9, | ||
| accounts: { | ||
| mnemonic, | ||
| }, | ||
|
|
||
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.
nitpick: Commented-out registration logic may cause confusion.
If registration is managed elsewhere, please remove these commented lines or add a brief note clarifying the change.