Skip to content

Commit e47116f

Browse files
Standardize doc mocks
1 parent 124e620 commit e47116f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.24;
33

4-
import {FHE, externalEuint64, ebool, euint64} from "@fhevm/solidity/lib/FHE.sol";
4+
import {FHE, externalEuint64} from "@fhevm/solidity/lib/FHE.sol";
55
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
66
import {ERC7984} from "../../token/ERC7984/ERC7984.sol";
77

88
contract ERC7984MintableBurnable is ERC7984, Ownable {
9-
using FHE for *;
10-
119
constructor(
1210
address owner,
1311
string memory name,
@@ -16,10 +14,10 @@ contract ERC7984MintableBurnable is ERC7984, Ownable {
1614
) ERC7984(name, symbol, uri) Ownable(owner) {}
1715

1816
function mint(address to, externalEuint64 amount, bytes memory inputProof) public onlyOwner {
19-
_mint(to, amount.fromExternal(inputProof));
17+
_mint(to, FHE.fromExternal(amount, inputProof));
2018
}
2119

2220
function burn(address from, externalEuint64 amount, bytes memory inputProof) public onlyOwner {
23-
_burn(from, amount.fromExternal(inputProof));
21+
_burn(from, FHE.fromExternal(amount, inputProof));
2422
}
2523
}

contracts/mocks/docs/SwapERC7984ToERC20.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ pragma solidity ^0.8.24;
44
import {FHE, externalEuint64, euint64} from "@fhevm/solidity/lib/FHE.sol";
55
import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
66
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
7-
87
import {IERC7984} from "../../interfaces/IERC7984.sol";
98

109
contract SwapConfidentialToERC20 {
11-
using FHE for *;
12-
1310
error SwapConfidentialToERC20InvalidGatewayRequest(uint256 requestId);
1411

1512
mapping(uint256 requestId => address) private _receivers;
@@ -22,8 +19,8 @@ contract SwapConfidentialToERC20 {
2219
}
2320

2421
function swapConfidentialToERC20(externalEuint64 encryptedInput, bytes memory inputProof) public {
25-
euint64 amount = encryptedInput.fromExternal(inputProof);
26-
amount.allowTransient(address(_fromToken));
22+
euint64 amount = FHE.fromExternal(encryptedInput, inputProof);
23+
FHE.allowTransient(amount, address(_fromToken));
2724
euint64 amountTransferred = _fromToken.confidentialTransferFrom(msg.sender, address(this), amount);
2825

2926
bytes32[] memory cts = new bytes32[](1);

0 commit comments

Comments
 (0)