33 Commits

Author SHA1 Message Date
Joseph-André Turk
535b055fc8 Updated Solidity version to ^0.8.20 and OpenZeppelin Contracts to ^5.0.1
updated to ethermint node

updated node dev version

removed parallel flag from hardhat test

reput inband test for ci

setup evm version to Paris to avoid PUSH0 error and updated hardhat version

removed utils.ts.new file

synced package.json and package-lock.json

prettier
2024-01-09 11:05:38 +01:00
Joseph-André Turk
ff075c72b2 Added Reencrypt abstract contract to replace use of EIP712WithModifier 2024-01-05 12:21:41 +01:00
Clément 'birdy' Danjou
051f3feefa feat() avoid decryption in transaction 2023-11-20 14:44:06 +01:00
Clément 'birdy' Danjou
b983d29877 feat() use operator instead of .add/.sub/.mul 2023-09-27 17:00:12 +02:00
Clément 'birdy' Danjou
cb1b8a27f1 fix() force 0.8.19 2023-09-25 16:37:13 +02:00
Clément 'birdy' Danjou
59f3480e3f fix() force 0.8.19 version for everything 2023-09-25 16:03:23 +02:00
Clément 'birdy' Danjou
dd385a2a40 feat() move contracts folder to examples folder 2023-09-11 13:42:57 +02:00
Clément 'birdy' Danjou
d7ab5c3db2 feat() add hardhat test and template 2023-07-27 17:09:19 +02:00
Louis Tremblay Thibault
35d94658a3 feat(tfhe): add support for ebool type (#86)
* feat(tfhe): add support for `ebool` type

* fix(auction): use `ebool` adequately

* fix(cmux): fix CMUX example

* fix(lib): rename variables to be consistent

* fix(lib): fix comments
2023-07-14 11:43:47 +02:00
Louis Tremblay Thibault
1ed0f52fd9 fix(auction): remove use of euint32.wrap(0) (#84) 2023-07-12 14:38:40 +02:00
Louis Tremblay Thibault
1ae6cdc592 fix(lib): make solc max version 0.8.19 (#81)
* fix(lib): make solc max version 0.8.19

* fix(tfhe): delete Trivial.sol
2023-07-11 10:30:59 +02:00
Clément 'birdy' Danjou
6afba4e468 feat() make abstract available in the npm package 2023-07-07 19:10:04 +02:00
Clément 'birdy' Danjou
6d66b33af2 feat() make stop only available to contract owner 2023-07-07 19:09:30 +02:00
Clément 'birdy' Danjou
83b9e00e47 feat() add default value for reencrypt 2023-06-29 16:23:15 +02:00
Clément 'birdy' Danjou
db08a35e08 dev() Add hardhat framework to compile and test contracts 2023-06-28 16:41:04 +02:00
Clément 'birdy' Danjou
8bf83bfcd0 feat() add isInitialized function 2023-06-26 19:38:00 +02:00
Clément 'birdy' Danjou
28af1c6e70 fix() fix import 2023-06-26 19:27:17 +02:00
Clément 'birdy' Danjou
d49e09563d feat() blind auction on 32bits 2023-06-26 18:34:24 +02:00
Clément 'birdy' Danjou
c167fd0de7 feat() Update name of optReq and req 2023-06-26 18:34:13 +02:00
Louis Tremblay Thibault
f59adff99f feat(fhe): add missing FHE operators (#53)
* feat: add casting

* feat(ops): add missing fhe ops

* feat(tfhe): type rules

* fix(tfhe): change `lte` to `le`
2023-06-26 11:29:10 +02:00
Clément 'birdy' Danjou
0bcff19da4 prettier things 2023-06-14 16:12:59 +02:00
Clément 'birdy' Danjou
9425840512 Fix() modifier call 2023-06-14 16:07:10 +02:00
Clément 'birdy' Danjou
789631b461 feat() Add abstract for EIP712 modifier 2023-06-02 20:36:48 +02:00
Clément 'birdy' Danjou
006f20e942 Update contracts with new lib 2023-06-01 17:12:05 +02:00
Clément 'birdy' Danjou
1abdec2ba6 Implement 712 with openzeppelin and begin clean 2023-06-01 17:11:29 +02:00
Clément 'birdy' Danjou
f1161a30c0 feat() add bid counter and manual stop 2023-04-14 10:22:39 +02:00
Clément 'birdy' Danjou
702cbac42c feat() add bidcounter 2023-04-12 10:55:55 +02:00
Clément 'birdy' Danjou
7464c84de9 fix() make balances, allowances and bid as internal 2023-04-07 17:50:54 +02:00
Clément 'birdy' Danjou
5ccc35c8e1 feat() split transfer in 2 calls 2023-03-15 14:45:49 +01:00
Clément 'birdy' Danjou
af0f5436d3 feat() Add end time on blind auction and beneficiary 2023-03-14 18:53:56 +01:00
Clément 'birdy' Danjou
b5935e9a16 fix() add transfer to condition and handle if no bid exists 2023-03-07 19:49:40 +01:00
Petar Ivanov
9ee4f72b6b Allow users to bid higher values
When overwriting a bid of a particular user, only do so if the current
bid is less than the incomoing bid. This allows for safe updates of
bids.
2023-02-03 12:35:41 +02:00
Petar Ivanov
083c8c656f Add a blind auction example (#13)
The `BlindAuction` example contract supports a blind auction with the
following properties:
 * bids remain hidden
 * winning bid remains hidden
 * winner address becomes public at the end

In order to support hidden bids, we link the auction to the
`EncryptedERC20` contract, such that bids are in this token. We utilize
the allowances mechanism to approve use of user tokens on their behalf
by the auction contract.

The flow is:
1. Auction owner creates the auction contract.
2. Users approve use of tokens in the ERC20 contract via `approve()`.
3. Users call `bid()` to bid an amount less than or equal to the
approved token amount.
4. Auction owner stops the auction.
5. Users can call `doIHaveHighestBid() to know if they have the highest
bid.
6. If user has highest bid, they can call `claim()` to claim the object.
At that point, we decrypt a boolean that shows whether the caller has
the highest bid. No other decryptions are done.
7. If user doesn't have the highest bid, they can `withdraw()` their
bid.

Currently, we emit an event to denote that the winner has claimed the
"object" of the auction.

If two or more bidders bid the same value, whoever claims first is the
winner. All other bidders can only withdraw their bids at that point.

Add support for the less-than FHE op.
2023-02-02 16:52:25 +02:00