Skip to content

Commit

Permalink
⚡ RegistryCommunityV0_0 upgradable
Browse files Browse the repository at this point in the history
⚡ Factory createRegistry changed
⚡ more Natspec
⚡ adapt tests file
  • Loading branch information
kamikazebr committed Jul 2, 2024
1 parent 59feff0 commit 28ae2f7
Show file tree
Hide file tree
Showing 29 changed files with 82 additions and 43 deletions.
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
Submodule openzeppelin-contracts updated 42 files
+1 −1 .github/actions/setup/action.yml
+5 −3 .github/workflows/checks.yml
+2 −6 .github/workflows/release-cycle.yml
+0 −26 CHANGELOG.md
+3 −89 contracts/governance/Governor.sol
+10 −21 contracts/metatx/ERC2771Context.sol
+0 −19 contracts/mocks/Base64Dirty.sol
+0 −6 contracts/mocks/ContextMock.sol
+1 −6 contracts/mocks/ERC2771ContextMock.sol
+23 −36 contracts/mocks/docs/ERC4626Fees.sol
+0 −88 contracts/mocks/docs/governance/MyGovernor.sol
+0 −24 contracts/mocks/docs/governance/MyToken.sol
+0 −35 contracts/mocks/docs/governance/MyTokenTimestampBased.sol
+0 −31 contracts/mocks/docs/governance/MyTokenWrapped.sol
+10 −10 contracts/mocks/token/ERC4646FeesMock.sol
+1 −1 contracts/mocks/wizard/MyGovernor3.sol
+1 −1 contracts/package.json
+3 −5 contracts/token/ERC20/README.adoc
+4 −4 contracts/token/ERC20/extensions/ERC20Permit.sol
+1 −31 contracts/token/ERC20/extensions/IERC20Permit.sol
+3 −3 contracts/token/ERC20/utils/SafeERC20.sol
+10 −19 contracts/utils/Base64.sol
+1 −5 contracts/utils/Context.sol
+3 −17 contracts/utils/Multicall.sol
+3 −7 contracts/utils/cryptography/MerkleProof.sol
+1 −0 docs/modules/ROOT/nav.adoc
+1 −1 docs/modules/ROOT/pages/crosschain.adoc
+195 −4 docs/modules/ROOT/pages/governance.adoc
+0 −2 docs/modules/ROOT/pages/index.adoc
+15 −0 docs/modules/ROOT/pages/wizard.adoc
+22 −12 hardhat/task-test-get-files.js
+2 −2 package-lock.json
+1 −1 package.json
+5 −8 scripts/prepare-docs.sh
+24 −0 scripts/release/workflow/prepare-release-merge.sh
+2 −8 scripts/release/workflow/publish.sh
+0 −55 test/governance/Governor.t.sol
+0 −83 test/governance/Governor.test.js
+0 −74 test/metatx/ERC2771Context.test.js
+3 −3 test/token/ERC20/extensions/ERC4626.test.js
+1 −11 test/utils/Base64.test.js
+4 −24 test/utils/cryptography/MerkleProof.test.js
2 changes: 1 addition & 1 deletion pkg/contracts/out/Allo.sol/Allo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CVStrategy.sol/CVStrategy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CVStrategy.sol/IPointStrategy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CVStrategy.sol/StrategyStruct.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ERC20.sol/ERC20.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/contracts/out/FAllo.sol/FAllo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/GV2ERC20.sol/GV2ERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IERC20Permit.sol/IERC20Permit.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ISafe.sol/ISafe.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"abi":[{"type":"function","name":"getOwners","inputs":[],"outputs":[{"name":"","type":"address[]","internalType":"address[]"}],"stateMutability":"view"}],"bytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"deployedBytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"methodIdentifiers":{"getOwners()":"a0e67e2b"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"getOwners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"pkg/contracts/src/ISafe.sol\":\"ISafe\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@openzeppelin/foundry/=lib/openzeppelin-foundry-upgrades/src/\",\":@prb/math/=lib/allo-v2/lib/v2-core/lib/prb-math/\",\":@prb/test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/\",\":@sablier/v2-core/=lib/allo-v2/lib/v2-core/\",\":ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/\",\":allo-v2-contracts/=lib/allo-v2/contracts/\",\":allo-v2-test/=lib/allo-v2/test/\",\":allo-v2/=lib/allo-v2/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":eas-contracts/=lib/allo-v2/lib/eas-contracts/contracts/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/allo-v2/lib/permit2/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":hats-protocol/=lib/allo-v2/lib/hats-protocol/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/\",\":openzeppelin/=lib/openzeppelin-contracts/contracts/\",\":permit2/=lib/allo-v2/lib/permit2/\",\":prb-math/=lib/allo-v2/lib/v2-core/lib/prb-math/src/\",\":prb-test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/\",\":safe-contracts/=lib/safe-contracts/\",\":solady/=lib/allo-v2/lib/solady/\",\":solarray/=lib/allo-v2/lib/v2-core/lib/solarray/src/\",\":solbase/=lib/allo-v2/lib/hats-protocol/lib/solbase/src/\",\":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/\",\":solmate/=lib/allo-v2/lib/permit2/lib/solmate/\",\":utils/=lib/allo-v2/lib/hats-protocol/lib/utils/\",\":v2-core/=lib/allo-v2/lib/v2-core/\"]},\"sources\":{\"pkg/contracts/src/ISafe.sol\":{\"keccak256\":\"0x878a210809bb684c42157a10f3f90350a67d0a4863f130499942b06f0f2c9143\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fa2d71bd427c3415e98a2ee15ff673f3cc61c17f14d7087c5eedc83b55f6b0ef\",\"dweb:/ipfs/QmesVSmJQQzi6ys1cvhQFCJyDXchb736mT5bXks4Yp6Cbj\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.19+commit.7dd6d404"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"view","type":"function","name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}]}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@openzeppelin/foundry/=lib/openzeppelin-foundry-upgrades/src/","@prb/math/=lib/allo-v2/lib/v2-core/lib/prb-math/","@prb/test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/","@sablier/v2-core/=lib/allo-v2/lib/v2-core/","ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/","allo-v2-contracts/=lib/allo-v2/contracts/","allo-v2-test/=lib/allo-v2/test/","allo-v2/=lib/allo-v2/","ds-test/=lib/forge-std/lib/ds-test/src/","eas-contracts/=lib/allo-v2/lib/eas-contracts/contracts/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/allo-v2/lib/permit2/lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","hats-protocol/=lib/allo-v2/lib/hats-protocol/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/","openzeppelin/=lib/openzeppelin-contracts/contracts/","permit2/=lib/allo-v2/lib/permit2/","prb-math/=lib/allo-v2/lib/v2-core/lib/prb-math/src/","prb-test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/","safe-contracts/=lib/safe-contracts/","solady/=lib/allo-v2/lib/solady/","solarray/=lib/allo-v2/lib/v2-core/lib/solarray/src/","solbase/=lib/allo-v2/lib/hats-protocol/lib/solbase/src/","solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/","solmate/=lib/allo-v2/lib/permit2/lib/solmate/","utils/=lib/allo-v2/lib/hats-protocol/lib/utils/","v2-core/=lib/allo-v2/lib/v2-core/"],"optimizer":{"enabled":true,"runs":1000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"pkg/contracts/src/ISafe.sol":"ISafe"},"evmVersion":"paris","libraries":{}},"sources":{"pkg/contracts/src/ISafe.sol":{"keccak256":"0x878a210809bb684c42157a10f3f90350a67d0a4863f130499942b06f0f2c9143","urls":["bzz-raw://fa2d71bd427c3415e98a2ee15ff673f3cc61c17f14d7087c5eedc83b55f6b0ef","dweb:/ipfs/QmesVSmJQQzi6ys1cvhQFCJyDXchb736mT5bXks4Yp6Cbj"],"license":"LGPL-3.0-only"}},"version":1},"storageLayout":{"storage":[],"types":{}},"ast":{"absolutePath":"pkg/contracts/src/ISafe.sol","id":75579,"exportedSymbols":{"ISafe":[75578]},"nodeType":"SourceUnit","src":"42:113:127","nodes":[{"id":75571,"nodeType":"PragmaDirective","src":"42:24:127","nodes":[],"literals":["solidity","^","0.8",".19"]},{"id":75578,"nodeType":"ContractDefinition","src":"68:86:127","nodes":[{"id":75577,"nodeType":"FunctionDefinition","src":"90:62:127","nodes":[],"functionSelector":"a0e67e2b","implemented":false,"kind":"function","modifiers":[],"name":"getOwners","nameLocation":"99:9:127","parameters":{"id":75572,"nodeType":"ParameterList","parameters":[],"src":"108:2:127"},"returnParameters":{"id":75576,"nodeType":"ParameterList","parameters":[{"constant":false,"id":75575,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":75577,"src":"134:16:127","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":75573,"name":"address","nodeType":"ElementaryTypeName","src":"134:7:127","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":75574,"nodeType":"ArrayTypeName","src":"134:9:127","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"133:18:127"},"scope":75578,"stateMutability":"view","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[],"canonicalName":"ISafe","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"linearizedBaseContracts":[75578],"name":"ISafe","nameLocation":"78:5:127","scope":75579,"usedErrors":[]}],"license":"LGPL-3.0-only"},"id":127}
{"abi":[{"type":"function","name":"getOwners","inputs":[],"outputs":[{"name":"","type":"address[]","internalType":"address[]"}],"stateMutability":"view"}],"bytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"deployedBytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"methodIdentifiers":{"getOwners()":"a0e67e2b"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"getOwners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"pkg/contracts/src/interfaces/ISafe.sol\":\"ISafe\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@openzeppelin/foundry/=lib/openzeppelin-foundry-upgrades/src/\",\":@prb/math/=lib/allo-v2/lib/v2-core/lib/prb-math/\",\":@prb/test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/\",\":@sablier/v2-core/=lib/allo-v2/lib/v2-core/\",\":ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/\",\":allo-v2-contracts/=lib/allo-v2/contracts/\",\":allo-v2-test/=lib/allo-v2/test/\",\":allo-v2/=lib/allo-v2/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":eas-contracts/=lib/allo-v2/lib/eas-contracts/contracts/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/allo-v2/lib/permit2/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":hats-protocol/=lib/allo-v2/lib/hats-protocol/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/\",\":openzeppelin/=lib/openzeppelin-contracts/contracts/\",\":permit2/=lib/allo-v2/lib/permit2/\",\":prb-math/=lib/allo-v2/lib/v2-core/lib/prb-math/src/\",\":prb-test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/\",\":safe-contracts/=lib/safe-contracts/\",\":solady/=lib/allo-v2/lib/solady/\",\":solarray/=lib/allo-v2/lib/v2-core/lib/solarray/src/\",\":solbase/=lib/allo-v2/lib/hats-protocol/lib/solbase/src/\",\":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/\",\":solmate/=lib/allo-v2/lib/permit2/lib/solmate/\",\":utils/=lib/allo-v2/lib/hats-protocol/lib/utils/\",\":v2-core/=lib/allo-v2/lib/v2-core/\"]},\"sources\":{\"pkg/contracts/src/interfaces/ISafe.sol\":{\"keccak256\":\"0x878a210809bb684c42157a10f3f90350a67d0a4863f130499942b06f0f2c9143\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fa2d71bd427c3415e98a2ee15ff673f3cc61c17f14d7087c5eedc83b55f6b0ef\",\"dweb:/ipfs/QmesVSmJQQzi6ys1cvhQFCJyDXchb736mT5bXks4Yp6Cbj\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.19+commit.7dd6d404"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"view","type":"function","name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}]}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@openzeppelin/foundry/=lib/openzeppelin-foundry-upgrades/src/","@prb/math/=lib/allo-v2/lib/v2-core/lib/prb-math/","@prb/test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/","@sablier/v2-core/=lib/allo-v2/lib/v2-core/","ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/","allo-v2-contracts/=lib/allo-v2/contracts/","allo-v2-test/=lib/allo-v2/test/","allo-v2/=lib/allo-v2/","ds-test/=lib/forge-std/lib/ds-test/src/","eas-contracts/=lib/allo-v2/lib/eas-contracts/contracts/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/allo-v2/lib/permit2/lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","hats-protocol/=lib/allo-v2/lib/hats-protocol/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/","openzeppelin/=lib/openzeppelin-contracts/contracts/","permit2/=lib/allo-v2/lib/permit2/","prb-math/=lib/allo-v2/lib/v2-core/lib/prb-math/src/","prb-test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/","safe-contracts/=lib/safe-contracts/","solady/=lib/allo-v2/lib/solady/","solarray/=lib/allo-v2/lib/v2-core/lib/solarray/src/","solbase/=lib/allo-v2/lib/hats-protocol/lib/solbase/src/","solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/","solmate/=lib/allo-v2/lib/permit2/lib/solmate/","utils/=lib/allo-v2/lib/hats-protocol/lib/utils/","v2-core/=lib/allo-v2/lib/v2-core/"],"optimizer":{"enabled":true,"runs":1000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"pkg/contracts/src/interfaces/ISafe.sol":"ISafe"},"evmVersion":"paris","libraries":{}},"sources":{"pkg/contracts/src/interfaces/ISafe.sol":{"keccak256":"0x878a210809bb684c42157a10f3f90350a67d0a4863f130499942b06f0f2c9143","urls":["bzz-raw://fa2d71bd427c3415e98a2ee15ff673f3cc61c17f14d7087c5eedc83b55f6b0ef","dweb:/ipfs/QmesVSmJQQzi6ys1cvhQFCJyDXchb736mT5bXks4Yp6Cbj"],"license":"LGPL-3.0-only"}},"version":1},"storageLayout":{"storage":[],"types":{}},"ast":{"absolutePath":"pkg/contracts/src/interfaces/ISafe.sol","id":80233,"exportedSymbols":{"ISafe":[80232]},"nodeType":"SourceUnit","src":"42:113:135","nodes":[{"id":80225,"nodeType":"PragmaDirective","src":"42:24:135","nodes":[],"literals":["solidity","^","0.8",".19"]},{"id":80232,"nodeType":"ContractDefinition","src":"68:86:135","nodes":[{"id":80231,"nodeType":"FunctionDefinition","src":"90:62:135","nodes":[],"functionSelector":"a0e67e2b","implemented":false,"kind":"function","modifiers":[],"name":"getOwners","nameLocation":"99:9:135","parameters":{"id":80226,"nodeType":"ParameterList","parameters":[],"src":"108:2:135"},"returnParameters":{"id":80230,"nodeType":"ParameterList","parameters":[{"constant":false,"id":80229,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":80231,"src":"134:16:135","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":80227,"name":"address","nodeType":"ElementaryTypeName","src":"134:7:135","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":80228,"nodeType":"ArrayTypeName","src":"134:9:135","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"133:18:135"},"scope":80232,"stateMutability":"view","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[],"canonicalName":"ISafe","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"linearizedBaseContracts":[80232],"name":"ISafe","nameLocation":"78:5:135","scope":80233,"usedErrors":[]}],"license":"LGPL-3.0-only"},"id":135}
2 changes: 1 addition & 1 deletion pkg/contracts/out/MockERC20.sol/MockERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/PassportScorer.sol/PassportScorer.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/Registry.sol/Registry.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/RegistryCommunity.sol/FAllo.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/RegistryFactory.sol/RegistryFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/RegistrySetup.sol/RegistrySetup.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/RegistrySetup.sol/RegistrySetupFull.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/SafeERC20.sol/SafeERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/TERC20.sol/TERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/src/RegistryCommunity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.
import {IRegistry, Metadata} from "allo-v2-contracts/core/interfaces/IRegistry.sol";
import {IAllo} from "allo-v2-contracts/core/interfaces/IAllo.sol";
import {RegistryFactory} from "./RegistryFactory.sol";
import {ISafe} from "./ISafe.sol";
import {ISafe} from "./interfaces/ISafe.sol";
// import {Safe} from "safe-contracts/contracts/Safe.sol";
import "forge-std/console.sol";
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
Expand Down
36 changes: 30 additions & 6 deletions pkg/contracts/src/RegistryCommunityV0_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ import {ISafe} from "./interfaces/ISafe.sol";
import {RegistryFactory} from "./RegistryFactory.sol";
import {IPointStrategy, CVStrategy, StrategyStruct} from "./CVStrategy.sol";

contract RegistryCommunity is UUPSUpgradeable, ReentrancyGuardUpgradeable, AccessControlUpgradeable {
contract RegistryCommunityV0_0 is
OwnableUpgradeable,
UUPSUpgradeable,
ReentrancyGuardUpgradeable,
AccessControlUpgradeable
{
using ERC165Checker for address;
using SafeERC20 for IERC20;
using Clone for address;
Expand Down Expand Up @@ -187,11 +192,25 @@ contract RegistryCommunity is UUPSUpgradeable, ReentrancyGuardUpgradeable, Acces
address[] strategies;
}

/// @notice Initialize the contract with the required parameters
/// @param _allo The Allo contract address
/// @param _gardenToken The token used to stake in the community
/// @param _registerStakeAmount The amount of tokens required to register a member
/// @param _communityFee The fee charged to the community for each registration
/// @param _nonce The nonce used to create new profiles in the Allo Registry
/// @param _registryFactory The address of the registry factory
/// @param _feeReceiver The address that receives the community fee
/// @param _metadata The covenant IPFS hash of community
/// @param _councilSafe The council safe contract address
/// @param _communityName The community name
/// @param _isKickEnabled Enable or disable the kick feature
/// @param covenantIpfsHash The covenant IPFS hash of community
/// @param _strategyTemplate The address of the strategy template
struct InitializeParams {
address _allo;
IERC20 _gardenToken;
uint256 _registerStakeAmount;
uint256 _communityFee; //@todo if remove the protocol fee, also remove it here
uint256 _communityFee;
uint256 _nonce;
address _registryFactory;
address _feeReceiver;
Expand All @@ -203,12 +222,13 @@ contract RegistryCommunity is UUPSUpgradeable, ReentrancyGuardUpgradeable, Acces
address _strategyTemplate;
}

constructor() {
// _grantRole(DEFAULT_ADMIN_ROLE, address(this));
function initialize(RegistryCommunityV0_0.InitializeParams memory params) public initializer {
__Ownable_init();
__ReentrancyGuard_init();
__AccessControl_init();

_setRoleAdmin(COUNCIL_MEMBER, DEFAULT_ADMIN_ROLE);
}

function initialize(RegistryCommunity.InitializeParams memory params) public {
_revertZeroAddress(address(params._gardenToken));
_revertZeroAddress(params._councilSafe);
_revertZeroAddress(params._allo);
Expand Down Expand Up @@ -586,4 +606,8 @@ contract RegistryCommunity is UUPSUpgradeable, ReentrancyGuardUpgradeable, Acces
gardenToken.transfer(_transferAddress, member.stakedAmount);
emit MemberKicked(_member, _transferAddress, member.stakedAmount);
}

function _authorizeUpgrade(address) internal override onlyOwner {}

uint256[50] private __gap;
}
16 changes: 12 additions & 4 deletions pkg/contracts/src/RegistryFactoryV0_0.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.19;

import {RegistryCommunity} from "../src/RegistryCommunity.sol";
import {RegistryCommunityV0_0} from "../src/RegistryCommunityV0_0.sol";

import {RegistryFactory} from "../src/RegistryFactory.sol";

import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";

import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

struct CommunityInfo {
uint256 fee;
bool valid;
Expand Down Expand Up @@ -51,16 +53,22 @@ contract RegistryFactoryV0_0 is OwnableUpgradeable, UUPSUpgradeable {
// setReceiverAddress(_gardensFeeReceiver); //onlyOwner
}

function createRegistry(RegistryCommunity.InitializeParams memory params)
function createRegistry(RegistryCommunityV0_0.InitializeParams memory params)
public
virtual
returns (address _createdRegistryAddress)
{
RegistryCommunity registryCommunity = new RegistryCommunity();
params._nonce = nonce++;
params._registryFactory = address(this);

registryCommunity.initialize(params);
ERC1967Proxy proxy = new ERC1967Proxy(
address(new RegistryCommunityV0_0()),
abi.encodeWithSelector(RegistryCommunityV0_0.initialize.selector, params)
);

RegistryCommunityV0_0 registryCommunity = RegistryCommunityV0_0(payable(address(proxy)));

// registryCommunity.initialize(params);
communityToInfo[address(registryCommunity)].valid = true;
emit CommunityCreated(address(registryCommunity));
return address(registryCommunity);
Expand Down
Loading

0 comments on commit 28ae2f7

Please sign in to comment.