diff --git a/contracts/scripts/deployments/facets/DeployCreateSpace.s.sol b/contracts/scripts/deployments/facets/DeployCreateSpace.s.sol index 374a1d39d..7f56f0760 100644 --- a/contracts/scripts/deployments/facets/DeployCreateSpace.s.sol +++ b/contracts/scripts/deployments/facets/DeployCreateSpace.s.sol @@ -14,7 +14,20 @@ import {CreateSpaceFacet} from "contracts/src/factory/facets/create/CreateSpace. contract DeployCreateSpace is FacetHelper, Deployer { constructor() { addSelector(CreateSpaceFacet.createSpace.selector); - addSelector(CreateSpaceFacet.createSpaceWithPrepay.selector); + addSelector( + bytes4( + keccak256( + "createSpaceWithPrepay(((string,string,string,string),((string,string,uint256,uint256,uint64,address,address,uint256,address),(bool,address[],bytes,bool),string[]),(string),(uint256)))" + ) + ) + ); + addSelector( + bytes4( + keccak256( + "createSpaceWithPrepay(((string,string,string,string),((string,string,uint256,uint256,uint64,address,address,uint256,address),(bool,address[],bytes),string[]),(string),(uint256)))" + ) + ) + ); } function initializer() public pure override returns (bytes4) { diff --git a/contracts/src/factory/facets/architect/IArchitect.sol b/contracts/src/factory/facets/architect/IArchitect.sol index da1aa7f31..2799602a5 100644 --- a/contracts/src/factory/facets/architect/IArchitect.sol +++ b/contracts/src/factory/facets/architect/IArchitect.sol @@ -17,6 +17,25 @@ interface IArchitectBase { // STRUCTS // ============================================================= + struct MembershipRequirementsOld { + bool everyone; + address[] users; + bytes ruleData; + } + + struct MembershipOld { + IMembershipBase.Membership settings; + MembershipRequirementsOld requirements; + string[] permissions; + } + + struct CreateSpaceOld { + Metadata metadata; + MembershipOld membership; + ChannelInfo channel; + Prepay prepay; + } + // Latest struct MembershipRequirements { bool everyone; diff --git a/contracts/src/factory/facets/create/CreateSpace.sol b/contracts/src/factory/facets/create/CreateSpace.sol index 517fdd7d3..6cef01052 100644 --- a/contracts/src/factory/facets/create/CreateSpace.sol +++ b/contracts/src/factory/facets/create/CreateSpace.sol @@ -34,4 +34,27 @@ contract CreateSpaceFacet is ) external payable nonReentrant whenNotPaused returns (address) { return _createSpaceWithPrepay(spaceInfo); } + + function createSpaceWithPrepay( + CreateSpaceOld memory spaceInfo + ) external payable nonReentrant whenNotPaused returns (address) { + MembershipRequirements memory requirements = MembershipRequirements({ + everyone: spaceInfo.membership.requirements.everyone, + users: spaceInfo.membership.requirements.users, + ruleData: spaceInfo.membership.requirements.ruleData, + syncEntitlements: false + }); + Membership memory membership = Membership({ + settings: spaceInfo.membership.settings, + requirements: requirements, + permissions: spaceInfo.membership.permissions + }); + CreateSpace memory newSpaceInfo = CreateSpace({ + metadata: spaceInfo.metadata, + membership: membership, + channel: spaceInfo.channel, + prepay: spaceInfo.prepay + }); + return _createSpaceWithPrepay(newSpaceInfo); + } }