From 74d6256e8e2b6149a3f68f1fd8ac09d11d141137 Mon Sep 17 00:00:00 2001 From: mcisb <83702309+KyryloKilin@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:19:06 +0300 Subject: [PATCH 1/2] Update Writing-The-Contract.md --- docs/devdocs/Tutorials/Basic/Writing-The-Contract.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devdocs/Tutorials/Basic/Writing-The-Contract.md b/docs/devdocs/Tutorials/Basic/Writing-The-Contract.md index 509c2a25..89ce2f2c 100644 --- a/docs/devdocs/Tutorials/Basic/Writing-The-Contract.md +++ b/docs/devdocs/Tutorials/Basic/Writing-The-Contract.md @@ -139,7 +139,7 @@ Here we can see a few interesting things: `transferEncrypted(address to, bytes calldata encryptedAmount)` is a public function that transfers encrypted tokens from the function caller to the to address. It converts the encrypted amount into the encrypted integer form `euint32` using the `FHE.asEuint32(encryptedAmount)` function and then calls `_transferEncrypted`. The function `_transferEncrypted(address to, euint32 amount)` is an internal function that just calls _transferImpl. -`_transferImpl(address from, address to, euint32 amount)` performs the actual transfer. It checks if the sender has enough tokens, then adds the amount to the to address encrypted balance and subtracts the same amount from the from address encrypted balance. +`_transferImpl(address from, address to, euint32 amount)` performs the actual transfer. It checks if the sender has enough tokens, then adds the amount to the address encrypted balance and subtracts the same amount from the address encrypted balance. ```javascript function transferEncrypted(address to, inEuint32 calldata encryptedAmount) public { From 29d1776edeffb41f25c2aaa268315222b24bf7c6 Mon Sep 17 00:00:00 2001 From: mcisb <83702309+KyryloKilin@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:26:20 +0300 Subject: [PATCH 2/2] Update FHE.md --- docs/devdocs/Solidity API/FHE.md | 86 ++++++++++++++++---------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/docs/devdocs/Solidity API/FHE.md b/docs/devdocs/Solidity API/FHE.md index 7ba36339..5d3d8c66 100644 --- a/docs/devdocs/Solidity API/FHE.md +++ b/docs/devdocs/Solidity API/FHE.md @@ -132,7 +132,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function add(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the add operation +This function performs the add operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -156,7 +156,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function add(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the add operation +This function performs the add operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -341,7 +341,7 @@ _Pure in this function is marked as a hack/workaround - note that this function function sealoutput(eaddress value, bytes32 publicKey) internal pure returns (string) ``` -performs the sealoutput function on a eaddress ciphertext. This operation returns the plaintext value, sealed for the public key provided +performs the sealoutput function on an eaddress ciphertext. This operation returns the plaintext value, sealed for the public key provided _Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -564,7 +564,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function lte(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the lte operation +This function performs the lte operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -588,7 +588,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function lte(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the lte operation +This function performs the lte operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -684,7 +684,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function sub(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the sub operation +This function performs the sub operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -708,7 +708,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function sub(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the sub operation +This function performs the sub operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -804,7 +804,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function mul(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the mul operation +This function performs the mul operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -900,7 +900,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function lt(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the lt operation +This function performs the lt operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -924,7 +924,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function lt(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the lt operation +This function performs the lt operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1252,7 +1252,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function gt(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the gt operation +This function performs the gt operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1276,7 +1276,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function gt(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the gt operation +This function performs the gt operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1372,7 +1372,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function gte(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the gte operation +This function performs the gte operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1396,7 +1396,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function gte(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the gte operation +This function performs the gte operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1588,7 +1588,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function and(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the and operation +This function performs the and operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1612,7 +1612,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function and(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the and operation +This function performs the and operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1732,7 +1732,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function or(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the or operation +This function performs the or operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1756,7 +1756,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function or(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the or operation +This function performs the or operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1876,7 +1876,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function xor(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the xor operation +This function performs the xor operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -1900,7 +1900,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function xor(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the xor operation +This function performs the xor operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2020,7 +2020,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function eq(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the eq operation +This function performs the eq operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2044,7 +2044,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function eq(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the eq operation +This function performs the eq operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2068,7 +2068,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function eq(euint256 lhs, euint256 rhs) internal pure returns (ebool) ``` -This functions performs the eq operation +This function performs the eq operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2092,7 +2092,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function eq(eaddress lhs, eaddress rhs) internal pure returns (ebool) ``` -This functions performs the eq operation +This function performs the eq operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2212,7 +2212,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function ne(euint64 lhs, euint64 rhs) internal pure returns (ebool) ``` -This functions performs the ne operation +This function performs the ne operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2236,7 +2236,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function ne(euint128 lhs, euint128 rhs) internal pure returns (ebool) ``` -This functions performs the ne operation +This function performs the ne operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2260,7 +2260,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function ne(euint256 lhs, euint256 rhs) internal pure returns (ebool) ``` -This functions performs the ne operation +This function performs the ne operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2284,7 +2284,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function ne(eaddress lhs, eaddress rhs) internal pure returns (ebool) ``` -This functions performs the ne operation +This function performs the ne operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2380,7 +2380,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function min(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the min operation +This function performs the min operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2404,7 +2404,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function min(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the min operation +This function performs the min operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2500,7 +2500,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function max(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the max operation +This function performs the max operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2524,7 +2524,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function max(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the max operation +This function performs the max operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2620,7 +2620,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function shl(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the shl operation +This function performs the shl operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2644,7 +2644,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function shl(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the shl operation +This function performs the shl operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2740,7 +2740,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function shr(euint64 lhs, euint64 rhs) internal pure returns (euint64) ``` -This functions performs the shr operation +This function performs the shr operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -2764,7 +2764,7 @@ Pure in this function is marked as a hack/workaround - note that this function i function shr(euint128 lhs, euint128 rhs) internal pure returns (euint128) ``` -This functions performs the shr operation +This function performs the shr operation _If any of the inputs are expected to be a ciphertext, it verifies that the value matches a valid ciphertext Pure in this function is marked as a hack/workaround - note that this function is NOT pure as fetches of ciphertexts require state access_ @@ -3394,7 +3394,7 @@ Converts a euint256 to an eaddress function asEbool(eaddress value) internal pure returns (ebool) ``` -Converts a eaddress to an ebool +Converts an eaddress to an ebool ### asEuint8 @@ -3402,7 +3402,7 @@ Converts a eaddress to an ebool function asEuint8(eaddress value) internal pure returns (euint8) ``` -Converts a eaddress to an euint8 +Converts an eaddress to an euint8 ### asEuint16 @@ -3410,7 +3410,7 @@ Converts a eaddress to an euint8 function asEuint16(eaddress value) internal pure returns (euint16) ``` -Converts a eaddress to an euint16 +Converts an eaddress to an euint16 ### asEuint32 @@ -3418,7 +3418,7 @@ Converts a eaddress to an euint16 function asEuint32(eaddress value) internal pure returns (euint32) ``` -Converts a eaddress to an euint32 +Converts an eaddress to an euint32 ### asEuint64 @@ -3426,7 +3426,7 @@ Converts a eaddress to an euint32 function asEuint64(eaddress value) internal pure returns (euint64) ``` -Converts a eaddress to an euint64 +Converts an eaddress to an euint64 ### asEuint128 @@ -3434,7 +3434,7 @@ Converts a eaddress to an euint64 function asEuint128(eaddress value) internal pure returns (euint128) ``` -Converts a eaddress to an euint128 +Converts an eaddress to an euint128 ### asEuint256 @@ -3442,7 +3442,7 @@ Converts a eaddress to an euint128 function asEuint256(eaddress value) internal pure returns (euint256) ``` -Converts a eaddress to an euint256 +Converts an eaddress to an euint256 ### asEaddress