-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from stabilitydao/dev
0.18.0: contests
- Loading branch information
Showing
8 changed files
with
210 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
import {ChainName} from "./chains"; | ||
|
||
export interface YieldContest { | ||
// name of the contest | ||
name: string, | ||
// start timestamp | ||
start: number, | ||
// end timestamp | ||
end: number, | ||
// contest rewards | ||
rewards: Reward[], | ||
// integration of quest platform campaign | ||
integration?: { | ||
// Intract campaign id | ||
intract?: string, | ||
}, | ||
// XP multiplier | ||
xpMultiplier?: number, | ||
// image file in stabilitydao/.github/contests | ||
img?: string, | ||
// hidden service contest for devs | ||
hidden?: boolean, | ||
} | ||
|
||
export interface Reward { | ||
type: RewardType, | ||
// number of winners | ||
winners: number, | ||
// reward per winner | ||
winnerReward: number, | ||
// contract of reward | ||
contract?: { | ||
chain: ChainName, | ||
address: `0x${string}`, | ||
tokenIds?: number[], | ||
}, | ||
} | ||
|
||
export enum RewardType { | ||
// Any transferable ERC-20 token | ||
// Intract: ERC20 Tokens (USDT, etc claimed on intract) + Custom FTs (claimed on our side) | ||
ERC20 = 'ERC20 Token', | ||
// any our (Vault Manager, Strategy Logic) or external (deployed on quest platform, etc) NFTs | ||
NFT = 'NFTs', | ||
// official points | ||
POINTS = 'Points', | ||
} | ||
|
||
export const contests: { [contestId: string]: YieldContest } = { | ||
"d1": { | ||
// 10 Oct 2024 - 16 Oct 2024 | ||
name: 'Dev pre contest 1', | ||
start: 1728518400, // Thu Oct 10 2024 00:00:00 GMT+0000 | ||
end: 1729123199, // Wed Oct 16 2024 23:59:59 GMT+0000 | ||
rewards: [], // no rewards | ||
hidden: true, | ||
}, | ||
"d2": { | ||
// 17 Oct 2024 - 23 Oct 2024 | ||
name: 'Dev pre contest 2', | ||
start: 1729123200, // Thu Oct 17 2024 00:00:00 GMT+0000 | ||
end: 1729727999, // Wed Oct 23 2024 23:59:59 GMT+0000 | ||
rewards: [], // no rewards | ||
hidden: true, | ||
}, | ||
"y1": { | ||
// 24 Oct 2024 - 06 Nov 2024 | ||
name: "Yield Contest #1", | ||
start: 1729728000, // Thu, 24 Oct 2024 00:00:00 GMT | ||
end: 1730937599, // Wed, 06 Nov 2024 23:59:59 GMT | ||
rewards: | ||
[ | ||
{ | ||
type: RewardType.POINTS, | ||
winners: 50, | ||
winnerReward: 120, | ||
}, | ||
], | ||
}, | ||
"y2": { | ||
// 07 Nov 2024 - 20 Nov 2024 | ||
name: "Yield Contest #2", | ||
start: 1730937600, // Thu, 07 Nov 2024 00:00:00 GMT | ||
end: 1732147199, // Wed, 20 Nov 2024 23:59:59 GMT | ||
rewards: [ | ||
{ | ||
type: RewardType.POINTS, | ||
winners: 50, | ||
winnerReward: 130, | ||
}, | ||
// 200 USDT | ||
{ | ||
type: RewardType.ERC20, | ||
winners: 20, | ||
winnerReward: 10, | ||
contract: { | ||
chain: ChainName.POLYGON, | ||
address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", | ||
}, | ||
}, | ||
], | ||
}, | ||
"y3": { | ||
// 21 Nov 2024 - 04 Dec 2024 | ||
name: "Yield Contest #3", | ||
start: 1732147200, // Thu, 21 Nov 2024 00:00:00 GMT | ||
end: 1733356799, // Wed, 04 Dec 2024 23:59:59 GMT | ||
rewards: [ | ||
{ | ||
type: RewardType.POINTS, | ||
winners: 100, | ||
winnerReward: 100, | ||
}, | ||
// 500 USDT | ||
{ | ||
type: RewardType.ERC20, | ||
winners: 50, | ||
winnerReward: 10, | ||
contract: { | ||
chain: ChainName.POLYGON, | ||
address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", | ||
}, | ||
}, | ||
// VaultManager | ||
{ | ||
type: RewardType.NFT, | ||
winners: 3, | ||
winnerReward: 1, | ||
contract: { | ||
chain: ChainName.POLYGON, | ||
address: "0x6008b366058B42792A2497972A3312274DC5e1A8", | ||
tokenIds: [ | ||
30, // C-DAI-Y | ||
28, // C-USDC-Y | ||
21, // C-E-U-IQMF | ||
] | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {contests} from "../src"; | ||
|
||
describe('testing contests', () => { | ||
test('check start less then end', () => { | ||
for (const contestId of Object.keys(contests)) { | ||
expect(contests[contestId].start).toBeLessThan(contests[contestId].end) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {contests} from "../src"; | ||
|
||
const genTotal = 10 | ||
const WEEK = 86400 * 7 | ||
const PERIOD = 2 * WEEK | ||
|
||
console.log(`=== 🏆 Create Contests`) | ||
const curLen = Object.keys(contests).length | ||
let lastId = Object.keys(contests)[curLen - 1] | ||
let prevTs = contests[lastId].end | ||
for (let i = +(lastId.replace('y', '') || 0) + 1; i < +(lastId.replace('y', '') || 0) + 1 + genTotal; i++) { | ||
const start = prevTs + 1 | ||
const end = prevTs + PERIOD | ||
const startDateArr = new Date(start * 1000).toUTCString().split(' ') | ||
const endDateArr = new Date(end * 1000).toUTCString().split(' ') | ||
const name = `Yield Contest #${i}` | ||
const dates = `${startDateArr[1]} ${startDateArr[2]} ${startDateArr[3]} - ${endDateArr[1]} ${endDateArr[2]} ${endDateArr[3]}` | ||
console.log(`"y${i}": \{ | ||
// ${dates} | ||
name: "${name}", | ||
start: ${start}, // ${new Date(start * 1000).toUTCString()} | ||
end: ${end}, // ${new Date(end * 1000).toUTCString()} | ||
\},`) | ||
prevTs += PERIOD | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters