hubiinetwork / nahmii-contracts

Smart contracts for 1st generation Nahmii 2nd layer scaling solution for Ethereum
16 stars 12 forks source link

Revision of schemas related to trade #415

Open jijordre opened 5 years ago

jijordre commented 5 years ago

Description

The security of the API requires the addition of string properties in trade and order documents.

It is suggested that property data be added to TradeParty. This property should be populated by concerned wallet.

Struct Order should be revised to be more consistent with Payment of PaymentTypesLib. A new struct OrderParty is suggested. Order should then obtain property OperatorParty party.

Struct OrderParty is suggested to host properties uint256 nonce and address wallet. The corresponding two properties will be removed from Order. In addition OrderParty should include the concerned wallet's balances in the intended and conjugate currencies and string data property.

Property uint256 operatorId of Trade and Order should be replaced by Operator operator, i.e. of the same type as in PaymentTypesLib. The latter string property only should be populated by the operator and part of properties hashed by the operator.

In the same go the global nonce property of trade should be removed both from trade schema as well as from set of properties hashed by the operator. It has no longer any use in smart contracts. Correspondingly fraud challenge smart contracts that trigger on the duplication of global nonce from trade are obsolete and should be removed.

Definition of done

Details & Questions

Depends on