Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ERC-6123: EIP-6123, align EIP with local development #679

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Julius278
Copy link

@Julius278 Julius278 commented Oct 21, 2024

added missing PaymentTriggered event

…tTriggered event), added two missing events in ISDC.sol
@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Oct 21, 2024

File ERCS/erc-6123.md

Requires 1 more reviewers from @axic, @g11tech, @gcolvin, @lightclient, @SamWilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title EIP-6123, align EIP with local development Update ERC-6123: EIP-6123, align EIP with local development Oct 21, 2024
@Julius278 Julius278 marked this pull request as draft October 21, 2024 09:09
@Julius278 Julius278 marked this pull request as ready for review October 21, 2024 09:10
@Julius278
Copy link
Author

Julius278 commented Oct 21, 2024

@cfries @pekola
could you please check the changes and if the pull request can be merged
Unfortunately I cant add reviewers to the pull request

Best regards,
Julius

@cfries
Copy link
Contributor

cfries commented Oct 21, 2024

I need to have a look, because I thought that we discussed about theses events and I think the outcome would be that it is handled by the settlement token.

I will check now.

@cfries
Copy link
Contributor

cfries commented Oct 21, 2024

I believe the change to ISDC is not needed / superfluous.

Remarks on TradeSettlementPhase:

We started distiguishing events on the Trade and events on the Settlement. For an SDC that has multiple trades all trade may / should settle in a single settlement. So the name "TradeSettlementPhase" is wrong. It is a settlement phase. Hence the event should start with Settlement.

The


event SettlementRequested(address initiator, string tradeData, string lastSettlementData);

marks the beginning of the settlement phase (from the perspective of the SDC - maybe the token has a finer granularity). So this should replace TradeSettlementPhase.

Remarks on TradeSettled :

There are already two events that mark the end of the settlement phase:

    /**
     * @dev Emitted when settlement process has been finished
     */
    event SettlementTransferred(string transactionData);

    /**
     * @dev Emitted when settlement process has been finished
     */
    event SettlementFailed(string transactionData);

@Julius278
Copy link
Author

Hi @cfries,
there is a difference between SettlementRequested, which marks the request to a service which will provide the new settlement data, and TradeSettlementPhase, which is emitted during "performSettlement".

TradeSettled is now more granular, that looks good, I will remove TradeSettled

@cfries
Copy link
Contributor

cfries commented Oct 21, 2024

You are right. performSettlement is a different thing.

But there is already an event issued from performSettlement. The documentation in the comment already states that is is emitted when the settlement phase begins:

 /**
     * @dev Emitted when Settlement has been valued and settlement phase is initiated
     * @param initiator the address of the requesting party
     * @param settlementAmount the settlement amount. If settlementAmount > 0 then receivingParty receives this amount from other party. If settlementAmount < 0 then other party receives -settlementAmount from receivingParty.
     * @param settlementData. the tripple (product, previousSettlementData, settlementData) determines the settlementAmount.
     */
    event SettlementEvaluated(address initiator, int256 settlementAmount, string settlementData);

The method performSettlement states that this event is emitted

    /**
     * @notice Called to trigger according settlement on chain-balances callback for initiateSettlement() event handler
     * @dev perform settlement checks, may initiate transfers and emits {SettlementEvaluated}
     * @param settlementAmount the settlement amount. If settlementAmount > 0 then receivingParty receives this amount from other party. If settlementAmount < 0 then other party receives -settlementAmount from receivingParty.
     * @param settlementData. the tripple (product, previousSettlementData, settlementData) determines the settlementAmount.
     */
    function performSettlement(int256 settlementAmount, string memory settlementData) external;

The name starts with "Settlement" due to the remark I made above. Settlement is indepent of Trade. I believe I made the renaming comments somewhere, but it was a time ago. Maybe in Teams? :-)
Also the documentation has clear subsections: "Trade Events" and "Settlement Events". All the events in "Settlement Events" start with "Settlement".

@Julius278
Copy link
Author

okay, SettlementEvaluated is also fine for me and has some more details.
Especially initiator and settlementData is nice cause you dont need to retrieve those information manually after receiving the event.

But I cant find any "PaymentTriggered" event currently and we will need it on one of the token interfaces cause it could/will be necessary on more than one possible token implemenation

@pekola
Copy link
Contributor

pekola commented Oct 21, 2024

Hi. @Julius278 - Why do we need to specify a separate interface for the offchain variant. One could include the PaymentTriggered Event into the ERC20TokenSettlement. Not sure whether we need a separate function "initParty".

@cfries - this might be a bit subtle but stumbling across the settlement event names: SettlementRequested, SettlementEvaluated, SettlementTransferred. Since we removed the "Valuation" out of the SettlementRequested, we could generalise the second event naming also to be even more generic: SettlementEvaluated --> SettlementDetermined.

@Julius278
Copy link
Author

Hi @pekola,
I removed the offchain interface.

"initParty" is not directly required in case of onchain settlement but it can be used as an "who is this party / address" description.
If this is not desired, I can remove it

@cfries
Copy link
Contributor

cfries commented Oct 21, 2024

SettlementDetermined is also a good name. But I am hesitating a bit, now that QualitaX has published the review based on the other names. ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants