diff --git a/ERCS/erc-6123.md b/ERCS/erc-6123.md
index dc6fb80aa3..fd7055656f 100644
--- a/ERCS/erc-6123.md
+++ b/ERCS/erc-6123.md
@@ -131,14 +131,14 @@ The settlement amount will be checked according to contract terms, resulting in
function performSettlement(int256 settlementAmount, string memory settlementData) external;
```
-#### Settlement Phase: `afterTransfer`
+#### Settlement Phase: `afterSettlement`
This method - either called back from the provided settlement token directly or from an eligible address - completes the settlement transfer.
The transactionData is emitted as part of the corresponding event: `SettlementTransferred` or `SettlementFailed`
This might result in a termination or start of the next settlement phase, depending on the provided success flag.
```solidity
-function afterTransfer(bool success, uint256 transactionID, string memory transactionData) external;
+function afterSettlement(bool success, uint256 transactionID, string memory transactionData) external;
```
@@ -262,13 +262,13 @@ The interface design and reference implementation are based on the following con
### State diagram of trade and process states
-![image info](../assets/eip-6123/doc/sdc_trade_states.svg)
+![image info](../assets/erc-6123/doc/sdc_trade_states.svg)
The diagram shows the trade states of a single trade SDC as in `SDCSingleTrade.sol`.
### Sequence diagram of reference implementation 'SDCPledgedBalance.sol'
-![image info](../assets/eip-6123/doc/sequence.svg)
+![image info](../assets/erc-6123/doc/sequence.svg)
The sequence diagram show the function calls that create the trade and stellement state transitions
and the emitted events.
diff --git a/assets/erc-6123/contracts/ERC20Settlement.sol b/assets/erc-6123/contracts/ERC20Settlement.sol
index 0fa805e952..e628167961 100644
--- a/assets/erc-6123/contracts/ERC20Settlement.sol
+++ b/assets/erc-6123/contracts/ERC20Settlement.sol
@@ -12,7 +12,7 @@ import "./IERC20Settlement.sol";
* @dev This token performs transfers on-chain.
* Token is tied to one SDC address
* Only SDC can call checkedTransfers
-* Settlement Token calls back the referenced SDC by calling "afterTransfer" with a success flag. Depending on this SDC perfoms next state change
+* Settlement Token calls back the referenced SDC by calling "afterSettlement" with a success flag. Depending on this SDC perfoms next state change
*/
contract ERC20Settlement is ERC20, IERC20Settlement{
@@ -38,11 +38,11 @@ contract ERC20Settlement is ERC20, IERC20Settlement{
function transferAndCallback(address to, uint256 value, uint256 transactionID, address callbackContract) public onlySDC{
if ( balanceOf(msg.sender) < value) {
- ISDC(callbackContract).afterTransfer(false, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(false, transactionID, Strings.toString(transactionID));
}
else {
_transfer(msg.sender,to,value);
- ISDC(callbackContract).afterTransfer(true, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(true, transactionID, Strings.toString(transactionID));
}
}
@@ -57,14 +57,14 @@ contract ERC20Settlement is ERC20, IERC20Settlement{
requiredBalance += values[i];
}
if (balanceOf(msg.sender) < requiredBalance){
- ISDC(callbackContract).afterTransfer(false, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(false, transactionID, Strings.toString(transactionID));
return;
}
else{
for(uint256 i = 0; i < to.length; i++){
_transfer(msg.sender,to[i],values[i]);
}
- ISDC(callbackContract).afterTransfer(true, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(true, transactionID, Strings.toString(transactionID));
}
}
@@ -79,7 +79,7 @@ contract ERC20Settlement is ERC20, IERC20Settlement{
totalRequiredBalance += values[j];
}
if (balanceOf(fromAddress) < totalRequiredBalance){
- ISDC(callbackContract).afterTransfer(false, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(false, transactionID, Strings.toString(transactionID));
return;
}
@@ -87,6 +87,6 @@ contract ERC20Settlement is ERC20, IERC20Settlement{
for(uint256 i = 0; i < to.length; i++){
_transfer(from[i],to[i],values[i]);
}
- ISDC(callbackContract).afterTransfer(true, transactionID, Strings.toString(transactionID));
+ ISDC(callbackContract).afterSettlement(true, transactionID, Strings.toString(transactionID));
}
}
\ No newline at end of file
diff --git a/assets/erc-6123/contracts/IERC20Settlement.sol b/assets/erc-6123/contracts/IERC20Settlement.sol
index 60b913badb..cfd85bf4af 100644
--- a/assets/erc-6123/contracts/IERC20Settlement.sol
+++ b/assets/erc-6123/contracts/IERC20Settlement.sol
@@ -9,7 +9,7 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
* @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 afterTransfer(bool success, uint256 transactionID, string memory transactionData)
+ * The SDC or callbackContract needs to implemnt a function afterSettlement(bool success, uint256 transactionID, string memory transactionData)
*/
interface IERC20Settlement is IERC20 {
@@ -19,7 +19,7 @@ interface IERC20Settlement is IERC20 {
* @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
+ * @param callbackContract a contract implementing afterSettlement
*/
event TransferRequested(address from, address to, uint256 value, uint256 transactionID, address callbackContract);
@@ -29,7 +29,7 @@ interface IERC20Settlement is IERC20 {
* @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
+ * @param callbackContract a contract implementing afterSettlement
*/
event TransferBatchRequested(address[] from, address[] to, uint256[] value, uint256 transactionID, address callbackContract);
@@ -38,7 +38,7 @@ interface IERC20Settlement is IERC20 {
* @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 afterTransfer(bool success, uint256 transactionID, string memory transactionData)
+ * @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;
@@ -48,7 +48,7 @@ interface IERC20Settlement is IERC20 {
* @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 afterTransfer(bool success, uint256 transactionID, string memory transactionData)
+ * @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 ;
@@ -57,7 +57,7 @@ interface IERC20Settlement is IERC20 {
* @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 afterTransfer(bool success, uint256 transactionID, string memory transactionData)
+ * @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;
@@ -67,7 +67,7 @@ interface IERC20Settlement is IERC20 {
* @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 afterTransfer(bool success, uint256 transactionID, string memory transactionData)
+ * @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;
}
diff --git a/assets/erc-6123/contracts/ISDC.sol b/assets/erc-6123/contracts/ISDC.sol
index 7b1088b131..a7f603d8bf 100644
--- a/assets/erc-6123/contracts/ISDC.sol
+++ b/assets/erc-6123/contracts/ISDC.sol
@@ -230,7 +230,7 @@ interface ISDC {
* @param transactionData data associtated with the transfer, will be emitted via the events.
* @dev emit a {SettlementTransferred} or a {SettlementFailed} event. May emit a {TradeTerminated} event.
*/
- function afterTransfer(bool success, uint256 transactionID, string memory transactionData) external;
+ function afterSettlement(bool success, uint256 transactionID, string memory transactionData) external;
/// Trade termination
diff --git a/assets/erc-6123/contracts/SDCSingleTradePledgedBalance.sol b/assets/erc-6123/contracts/SDCSingleTradePledgedBalance.sol
index 25586d214c..66ca22786d 100644
--- a/assets/erc-6123/contracts/SDCSingleTradePledgedBalance.sol
+++ b/assets/erc-6123/contracts/SDCSingleTradePledgedBalance.sol
@@ -92,10 +92,10 @@ contract SDCSingleTradePledgedBalance is SDCSingleTrade {
}
/*
- * afterTransfer processes SDC depending on success of the respective payment and depending on the current trade state
+ * afterSettlement processes SDC depending on success of the respective payment and depending on the current trade state
* Good Case: state will be settled, failed settlement will trigger the pledge balance transfer and termination
*/
- function afterTransfer(bool success, uint256 transactionID, string memory transactionData) external override {
+ function afterSettlement(bool success, uint256 transactionID, string memory transactionData) external override {
if ( inStateConfirmed()){
if (success){
setTradeState(TradeState.Settled);
@@ -130,7 +130,7 @@ contract SDCSingleTradePledgedBalance is SDCSingleTrade {
}
}
else
- revert("Trade State does not allow to call 'afterTransfer'");
+ revert("Trade State does not allow to call 'afterSettlement'");
}
/*
diff --git a/assets/erc-6123/doc/sdc_trade_states.svg b/assets/erc-6123/doc/sdc_trade_states.svg
index 31219ae7c5..05603d1151 100644
--- a/assets/erc-6123/doc/sdc_trade_states.svg
+++ b/assets/erc-6123/doc/sdc_trade_states.svg
@@ -237,12 +237,12 @@
x="31.46" dy="1.2em" class="st17">by Counterparty2
Dynamischer Verbinder.66
- tx: afterTransfer
+ tx: afterSettlement
- tx: afterTransfer
+ tx: afterSettlement
diff --git a/assets/erc-6123/doc/sequence.puml b/assets/erc-6123/doc/sequence.puml
index 58322007c5..5a0f3cc953 100644
--- a/assets/erc-6123/doc/sequence.puml
+++ b/assets/erc-6123/doc/sequence.puml
@@ -41,7 +41,7 @@ SDC-->EventHandler: emit TradeIncepted
== TradeState 'inTransfer' ==
- SettlementToken->SDC: callback tx 'afterTransfer'
+ SettlementToken->SDC: callback tx 'afterSettlement'
SDC-->EventHandler: emit TradeActivated
@@ -68,7 +68,7 @@ SDC->SettlementToken: tx 'transferFrom' settlement amount from Paying Party to R
== TradeState 'inTransfer' ==
alt Transfer Check
- SettlementToken->SDC: callback tx 'afterTransfer'
+ SettlementToken->SDC: callback tx 'afterSettlement'
else success
SDC-->EventHandler: emit SettlementTransferred
== TradeState 'Settled' ==
diff --git a/assets/erc-6123/doc/sequence.svg b/assets/erc-6123/doc/sequence.svg
index 8b07b4ed5a..9b61362834 100644
--- a/assets/erc-6123/doc/sequence.svg
+++ b/assets/erc-6123/doc/sequence.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/erc-6123/package.json b/assets/erc-6123/package.json
index c8857b4772..ba1a7ee84b 100644
--- a/assets/erc-6123/package.json
+++ b/assets/erc-6123/package.json
@@ -1,6 +1,6 @@
{
"name": "@finmath.net/sdc",
- "version": "0.4.4",
+ "version": "0.5.0",
"description": "Solidity Smart Derivative Contracts",
"author": "Christian Fries, Peter Kohl-Landgraf, Alexandros Korpis",
"license": "ISC",