tx · 3kfqDsViqgTPh7uzrE92TZkbRJnPwwwYWSFeowLL56DG
3NBavuhMypAG6uhUSDt6eFxwSDEAYhDgw3n: -0.01000000 Waves
2022.11.10 12:15 [2310858] smart account 3NBavuhMypAG6uhUSDt6eFxwSDEAYhDgw3n > SELF 0.00000000 Waves
{
"type": 13,
"id": "3kfqDsViqgTPh7uzrE92TZkbRJnPwwwYWSFeowLL56DG",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1668071620072,
"version": 2,
"chainId": 84,
"sender": "3NBavuhMypAG6uhUSDt6eFxwSDEAYhDgw3n",
"senderPublicKey": "J5eBHKm7MSDVtQDu9rBwxViFQpGi3ChFyZNRFjfRum5b",
"proofs": [
"5cEfZYDz5bUQ3p12LEbas4PiTiViHN7PBHmuzu6z68wQmE4ERrJYekr5XzebXofsogQ2oAQBQeRba5Zh6oqfX5e2"
],
"script": "base64:BgIICAISBAoCCAEAAQFpAQRzd2FwAgZfdG9rZW4KX21pbkFtb3VudAQHX2Ftb3VudAgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQEDWZyb21Bc3NldEluZm8JAQV2YWx1ZQEJAOwHAQkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBAt0b0Fzc2V0SW5mbwkBBXZhbHVlAQkA7AcBCQDZBAEFBl90b2tlbgQLZGVjaW1hbERpZmYJAGUCCAULdG9Bc3NldEluZm8IZGVjaW1hbHMIBQ1mcm9tQXNzZXRJbmZvCGRlY2ltYWxzBAptdWx0aXBsaWVyAwkAAAIFC2RlY2ltYWxEaWZmAAIAZAMJAAACBQtkZWNpbWFsRGlmZgAAAAEJAAIBAhRJbnZhbGlkIGRlY2ltYWwgZGlmZgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAGgCBQdfYW1vdW50BQptdWx0aXBsaWVyCQDZBAEFBl90b2tlbgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlefGK5cg=",
"height": 2310858,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: gEuMPsBtTTPKCvkumuoEnehGDnoVv49kEkkmRCHNXPP
Next: none
Diff:
Old | New | | Differences |
---|
6 | 6 | | @Callable(a) |
---|
7 | 7 | | func swap (b,c) = { |
---|
8 | 8 | | let d = a.payments[0].amount |
---|
9 | | - | [ScriptTransfer(a.caller, (d * 100), fromBase58String(b))] |
---|
| 9 | + | let e = value(assetInfo(value(a.payments[0].assetId))) |
---|
| 10 | + | let f = value(assetInfo(fromBase58String(b))) |
---|
| 11 | + | let g = (f.decimals - e.decimals) |
---|
| 12 | + | let h = if ((g == 2)) |
---|
| 13 | + | then 100 |
---|
| 14 | + | else if ((g == 0)) |
---|
| 15 | + | then 1 |
---|
| 16 | + | else throw("Invalid decimal diff") |
---|
| 17 | + | [ScriptTransfer(a.caller, (d * h), fromBase58String(b))] |
---|
10 | 18 | | } |
---|
11 | 19 | | |
---|
12 | 20 | | |
---|
13 | | - | @Verifier(e) |
---|
14 | | - | func f () = sigVerify(e.bodyBytes, e.proofs[0], e.senderPublicKey) |
---|
| 21 | + | @Verifier(i) |
---|
| 22 | + | func j () = sigVerify(i.bodyBytes, i.proofs[0], i.senderPublicKey) |
---|
15 | 23 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | 7 | | func swap (b,c) = { |
---|
8 | 8 | | let d = a.payments[0].amount |
---|
9 | | - | [ScriptTransfer(a.caller, (d * 100), fromBase58String(b))] |
---|
| 9 | + | let e = value(assetInfo(value(a.payments[0].assetId))) |
---|
| 10 | + | let f = value(assetInfo(fromBase58String(b))) |
---|
| 11 | + | let g = (f.decimals - e.decimals) |
---|
| 12 | + | let h = if ((g == 2)) |
---|
| 13 | + | then 100 |
---|
| 14 | + | else if ((g == 0)) |
---|
| 15 | + | then 1 |
---|
| 16 | + | else throw("Invalid decimal diff") |
---|
| 17 | + | [ScriptTransfer(a.caller, (d * h), fromBase58String(b))] |
---|
10 | 18 | | } |
---|
11 | 19 | | |
---|
12 | 20 | | |
---|
13 | | - | @Verifier(e) |
---|
14 | | - | func f () = sigVerify(e.bodyBytes, e.proofs[0], e.senderPublicKey) |
---|
| 21 | + | @Verifier(i) |
---|
| 22 | + | func j () = sigVerify(i.bodyBytes, i.proofs[0], i.senderPublicKey) |
---|
15 | 23 | | |
---|