tx · DbarVWahmHKnZ4pjSotr4EwuTX2CGDxeXhugfuqN5nPu

3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL:  -0.01400000 Waves

2019.07.16 16:01 [588413] smart account 3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL > SELF 0.00000000 Waves

{ "type": 13, "id": "DbarVWahmHKnZ4pjSotr4EwuTX2CGDxeXhugfuqN5nPu", "fee": 1400000, "feeAssetId": null, "timestamp": 1563282067053, "version": 1, "sender": "3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL", "senderPublicKey": "3RTmBp69DqXiohzMXcmVU1pMFssmztWoibFARiKrgTr7", "proofs": [ "5a8LLTULKxPZjMupFtwExkqa7iE14oQq9gUH6Ch3B3TfG5qHpjuUuLv3ykoYgrUGXXr1eM6UUp9u3RQPoWaQ7Tjb" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAAAhJZFRva2VuQQEAAAAgnRVvdKvGL2hq2sNhnu09hyaOGV75Lrx4DW47syLUT28AAAAACElkVG9rZW5CBQAAAAR1bml0AAAAAQAAAApjb250ZXh0T2JqAQAAAAhleGNoYW5nZQAAAAAEAAAAB2Ftb3VudEEJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAB2Ftb3VudEEEAAAAB2Ftb3VudEIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAB2Ftb3VudEIEAAAAB3BheW1lbnQEAAAAByRtYXRjaDAIBQAAAApjb250ZXh0T2JqAAAAB3BheW1lbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0F0dGFjaGVkUGF5bWVudAQAAAABcAUAAAAHJG1hdGNoMAUAAAABcAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAAPYXNzZXRJZFJlY2VpdmVkCAUAAAAHcGF5bWVudAAAAAdhc3NldElkBAAAABJ0b2tlblJlY2VpdmVBbW91bnQ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uUmVjZWl2ZUFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAHYW1vdW50QQkAAGUAAAACBQAAAAdhbW91bnRBBQAAAA90b2tlblNlbmRBbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIFAAAAD3Rva2VuU2VuZEFtb3VudAUAAAALYXNzZXRJZFNlbnQFAAAAA25pbAkAAAIAAAABAgAAABRBc3NldCBpcyBub3QgYWxsb3dlZAAAAAAGomZu", "chainId": 84, "height": 588413, "spentComplexity": 0 } View: original | compacted Prev: 2Zi8bASgFzqwvmfNYcaxN51B1JhskY1PwBKiAwAZX2D2 Next: GUXXVYoen7RdGU11So66hnAs3iGrWCP5QwvuPVcVsiMQ Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let IdTokenA = base58'GhAFhXzwCYfvcXQ3GHFaQFnCzAuYCT156qFqiYyzfkzv'
4+let IdTokenA = base58'BaBy2y5tGsuQZPMM7JHU89zmahR7yybXaVMXpnZ589An'
55
66 let IdTokenB = unit
77
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let IdTokenA = base58'GhAFhXzwCYfvcXQ3GHFaQFnCzAuYCT156qFqiYyzfkzv'
4+let IdTokenA = base58'BaBy2y5tGsuQZPMM7JHU89zmahR7yybXaVMXpnZ589An'
55
66 let IdTokenB = unit
77
88 @Callable(contextObj)
99 func exchange () = {
1010 let amountA = getIntegerValue(this, "amountA")
1111 let amountB = getIntegerValue(this, "amountB")
1212 let payment = match contextObj.payment {
1313 case p: AttachedPayment =>
1414 p
1515 case _ =>
1616 throw("Payment not attached")
1717 }
1818 let assetIdReceived = payment.assetId
1919 let tokenReceiveAmount = payment.amount
2020 if ((assetIdReceived == IdTokenB))
2121 then {
2222 let tokenSendAmount = fraction(amountB, tokenReceiveAmount, (tokenReceiveAmount + amountA))
2323 let assetIdSent = IdTokenA
2424 ScriptResult(WriteSet([DataEntry("amountB", (amountB - tokenSendAmount)), DataEntry("amountA", (amountA + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
2525 }
2626 else if ((assetIdReceived == IdTokenA))
2727 then {
2828 let tokenSendAmount = fraction(amountA, tokenReceiveAmount, (tokenReceiveAmount + amountB))
2929 let assetIdSent = unit
3030 ScriptResult(WriteSet([DataEntry("amountB", (amountB + tokenReceiveAmount)), DataEntry("amountA", (amountA - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
3131 }
3232 else throw("Asset is not allowed")
3333 }
3434
3535

github/deemru/w8io/026f985 
26.69 ms