Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new JavaScript module Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The adapter at projects/minebean exports TVL: |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
projects/minebean/index.js (2)
8-11: Consider extracting owner addresses into named constants.This would make future contract migrations safer and reduce inline literal duplication.
♻️ Suggested small refactor
const BEAN = '0x5c72992b83E74c4D5200A8E8920fB946214a5A5D' +const GRID_MINING = '0x9632495bDb93FD6B0740Ab69cc6c71C9c01da4f0' +const STAKING = '0xfe177128Df8d336cAf99F787b72183D1E68Ff9c2' async function tvl(api) { return sumTokens2({ api, tokensAndOwners: [ - [BEAN, '0x9632495bDb93FD6B0740Ab69cc6c71C9c01da4f0'], // GridMining - mined BEAN rewards - [BEAN, '0xfe177128Df8d336cAf99F787b72183D1E68Ff9c2'], // Staking - staked BEAN + [BEAN, GRID_MINING], // GridMining - mined BEAN rewards + [BEAN, STAKING], // Staking - staked BEAN ], }) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/minebean/index.js` around lines 8 - 11, Extract the hard-coded owner addresses into named constants and replace the inline literals in the tokensAndOwners array; e.g., create descriptively named constants (like GRID_MINING_OWNER and STAKING_OWNER) near where BEAN is defined and use those identifiers inside tokensAndOwners instead of the raw addresses to avoid duplication and make future migrations safer.
15-18: AddownTokens: truefor clearer TVL classification.Since this TVL is BEAN-only (protocol token), adding
ownTokens: trueimproves downstream interpretation.Based on learnings: In DefiLlama adapters, `ownTokens` is a valid export key, and protocol-owned liquidity handling should be explicit in adapter metadata/methodology.🧩 Suggested export update
module.exports = { methodology: 'TVL is BEAN tokens held in GridMining (mined rewards) and Staking (user-staked BEAN).', + ownTokens: true, base: { tvl }, }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/minebean/index.js` around lines 15 - 18, Update the exported adapter object (the module.exports literal that currently contains methodology and base: { tvl }) to include the ownTokens: true flag so downstream consumers know this TVL is protocol-owned BEAN tokens; i.e., add ownTokens: true alongside methodology and base in the exported object (refer to the module.exports / base / tvl identifiers to locate the spot).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@projects/minebean/index.js`:
- Around line 8-11: Extract the hard-coded owner addresses into named constants
and replace the inline literals in the tokensAndOwners array; e.g., create
descriptively named constants (like GRID_MINING_OWNER and STAKING_OWNER) near
where BEAN is defined and use those identifiers inside tokensAndOwners instead
of the raw addresses to avoid duplication and make future migrations safer.
- Around line 15-18: Update the exported adapter object (the module.exports
literal that currently contains methodology and base: { tvl }) to include the
ownTokens: true flag so downstream consumers know this TVL is protocol-owned
BEAN tokens; i.e., add ownTokens: true alongside methodology and base in the
exported object (refer to the module.exports / base / tvl identifiers to locate
the spot).
|
The adapter at projects/minebean exports TVL: |
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.jsonfile as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIName (to be shown on DefiLlama): MineBean
Twitter Link: https://x.com/minebean_
List of audit links if any:
Website Link: https://minebean.com/
Logo (High resolution, will be shown with rounded borders): https://imagedelivery.net/GyRgSdgDhHz2WNR4fvaN-Q/0e548f28-3729-463a-6feb-9dbdbfbb8c00/public
Current TVL: $51,542.48
Treasury Addresses (if the protocol has treasury): 0x38F6E74148D6904286131e190d879A699fE3Aeb3
Chain: BASE (8453)
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama): BEAN is a gamified mining protocol on Base. Players compete in continuous 60-second rounds to earn ETH and BEAN tokens, Competitive gaming mechanics layered with DeFi infrastructure.
Token address and ticker if any: 0x5c72992b83E74c4D5200A8E8920fB946214a5A5D (BEAN)
Category (full list at https://defillama.com/categories) *Please choose only one: Gamified Mining
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.): Chainlink VRF, TWAP
Implementation Details: Briefly describe how the oracle is integrated into your project: Chainlink VRF v2.5 is used to generate verifiable random winning blocks each round. Built-in BEAN token TWAP oracle provides slippage protection for Treasury buybacks via Uniswap V4.
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage: https://www.minebean.com/about.
Contract where TWAP is used: https://basescan.org/address/0x5c72992b83E74c4D5200A8E8920fB946214a5A5D#code
Contract where chainlink VRF is used: https://basescan.org/address/0x9632495bDb93FD6B0740Ab69cc6c71C9c01da4f0#code
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated): TVL is BEAN tokens held in GridMining contract (mined rewards unclaimed by users who are rewarded for not claiming with the fee paid by users who do claim) and Staking contracts (user-staked BEAN, rewarded by the yield generated from buybacks).
Github org/user (Optional, if your code is open source, we can track activity): https://github.com/nu11dotfun
Does this project have a referral program? No
Summary by CodeRabbit