OSDN Git Service

optimise dev-dexprogram
authoroys <oys@oysdeMacBook-Pro.local>
Sat, 12 Oct 2019 08:24:32 +0000 (16:24 +0800)
committeroys <oys@oysdeMacBook-Pro.local>
Sat, 12 Oct 2019 08:24:32 +0000 (16:24 +0800)
protocol/vm/vmutil/script.go

index 51b7e00..201eeaf 100644 (file)
@@ -165,22 +165,23 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
 //                           sellerProgram: Program,
 //                           standardProgram: Program,
 //                           sellerKey: PublicKey) locks valueAmount of valueAsset {
-// clause partialTrade(exchangeAmount: Amount) {
+//  clause partialTrade(exchangeAmount: Amount) {
 //      define actualAmount: Integer = exchangeAmount * ratioDenominator / ratioMolecule
 //      verify actualAmount > 0 && actualAmount < valueAmount
 //   lock exchangeAmount of requestedAsset with sellerProgram
 //   lock valueAmount-actualAmount of valueAsset with standardProgram
 //   unlock actualAmount of valueAsset
-// }
-// clause fullTrade() {
+//  }
+//  clause fullTrade() {
 //   define requestedAmount: Integer = valueAmount * ratioMolecule / ratioDenominator
 //   verify requestedAmount > 0
 //   lock requestedAmount of requestedAsset with sellerProgram
 //   unlock valueAmount of valueAsset
-// }
-// clause cancel(sellerSig: Signature) {
+//  }
+//  clause cancel(sellerSig: Signature) {
 //   verify checkTxSig(sellerKey, sellerSig)
 //   unlock valueAmount of valueAsset
+//  }
 // }
 //
 // contract stack flow: