Commit graph

67 commits

Author SHA1 Message Date
texuf 8b552589e4 Update zioneer local contract addresses (#1509) 2023-02-16 12:41:39 -08:00
Tak Wai Wong a25ca83eb8 Tak/fix client regressions due to contract changes (#1466)
smart contract now returns the permissions as strings so that the client
doesn't have to parse bytes into strings. Fix spaceShim
to handle the different behaviors between localhost and goerli because contract changes are not yet deployed to goerli.
2023-02-10 10:26:44 -08:00
Giuseppe Rodriguez 910e40e2b5 rename struct module key to module address (#1458)
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2023-02-10 09:54:38 -08:00
Giuseppe Rodriguez d20ddb49b1 get permissions by role id return string (#1453) 2023-02-09 17:29:05 -08:00
Giuseppe Rodriguez d74b58a20f remove permission from roles should accept array or permissions (#1464) 2023-02-09 17:15:57 -08:00
Giuseppe Rodriguez f973cdc9a2 revert accidental merge to main (#1462)
This reverts commit c75ce8e83c5544d5492f413f460c66476105b69a, reversing
changes made to c917bcfc11d86f85b384d74558bb68c624ee59a3.
2023-02-09 16:51:33 -08:00
g 39fb63bd8d typings 2023-02-09 15:30:32 -08:00
g 88a142a28a typings 2023-02-09 15:29:23 -08:00
Giuseppe Rodriguez 923b8b5c73 addPermissionToRole takes array of permissions (#1451)
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2023-02-09 15:25:01 -08:00
Giuseppe Rodriguez 7b947bba55 rename getEntitlements to getEntitlementModules (#1450)
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2023-02-09 14:56:23 -08:00
Tak Wai Wong 0498c58e4f regenerate localhost types 2023-02-09 11:36:54 -08:00
g 0bda5a5ee1 typings 2023-02-08 18:17:44 -08:00
Giuseppe Rodriguez d9801a3dbf store channel network id in struct (#1447) 2023-02-08 17:13:08 -08:00
Giuseppe Rodriguez 9a85e1b3c1 Audit Fixes 6 - Code quality checks (#1439) 2023-02-08 14:38:06 -08:00
Giuseppe Rodriguez 6bdd949235 Audit Fixes 5 - Updates to channel based functionality (#1435)
Fixes HNT-716
Fixes HNT-710
Fixes HNT-708
2023-02-08 14:09:03 -08:00
Giuseppe Rodriguez 72d43d8baa getter for channels (#1441) 2023-02-08 11:41:38 -08:00
Giuseppe Rodriguez 3757e0f596 Audit Fixes 4 - Upgradeability of Entitlement Modules is controlled by OpenZeppelin owner() and not SpaceOwner NFT holder (#1431)
Fixes HNT-704
Fixes HNT-715
Fixes HNT-714
Fixes HNT-711
Fixes HNT-706
Fixes HNT-707
2023-02-07 19:43:32 -08:00
Giuseppe Rodriguez cade6d1de3 Audit Fixes 3 - [M-1] More than one Role can contain the Permissions.Owner permission (#1429)
Impact: High

Likelihood: Low

According to the discussion with the team, it is expected that in Space
contracts, only one Role can have the Permissions.Owner permission.
Currently, multiple Roles can be created containing this permission.
This is caused by Space.sol’s createRole() function allowing the
OpenZeppelin owner to create new owner-permissioned roles without limit.

Remediations to consider:

Do not allow multiple roles to be created with the ownership permission.
This could be done with something like: if Space.sol’s ownerRoleId is
set, do not allow new roles to be created with the Permissions.Owner
permission.

 Fixes HNT-703 as well
2023-02-07 19:23:07 -08:00
Giuseppe Rodriguez 7d6ffad2de Audit Fixes 1 - Removes OZ Ownable from Space contract and makes checks for space token ownership to see if caller is space owner (#1424)
Removing the OpenZeppelin ownership logic, and, checking directly for
the ownership of the Space’s SpaceOwner NFT. The SpaceFactory could be
the owner during the bootstrapping phase, and afterwards, could transfer
the NFT to the proper owner. Doing a direct check like
_spaceOwner().ownerOf(tokenId) == _msgSender() would be safe because
that’s what the owner entitlement is going to check eventually.

---------

Co-authored-by: Kerem Kazan <kerem.kazan@gmail.com>
2023-02-07 15:57:39 -08:00
texuf 8a688ef92a Update contract addresses (#1354) 2023-01-27 16:08:13 -08:00
Giuseppe Rodriguez d7cabc8352 Clean up Spaces V1 contracts and testing (#1273) 2023-01-27 15:15:01 -08:00
Tak Wai Wong e3a98393a1 generate user entitlement types for localhost and goerli (#1272)
Need this to get user entitlement role details.
2023-01-24 13:08:46 -08:00
Tak Wai Wong 2506761678 delete v1 smart contract-related code from dendrite (#1263) 2023-01-19 17:08:30 -08:00
Tak Wai Wong 1c61837bfd fix client and dendrite to always use v2 smart contracts (#1259)
Remove the logic to switch between v1 and v2 smart contracts. Always use
v2.
2023-01-19 13:11:35 -08:00
Tak Wai Wong 425b28f2cc Add goerli types to client lib and dendrite (#1247) 2023-01-19 09:42:09 -08:00
Pat Fives 2020161369 Add comments for iSpace and the entitlements (#1233)
Co-authored-by: g <5714678+giuseppecrj@users.noreply.github.com>
2023-01-18 17:27:30 -08:00
Giuseppe Rodriguez fdc253e2ae deploy spaces v2 (#1235) 2023-01-17 17:26:08 -08:00
Tak Wai Wong 69609d885b hnt-571 client integration for v2 (#1237)
Fixes the remaining issues in tests, client lib, and dendrite to interact with v2 smart contracts
2023-01-17 16:04:56 -08:00
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