Skip to content

madebyshun/blueagent-rewards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlueAgent Agent Rewards Contract

Agents stake $BLUEAGENT to register and earn weekly rewards from 5% fee on every user claim.

Contract: 0x9daD1E3501e3322bA834D1269eC8C3105d4752F8 on Base $BLUEAGENT: 0xf895783b2931c919955e18b5e3343e7c7c456ba3 Basescan: https://basescan.org/address/0x9daD1E3501e3322bA834D1269eC8C3105d4752F8


How it works

User claims $BLUEAGENT from Blue Agent bot
    ↓ 5% fee auto-sent to this contract

Weekly epoch ends
    ↓ admin calls distributeEpoch()
    
Agents claim proportional share based on staked weight

Staking Tiers

Stake Weight Share
10M $BLUEAGENT 1x base share
50M $BLUEAGENT 2x 2× base
100M $BLUEAGENT 3x 3× base
500M $BLUEAGENT 5x 5× base

How to Stake (via Bankr)

Any agent with a Bankr wallet can stake:

"approve 10000000 BLUEAGENT to 0x9daD1E3501e3322bA834D1269eC8C3105d4752F8"
"stake 10000000 BLUEAGENT on 0x9daD1E3501e3322bA834D1269eC8C3105d4752F8"

Or directly via ethers.js:

const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, wallet)
await blueagent.approve(CONTRACT_ADDRESS, amount)
await contract.stake(amount)

Contract Functions

Function Who Description
stake(amount) Agent Stake $BLUEAGENT to register
unstake() Agent Start 7-day cooldown
withdraw() Agent Withdraw after cooldown
notifyFee(amount) Blue Agent bot Notify contract of fee received
distributeEpoch() Owner Weekly distribution trigger
claim(epochIds[]) Agent Claim weekly rewards
agentInfo(address) Anyone View agent stake + weight
epochInfo() Anyone Current epoch stats
claimableAmount(agent, epochId) Anyone View claimable amount

Example: Weekly Distribution

Epoch pool: 100,000 $BLUEAGENT

Agent A: 50M staked → weight 2x
Agent B: 10M staked → weight 1x
Agent C: 100M staked → weight 3x
Total weight: 6

Agent A earns: 2/6 × 100,000 = 33,333 $BLUEAGENT
Agent B earns: 1/6 × 100,000 = 16,667 $BLUEAGENT
Agent C earns: 3/6 × 100,000 = 50,000 $BLUEAGENT

Cooldown

  • Unstake request → 7-day cooldown
  • Withdraw only after cooldown elapsed

Links


Built by Blocky Studio · Powered by Bankr · Base

About

BlueAgent rewards system — npm skill + onchain staking contract for agents on Base

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors