WoofSwapLPLocker

ca: 0xA6e957bf81b91DD572B19AfA34166c0E52af7dA5

https://shibariummemecoin.github.io/LPLocker/

WoofSwapLPLocker Contract Rules Explained

The WoofSwapLPLocker is a smart contract that lets you lock your WoofSwap LP (Liquidity Provider) tokens securely. It’s built for the WoofSwap decentralized exchange and follows these key rules:

  1. Only WoofSwap LP Tokens Allowed:

    • You can only lock LP tokens created by WoofSwap (checked via the contract’s PAIR_FACTORY address). Other tokens won’t work.

  2. Two Ways to Lock:

    • Temporary Lock: Use lockLiquidity(pair, amount, daysToLock) to lock your LP tokens for a specific number of days (minimum 1 day, maximum 100 years). You decide how long by setting daysToLock.

    • Permanent Lock: Use lockLiquidityPermanently(pair, amount) to lock your LP tokens forever. Once locked permanently, you can’t unlock them.

  3. Locking Limits:

    • You can lock as many times as you want with the same LP token (pair), but you’re limited to 1,000 total locks per user.

    • You must have enough LP tokens in your wallet, and you need to approve the contract to move them first.

  4. Earning Fees:

    • While your LP tokens are locked, you can still collect trading fees they earn on WoofSwap.

    • Use claimFees(lockId) to claim fees for one lock, or claimFeesBatch(lockIds) to claim fees for multiple locks at once (up to 50 at a time).

  5. Unlocking:

    • For temporary locks, you can unlock your LP tokens after the lock period ends using unlockLiquidity(lockId) or unlockLiquidityBatch(lockIds) (up to 50 at once).

    • Permanent locks can’t be unlocked—no exceptions.

  6. Checking Your Locks:

    • Single Lock: getLockInfo(lockId) shows details like the LP token, amount, unlock time, and collected fees.

    • All Locks: getUserLocks(user, start, count) lists all your locks, with pagination (e.g., start=0, count=10 for the first 10).

    • By LP Token: getUserLocksByPair(user, pair) shows locks for a specific LP token.

    • Summary: getUserLockSummary(user) gives your total lock count and total locked amount.

    • Pair Summary: getUserPairSummary(user) lists each LP token you’ve locked, with counts and totals.

    • Unclaimed Fees: getClaimableFees(lockId) shows fees you can claim for one lock; getUserClaimableFeesSummary(user) shows the total unclaimed fees across all your locks.

  7. Safety Rules:

    • Only you (the locker) can claim fees or unlock your LP tokens.

    • The contract prevents re-entry attacks, ensuring your tokens stay safe.

    • Batch operations are capped at 50 to avoid running out of gas.

  8. How It Works:

    • Each time you lock, you get a unique lockId (a number starting from 0). Use this ID to manage your lock later.

    • Locked LP tokens are held by the contract until you unlock them (if temporary) or forever (if permanent).


For Beginners: How to Use It

  • Step 1: Get WoofSwap LP tokens by adding liquidity on WoofSwap.

  • Step 2: Approve this contract to use your LP tokens (via your wallet).

  • Step 3: Call lockLiquidity or lockLiquidityPermanently with your LP token address (pair) and amount. Note the lockId returned.

  • Step 4: Check your locks anytime using the get... functions.

  • Step 5: Claim fees with claimFees or unlock with unlockLiquidity when ready (only for temporary locks).

This contract is designed to be secure and easy to use, letting you lock your LP tokens while still earning fees, all tailored for WoofSwap!

Last updated