-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged by EIP-Bot.
- Loading branch information
Showing
10 changed files
with
90 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,73 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity >=0.7.0 <0.9.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 so called checked transfer functionality which can be used to directly interact with an SDC. | ||
* Checked transfers can be conducted for single or multiple transactions where SDC will receive a success message whether the transfer was executed successfully or not. | ||
* @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 afterTransfer(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 afterTransfer | ||
*/ | ||
event TransferRequested(address from, address to, uint256 value, uint256 transactionID, address callbackContract); | ||
|
||
interface IERC20Settlement is IERC20 { | ||
/** | ||
* @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 afterTransfer | ||
*/ | ||
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 | ||
* @param transactionID - an id that will be passed back to the callback | ||
* @param callbackContract - a contract implementing the method afterTransfer(bool success, uint256 transactionID, string memory transactionData) | ||
*/ | ||
function checkedTransfer(address to, uint256 value, uint256 transactionID) external; | ||
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 | ||
* @param transactionID - an id that will be passed back to the callback | ||
* @param callbackContract - a contract implementing the method afterTransfer(bool success, uint256 transactionID, string memory transactionData) | ||
*/ | ||
function checkedTransferFrom(address from, address to, uint256 value, uint256 transactionID) external ; | ||
|
||
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 | ||
* @param transactionID - an id that will be passed back to the callback | ||
* @param callbackContract - a contract implementing the method afterTransfer(bool success, uint256 transactionID, string memory transactionData) | ||
*/ | ||
function checkedBatchTransfer(address[] memory to, uint256[] memory values, uint256 transactionID ) external; | ||
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 value - transfer amounts | ||
* @param transactionID | ||
* @param values - transfer amounts | ||
* @param transactionID - an id that will be passed back to the callback | ||
* @param callbackContract - a contract implementing the method afterTransfer(bool success, uint256 transactionID, string memory transactionData) | ||
*/ | ||
function checkedBatchTransferFrom(address[] memory from, address[] memory to, uint256[] memory values, uint256 transactionID ) external; | ||
|
||
|
||
function transferBatchFromAndCallback(address[] memory from, address[] memory to, uint256[] memory values, uint256 transactionID, address callbackContract) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.