push-protocol / push-dapp

The Push Protocol Dapp
https://app.push.org
Other
42 stars 36 forks source link

Feat/Base Chain support #1608

Open corlard3y opened 1 month ago

corlard3y commented 1 month ago

Pull Request Template

1607

Description

CoinBase has invited us to deploy on Base chain, with the biggest incentive being the integration of Push Notifications in Coinbase Wallet. So we are basically just adding Base chain support, it’s just going to be a new chain like the others we have, from polygon, Arbitrum, cyber and the rest that have been added beforehand. So this is a new one called Base Chain - IIntegration of Push will enable native visibility of notifications from base ecosystem in coinbase wallet. So you can create channels, send notifications on this chain.

Type of Change

Checklist

Frontend Guidelines

Build & Testing

Screenshots/Video with Explanation

Additional Context

Review & Approvals

Notes

github-actions[bot] commented 1 month ago

In the file src/components/Faucets.tsx:

In the file src/config/config-dev.js:

In the file src/config/config-prod.js:

In the file src/helpers/CaipHelper.ts:

Kindly make the necessary corrections based on the observations mentioned above.

github-actions[bot] commented 1 month ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://push-protocol.github.io/push-dapp/pr-preview/pr-1608/ on branch gh-pages at 2024-06-11 12:32 UTC

github-actions[bot] commented 1 month ago

In the file src/components/Faucets.tsx, there are multiple syntax errors such as missing commas between object properties, incorrect formatting of object literals, and missing closing braces. Here are the corrections:

{
  id: '97',
  value: 'BNB',
  title: 'BNB Faucet',
  function: () => {},
  link: 'https://testnet.bnbchain.org/faucet-smart',
},
{
  id: '11155420',
  value: 'Optimism',
  title: 'Optimism Sepolia Faucet',
  link: 'https://faucet.quicknode.com/optimism/sepolia',
},
{
  id: '2442',
  value: 'Polygon zkEVM',
  title: 'Polygon zkEVM Bridge',
  link: 'https://faucet.polygon.technology/',
},
{
  id: '421614',
  value: 'Arbitrum',
  title: 'Arbitrum Testnet Faucet',
  link: 'https://faucet.quicknode.com/arbitrum/sepolia',
},
{
  id: '123',
  value: 'Fuse',
  title: 'Fuse Sparknet Faucet',
  link: 'https://chaindrop.org/?chainid=123&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
},
{
  id: '111557560',
  value: 'Cyber',
  title: 'Cyber Faucet',
  link: 'https://cyber-testnet.testnets.rollbridge.app/',
},
{
  id: '84532',
  value: 'Base Sepolia',
  title: 'Base Sepolia Faucet',
  link: 'https://www.alchemy.com/faucets/base-sepolia',
}

In the file src/config/config-dev.js, there are missing curly braces in the objects defining Faucets information. Here are the corrected lines:

80002: {
  label: 'Amoy MATIC',
  url: 'https://faucet.polygon.technology/',
},
97: {
  label: 'Testnet BNB',
  url: 'https://testnet.bnbchain.org/faucet-smart',
},
11155420: {
  label: 'Sepolia OpETH',
  url: 'https://faucet.quicknode.com/optimism/sepolia',
},
2442: {
  label: 'Polygon zkEVM ETH',
},
421614: {
  label: 'Sepolia ArbETH',
  url: 'https://faucet.quicknode.com/arbitrum/sepolia',
},
123: {
  label: 'Fuse SPARK',
  url: 'https://chaindrop.org/?chainid=123&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
},
111557560: {
  label: 'Cyber ETH',
  url: 'https://cyber-testnet.testnets.rollbridge.app/',
},
84532: {
  label: 'Base Sepolia',
  url: 'https://www.alchemy.com/faucets/base-sepolia',
}

In the same file src/config/config-dev.js, there are syntax errors in the aliasRPC object. Here is the corrected format:

aliasRPC: {
  80002: 'https://polygon-amoy.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7',
  97: 'https://data-seed-prebsc-1-s1.binance.org:8545',
  11155420: 'https://optimism-sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7',
  2442: 'https://rpc.cardona.zkevm-rpc.com',
  421614: 'https://arbitrum-sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7',
},

In the file src/helpers/CaipHelper.ts, there is a missing closing brace at the end of the getCAIPObj function. Here is the corrected line:

} // Add this closing brace

Additionally, there is an if block in the convertAddrCaipToAddress function that does not have a corresponding closing brace. Here is the corrected block:

if (caipArr.length == 3 && caipArr[0] == 'eip155') {
  return caipArr[2];
}
throw new Error('Invalid CAIP Format');

After these corrections are made, the code should be free of syntax errors.

github-actions[bot] commented 1 month ago

I have reviewed the provided code and found some issues and potential improvements:

File: package.json

  1. In the "scripts" section, there are multiple commands listed with syntax errors such as missing closing braces } and misplaced characters <Button, which need to be corrected.

File: public/svg/Base.svg

  1. The SVG <path> tag is using an incorrect closing tag syntax. It should be <path ... /> instead of <path ... "></>.

File: src/components/ChangeNetwork.tsx

  1. It seems there are missing closing braces on the "if" conditions within the checkUserForAlias function. The logic structure needs to be reviewed.

File: src/components/Faucets.tsx

  1. The array of testnet faucets seems to have incorrect object structures. Each object should have {} surrounding them.
  2. There are missing closing tags in the JSX markup, make sure all opening tags have corresponding closing tags.
  3. The <Dropdown> component may not be properly implemented. Ensure it is imported correctly.

File: src/components/InitState.tsx

  1. There seems to be an issue with the checkUserForEthAlias function call, it's missing implementation.

File: src/components/VerifyAlias.tsx

  1. There are syntax errors in defining the testnet faucets array. Each object should be enclosed in {}.
  2. There is an incomplete if condition block in the checkAlias function. Make sure it is properly closed.
  3. Check the implementation of the submitAlias function.

File: src/helpers/CaipHelper.ts

  1. The Eip155EnabledIds array might have a typo with value 122, which should be confirmed.

File: src/connectors/chains.ts

  1. The file content is missing in the provided code snippet.

File: Other files

Files like src/config/*.js, src/helpers/UtilityHelper.ts, src/hooks/useInactiveListener.ts, src/redux/slices/adminSlice.js, and src/structure/Header.tsx were mentioned but not provided in the snippet for review.

General

  1. The overall syntax and structure of the code need to be carefully reviewed for correctness.
  2. Check if all required modules are imported and used properly.

Please address the above-mentioned issues in the respective files. Let me know if you need any further assistance.