Skip to content

Commit

Permalink
Merge branch 'main' into brian/stream-async-unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
mechanical-turk authored Oct 18, 2024
2 parents 112f40c + 8bee2cb commit a6e1394
Show file tree
Hide file tree
Showing 208 changed files with 6,538 additions and 4,310 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/Stream_metadata_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
- 'packages/stream-metadata/**'
- 'packages/**'
workflow_dispatch:
inputs:
is_latest: # This is a boolean input
description: 'Add docker:latest tag'
required: true
default: false
type: boolean

env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CD_WORKFLOW_WEBHOOK_URL }}
Expand Down Expand Up @@ -45,6 +51,7 @@ jobs:
#This can be custom alias once requested to aws and approved for public repo
REGISTRY_ALIAS: h5v6m2x1
ECR_REPOSITORY: river-stream-metadata
IS_LATEST_OR_PUSH: ${{ github.event_name == 'push' || github.event.inputs.is_latest }}
run: |
docker build \
--build-arg GIT_SHA=${{ github.sha }} \
Expand All @@ -53,7 +60,13 @@ jobs:
-t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:${{ github.sha }} \
.
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest
if [ $IS_LATEST_OR_PUSH == true ]; then
echo "Pushing docker image with latest tag"
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest
else
echo "Not pushing docker image with latest tag"
fi
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:${{ github.sha }}
# If action failed, we send a slack notification
Expand Down
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
{
"label": "Casablanca",
"type": "shell",
"command": "sleep 3 && cd ./core && just RUN_ENV=multi start",
"command": "sleep 3 && cd ./core && just RUN_ENV=multi run-and-tail",
"isBackground": true,
"problemMatcher": [],
"presentation": {
Expand All @@ -185,7 +185,7 @@
{
"label": "Casablanca-No-Entitlements",
"type": "shell",
"command": "sleep 5 && cd ./core && just RUN_ENV=multi_ne start",
"command": "sleep 5 && cd ./core && just RUN_ENV=multi_ne run-and-tail",
"isBackground": true,
"problemMatcher": [],
"presentation": {
Expand Down Expand Up @@ -219,7 +219,7 @@
{
"label": "Casablanca-Multinode",
"type": "shell",
"command": "cd ./core && just RUN_ENV=multi start",
"command": "cd ./core && just RUN_ENV=multi run-and-tail",
"isBackground": true,
"problemMatcher": [],
"presentation": {
Expand All @@ -229,7 +229,7 @@
{
"label": "Casablanca-Multinode-No-Entitlements",
"type": "shell",
"command": "cd ./core && just RUN_ENV=multi_ne start",
"command": "cd ./core && just RUN_ENV=multi_ne run-and-tail",
"isBackground": true,
"problemMatcher": [],
"presentation": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0xdE75E5Eb70ddcE78Ed96E2E6289435C69eEb4F10"
"address": "0x5EbB278B1f1AF4b73380B288F5B03E326E95B120"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0x7919b43511f59F5a27EB9FCec4FAf8FDC05b8A58"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x4c26Cf67dfEd33bc7184D30707eFbA3118202b00"
"address": "0xe81d32064F7d10FB42CC2694937d5de237b0abDc"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x15F3F59504ba9a40A7548C801Ffa590c12D6b48b"
"address": "0x5858Dcfcf44C0e80a1b011981d4E915366E3208b"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x3522A654E5F38E6Edb79190F09B101b88BE4274C"
"address": "0x133dF69F7640F6d4866CC5AD4023e343511217a4"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x95f055eFE9bF04cFA2b2653b80784130d451571A"
"address": "0xa01376a3B6537659adCCA5548455270aa61389b5"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0x770d5C42A39ff15B3a5d716DbE357ad92ce39E05"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x896134e3D319091B299002C134E16153184A8056"
"address": "0xA20d7Ced36d50ca7E620A0885518D8390909A367"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x08C6583c10E24788B3a2558c38a9276B19FF897e"
"address": "0x9bD457ccD3F343710Bf6B55526BB67434b6C18e4"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0xCA3bdcb3deA29a92aFEA4f6153D39b173a617d3b"
"address": "0xA4DdC6C2B372039d23A1c07AbA644379d5b53A8c"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x8e405F31C317C6690BDBE8208687F4d7F92C84b2"
"address": "0x6a31f9c0b5cD3457Df2EEc437ef877Ee56900D37"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0x63D7cd7e7B4D662bB46621dDB79c3EA7865dA3e8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0xFc470255d722ccC8d110355C09d8A5bB2abB4831"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0xaB568DFD469AaCa1B6ab39EEA4974B8Eb8Dc9E4F"
"address": "0xf90432685b1B967EC5fB7769FD5faFbEdC61aeAC"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x0E4A2488266C77A9189c5EFdeF8b9055eDc0200e"
"address": "0x8847Bcd893E7Face7F8Baf40D4a8056e4Ada98f3"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"address": "0x0748AE219D4bdE9C8775f7283DBA2f21320e5B83"
"address": "0xA579E89b05F31FC65CE8017E1bAeDAA41f4b8013"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0xDCc88702F3c10043285860eFD988b28fBc71D2A5"
}
3 changes: 3 additions & 0 deletions contracts/deployments/omega/base/addresses/rolesFacet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"address": "0x0D4643EB0133555e486538CB87083F6f84A56551"
}
18 changes: 18 additions & 0 deletions contracts/scripts/deployments/diamonds/DeploySpaceFactory.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {DeployDiamondLoupe} from "contracts/scripts/deployments/facets/DeployDia
import {DeployIntrospection} from "contracts/scripts/deployments/facets/DeployIntrospection.s.sol";
import {DeployMetadata} from "contracts/scripts/deployments/facets/DeployMetadata.s.sol";
import {DeployArchitect} from "contracts/scripts/deployments/facets/DeployArchitect.s.sol";
import {DeployCreateSpace} from "contracts/scripts/deployments/facets/DeployCreateSpace.s.sol";
import {DeployProxyManager} from "contracts/scripts/deployments/facets/DeployProxyManager.s.sol";

import {DeployUserEntitlement} from "contracts/scripts/deployments/utils/DeployUserEntitlement.s.sol";
Expand Down Expand Up @@ -56,6 +57,7 @@ contract DeploySpaceFactory is DiamondHelper, Deployer {

// facets
DeployArchitect architectHelper = new DeployArchitect();
DeployCreateSpace createSpaceHelper = new DeployCreateSpace();
DeployPricingModules pricingModulesHelper = new DeployPricingModules();
DeployImplementationRegistry registryHelper =
new DeployImplementationRegistry();
Expand Down Expand Up @@ -98,6 +100,7 @@ contract DeploySpaceFactory is DiamondHelper, Deployer {

// space addresses
address architect;
address create;
address legacyArchitect;
address proxyManager;
address pausable;
Expand Down Expand Up @@ -179,6 +182,7 @@ contract DeploySpaceFactory is DiamondHelper, Deployer {
) public returns (Diamond.InitParams memory) {
metadata = metadataHelper.deploy(deployer);
architect = architectHelper.deploy(deployer);
create = createSpaceHelper.deploy(deployer);
registry = registryHelper.deploy(deployer);
walletLink = walletLinkHelper.deploy(deployer);
proxyManager = proxyManagerHelper.deploy(deployer);
Expand Down Expand Up @@ -212,6 +216,11 @@ contract DeploySpaceFactory is DiamondHelper, Deployer {
legacyRuleEntitlement // legacyRuleEntitlement
)
);
addFacet(
createSpaceHelper.makeCut(create, IDiamond.FacetCutAction.Add),
create,
createSpaceHelper.makeInitData("")
);
addFacet(
deployMockLegacyArchitect.makeCut(
legacyArchitect,
Expand Down Expand Up @@ -406,6 +415,15 @@ contract DeploySpaceFactory is DiamondHelper, Deployer {
partnerRegistry,
partnerRegistryHelper.makeInitData("")
);
} else if (
facetNameHash == keccak256(abi.encodePacked("CreateSpaceFacet"))
) {
create = createSpaceHelper.deploy(deployer);
addFacet(
createSpaceHelper.makeCut(create, IDiamond.FacetCutAction.Add),
create,
createSpaceHelper.makeInitData("")
);
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/scripts/deployments/facets/DeployArchitect.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import {FacetHelper} from "contracts/test/diamond/Facet.t.sol";

contract DeployArchitect is FacetHelper, Deployer {
constructor() {
addSelector(IArchitect.createSpace.selector);
addSelector(IArchitect.getSpaceByTokenId.selector);
addSelector(IArchitect.getTokenIdBySpace.selector);
addSelector(IArchitect.setSpaceArchitectImplementations.selector);
addSelector(IArchitect.getSpaceArchitectImplementations.selector);
addSelector(IArchitect.createSpaceWithPrepay.selector);
addSelector(IArchitect.setProxyInitializer.selector);
addSelector(IArchitect.getProxyInitializer.selector);
}
Expand Down
47 changes: 47 additions & 0 deletions contracts/scripts/deployments/facets/DeployCreateSpace.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

//interfaces

//libraries

//contracts
import {Deployer} from "contracts/scripts/common/Deployer.s.sol";
import {FacetHelper} from "contracts/test/diamond/Facet.t.sol";

import {CreateSpaceFacet} from "contracts/src/factory/facets/create/CreateSpace.sol";

contract DeployCreateSpace is FacetHelper, Deployer {
constructor() {
addSelector(CreateSpaceFacet.createSpace.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) {
return CreateSpaceFacet.__CreateSpace_init.selector;
}

function versionName() public pure override returns (string memory) {
return "createSpaceFacet";
}

function __deploy(address deployer) public override returns (address) {
vm.startBroadcast(deployer);
CreateSpaceFacet facet = new CreateSpaceFacet();
vm.stopBroadcast();
return address(facet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ abstract contract VotesEnumerable is IVotesEnumerable {
) internal virtual {
VotesEnumerableStorage.Layout storage ds = VotesEnumerableStorage.layout();

ds.delegators.remove(account);
ds.delegatorsByDelegatee[currentDelegatee].remove(account);

// if the delegatee is not address(0) then add the account and is not already a delegator then add it
if (newDelegatee != address(0)) {
// if the current delegatee is address(0) then add the account
if (currentDelegatee == address(0)) {
ds.delegators.add(account);
} else {
ds.delegatorsByDelegatee[currentDelegatee].remove(account);
}

if (newDelegatee == address(0)) {
ds.delegators.remove(account);
ds.delegationTimeForDelegator[account] = 0;
} else {
// if the new delegatee is not address(0) then add the account
ds.delegatorsByDelegatee[newDelegatee].add(account);
ds.delegationTimeForDelegator[account] = block.timestamp;
}
Expand Down
14 changes: 0 additions & 14 deletions contracts/src/factory/facets/architect/Architect.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@ contract Architect is
// Space
// =============================================================

/// @inheritdoc IArchitect
function createSpace(
SpaceInfo memory spaceInfo
) external nonReentrant whenNotPaused returns (address) {
return _createSpace(spaceInfo);
}

/// @inheritdoc IArchitect
function createSpaceWithPrepay(
CreateSpace memory spaceInfo
) external payable nonReentrant whenNotPaused returns (address) {
return _createSpaceWithPrepay(spaceInfo);
}

/// @inheritdoc IArchitect
function getSpaceByTokenId(uint256 tokenId) external view returns (address) {
return _getSpaceByTokenId(tokenId);
Expand Down
29 changes: 19 additions & 10 deletions contracts/src/factory/facets/architect/IArchitect.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,16 +112,6 @@ interface IArchitect is IArchitectBase {

function getTokenIdBySpace(address space) external view returns (uint256);

/// @notice Creates a new space
/// @param SpaceInfo Space information
function createSpace(SpaceInfo memory SpaceInfo) external returns (address);

/// @notice Creates a new space with a prepayment
/// @param createSpace Space information
function createSpaceWithPrepay(
CreateSpace memory createSpace
) external payable returns (address);

// =============================================================
// Implementations
// =============================================================
Expand Down
Loading

0 comments on commit a6e1394

Please sign in to comment.