Interfaces
Smart contract interfaces utilities and implementations
These interfaces are available as .sol files and are useful to interact with third party contracts that implement them.
Core
import "@openzeppelin/confidential-contracts/interfaces/IERC7984.sol";Draft interface for a confidential fungible token standard utilizing the Zama FHE library.
Functions
- name()
- symbol()
- decimals()
- contractURI()
- confidentialTotalSupply()
- confidentialBalanceOf(account)
- isOperator(holder, spender)
- setOperator(operator, until)
- confidentialTransfer(to, encryptedAmount, inputProof)
- confidentialTransfer(to, amount)
- confidentialTransferFrom(from, to, encryptedAmount, inputProof)
- confidentialTransferFrom(from, to, amount)
- confidentialTransferAndCall(to, encryptedAmount, inputProof, data)
- confidentialTransferAndCall(to, amount, data)
- confidentialTransferFromAndCall(from, to, encryptedAmount, inputProof, data)
- confidentialTransferFromAndCall(from, to, amount, data)
IERC165
Events
name() → string
external
#Returns the name of the token.
symbol() → string
external
#Returns the symbol of the token.
decimals() → uint8
external
#Returns the number of decimals of the token. Recommended to be 6.
confidentialTotalSupply() → euint64
external
#Returns the confidential total supply of the token.
confidentialBalanceOf(address account) → euint64
external
#Returns the confidential balance of the account account.
isOperator(address holder, address spender) → bool
external
#Returns true if spender is currently an operator for holder.
setOperator(address operator, uint48 until)
external
#Sets operator as an operator for holder until the timestamp until.
An operator may transfer any amount of tokens on behalf of a holder while approved.
confidentialTransfer(address to, externalEuint64 encryptedAmount, bytes inputProof) → euint64
external
#Transfers the encrypted amount encryptedAmount to to with the given input proof inputProof.
Returns the encrypted amount that was actually transferred.
confidentialTransfer(address to, euint64 amount) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransfer-address-externalEuint64-bytes- but without an input proof. The caller
must already be allowed by ACL for the given amount.
confidentialTransferFrom(address from, address to, externalEuint64 encryptedAmount, bytes inputProof) → euint64
external
#Transfers the encrypted amount encryptedAmount from from to to with the given input proof
inputProof. msg.sender must be either from or an operator for from.
Returns the encrypted amount that was actually transferred.
confidentialTransferFrom(address from, address to, euint64 amount) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransferFrom-address-address-externalEuint64-bytes- but without an input proof.
The caller must be already allowed by ACL for the given amount.
confidentialTransferAndCall(address to, externalEuint64 encryptedAmount, bytes inputProof, bytes data) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransfer-address-externalEuint64-bytes- but with a callback to to after
the transfer.
The callback is made to the IERC7984Receiver.onConfidentialTransferReceived function on the
to address with the actual transferred amount (may differ from the given encryptedAmount) and the given
data data.
confidentialTransferAndCall(address to, euint64 amount, bytes data) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransfer-address-euint64- but with a callback to to after the transfer.
confidentialTransferFromAndCall(address from, address to, externalEuint64 encryptedAmount, bytes inputProof, bytes data) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransferFrom-address-address-externalEuint64-bytes- but with a callback to to
after the transfer.
confidentialTransferFromAndCall(address from, address to, euint64 amount, bytes data) → euint64 transferred
external
#Similar to #IERC7984-confidentialTransferFrom-address-address-euint64- but with a callback to to
after the transfer.
OperatorSet(address indexed holder, address indexed operator, uint48 until)
event
#Emitted when the expiration timestamp for an operator operator is updated for a given holder.
The operator may move any amount of tokens on behalf of the holder until the timestamp until.
ConfidentialTransfer(address indexed from, address indexed to, euint64 indexed amount)
event
#Emitted when a confidential transfer is made from from to to of encrypted amount amount.
AmountDisclosed(euint64 indexed encryptedAmount, uint64 amount)
event
#Emitted when an encrypted amount is disclosed.
Accounts with access to the encrypted amount encryptedAmount that is also accessible to this contract
should be able to disclose the amount. This functionality is implementation specific.
import "@openzeppelin/confidential-contracts/interfaces/IERC7984Receiver.sol";Interface for contracts that can receive ERC7984 transfers with a callback.
onConfidentialTransferReceived(address operator, address from, euint64 amount, bytes data) → ebool
external
#Called upon receiving a confidential token transfer. Returns an encrypted boolean indicating success of the callback. If false is returned, the transfer must be reversed.
import "@openzeppelin/confidential-contracts/interfaces/IERC7984Rwa.sol";Interface for confidential RWA contracts.
Functions
- paused()
- isUserAllowed(account)
- confidentialFrozen(account)
- confidentialAvailable(account)
- pause()
- unpause()
- blockUser(account)
- unblockUser(account)
- setConfidentialFrozen(account, encryptedAmount, inputProof)
- setConfidentialFrozen(account, encryptedAmount)
- confidentialMint(to, encryptedAmount, inputProof)
- confidentialMint(to, encryptedAmount)
- confidentialBurn(account, encryptedAmount, inputProof)
- confidentialBurn(account, encryptedAmount)
- forceConfidentialTransferFrom(from, to, encryptedAmount, inputProof)
- forceConfidentialTransferFrom(from, to, encryptedAmount)
IERC7984
- name()
- symbol()
- decimals()
- contractURI()
- confidentialTotalSupply()
- confidentialBalanceOf(account)
- isOperator(holder, spender)
- setOperator(operator, until)
- confidentialTransfer(to, encryptedAmount, inputProof)
- confidentialTransfer(to, amount)
- confidentialTransferFrom(from, to, encryptedAmount, inputProof)
- confidentialTransferFrom(from, to, amount)
- confidentialTransferAndCall(to, encryptedAmount, inputProof, data)
- confidentialTransferAndCall(to, amount, data)
- confidentialTransferFromAndCall(from, to, encryptedAmount, inputProof, data)
- confidentialTransferFromAndCall(from, to, amount, data)
IERC165
Events
paused() → bool
external
#Returns true if the contract is paused, false otherwise.
isUserAllowed(address account) → bool
external
#Returns whether an account is allowed to interact with the token.
confidentialFrozen(address account) → euint64
external
#Returns the confidential frozen balance of an account.
confidentialAvailable(address account) → euint64
external
#Returns the confidential available (unfrozen) balance of an account. Up to IERC7984.confidentialBalanceOf.
pause()
external
#Pauses contract.
unpause()
external
#Unpauses contract.
blockUser(address account)
external
#Blocks a user account.
unblockUser(address account)
external
#Unblocks a user account.
setConfidentialFrozen(address account, externalEuint64 encryptedAmount, bytes inputProof)
external
#Sets confidential amount of token for an account as frozen with proof.
setConfidentialFrozen(address account, euint64 encryptedAmount)
external
#Sets confidential amount of token for an account as frozen.
confidentialMint(address to, externalEuint64 encryptedAmount, bytes inputProof) → euint64
external
#Mints confidential amount of tokens to account with proof.
confidentialMint(address to, euint64 encryptedAmount) → euint64
external
#Mints confidential amount of tokens to account.
confidentialBurn(address account, externalEuint64 encryptedAmount, bytes inputProof) → euint64
external
#Burns confidential amount of tokens from account with proof.
confidentialBurn(address account, euint64 encryptedAmount) → euint64
external
#Burns confidential amount of tokens from account.
forceConfidentialTransferFrom(address from, address to, externalEuint64 encryptedAmount, bytes inputProof) → euint64
external
#Forces transfer of confidential amount of tokens from account to account with proof by skipping compliance checks.
forceConfidentialTransferFrom(address from, address to, euint64 encryptedAmount) → euint64
external
#Forces transfer of confidential amount of tokens from account to account by skipping compliance checks.