Commit Graph

3281 Commits

Author SHA1 Message Date
Pascal Precht 2cbced95c5 Check token funds when handling community requests to join
This adds checks to `HandleCommunityRequestToJoin` and
`AcceptRequestToJoinCommunity` that ensure a given user's revealed
wallet addresses own the token funds required by a community.

When community has token permissions of type `BECOME_MEMBER`, the
following happens when the owner receives a request:

1. Upon verifying provided wallet addresses by the requester, the owner
   node accumulates all token funds related to the given wallets that
   match the token criteria in the configured permissions
2. If the requester does not meet the necessary requirements, the
   request to join will be declined. If the requester does have the
   funds, he'll either be automatically accepted to the community, or
   enters the next stage where an owner needs to manually accept the
   request.
3. The the community does not automatically accept users, then the funds
   check will happen again, when the owner tries to manually accept the
   request. If the necessary funds do not exist at this stage, the
   request will be declined
4. Upon accepting, whether automatically or manually, the owner adds the
   requester's wallet addresses to the `CommunityDescription`, such that
   they can be retrieved later when doing periodic checks or when
   permissions have changed.
2023-03-23 08:40:31 +01:00
Pascal Precht 48eb705284 fix: add `decimals` to `TokenCriteria`
We need to store the `decimals` of a given token when creating community
permissions so that we can use it later on to do calculations when
checking funds for given wallet addresses.
2023-03-22 14:31:36 +01:00
Andrea Maria Piana 31ae4c958b Add RestoreAccountAndLogin endpoint 2023-03-22 13:31:16 +00:00
Andrea Maria Piana ccc8c9122c Dont set backup disabled datadir in defaults 2023-03-22 13:31:16 +00:00
Pascal Precht 051314aad0 feat: add verified wallet accounts to community requests
This commit extends the `CommunityRequestToJoin` with `RevealedAddresses` which represent wallet addresses and signatures provided by the sender, to proof a community owner ownership of those wallet addresses.

**Note: This only works with keystore files maanged by status-go**

At high level, the follwing happens:

1. User instructs Status to send a request to join to a community. By adding a password hash to the instruction, Status will try to unlock the users keystore and verify each wallet account.
2. For every verified wallet account, a signature is created for the following payload, using each wallet's private key

   ``` keccak256(chatkey + communityID + requestToJoinID) ``` A map of walletAddress->signature is then attached to the community request to join, which will be sent to the community owner
3. The owner node receives the request, and if the community requires users to hold tokens to become a member, it will check and verify whether the given wallet addresses are indeed owned by the sender. If any signature provided by the request cannot be recovered, the request is immediately declined by the owner.
4. The verified addresses are then added to the owner node's database such that, once the request should be accepted, the addresses can be used to check on chain whether they own the necessary funds to fulfill the community's permissions

The checking of required funds is **not** part of this commit. It will be added in a follow-up commit.
2023-03-22 13:50:25 +01:00
Michal Iskierko 736766ec37 fix(AddCommunityToken): Change AddCommunityToken API call
The function returns object with image converted to base64 format.

