Skip to content

Commit

Permalink
updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-gai committed Oct 1, 2023
1 parent 24bc4c0 commit 0019623
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions contracts/EncryptedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ contract EncryptedERC20 is EIP712WithModifier {

function _updateAllowance(address owner, address spender, euint32 amount) internal {
euint32 currentAllowance = _allowance(owner, spender);
TFHE.req(TFHE.le(amount, currentAllowance));
TFHE.optReq(TFHE.le(amount, currentAllowance));
_approve(owner, spender, TFHE.sub(currentAllowance, amount));
}

// Transfers an encrypted amount.
function _transfer(address from, address to, euint32 amount) internal {
// Make sure the sender has enough tokens.
TFHE.req(TFHE.le(amount, balances[from]));
TFHE.optReq(TFHE.le(amount, balances[from]));

// Add to the balance of `to` and subract from the balance of `from`.
balances[to] = TFHE.add(balances[to], amount);
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const config: HardhatUserConfig = {
tests: "./test",
},
solidity: {
version: "0.8.17",
version: "0.8.19",
settings: {
metadata: {
// Not including the metadata hash
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.4.0",
"fhevm": "^0.1.6",
"fhevmjs": "^0.1.3",
"fhevm": "^0.1.13",
"fhevmjs": "^0.2.1",
"fs-extra": "^10.1.0",
"hardhat": "^2.12.2",
"hardhat-deploy": "^0.11.29",
Expand Down
47 changes: 24 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0019623

Please sign in to comment.