NethermindEth / StarknetByExample

A collection of examples of Cairo smart contracts for Starknet.
https://starknet-by-example.voyager.online/
MIT License
101 stars 77 forks source link

Commit reveal #77 #184

Open LamsyA opened 1 month ago

LamsyA commented 1 month ago

Issue(s): Close #77

Description

This is an implementation of the commitment scheme in cairo.

The contract uses a commitment scheme where bidders first commit to their bids and later reveal them. This ensures bid privacy until the reveal phase.

Interface: ICommitmentRevealTrait The ICommitmentRevealTrait interface defines two essential methods:

commit(name: felt252, amount: felt252) -> felt252: Commits a bid with a name and amount, returning a hash. reveal(name: felt252, amount: felt252) -> bool: Reveals a previously committed bid, returning true if the commitment is valid.

Checklist

LamsyA commented 1 month ago

Okay, am on it.

julio4 commented 1 month ago

@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.

LamsyA commented 1 month ago

@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.

Yeah, I did

I will need your help to clarify something.

julio4 commented 1 month ago

@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.

Yeah, I did

I will need your help to clarify something.

Yes, what points you would like me to clarify?