Issue #9866
2023-03-22 13:45:53 +01:00
Alex Jbanca 68d9ba64b7 chore: Enable arm64 build on MacOs 2023-03-22 14:23:29 +02:00
Mikhail Rogachev 95a76fe33b
Update status-go VERSION for endpoints change (#3325) 2023-03-21 22:24:31 +07:00
Mikhail Rogachev 81dd214e9b
feat: Remove cancelOutgoingContactRequest feature (#3293) 2023-03-21 20:49:14 +07:00
Andrea Maria Piana 6775e79920 Make image path optional 2023-03-20 19:36:41 +00:00
Andrea Maria Piana ba2aa3f83e Support display name/images/password/mnemonic 2023-03-20 17:26:25 +00:00
Khushboo-dev-cpp a3f1a84d29
chore: Improve error logging for OpenSea errors / generic json unmarshalling errors (#3298)
fixes #8798
2023-03-20 16:53:39 +01:00
Anthony Laibe 6f10e8c12a feat: add ethscan to arbitrum and optimism 2023-03-20 15:44:35 +01:00
Dario Gabriel Lipicar bd82250cf7 feat(Wallet): add API to fetch collectibles by owner and contract address 2023-03-20 10:52:16 -03:00
Khushboo-dev-cpp bbec93b501
fix: Return token items even when market is down (#3291) 2023-03-20 14:44:23 +01:00
Igor Sirotin 7e8804788e
feat: Added `setInstallationName` method (#3294) 2023-03-20 23:51:17 +11:00
Volodymyr Kozieiev 94cd1ecebe
Changed connection state now correctly propagates to messenger (#3310) 2023-03-20 11:52:24 +00:00
IvanBelyakoff fe4e079bea
fix(wallet): fix crash on market price cache concurrent write (#3307) 2023-03-17 09:33:20 +03:00
Boris Melnik 1453f5a0e3
fix(activity_center): Add remove activity center notifications array to message response (#3277) 2023-03-16 21:41:53 +03:00
Andrea Maria Piana 4be978a2fe Address feedback 2023-03-16 17:02:11 +00:00
Andrea Maria Piana 3d2fd26d80 Add CreateAccount endpoint 2023-03-16 17:02:11 +00:00
Andrea Maria Piana 5d0e08ec7b Add spiff workflow cmd 2023-03-16 14:31:34 +00:00
Andrea Maria Piana d1ec6d876c Fix collapsed tests 2023-03-16 13:40:20 +00:00
Andrea Maria Piana b20dc0a87c Add index to raw messages 2023-03-16 13:40:20 +00:00
Pascal Precht 6859a1d3b7 Add methods to sign and recover messages/signatures to AccountManager
Also, make AccountManager a dependency of Messenger.
This is needed for community token permissions as we'll need a way to access wallet accounts
and sign messages when sending requests to join a community.

The APIs have been mostly taken from GethStatusBackend and personal service.
2023-03-16 12:25:06 +01:00
IvanBelyakoff 612efb9b89
fix(Wallet): Fix uninitialized token map accessed (#3289) 2023-03-15 18:10:36 +03:00
Lukáš Tinkl 0eef19f80e feat: dynamic social links
- completely replace social links on save
- respect the order of items and also the URL when comparing

Rationale: for MVP, we'll want the user to be able to add several links
of the same type, and adjust/preserve their order by drag'n'drop

Needed for https://github.com/status-im/status-desktop/issues/9777
2023-03-15 12:41:57 +01:00
IvanBelyakoff 2c9714f0f8
fix(wallet/coingecko): Fix coingecko crash on race writing to tokens map (#3274) 2023-03-14 21:59:10 +03:00
IvanBelyakoff 804b5b43b4
feat(Wallet): implement token list from Uniswap (#3273)
Fixes #8807
2023-03-14 20:33:05 +03:00
Andrea Maria Piana 44a0f5b74d
Add collapsed community categories 2023-03-14 17:13:21 +00:00
Roman Volosovskyi 290579f74f
Update wakuext_buildContact 2023-03-14 16:57:33 +01:00
Ibrahem Khalil cd96f557f9
Allow underscores for status-tags (#3286) 2023-03-14 17:31:15 +02:00
Andrea Maria Piana 5d81866957 Add request to response when canceling request 2023-03-14 13:50:18 +00:00
Alexander 7123b22c52
Fetch details of user when adding a contact (#3271) 2023-03-14 10:00:05 +01:00
Richard Ramos cbb016ac00 feat: update go-waku to introduce meta field and deterministic hashing 2023-03-13 21:03:34 -04:00
Dario Gabriel Lipicar bac7eb08ca feat(Wallet): add API to fetch collectibles in a paginated way 2023-03-10 11:27:03 -03:00
Dario Gabriel Lipicar 7b6fc87f89 fix(wallet): use OpenSea api key only for mainnet endpoint 2023-03-10 08:55:58 -03:00
Richard Ramos 8fe077380b fix: set device type on init 2023-03-09 18:02:49 -04:00
Stefan f607164122 feat(wallet) add GetMultiTransactions wallet API
Updates status-desktop #7663
2023-03-07 19:38:31 +04:00
Pascal Precht f5475ed45c fix: add missing `Name` property to `CommunityTokensMetadata` 2023-03-07 16:37:36 +01:00
Anthony Laibe bbe4e57f0f fix: use correct chain client 2023-03-07 16:24:32 +01:00
Pascal Precht a6194ffad4 fix: don't expect `CommunityTokensMetadata` in `EditCommunity()`
The `Edit()` method on `Community` merely updates "primitive" values
that live inside a community description. For any data that is more complex,
we typically have dedicated methods.

Because `Edit()` was expecting `CommunityTokensMetadata`, it would
override it with empty data every time we would edit a community.
This is because we typically don't update that kind of data as part
of `Edit()`.

In addition, `CommunityTokensMetadata` is append-only anyways,
so there wouldn't be any other way to update that field, other than
adding new items to it, which is done in a dedicated method.
2023-03-07 16:07:48 +01:00
yqrashawn 475b5f855f
feat: allow group admin to delete others message (#3259) 2023-03-07 22:38:09 +08:00
Dario Gabriel Lipicar 3f3e8f8894 feat(Wallet): add opensea asset fetching by contract address and token id 2023-03-07 10:33:50 -03:00
Dario Gabriel Lipicar 67bcf10466 feat(Wallet): handle erc721 transfers 2023-03-07 10:33:50 -03:00
Sale Djenic b660672a60 chore(accounts): `type` column from `accounts` table updated
`type` column is set for all rows to appropriate value. Before this change
accounts which were generated from the keypair created importing seed phrase
had `generated` value for the `type`.

According to above, a function for generating an account sets the `type`
based on the passed derive from address.
2023-03-07 11:28:06 +01:00
Michal Iskierko 1b24342a75 feat(CommunityTokenMetadata): Keep token metadata in CommunityDescription
Community tokens has some metadata (image, description) which must be kept in waku(CommunityDescription).
Add CommunityTokenMetadata message to communities.proto.
Add []CommunityTokenMetadata to CommunityDescription.

Issue #9545
2023-03-07 08:40:47 +01:00
Richard Ramos b8d5455904 chore: bump go-waku version 2023-03-06 17:39:59 -04:00
IvanBelyakoff 48078393f9
feat: Update saved addresses DB to store ENS, isTest flag and chains (#3183)
prefixes. Changed primary keys and API methods.
Fixed tests and added new ones.
Fixed saved addresses and transaction tests to use ':memory:' sqlite
DB instead of a tmp file to speed up testing by hundred of times.

Fixes #8599
2023-03-06 16:26:46 +03:00
Vitaliy Vlasov 27a76f43ba Compute emojiHash on-the-fly 2023-03-06 13:22:40 +02:00