• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revisionc105e64c3ce37e566bf4ad59b53037782d57ae99 (tree)
Time2020-05-23 13:21:44
AuthorPaladz <yzhu101@uott...>
CommiterGitHub

Log Message

Hot fix (#535)

* fix net issue

* fix mov contract issue

* add version number

Co-authored-by: paladz <453256728@qq.com>

Change Summary

Incremental Difference

--- a/protocol/vm/vmutil/script.go
+++ b/protocol/vm/vmutil/script.go
@@ -167,7 +167,7 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
167167 // sellerKey: PublicKey) locks valueAmount of valueAsset {
168168 // clause partialTrade(exchangeAmount: Amount) {
169169 // define actualAmount: Integer = exchangeAmount * ratioDenominator / ratioNumerator
170-// verify actualAmount > 0 && actualAmount < valueAmount
170+// verify actualAmount >= 0 && actualAmount < valueAmount
171171 // define receiveAmount: Integer = exchangeAmount * 999 / 1000
172172 // lock receiveAmount of requestedAsset with sellerProgram
173173 // lock valueAmount-actualAmount of valueAsset with standardProgram
@@ -176,7 +176,7 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
176176 // clause fullTrade() {
177177 // define requestedAmount: Integer = valueAmount * ratioNumerator / ratioDenominator
178178 // define requestedAmount: Integer = requestedAmount * 999 / 1000
179-// verify requestedAmount > 0
179+// verify requestedAmount >= 0
180180 // lock requestedAmount of requestedAsset with sellerProgram
181181 // unlock valueAmount of valueAsset
182182 // }
@@ -208,7 +208,7 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
208208 // AMOUNT [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount]
209209 // OVER [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount actualAmount]
210210 // 0 [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount actualAmount 0]
211-// GREATERTHAN [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount (actualAmount > 0)]
211+// GREATERTHANOREQUAL [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount (actualAmount > 0)]
212212 // 2 [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount (actualAmount > 0) 2]
213213 // PICK [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount (actualAmount > 0) actualAmount]
214214 // 2 [... exchangeAmount sellerKey standardProgram sellerProgram requestedAsset actualAmount valueAmount (actualAmount > 0) actualAmount 2]
@@ -256,7 +256,7 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
256256 // MULFRACTION [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount]
257257 // DUP [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount requestedAmount]
258258 // 0 [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount requestedAmount 0]
259-// GREATERTHAN [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount (requestedAmount > 0)]
259+// GREATERTHANOREQUAL [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount (requestedAmount > 0)]
260260 // VERIFY [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount]
261261 // FROMALTSTACK [... sellerKey standardProgram sellerProgram requestedAsset requestedAmount <position>]
262262 // SWAP [... sellerKey standardProgram sellerProgram requestedAsset <position> requestedAmount]
@@ -311,7 +311,7 @@ func P2MCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
311311 builder.AddOp(vm.OP_AMOUNT)
312312 builder.AddOp(vm.OP_OVER)
313313 builder.AddOp(vm.OP_0)
314- builder.AddOp(vm.OP_GREATERTHAN)
314+ builder.AddOp(vm.OP_GREATERTHANOREQUAL)
315315 builder.AddOp(vm.OP_2)
316316 builder.AddOp(vm.OP_PICK)
317317 builder.AddOp(vm.OP_ROT)
@@ -356,7 +356,7 @@ func P2MCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) {
356356 builder.AddOp(vm.OP_MULFRACTION)
357357 builder.AddOp(vm.OP_DUP)
358358 builder.AddOp(vm.OP_0)
359- builder.AddOp(vm.OP_GREATERTHAN)
359+ builder.AddOp(vm.OP_GREATERTHANOREQUAL)
360360 builder.AddOp(vm.OP_VERIFY)
361361 builder.AddOp(vm.OP_FROMALTSTACK)
362362 builder.AddOp(vm.OP_SWAP)
--- a/version/version.go
+++ b/version/version.go
@@ -47,7 +47,7 @@ const (
4747
4848 var (
4949 // The full version string
50- Version = "1.1.2"
50+ Version = "1.1.3"
5151 // GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)"
5252 GitCommit string
5353 Status *UpdateStatus
Show on old repository browser