Skip to content

Commit

Permalink
🐛 fix deployment CVStrategy via createPool
Browse files Browse the repository at this point in the history
  • Loading branch information
kamikazebr committed Jul 30, 2024
1 parent 6c45cbd commit 3d22017
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 29 deletions.
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.

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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/ISafe.sol/ISafe.json

Large diffs are not rendered by default.

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/TERC20.sol/TERC20.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/contracts/src/BaseStrategyUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ abstract contract BaseStrategyUpgradeable is UUPSUpgradeable, IStrategy, Transfe
/// @dev Will revert if the poolId is invalid or already initialized
/// @param _poolId ID of the pool
function __BaseStrategy_init(uint256 _poolId) internal virtual onlyAllo {
//@todo rename init to InitAllo
// check if pool ID is not initialized already, if it is, revert
if (poolId != 0) revert ALREADY_INITIALIZED();

Expand Down
13 changes: 11 additions & 2 deletions pkg/contracts/src/RegistryCommunityV0_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import {ISafe} from "./interfaces/ISafe.sol";
import {RegistryFactory} from "./RegistryFactory.sol";
import {IPointStrategy, StrategyStruct, CVStrategyV0_0} from "./CVStrategyV0_0.sol";

import {Upgrades} from "@openzeppelin/foundry/LegacyUpgrades.sol";

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

contract RegistryCommunityV0_0 is
OwnableUpgradeable,
UUPSUpgradeable,
Expand Down Expand Up @@ -281,9 +285,14 @@ contract RegistryCommunityV0_0 is
returns (uint256 poolId, address strategy)
{
// address strategyClone = Clone.createClone(strategyTemplate, cloneNonce++);
address strategyClone = address(new CVStrategyV0_0());
// address strategyClone = address(new CVStrategyV0_0());
address strategyProxy = address(
new ERC1967Proxy(
address(new CVStrategyV0_0()), abi.encodeWithSelector(CVStrategyV0_0.init.selector, address(allo))
)
);

return createPool(strategyClone, _token, _params, _metadata);
return createPool(strategyProxy, _token, _params, _metadata);
}

function createPool(
Expand Down
2 changes: 1 addition & 1 deletion pkg/contracts/src/RegistryFactoryV0_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ contract RegistryFactoryV0_0 is OwnableUpgradeable, UUPSUpgradeable {
return communityToInfo[_community].fee;
}

function _authorizeUpgrade(address) internal override onlyOwner {}
function _authorizeUpgrade(address) internal virtual override onlyOwner {}

uint256[50] private __gap;
}

0 comments on commit 3d22017

Please sign in to comment.