carbonable-labs / carbon-locker

2 stars 4 forks source link

[Cairo Contract] - Implement Early Withdrawal Logic #6

Open julienbrs opened 3 days ago

julienbrs commented 3 days ago

Description

Implement the penalty offset logic allowing early termination of locks under strict conditions. Add an admin function to configure the penalty calculation. Locks can only be partially withdrawn once the associated carbon credits have the status "audited." Any remaining credits will be offset immediately for a predefined recipient (e.g., an NGO) by calling the offsetter for that amount.

Acceptance Criteria

Additional context

Simplest penalty function would be: Penalty Amount=Withdraw Amount×Penalty Multiplier×Remaining Lock Time / Total Lock Time​. Better penalty function can be used. [ Medium Difficulty - Cairo ]

lascarbz commented 19 hours ago

Hello, I'd like to work on this issue please. I've looked into the vintage struct of the protocol so I know how to handle it

lascarbz commented 18 hours ago

repost: Also asking on OD

julienbrs commented 18 hours ago

Hi, I'm assigning it to @lascarbz. Please join TG to discuss about it if needed: https://t.me/carbonableOD Issue might be reassigned during ODHack if the contributor drops the isue. You can ping me if needed