keep-starknet-strange / zkramp

MIT License
27 stars 26 forks source link

[CONTRACT] add lock duration logic to the escrow #51

Closed 0xChqrles closed 2 months ago

0xChqrles commented 2 months ago

The lock function of the escrow should take as a parameter a minimum lock duration expressed in seconds.

The verification of compliance with this duration will be implemented later in a hook.


This way, a user who locks an amount in USDC must wait for a certain period before being able to withdraw their funds if no one has agreed to the exchange. However, a user who provides proof of an off-chain transfer can withdraw the funds without waiting.

mubarak23 commented 2 months ago

I

Am available kindly assign @0xChqrles

mubarak23 commented 2 months ago

if i understand the issue description correctly,

we are going to add a lock function to escrow component that take an amount and lock duration in second, save it to storage and dispatch an event.

the save of the price and duration will be in form of map of KEY to TUPLE, i.e MAP<user, (amount, lock_duraton)>

am i correct here @0xChqrles