A global way to get token info in gateway#408
Conversation
| @@ -0,0 +1,276 @@ | |||
| { | |||
There was a problem hiding this comment.
if you intend to use this on alt-l1s - perhaps it makes sense to name the files by chainid?
-mainnet.json
-testnet.json
There was a problem hiding this comment.
For alt-l1s, I will use tokenInfo[L1_NAME][MAINNET or TESTNET]. It's hard to remember 10 chain Ids.
There was a problem hiding this comment.
well... you can make a mapping of chains, chainids as well. Better this way than having different implementations across the stack
There was a problem hiding this comment.
and you get the chainid with rpc and immediately know what to load
There was a problem hiding this comment.
You mean adding all token information with chain Ids in the tokenInfoMainnet file? Like this:
{
chain_id_1: {},
chain_id_2: {}
}
There was a problem hiding this comment.
and you get the chainid with rpc and immediately know what to load
The loading process is before connecting to the RPC endpoint. I need to double check if you want to automatically load the file.
There was a problem hiding this comment.
yeah that would work too, tokenInfo.json as chainid doesn't tell you if it's testnet or not
There was a problem hiding this comment.
Ok. Now, we only need to add token information to tokenInfo.json for alt l1s. The gateway automatically fetches the right information based on the chain Id.
* A global way to get token info in gateway * Rename file name and move tokenInfo outside * Use a single file to store token info (cherry picked from commit 48ce0f6)
* Fix Layer Zero monitor (#359) * Fix database typo * Fix the env * Fix Layer Zero monitor * Reduce logs * Fix typo Co-authored-by: Ino Murko <ino.murko.github@protonmail.com> Co-authored-by: Ino Murko <ino.murko.github@protonmail.com> (cherry picked from commit c1c144b) * 1. fix blank page on unknown routes (#379) 2. move routes path to const and ref in menuitem, route) 3. fix caniuse-lite terminal warnigng. (cherry picked from commit f53ae8c) * Add links to Boba multi-chains in the gateway (#384) * Links to Boba multi-chains * updated costant * Add Boba Eth and Boba Fantom Co-authored-by: Sahil Kashetwar <sahil@enya.ai> (cherry picked from commit de21c96) * Fix ABI and length of result for Layer Zero monitor (#376) * Fix ABI and length * Add layer zero contracts * Fix bridge tag * Update MySQL query (cherry picked from commit 8b14503) * rm bedrock - use v3-repos instead (#389) (cherry picked from commit 0eac030) * Gateway : Bridge to Alt L1s (#297) * change: 1. added tab in history for bridge between l1 & update history page. 2. added action button to token list l1 layer bridge to alt l1 3. inputStepMultiChain popup for bridging to alt l1s. * updated the button style and remove tooltip. * added networkservice func for multi chain deposit * 1.Added abi, Deposit function. * added bridge trnsfer from l1 to alt l1 * Add multichain bridge addresses (#310) * change: - added loader when initiate briding - disabling bridge button in case of false conditions - commented unused contract initiation from depositErc20 to alt L1. - using the address added into the chainRinkeby. * change: - Added actions, reducer, state to get the estimated - Showing estimated fees on UI for briding boba to alt l1. * change: cleanup * Clean the gateway for supporting multi-chains (#314) * Support bridge between Eth and Moonbeam in gateway (#315) * Support bridge between Eth and Moonbeam * Remove console.log * Fix contract address * change: 1. fix for the failing import for rinkebny 2. updated get transaction to load the data for bridge between l1's 3. representation tx details on history page. 4. warning fix for coinImage breakstatement. 5. removed consoles. * fix for warning * change: 1. added boba to amount 2. showing destination chain & EventType on UI * fix for the amout to be show on UI for txs. * Update L0 contract addresses Co-authored-by: Boyuan-Chen <46272347+Boyuan-Chen@users.noreply.github.com> Co-authored-by: cby3149 <cby3149@gmail.com> (cherry picked from commit 4640621) * Fix Layer Zero fee and deploy API endpoint (#401) * Fix Layer Zero fee and deploy API endpoint * Disable button if warning is true (cherry picked from commit 78b450c) * Have verifier node sync in parallel with dtl to save time. (#394) (cherry picked from commit 0ffde99) * Edit beamer ecosystem entry (#411) * Update project.list.js We want to update the link to lead directly to the Beamer app now that we're live on Mainnet. * Add files via upload Replacement of Beamer Logo (cherry picked from commit aa22ec3) * Gateway : Vote & Dao Page. (#292) Dao Page: Create proposal with the option to select the Lock Boba (vBoba) Show proposal list Voting on proposal (abstain / against/ for) Vote Page: Showing available balance of vBoba. Listing pools and available (vBoba) tokens Way to vote on pools w.r.to. selected (vBoba) tokens. updated contracts along with redux state/ actions / selectors (cherry picked from commit dfb71a0) * changes: (#410) - updated the gas poll interval to 30000 - moved fetchGasPrice calls to gasSwitcher component - removed unused gasReducer, gasSelector - updated readme (cherry picked from commit 2dbe326) * Enable whitelist for message relayer (#416) (cherry picked from commit a06c58a) * A global way to get token info in gateway (#408) * A global way to get token info in gateway * Rename file name and move tokenInfo outside * Use a single file to store token info (cherry picked from commit 48ce0f6) * fix: revert nft for failing mint (#419) * revert nft for failing mint * update tests * update README * add timeout * Apply suggestions from code review Co-authored-by: Ino Murko <ino.murko.github@protonmail.com> * fix: flaky test Co-authored-by: Ino Murko <ino.murko.github@protonmail.com> (cherry picked from commit 5f1d0f2) * Add Sushiswap link (#430) (cherry picked from commit 784c364) * Add L2StandardTokenFactory address (#427) (cherry picked from commit 33f6a50) Co-authored-by: Boyuan-Chen <46272347+Boyuan-Chen@users.noreply.github.com> Co-authored-by: Sahil K <86316370+sk-enya@users.noreply.github.com> Co-authored-by: Riedl Kevin, Bsc <kevin.riedl@wavect.io> Co-authored-by: DBecane <85872820+DBecane@users.noreply.github.com> Co-authored-by: Souradeep Das <dsouradeep2@gmail.com>
📋 Add associated issues, tickets, docs URL here. https://github.com/bobanetwork/boba/issues/404
Overview
Describe what your Pull Request is about in a few sentences.
Some tokens are not ERC20 compatible, which means that our standard ABI doesn't work for those tokens.
In order to solve the problem, we store token information in one separate file. In our gateway, it can load token information instead of sending PRC calls. This should improve the speed too.
Changes
Describe your changes and implementation choices. More details make PRs easier to review.
Testing
Describe how to test your new feature/bug fix and if possible, a step by step guide on how to demo this.