tx · 8o3juiN1Dev2zdt11ushde6rfK96F6bXZiyfxcsaBpnq

3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX:  -0.01000000 Waves

2022.05.05 15:28 [2038395] smart account 3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX > SELF 0.00000000 Waves

{ "type": 13, "id": "8o3juiN1Dev2zdt11ushde6rfK96F6bXZiyfxcsaBpnq", "fee": 1000000, "feeAssetId": null, "timestamp": 1651753698312, "version": 2, "chainId": 84, "sender": "3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX", "senderPublicKey": "DiHcx3LJuz15WXcQqQE1gEhBzw6k7HqgBE7m1qn3APFw", "proofs": [ "W9DcGXafpUBHWFcHbuR9NiV71jrTwsenWLcCBqMSw5mxXvyGi39etmwjdfyJChc443DHQyWXhQnCnhsJLAaYacm" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAHJG1hdGNoMAgFAAAAAXAAAAAHYXNzZXRJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAAHYXNzZXRJZAUAAAAHJG1hdGNoMAMJAAAAAAAAAgUAAAAHYXNzZXRJZAUAAAARYWNjZXB0YWJsZUFzc2V0SWQJAAAAAAAAAggFAAAAAXAAAAAGYW1vdW50AAAAAAAAD0JABwkAAAIAAAABAgAAABNXcm9uZyBwYXltZW50IGFzc2V0AAAAAQAAAAFpAQAAAARmbGlwAAAAAQAAAAZjaG9pY2UDCQEAAAALaXNQYXltZW50T2sAAAABBQAAAAFpBAAAAAF4CQEAAAALdmFsdWVPckVsc2UAAAACBQAAAAZjaG9pY2UAAAAAAAAAAAADAwkAAAAAAAACBQAAAAF4AAAAAAAAAAABBgkAAAAAAAACBQAAAAF4AAAAAAAAAAAABAAAAAZ3YWxsZXQJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAABXwkAAaQAAAABBQAAAAZjaG9pY2UCAAAAAl9jCQAAAgAAAAEFAAAABndhbGxldAkAAAIAAAABAgAAABJ3cm9uZyBjaG9pY2Ugc2VyISEJAAACAAAAAQIAAAAZd3JvbmcgcGF5bWVudCBhc3NldCBzZXIhIQAAAABHis/r", "height": 2038395, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FDKG95TFLaVFESjjHgfTSQDSWpq4KZJYjUMVfv3aMFmd Next: 7sDT8wewW3KN6UhG9F1MCbDeTdYgHs8W35tS1mtqKBjK Diff:
OldNewDifferences
2424 @Callable(i)
2525 func flip (choice) = if (isPaymentOk(i))
2626 then {
27- let wallet = (((toBase58String(i.caller.bytes) + "_") + toString(choice)) + "_c")
28- throw(wallet)
27+ let x = valueOrElse(choice, 0)
28+ if (if ((x == 1))
29+ then true
30+ else (x == 0))
31+ then {
32+ let wallet = (((toBase58String(i.caller.bytes) + "_") + toString(choice)) + "_c")
33+ throw(wallet)
34+ }
35+ else throw("wrong choice ser!!")
2936 }
30- else throw("wrong payment asset")
37+ else throw("wrong payment asset ser!!")
3138
3239
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 func isPaymentOk (i) = {
77 let acceptableAssetId = PAYMENT_ASSET
88 if ((size(i.payments) == 0))
99 then throw("Payment not attached")
1010 else {
1111 let p = i.payments[0]
1212 match p.assetId {
1313 case assetId: ByteVector =>
1414 if ((assetId == acceptableAssetId))
1515 then (p.amount == 1000000)
1616 else false
1717 case _ =>
1818 throw("Wrong payment asset")
1919 }
2020 }
2121 }
2222
2323
2424 @Callable(i)
2525 func flip (choice) = if (isPaymentOk(i))
2626 then {
27- let wallet = (((toBase58String(i.caller.bytes) + "_") + toString(choice)) + "_c")
28- throw(wallet)
27+ let x = valueOrElse(choice, 0)
28+ if (if ((x == 1))
29+ then true
30+ else (x == 0))
31+ then {
32+ let wallet = (((toBase58String(i.caller.bytes) + "_") + toString(choice)) + "_c")
33+ throw(wallet)
34+ }
35+ else throw("wrong choice ser!!")
2936 }
30- else throw("wrong payment asset")
37+ else throw("wrong payment asset ser!!")
3138
3239

github/deemru/w8io/169f3d6 
21.52 ms