Private ERC20
The Private ERC20 contract is an abstract implementation of a privacy-enhanced ERC20 token. It introduces mechanisms for handling encrypted balances, allowing for more secure and private token transfers. This contract integrates with the MPC Core library for secure multiparty computation (MPC).
Usage
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "@coti-io/coti-contracts/contracts/token/PrivateERC20/PrivateERC20.sol";
contract MyToken is PrivateERC20 {
constructor() PrivateERC20("Private Token", "PTOK") {}
}
Functions
constructor(string memory name_, string memory symbol_)
function name() view returns (string memory)
function symbol() view returns (string memory)
function decimals() view returns (uint8)
function totalSupply() view returns (uint256)
function accountEncryptionAddress(address account) view returns (address)
function balanceOf(address account) view returns (ctUint64)
function balanceOf() returns (gtUint64)
function setAccountEncryptionAddress(address addr) returns (bool)
function transfer(address to, itUint64 calldata value) returns (gtBool)
function transfer(address to, gtUint64 value) returns (gtBool)
function allowance(address owner, address spender) view returns (Allowance memory)
function allowance(address account, bool isSpender) returns (gtUint64)
function reencryptAllowance(address account, bool isSpender) returns (bool)
function approve(address spender, itUint64 calldata value) returns (bool)
function approve(address spender, gtUint64 value) returns (bool)
function transferFrom(address from, address to, itUint64 calldata value) returns (gtBool)
function transferFrom(address from, address to, gtUint64 value) returns (gtBool)
function _transfer(address from, address to, gtUint64 value) returns (gtBool)
function _update(address from, address to, gtUint64 value) returns (gtBool)
function _getBalance(address account) returns (gtUint64)
function _getAccountEncryptionAddress(address account) view returns (address)
function _updateBalance(address account, gtUint64 balance)
function _mint(address account, gtUint64 value) returns (gtBool)
function _burn(address account, gtUint64 value) returns (gtBool)
function _approve(address owner, address spender, gtUint64 value)
function _spendAllowance(address owner, address spender, gtUint64 value)
function _safeOnboard(ctUint64 value) returns (gtUint64)
event Transfer(address indexed from, address indexed to, ctUint64 senderValue, ctUint64 receiverValue);
event Approval(address indexed owner, address indexed spender, ctUint64 ownerValue, ctUint64 spenderValue);
Errors
error ERC20InvalidSender(address sender)
error ERC20InvalidReceiver(address receiver)
error ERC20InvalidApprover(address approver)
error ERC20InvalidSpender(address spender)
Last updated