project screenshot 1
project screenshot 2
project screenshot 3

your-data

Scroll Sepolia Testnet - ERC20 staking app. This app will allow users to stake a token and earn a reward token in return

your-data

Created At

Circuit Breaker

Project Description

Scroll Sepolia Testnet - This contract allows users to stake their ERC-20 tokens and get ERC-20 tokens as staking rewards (different from the staked tokens). Contract admin should set the Staking and Reward token addresses during deployment. These can't be changed later.

Staked tokens are stored inside the contract and rewards are calculated for the amount of time these tokens were staked. Admin should maintain adequate balance of reward tokens in the staking-contract. These rewards are then transferred to stakers upon claiming.

**Reward calculation at the time of claiming rewards:

rewardsPerTokenStaked = ((stakingDuration * rewardRatioNumerator) / rewardRatioDenominator) / timeUnit

**For e.g., if reward ratio is 1/20, this implies that there will be 1 Reward token given out for every 20 tokens staked. The numerator and denominator of the reward ratio should be set separately (1 and 20 in this case respectively).

**Note:

Users need to approve their tokens to the staking contract address before they can stake them

Contract admin should maintain adequate balance of Reward Tokens in the staking contract -- use the deposit function for depositing reward tokens

How it's Made

**Installation: npx thirdweb install

**Get Started: The React SDK uses React Query under the hood to expose a collection of query and mutation hooks, each with built-in caching, query invalidation, query retries, and more.

Each hook (except for wallet/network management) wraps some functionality of the TypeScript SDK, which are made available as either a query hook to read data, or as a mutation hook to write transactions to the blockchain.

When mutations are called (when a user executes a transaction), query invalidation is automatically triggered to update the relevant queries that depend on the data that was changed. For example, when minting a new NFT, queries that view information about NFTs are re-fetched to load the new NFT automatically.

background image mobile

Join the mailing list

Get the latest news and updates