Skip to content

Commit

Permalink
✨ RegistryFactory upgradable UUPS + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamikazebr committed Jun 19, 2024
1 parent 6ddbecb commit 7703bb1
Show file tree
Hide file tree
Showing 38 changed files with 115 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[submodule "lib/safe-contracts"]
path = lib/safe-contracts
url = https://github.com/safe-global/safe-contracts
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ src = 'pkg/contracts'
test = 'pkg/contracts/test'
out = 'pkg/contracts/out'
libs = ['lib']
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

optimizer = true
optimizer-runs = 1_000
# prompt_timeout = 120
fs_permissions = [{ access = "read", path = "./"}]
# fs_permissions = []
# auto_detect_remappings = true # recursive auto-detection of remappings
# remappings = ["ds-test/=lib/forge-std/lib/ds-test/src/",
# "forge-std/=lib/forge-std/src/",
Expand Down
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
2 changes: 2 additions & 0 deletions pkg/contracts/example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FOUNDRY_OUT=pkg/contracts/out

RPC_URL=
ALLO_PROXY=0x1133eA7Af70876e64665ecD07C0A0476d09465a1
ALLO_IMPL=0xB087535DB0df98fC4327136e897A5985E5Cfbd66
Expand Down
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: 0 additions & 1 deletion pkg/contracts/out/ERC20/ERC20.sol/ERC20.json

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ERC20/IERC20.sol/IERC20.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/IAllo.sol/IAllo.json

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IERC20Metadata.sol/IERC20Metadata.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.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IRegistry.sol/IRegistry.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/=lib/allo-v2/lib/openzeppelin-contracts/contracts/\",\":@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/allo-v2/lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":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/\",\":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/=lib/allo-v2/lib/openzeppelin-contracts/contracts/","@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/allo-v2/lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","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/","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},"id":110}
{"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":75800,"exportedSymbols":{"ISafe":[75799]},"nodeType":"SourceUnit","src":"42:113:128","nodes":[{"id":75792,"nodeType":"PragmaDirective","src":"42:24:128","nodes":[],"literals":["solidity","^","0.8",".19"]},{"id":75799,"nodeType":"ContractDefinition","src":"68:86:128","nodes":[{"id":75798,"nodeType":"FunctionDefinition","src":"90:62:128","nodes":[],"functionSelector":"a0e67e2b","implemented":false,"kind":"function","modifiers":[],"name":"getOwners","nameLocation":"99:9:128","parameters":{"id":75793,"nodeType":"ParameterList","parameters":[],"src":"108:2:128"},"returnParameters":{"id":75797,"nodeType":"ParameterList","parameters":[{"constant":false,"id":75796,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":75798,"src":"134:16:128","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":75794,"name":"address","nodeType":"ElementaryTypeName","src":"134:7:128","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":75795,"nodeType":"ArrayTypeName","src":"134:9:128","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"133:18:128"},"scope":75799,"stateMutability":"view","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[],"canonicalName":"ISafe","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"linearizedBaseContracts":[75799],"name":"ISafe","nameLocation":"78:5:128","scope":75800,"usedErrors":[]}],"license":"LGPL-3.0-only"},"id":128}
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.

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.

Loading

0 comments on commit 7703bb1

Please sign in to comment.