Fairblock / ArbitrumContracts

3 stars 1 forks source link

Create Solidity Auction Example #1

Closed hashedtitan closed 2 weeks ago

hashedtitan commented 3 weeks ago

Feature Details

Write Solidity Auction Example to help illustrate working with Arbitrum Stylus Fairblock Technologies Integrations (aka pre-deployed confidentiality contracts such as the Decrypter using stylus).

TODO

Context

Overview of the Auction Logic ## Context on The Simple Auction Contracts: Three main phases: 1. Bidding Phase - users submit encrypted bids to `Auction` contract 2. Reveal Phase - once deadline hit, bids are decrypted and revealed 3. Winner Declaration - if `Auction` contract acts as escrow, all value is returned aside from the winning bid. Contract storage consists of: 1. `struct BidEntry` w/ properties: bidder, encryptedBid, bidCondition 2. Array of BidEntry structs, populated when new bids are submitted 3. Vars signaling status of auction: `bool auctionFinalized` and `uint256 auctionDeadline` 4. Vars signaling admin aspects of auction: `auctionOwner, auctionFee` Future Modifications: - [ ] Make this contract able to make new auctions using a factory contract. This factory contract would simply deploy new auction contracts. There's much more gas efficient ways about it, such that auctions all live in one contract, but this is also a more simpler way and leverages the fact that it is on an L2. - [ ] Encrypt the entire bid itself, including the identity of the bidder. Questions: 1. What happens if the ciphertext is larger than a uint8 slot?
hashedtitan commented 3 weeks ago

Testing

Referencing the tests written for the simple auction written in rust, the following progress, questions / notes are made:

Progress:

Future Considerations:

hashedtitan commented 3 weeks ago

@bowenyou @SetarehGhorshi, please provide your PR Review at your convenience. I think this is at a point to get feedback so that I can adjust it to be properly tailored for the DevCon tutorials, etc.

I don't think it is at 100% complete yet of course.

Thanks!

hashedtitan commented 3 weeks ago

Finalization of this PR

After conversing with @bowenyou, this version (informally v0), will be finalized and merged upon review from @SetarehGhorshi.

The next version, v1, will be completed throughout this weekend and next week. It will focus on details as per issue #4

TODOs for Finalization: