Files
zeekayandHanzo Dev a8c164c427 Depend on the packages that exist
A rebrand renamed third-party names it did not own. @luxfhe-fhe/relayer-sdk and
@luxfhe-fhe/oracle-solidity were never published, and @fhevm/solidity ships
config/ZamaConfig.sol, not LuxConfig.sol, so nothing installed and no contract
compiled. The overrides now say what the lockfile already resolved
(@zama-fhe/relayer-sdk ^0.3.0-8, @zama-fhe/oracle-solidity ^0.2.0), and the
relayer bundle loads from cdn.zama.org, the host that serves it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-23 01:53:25 -07:00

43 lines
1.3 KiB
Solidity

// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
import {FHE, euint32} from "@fhevm/solidity/lib/FHE.sol";
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
contract PublicDecryptSingleValue is ZamaEthereumConfig {
euint32 private _encryptedUint32;
uint32 private _clearUint32;
constructor() {}
function initializeUint32(uint32 value) external {
_encryptedUint32 = FHE.add(FHE.asEuint32(value), FHE.asEuint32(1));
FHE.allowThis(_encryptedUint32);
}
function initializeUint32Wrong(uint32 value) external {
_encryptedUint32 = FHE.add(FHE.asEuint32(value), FHE.asEuint32(1));
}
function decryptSingleUint32() external {
FHE.makePubliclyDecryptable(_encryptedUint32);
}
function getHandle() external view returns (bytes32) {
return FHE.toBytes32(_encryptedUint32);
}
function callbackDecryptSingleUint32(
bytes32[] calldata handlesList,
bytes calldata cleartexts,
bytes calldata decryptionProof
) external {
FHE.checkSignatures(handlesList, cleartexts, decryptionProof);
_clearUint32 = abi.decode(cleartexts, (uint32));
}
function clearUint32() public view returns (uint32) {
return _clearUint32;
}
}