Skip to content

Commit f4b9c8f

Browse files
authored
docs(common): updates operator overload (#313)
1 parent e261c4c commit f4b9c8f

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

docs/solidity-guides/operations.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ You can generate cryptographically secure random numbers fully on-chain:
6767

6868
For more details, refer to the [Random Encrypted Numbers](random.md) document.
6969

70-
## Overload operators
71-
72-
The `FHE` library supports operator overloading for encrypted integers (e.g., `+`, `-`, `*`, `&`) using the Solidity [`using for`](https://docs.soliditylang.org/en/v0.8.24/contracts.html#using-for) syntax. These overloaded operators currently perform unchecked operations, meaning they do not include overflow checks.
73-
74-
**Example**\
75-
Overloaded operators make code more concise:
76-
77-
```solidity
78-
using {
79-
add as +
80-
} for FHE global;
81-
euint64 a = FHE.asEuint64(42);
82-
euint64 b = FHE.asEuint64(58);
83-
euint64 sum = a + b; /// @dev Calls FHE.add under the hood
84-
```
85-
8670
## Best Practices
8771

8872
Here are some best practices to follow when using encrypted operations in your smart contracts:

0 commit comments

Comments
 (0)