Commit graph

39 commits

Author SHA1 Message Date
Giuseppe Rodriguez 34d457c8b0 Deploy latest space goerli types and contracts (#1230) 2023-01-13 17:02:33 -08:00
Giuseppe Rodriguez b8fd046e51 Updates UserEntitlement to take array of addresses (#1213) 2023-01-13 12:10:38 -08:00
Tak Wai Wong 7f3d10905a regenerate json addresses (#1218)
json addresses changed when i run the deploy script on a new instance of
anvil. Regenerated the json
2023-01-13 09:39:22 -08:00
Giuseppe Rodriguez e51eb13a13 0xMacro Updates (#1200)
Fixes HNT-417, HNT-411, HNT-403, HNT-398, HNT-394
2023-01-12 11:08:20 -08:00
Giuseppe Rodriguez 6745cd8162 adds multicall and updates create role with entitlements and entitlementdata arguments (#1192) 2023-01-10 19:43:14 -08:00
Tak Wai Wong 3700bcbde4 rename isEntitled to isEntitledToSpace (#1174) 2023-01-06 12:12:35 -08:00
Tak Wai Wong b09cd18803 Rename isEntitled func for channel (#1168)
Overloaded isEntitled func in ISpace.sol and Space.sol caused the generated client types to turn into string names. Renaming one of them to isEntitledToChannel.
2023-01-04 14:13:39 -08:00
Evan Salzbrenner 45185aaed0 fix space manager deployment json order (#1164) 2023-01-03 12:58:14 -08:00
texuf 1d13259cf1 New localhost contract addresses (#1160) 2023-01-02 10:38:56 -08:00
Evan Salzbrenner 83fbf169ec regenerate contract addresses (#1159) 2022-12-30 14:58:56 -08:00
Giuseppe Rodriguez 197e74169c Creates SpacesUpgrade script to update the implementation address of a space on space factory and space (#1156) 2022-12-29 20:33:41 -08:00
Tak Wai Wong 982ce71aad fix dendrite to interact with v1 / v2 contracts (#1155)
dendrite uses commandline flag v1 or v2 to choose the smart contracts for the isEntitled check
2022-12-29 15:37:03 -08:00
Giuseppe Rodriguez d04b25996e Space v2 Updates (#1145) 2022-12-28 20:23:01 -08:00
Tak Wai Wong 751030a658 Add a config flag on dendrite to switch between zion contracts v1 / v2 (#1151)
Temporary flag to implement v2 smart contract integration. Once v2 is
done, will remove this flag.
2022-12-28 18:56:40 -08:00
Giuseppe Rodriguez 6aa7e26d52 Space Manager v2 with Upgradeability (#1005) 2022-12-27 18:26:43 -08:00
Giuseppe Rodriguez f690a2ace9 deploy latest goerli (#1143) 2022-12-27 16:38:50 -08:00
Tak Wai Wong ad3be52a8d hnt-535 add modify role function to change roleName, permissions, token and user entitlement data (#1141)
- Add new functions to modify role name, permissions, token entitlement
and user entitlement with a single call
- Add new solidity tests for the new functions
- Re-generated TypeScript and Go types for both localhost and goerli
2022-12-27 14:27:02 -08:00
Tak Wai Wong 88c1b4c7b5 Refactor SpaceManager.createRole to take additional parameters (#1137)
Fixes hnt-445. This change would let the client create a new role by
paying gas 1 time instead of 8+ times.
Re-generated the localhost types
2022-12-22 12:54:46 -08:00
Giuseppe Rodriguez 4586351a29 deploy latest space manager contracts (#1061)
update goerli addresses
2022-12-09 12:49:06 -08:00
Tak Wai Wong 8f4d1828b4 matrix room Id does not resolve to channelId or spaceId correctly (#1010)
Issue: matrix room id does not always resolve to spaceId or channelId
correctly.

Root cause: The clientApi routing endpoint and the syncapi routing
endpoint uses different stores to query for the current room states.

One is correct, the other has incomplete events. Fix the issue by using
the correct store in both routing code paths.
2022-11-30 20:12:00 -08:00
Tak Wai Wong a8127f9bdc Re-generate contract types due to ZionSpaceManger.sol changes (#1015)
- fix build-contract-types.sh to generate goerli
- re-generate types after ZionSpaceManager.sol changes.
2022-11-30 19:46:54 -08:00
Tak Wai Wong 6d6c85aadc Revert from space manager when adding duplicate roleId (#948)
- space manager catches error when adding roleId to channels so that
client can get meaningful error
- Update the createChannel tests to expect the new error AddRoleFailed
- Re-generate localhost and goerli types
2022-11-16 13:43:59 -08:00
Pat Fives b9e047dfac Refactor to track roles associated with channels (#915)
update interfaces to set and remove space entitlements or channel roles

all forge tests passing

all integration tests passing
2022-11-14 20:41:25 -08:00
Tak Wai Wong 22230a238a Make module type property available in the contract + publish client types (#923)
Add the new property moduleType to EntitlementModuleInfo.

Re-generate the typescript types, Go types, and the abi
2022-11-14 10:27:34 -08:00
John Terzis 40830b8a37 Space,Channel soft deletion with dendrite gating, tests (#889)
Closes HNT-244.

The following PR implements Space,Channel soft deletion using on-chain
`disabled` flag scope to space, channel respectively. On message sync,
dendrite will now gate disabled rooms by performing a leave on the user
attempting to sync unless the user is the owner (more on this later). To
re-join, given rooms (spaces,channels) are created by default using
`invite` membership state, the owner will need to undo the on-chain
`disabled` flag, setting it false then re-invite users that left the
room as a side effect of it becoming disabled previously.

The owner does not leave the space, channel because if they did then
there would be no one left to invite users let alone themselves back in
if the action is ever undone.

What is not implemented in this PR:
1. **Transitive leaves on channels in a space** - If a space is
disabled, users will leave the space but not the channels within the
space. To allow for fully disabling a space and all its' channels, the
client can offer a view to the owner that iterates over the channels and
space to disable all on-chain. Furthermore, we could implement a batch
on-chain method that fully disables all channels within a space (plus
the space) in one on-chain call to save the owner gas.
2. **Data deletion** - No data is remove from the DAGs or on-chain.
Therefore deletion is soft and reversible.
3. **New hook to check if a room is disabled** - the client can leverage
existing on-chain public read only methods `getSpaceInfoBySpaceId`,
`getChannelInfoByChannelId` to read the state of each in order to remove
spaces, channels from a member's view that are disabled.
2022-11-09 17:07:51 -07:00
Tak Wai Wong df41f84bfa generate localhost and goerli types (#895) 2022-11-09 14:23:54 -08:00
Tak Wai Wong 29dabec35e fix copy path of the deploy script (#856) 2022-11-07 11:53:26 -08:00
Tak Wai Wong 147b17eccf write out the rolemanager address in the json (#837)
Need the address to implement the ZionRoleManagerShim

I ran this in  zion-governance/ and it worked :
forge script scripts/Local.s.sol:DeployLocal --rpc-url
http://localhost:8545/ --private-key … --broadcast

space-manager.json has the rolemanager address
2022-11-04 14:04:03 -07:00
Giuseppe Rodriguez 686450bdad HNT-320-321 Updates create channel to take role ids and makes contract types script simpler (#807)
Closes HNT-320

Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2022-11-03 21:35:44 -07:00
John Terzis b4223a1a18 Jterzis/sync dendrite (#793) 2022-11-01 23:17:48 -07:00
Tak Wai Wong 424df14000 Sync dendrite fork changes for gating, and single chain support (#778)
* Latest dendrite main (8c7b274e4e)
* Gating implementation from John and Tak

Fixes for https://github.com/matrix-org/dendrite/issues/2838 and
https://github.com/matrix-org/dendrite/issues/2842

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-11-01 11:09:34 -07:00
Pat Fives 6cce0b9b43 Update create space interface, allow for setting specific users and multiple tokens during space creation (#734)
This PR finishes changing all the public interfaces at the moment for
space creation and updates the client.

All integration and forge tests passing.

Local and Goerli ABIs generated.

Co-authored-by: g <5714678+giuseppecrj@users.noreply.github.com>
2022-10-26 14:00:59 -04:00
Pat Fives 4c9f469a0c Update token entitlement logic to handle multiple tokens, decode entitlement data into structs (#729)
This change updates token entitlement data structures and allows for
multiple tokens to be set for a single role, permitting the AND
operation for multiple token requirements.

It also decodes structs when creating a space and setting a new token
entitlement.

Added new tests for multiple tokens gating a role. 

Also generates localhost AND Goerli ABIs.

Forge and integration tests all pass
2022-10-25 21:02:11 -07:00
Pat Fives 322e63e912 Fixes HNT-122 Mint space nft when creating a space and use to gate via token entitlement module (#702)
Update tests to gate ownership on NFT. Verified all tests pass.
2022-10-24 18:22:20 -07:00
Tak Wai Wong ce57591c65 Regenerate types due to solidity contract changes (#676)
Fix build break and re-generate the types.

yarn test passed except for the 2 unreadcount tests. Tested with sample
app. Can create space now
2022-10-19 18:54:41 -07:00
Pat Fives 0a1463fd65 Generate new ABIs, fix name ref in ZionClient (#660) 2022-10-17 20:40:47 -07:00
John Terzis 478579eea1 Jterzis/update dendrite (#656)
Pulls in upstream latest changes from [dendrite-fork
](https://github.com/HereNotThere/dendrite)to subtree at
servers/dendrite here.

Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
Co-authored-by: John Terzis <john@hntlabs.com>
2022-10-17 15:59:47 -07:00
Giuseppe Rodriguez 093f9ef21d HNT-121 Add createChannel function to space manager (#611)
Closes HNT-137
Co-authored-by: John Terzis <john@hntlabs.com>
2022-10-13 14:34:52 -07:00
Brian Meek 721260ac41 Setup foundry to build abi.json files (#509)
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-23 14:20:03 -07:00