🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Chainlink

by @ivangdavila

Assist with Chainlink LINK tokens, oracle integrations, staking, and price feed usage.

Versionv1.0.0
Downloads1,278
Stars⭐ 2
TERMINAL
clawhub install chainlink

πŸ“– About This Skill


name: Chainlink description: Assist with Chainlink LINK tokens, oracle integrations, staking, and price feed usage. metadata: {"clawdbot":{"emoji":"⬑","os":["linux","darwin","win32"]}}

LINK Token Basics

  • LINK is an ERC-20 token on Ethereum β€” standard wallet and exchange support
  • Also available on multiple chains β€” Arbitrum, Optimism, Polygon, Avalanche, BSC
  • Bridging LINK between chains uses official Chainlink bridge β€” verify bridge address before using
  • Different chains have different LINK contract addresses β€” verify correct address per network
  • Token Transfers

  • Standard ERC-20 transfer rules apply β€” gas paid in native token (ETH, MATIC, etc.)
  • Some DeFi protocols accept LINK as collateral β€” Aave, Compound
  • LINK has no special transfer restrictions β€” no tax tokens, no rebasing
  • Decimals: 18 β€” same as ETH, standard precision
  • Staking (v0.2)

  • Community staking allows LINK holders to stake β€” earn rewards for securing network
  • Staking has capacity limits β€” pool may be full, waitlist exists
  • Unbonding period applies β€” can't withdraw instantly after unstaking
  • Rewards in LINK β€” automatically added to staked balance
  • Slashing risk exists β€” node operators can lose stake for misbehavior
  • Price Feeds (For Developers)

  • Chainlink price feeds are the standard for DeFi β€” Aave, Synthetix, and most protocols use them
  • Feed addresses differ per network and pair β€” always verify on docs.chain.link
  • Feeds update based on deviation threshold and heartbeat β€” not every block
  • Check latestRoundData() not just latestAnswer() β€” includes timestamp and round info
  • Stale data check critical β€” verify updatedAt timestamp is recent
  • Oracle Integration Patterns

  • Direct consumer: your contract calls feed directly β€” simplest approach
  • Chainlink Automation (Keepers): trigger actions based on conditions β€” no server needed
  • VRF (Verifiable Random Function): provably fair randomness β€” for NFT mints, games, lotteries
  • Functions: connect to any API β€” custom off-chain computation
  • CCIP: cross-chain messaging β€” official Chainlink interoperability protocol
  • VRF Usage

  • Request/receive pattern: request randomness, receive in callback β€” not synchronous
  • Each request costs LINK β€” fund subscription or pay per request
  • Confirmation blocks add security but delay β€” more confirmations = more secure
  • Randomness is verifiable on-chain β€” anyone can verify it wasn't manipulated
  • Common Developer Mistakes

  • Hardcoding feed addresses β€” use address registry or config
  • Not checking for stale data β€” price feeds can stop updating
  • Assuming instant updates β€” deviation thresholds mean prices can be slightly stale
  • Not handling VRF callback failures β€” callback can revert, losing the randomness
  • Insufficient LINK for subscriptions β€” requests fail silently when underfunded
  • Network Comparisons

  • Ethereum mainnet: highest security, highest gas costs
  • L2s (Arbitrum, Optimism): lower cost, same security model
  • Alt-L1s (Polygon, Avalanche): native integration, different trust assumptions
  • Testnets: Sepolia for Ethereum, network-specific for others
  • Security Considerations

  • Only use official Chainlink feeds β€” verify contract addresses on docs.chain.link
  • Monitor for feed deprecation β€” Chainlink announces deprecated feeds
  • Multi-oracle pattern for critical systems β€” don't rely on single source
  • Circuit breakers for extreme price movements β€” protect against oracle manipulation
  • CCIP (Cross-Chain)

  • Send messages and tokens across chains β€” official Chainlink bridge
  • Lane availability varies β€” not all chain pairs supported
  • Fee estimation before sending β€” paid in LINK or native token
  • Message finality depends on source and destination chains
  • Ecosystem

  • Node operators earn LINK for providing data β€” professional infrastructure required
  • BUILD program for projects integrating Chainlink β€” access to resources and support
  • Extensive documentation at docs.chain.link β€” primary reference for developers
  • Community resources: Discord, Stack Overflow, GitHub