22
33pragma solidity ^ 0.8.24 ;
44
5- import { TFHE , euint64, einput } from "fhevm/lib/TFHE .sol " ;
5+ import { FHE , euint64, externalEuint64 } from "@ fhevm/solidity/ lib/FHE .sol " ;
66import { ConfidentialFungibleToken } from "../token/ConfidentialFungibleToken.sol " ;
7- import { SepoliaZamaGatewayConfig } from "fhevm/config/ZamaGatewayConfig.sol " ;
8- import { SepoliaZamaFHEVMConfig } from "fhevm/config/ZamaFHEVMConfig.sol " ;
7+ import { SepoliaConfig } from "@fhevm/solidity/config/ZamaConfig.sol " ;
98
10- contract ConfidentialFungibleTokenMock is ConfidentialFungibleToken , SepoliaZamaFHEVMConfig , SepoliaZamaGatewayConfig {
9+ contract ConfidentialFungibleTokenMock is ConfidentialFungibleToken , SepoliaConfig {
1110 address private immutable _OWNER;
1211
1312 constructor (
@@ -20,50 +19,50 @@ contract ConfidentialFungibleTokenMock is ConfidentialFungibleToken, SepoliaZama
2019
2120 function _update (address from , address to , euint64 amount ) internal virtual override returns (euint64 transferred ) {
2221 transferred = super ._update (from, to, amount);
23- TFHE .allow (totalSupply (), _OWNER);
22+ FHE .allow (totalSupply (), _OWNER);
2423 }
2524
2625 function $_mint (
2726 address to ,
28- einput encryptedAmount ,
27+ externalEuint64 encryptedAmount ,
2928 bytes calldata inputProof
3029 ) public returns (euint64 transferred ) {
31- return _mint (to, TFHE. asEuint64 (encryptedAmount, inputProof));
30+ return _mint (to, FHE. fromExternal (encryptedAmount, inputProof));
3231 }
3332
3433 function $_transfer (
3534 address from ,
3635 address to ,
37- einput encryptedAmount ,
36+ externalEuint64 encryptedAmount ,
3837 bytes calldata inputProof
3938 ) public returns (euint64 transferred ) {
40- return _transfer (from, to, TFHE. asEuint64 (encryptedAmount, inputProof));
39+ return _transfer (from, to, FHE. fromExternal (encryptedAmount, inputProof));
4140 }
4241
4342 function $_transferAndCall (
4443 address from ,
4544 address to ,
46- einput encryptedAmount ,
45+ externalEuint64 encryptedAmount ,
4746 bytes calldata inputProof ,
4847 bytes calldata data
4948 ) public returns (euint64 transferred ) {
50- return _transferAndCall (from, to, TFHE. asEuint64 (encryptedAmount, inputProof), data);
49+ return _transferAndCall (from, to, FHE. fromExternal (encryptedAmount, inputProof), data);
5150 }
5251
5352 function $_burn (
5453 address from ,
55- einput encryptedAmount ,
54+ externalEuint64 encryptedAmount ,
5655 bytes calldata inputProof
5756 ) public returns (euint64 transferred ) {
58- return _burn (from, TFHE. asEuint64 (encryptedAmount, inputProof));
57+ return _burn (from, FHE. fromExternal (encryptedAmount, inputProof));
5958 }
6059
6160 function $_update (
6261 address from ,
6362 address to ,
64- einput encryptedAmount ,
63+ externalEuint64 encryptedAmount ,
6564 bytes calldata inputProof
6665 ) public virtual returns (euint64 transferred ) {
67- return _update (from, to, TFHE. asEuint64 (encryptedAmount, inputProof));
66+ return _update (from, to, FHE. fromExternal (encryptedAmount, inputProof));
6867 }
6968}
0 commit comments