| pragma solidity ^0.8.0; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| import "./ZkSnarkVerifier.sol"; | |
| contract PrivateTransactions { | |
| IERC20 public immutable token; | |
| ZkSnarkVerifier public immutable verifier; | |
| constructor(address _token, address _verifier) { | |
| token = IERC20(_token); | |
| verifier = ZkSnarkVerifier(_verifier); | |
| } | |
| function privateTransfer( | |
| uint256[2] memory a, | |
| uint256[2][2] memory b, | |
| uint256[2] memory c, | |
| uint256[3] memory input | |
| ) external { | |
| require(verifier.verifyProof(a, b, c, input), "Invalid zk-SNARK proof"); | |
| // Executar a transferência privada | |
| } | |
| } |