tx · A1mqznGXM8Dz47EgGgQvkYr5NV6bfQLcczwCK7uKmppE
3N7ufBZVuVJtEPVnZAUjpffreNUxCYsb6Vk: -0.01000000 Waves
2021.02.03 21:03 [1382310] smart account 3N7ufBZVuVJtEPVnZAUjpffreNUxCYsb6Vk > SELF 0.00000000 Waves
{
"type": 13,
"id": "A1mqznGXM8Dz47EgGgQvkYr5NV6bfQLcczwCK7uKmppE",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1612375424964,
"version": 2,
"chainId": 84,
"sender": "3N7ufBZVuVJtEPVnZAUjpffreNUxCYsb6Vk",
"senderPublicKey": "8rDvQxFR9tYKSwAaR4umUxBMj37GmcVY3VtWAjLyJu62",
"proofs": [
"3xTEJtceWTde1eJbDpsQYfPX9niu8uxFK8SxVZ8FK6RyX5ZJVuhsTMRGnKYSH3gbZXtio4nxEnCu8Tt4KX7xHs6k"
],
"script": "base64:AAIEAAAAAAAAAAcIAhIDCgEBAAAAAAAAAAEAAAABaQEAAAAHZ2V0VW5pdAAAAAEAAAAGdW5pdGlkBAAAAAt1bml0QXNzZXRJZAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQABLAAAAAICAAAABHVuaXQJAAGkAAAAAQUAAAAGdW5pdGlkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAQAAAAEY29zdAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABWNvc3RfBQAAAAt1bml0QXNzZXRJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAcQXR0YWNoZWQgcGF5bWVudCBpcyByZXF1aXJlZAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5AwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABGNvc3QJAAACAAAAAQIAAAAYV3Jvbmcgc2VydmljZSBmZWUgYW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQkAAZsAAAABBQAAAAt1bml0QXNzZXRJZAUAAAADbmlsAAAAAF+FQEE=",
"height": 1382310,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: none
Next: 9sAGUFsG4pQNaqeeBdvESC79WCY8sx83x43Tm6VdBJvR
Full:
Old | New | | Differences |
---|
1 | | - | # no script |
---|
| 1 | + | {-# STDLIB_VERSION 4 #-} |
---|
| 2 | + | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
| 3 | + | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | |
---|
| 5 | + | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func getUnit (unitid) = { |
---|
| 8 | + | let unitAssetId = match getString(this, ("unit" + toString(unitid))) { |
---|
| 9 | + | case a: String => |
---|
| 10 | + | a |
---|
| 11 | + | case _ => |
---|
| 12 | + | "" |
---|
| 13 | + | } |
---|
| 14 | + | let cost = match getInteger(this, ("cost_" + unitAssetId)) { |
---|
| 15 | + | case a: Int => |
---|
| 16 | + | a |
---|
| 17 | + | case _ => |
---|
| 18 | + | 0 |
---|
| 19 | + | } |
---|
| 20 | + | let pmt = if ((size(i.payments) == 1)) |
---|
| 21 | + | then i.payments[0] |
---|
| 22 | + | else throw("Attached payment is required") |
---|
| 23 | + | if (isDefined(pmt.assetId)) |
---|
| 24 | + | then throw("works with waves only") |
---|
| 25 | + | else if ((pmt.amount != cost)) |
---|
| 26 | + | then throw("Wrong service fee amount") |
---|
| 27 | + | else [ScriptTransfer(i.caller, 1, toBytes(unitAssetId))] |
---|
| 28 | + | } |
---|
| 29 | + | |
---|
| 30 | + | |
---|