@@ -29,14 +29,12 @@ import { ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/ERC2
2929import { Address } from "@openzeppelin/contracts/utils/Address.sol " ;
3030import { Math } from "@openzeppelin/contracts/utils/math/Math.sol " ;
3131import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol " ;
32+ import { BITE, PublicKey } from "@skalenetwork/bite-solidity/BITE.sol " ;
3233
3334import { EIP3009 } from "./eip3009/EIP3009.sol " ;
3435
3536import { ZeroAddress } from "./errors.sol " ;
36- import { IBiteSupplicant } from "./interfaces/bite/IBiteSupplicant.sol " ;
37- import { IConfidentialToken } from "./interfaces/IConfidentialToken.sol " ;
38- import { Precompiled } from "./Precompiled.sol " ;
39- import { PublicKey } from "./types.sol " ;
37+ import { IBiteSupplicant, IConfidentialToken } from "./interfaces/IConfidentialToken.sol " ;
4038
4139
4240/// @title ConfidentialToken
@@ -54,10 +52,10 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
5452 uint256 public callbackFee = 1_000 gwei ;
5553
5654 /// @notice Address of the EncryptECIES precompiled contract
57- address public encryptECIESAddress = address ( 0x1C ) ;
55+ address public encryptECIESAddress = BITE.ENCRYPT_ECIES_ADDRESS ;
5856
5957 /// @notice Address of the EncryptTE precompiled contract
60- address public encryptTEAddress = address ( 0x1D ) ;
58+ address public encryptTEAddress = BITE.ENCRYPT_TE_ADDRESS ;
6159
6260 /// @notice Mapping of holder addresses to their viewers' addresses
6361 mapping (address holder = > address viewerAddress ) public viewerAddresses;
@@ -66,7 +64,7 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
6664 mapping (address accountAddress = > PublicKey publicKey ) public publicKeys;
6765
6866 /// @notice Address of the submitCTX precompiled contract
69- address public submitCTXAddress = address ( 0x1B ) ;
67+ address public submitCTXAddress = BITE.SUBMIT_CTX_ADDRESS ;
7068
7169 /// @notice Version of the contract
7270 /// @dev Is used to get proper ABI
@@ -385,7 +383,7 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
385383 }
386384 uint256 valueIndex = encryptedArgumentsLength;
387385 ++ encryptedArgumentsLength;
388- bytes memory encryptedValue = Precompiled .encryptTE (encryptTEAddress, abi.encodePacked (value));
386+ bytes memory encryptedValue = BITE .encryptTE (encryptTEAddress, abi.encodePacked (value));
389387
390388 bytes [] memory encryptedArguments = new bytes [](encryptedArgumentsLength);
391389 if (from != address (0 )) {
@@ -399,7 +397,7 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
399397 bytes [] memory plaintextArguments = new bytes [](1 );
400398 plaintextArguments[0 ] = abi.encode (from, to);
401399
402- address payable callback = Precompiled .submitCTX (
400+ address payable callback = BITE .submitCTX (
403401 submitCTXAddress,
404402 callbackFee / tx .gasprice ,
405403 encryptedArguments,
@@ -414,10 +412,10 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
414412 // Private functions
415413
416414 function _setBalance (address holder , uint256 balance ) private {
417- _thresholdBalances[holder] = Precompiled .encryptTE (encryptTEAddress, abi.encodePacked (balance));
415+ _thresholdBalances[holder] = BITE .encryptTE (encryptTEAddress, abi.encodePacked (balance));
418416 if (_viewerIsRegistered (holder)) {
419417 PublicKey memory viewerPublicKey = _getViewKey (holder);
420- _userBalances[holder] = Precompiled .encryptECIES (
418+ _userBalances[holder] = BITE .encryptECIES (
421419 encryptECIESAddress,
422420 abi.encodePacked (balance),
423421 viewerPublicKey
@@ -428,7 +426,7 @@ contract ConfidentialToken is EIP3009, ERC20Permit, AccessManaged, IConfidential
428426 function _getEncryptedBalance (address holder ) private view returns (bytes memory encryptedBalance ) {
429427 encryptedBalance = _thresholdBalances[holder];
430428 if (encryptedBalance.length == 0 ) {
431- encryptedBalance = Precompiled .encryptTE (
429+ encryptedBalance = BITE .encryptTE (
432430 encryptTEAddress,
433431 abi.encodePacked (uint256 (0 ))
434432 );
0 commit comments