// SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.7.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /*------------------------------------------- DESCRIPTION --------------------------------------------------------------------------------------- * @title ERC6123 - Settlement Token Interface * @dev Settlement Token Interface enhances the ERC20 Token by introducing an asynchronous (checked) transfer functionality which can be used to directly interact with an SDC. * Transfers can be conducted for single or multiple transactions where SDC will receive a success message whether the transfer was executed successfully or not. * The SDC or callbackContract needs to implemnt a function afterSettlement(bool success, uint256 transactionID, string memory transactionData) */ interface IERC20Settlement is IERC20 { /** * @dev Emitted when a transfer gets requested * @param from the address from which to transfer * @param to the address to which to transfer * @param value the value to transfer * @param transactionID a transaction ID that may serve as correlation ID, will be passed to the callback. * @param callbackContract a contract implementing afterSettlement */ event TransferRequested(address from, address to, uint256 value, uint256 transactionID, address callbackContract); /** * @dev Emitted when a batch transfer gets requested * @param from the addresses from which to transfer * @param to the addresses to which to transfer * @param value the values to transfer * @param transactionID a transaction ID that may serve as correlation ID, will be passed to the callback. * @param callbackContract a contract implementing afterSettlement */ event TransferBatchRequested(address[] from, address[] to, uint256[] value, uint256 transactionID, address callbackContract); /* * @dev Performs a single transfer from msg.sender balance and checks whether this transfer can be conducted * @param to - receiver * @param value - transfer amount * @param transactionID - an id that will be passed back to the callback * @param callbackContract - a contract implementing the method afterSettlement(bool success, uint256 transactionID, string memory transactionData) */ function transferAndCallback(address to, uint256 value, uint256 transactionID, address callbackContract) external; /* * @dev Performs a single transfer to a single addresss and checks whether this transfer can be conducted * @param from - payer * @param to - receiver * @param value - transfer amount * @param transactionID - an id that will be passed back to the callback * @param callbackContract - a contract implementing the method afterSettlement(bool success, uint256 transactionID, string memory transactionData) */ function transferFromAndCallback(address from, address to, uint256 value, uint256 transactionID, address callbackContract) external ; /* * @dev Performs a multiple transfers from msg.sender balance and checks whether these transfers can be conducted * @param to - receivers * @param values - transfer amounts * @param transactionID - an id that will be passed back to the callback * @param callbackContract - a contract implementing the method afterSettlement(bool success, uint256 transactionID, string memory transactionData) */ function transferBatchAndCallback(address[] memory to, uint256[] memory values, uint256 transactionID, address callbackContract) external; /* * @dev Performs a multiple transfers between multiple addresses and checks whether these transfers can be conducted * @param from - payers * @param to - receivers * @param values - transfer amounts * @param transactionID - an id that will be passed back to the callback * @param callbackContract - a contract implementing the method afterSettlement(bool success, uint256 transactionID, string memory transactionData) */ function transferBatchFromAndCallback(address[] memory from, address[] memory to, uint256[] memory values, uint256 transactionID, address callbackContract) external; }