Skip to content

Commit e2e9e17

Browse files
authored
Add B-Lucky project (#16976)
1 parent 543b624 commit e2e9e17

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

projects/b-lucky/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const ADDRESSES = require('../helper/coreAssets.json')
2+
const { sumTokens2 } = require('../helper/unwrapLPs')
3+
4+
// B-Lucky Protocol Contracts on BSC
5+
const HOUSE_FUNDING_CONTRACT = '0xA7f03BeAF428801476b1eBB226A5AD434dCFBA50';
6+
const LOTTERY_CONTRACT = '0xe18EAD45d0B0c04293Ad90Fa4E27C561e935AD5E';
7+
const STAKING_CONTRACT = '0xbB3BFfaCe9C9bf7FeD9ECBB93c0DCF4449e878fe';
8+
const LUCKY_TOKEN = '0x67b47971426bb2180453b3993FF2ec319e704444';
9+
10+
// TVL calculation: BNB and WBNB deposited in House Funding and Lottery contracts
11+
async function tvl(api) {
12+
// Get BNB and WBNB balance in House Funding and Lottery contracts
13+
return api.sumTokens({
14+
owners: [HOUSE_FUNDING_CONTRACT, LOTTERY_CONTRACT],
15+
tokens: [ADDRESSES.null, ADDRESSES.bsc.WBNB]
16+
});
17+
}
18+
19+
// Staking calculation: LUCKY tokens staked in Staking contract
20+
async function staking(api) {
21+
// Get LUCKY tokens balance in Staking contract
22+
return sumTokens2({ api, owner: STAKING_CONTRACT, tokens: [LUCKY_TOKEN] });
23+
}
24+
25+
module.exports = {
26+
methodology: 'B-Lucky is an on-chain lottery protocol on BSC. TVL consists of BNB and WBNB deposited in the House Funding and Lottery contracts which provide liquidity for lottery prizes. Staking tracks LUCKY tokens staked in the Staking contract where holders earn BNB rewards from protocol revenue.',
27+
bsc: {
28+
tvl,
29+
staking,
30+
}
31+
};

0 commit comments

Comments
 (0)