Closed MohammadPCh closed 2 days ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
giveth-dapps-v2 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 1, 2024 7:42am |
The updates introduce a permit-based staking mechanism in the Stake
and StakeGIV
components by adding permitSignature
, adjusting function calls, and implementing logic to handle token permitting. Additionally, new strings for multi-language support and updates to the subgraph URLs for both development and production environments have been included.
Files | Change Summary |
---|---|
src/.../Stake.tsx |
Introduced permit handling and refactored stake token function calls. |
src/.../StakeGIV.tsx |
Added permit handling, toggle switch for permit/approve mode, and logic adjustments. |
src/lib/stakingPool.ts |
Added signature parsing and encoding functions, adjusted staking functions for permit support. |
lang/ca.json |
Added new permit-related labels for multi-language support. |
lang/en.json |
Added new permit-related labels for multi-language support. |
lang/es.json |
Added new permit-related labels for multi-language support. |
src/config/development.tsx |
Updated subgraph URLs for the development environment. |
src/config/production.tsx |
Updated subgraph URLs for the production environment. |
Amidst the staking, a change arrives, Permit the tokens, watch them thrive. With toggle switch and new URLs, Multilingual support as well. Code evolves, now sleek and bright, In staking’s realm, the future’s light. 🌟
src/config/development.tsx
48-48: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 49-49: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 140-140: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 153-153: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 156-156: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 157-157: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 158-158: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 214-214: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 215-215: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 217-217: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 375-375: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 376-376: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)src/config/production.tsx
34-34: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 35-35: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 112-112: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 125-125: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 127-127: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 128-128: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 129-129: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 271-271: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 273-273: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 274-274: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 276-276: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 420-420: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) --- 421-421: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key)
src/config/development.tsx (2)
`371-371`: **Verify the new subgraph address for Optimism Sepolia.** Ensure that the new subgraph address is correct and accessible. --- `193-193`: **Verify the new subgraph address for Uniswap V2.** Ensure that the new subgraph address is correct and accessible.Verification successful
--- **The new subgraph address for Uniswap V2 is correct and accessible.** The POST request with the GraphQL query returned a valid response, confirming that the subgraph endpoint is functional. -Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify the new subgraph address for Uniswap V2. # Test: Fetch the subgraph schema. Expect: Successful response. curl -s 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu' | jq '.data.__schema' ``` Length of output: 170 --- --- Script: ```shell #!/bin/bash # Description: Re-verify the new subgraph address for Uniswap V2 and capture error messages. # Test: Fetch the subgraph schema with detailed error capture. Expect: Successful response or detailed error message. curl -s -D - 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu' | jq '.data.__schema' ``` Length of output: 232 --- --- Script: ```shell #!/bin/bash # Description: Fetch the raw response from the subgraph address to diagnose the issue. # Test: Fetch the raw response and capture headers and body. Expect: Detailed error message or status code. curl -s -D - 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu' ``` Length of output: 1022 --- --- Script: ```shell #!/bin/bash # Description: Send a POST request with a basic GraphQL query to verify the subgraph address. # GraphQL query to fetch the subgraph schema QUERY='{"query":"{ __schema { queryType { name } } }"}' # Test: Send POST request with the GraphQL query and capture the response. curl -s -X POST -H "Content-Type: application/json" -d "$QUERY" 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu' ``` Length of output: 358src/config/production.tsx (2)
`416-416`: **Verify the new subgraph address for Optimism.** Ensure that the new subgraph address is correct and accessible. --- `240-240`: **Verify the new subgraph address for Uniswap V2.** Ensure that the new subgraph address is correct and accessible.Verification successful
--- **Verification Successful: Subgraph Address for Uniswap V2** The new subgraph address for Uniswap V2 is correct and accessible. A POST request to the endpoint returned a successful response with HTTP status code 200 and the expected schema data. - **File**: `src/config/production.tsx` - **Line**: 240Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify the new subgraph address for Uniswap V2. # Test: Fetch the subgraph schema. Expect: Successful response. curl -s 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu' | jq '.data.__schema' ``` Length of output: 170 --- --- Script: ```shell #!/bin/bash # Description: Verify the new subgraph address for Uniswap V2. # Test: Fetch the HTTP status code and response body. Expect: Successful response. response=$(curl -s -w "%{http_code}" -o response_body.txt 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu') http_code=$(tail -n1 <<< "$response") echo "HTTP Status Code: $http_code" echo "Response Body:" cat response_body.txt ``` Length of output: 349 --- --- Script: ```shell #!/bin/bash # Description: Verify the new subgraph address for Uniswap V2 using a POST request. # Test: Send a POST request to fetch the subgraph schema. Expect: Successful response. response=$(curl -s -w "%{http_code}" -o response_body.txt -X POST -H "Content-Type: application/json" --data '{"query":"{ __schema { types { name } } }"}' 'https://gateway-arbitrum.network.thegraph.com/api/49102048d5822209c7cd189f8e4a51a9/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu') http_code=$(tail -n1 <<< "$response") echo "HTTP Status Code: $http_code" echo "Response Body:" cat response_body.txt ``` Length of output: 2086
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@kkatusic Thanks, Please DONT MERGE THIS since the UI is not complete. can you take this and finalize it?
@kkatusic Thanks, Please DONT MERGE THIS since the UI is not complete. can you take this and finalize it?
@MohammadPCh I don't understand what is missing, I only tested this, doesn't make any code change? Write what is missing and I will add it, thx
I tested on Op Sepolia: https://optimism-sepolia.blockscout.com/tx/0x298ba7c241c9dee93c738e5806722290ca62bd9da7540433fff3efaedfb75439?tab=logs
with permit and without permit option it is working.
Enabled also FOX/xDAI otpion on production on Gnosis network:
without permit: https://gnosisscan.io/tx/0x930579bc4497a8a0b310dd3c2d429b7fee308194496935625f1098028ab74383
wit permit:
https://gnosisscan.io/tx/0xfed288e5a9c5890d616bf5be9dbc5d7b8611bd6a801dd8632ef4953ccf54a852
https://gnosisscan.io/tx/0x801ecb80e130765822518416633174b5e42a1a7ad1d0e75ab4c003a05f3506e4
Just for me @aminlatifi , how to find on transaction contract that you provide function stakeWithPermit
: https://gnosisscan.io/token/0x8a0bee989c591142414ad67fb604539d917889df#code
thx in advance
https://gnosisscan.io/tx/0x801ecb80e130765822518416633174b5e42a1a7ad1d0e75ab4c003a05f3506e4
Just for me @aminlatifi , how to find on transaction contract that you provide function
stakeWithPermit
: https://gnosisscan.io/token/0x8a0bee989c591142414ad67fb604539d917889df#codethx in advance
The same contract you staked on https://sepolia-optimism.etherscan.io/address/0xe6836325b13819cf38f030108255a5213491a725#writeProxyContract
https://gnosisscan.io/tx/0x801ecb80e130765822518416633174b5e42a1a7ad1d0e75ab4c003a05f3506e4
Just for me @aminlatifi , how to find on transaction contract that you provide function
stakeWithPermit
: https://gnosisscan.io/token/0x8a0bee989c591142414ad67fb604539d917889df#code thx in advanceThe same contract you staked on https://sepolia-optimism.etherscan.io/address/0xe6836325b13819cf38f030108255a5213491a725#writeProxyContract
But that isn't same chain network, maybe this is above my grade :)
@aminlatifi @kkatusic Could you please re-review this? Thanks.
3420
Summary by CodeRabbit
New Features
Bug Fixes
Localization
Configuration