tx · GxavBpvWcLG39tha3kpuhZxBVpBePms6v7Tf89JNuodT
3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa: -0.01400000 Waves
2019.09.08 12:02 [666888] smart account 3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa > SELF 0.00000000 Waves
{
"type": 13,
"id": "GxavBpvWcLG39tha3kpuhZxBVpBePms6v7Tf89JNuodT",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1567933329428,
"version": 1,
"sender": "3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa",
"senderPublicKey": "HktRLq8bnL31myXeh7WVXAuMw8Qb7yrhPfMVxucQVeU",
"proofs": [
"3dqBn8Qa7ZCVmbyi6oXNi6dW4MrweV7Mo8v8RWu3vwciiHCgX6cez83ACbo5tcjNknkb7N6szcjC8M7QkGnxHWf8"
],
"script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAhudWxsSG9tZQIAAAABMAAAAAIAAAABaQEAAAAHc2V0aG9tZQAAAAEAAAAGaG9tZUlkBAAAABVzZWxsZXJQdWJsaWNLZXlCYXNlNTgJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFd3JpdGUJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAFXNlbGxlclB1YmxpY0tleUJhc2U1OAUAAAAGaG9tZUlkBQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAAV3cml0ZQkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAWkBAAAABG1haW4AAAACAAAAD3NlbGxlclB1YmxpY0tleQAAAAZob21lSWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABVwYXltZW50IGlzIG9ubHkgd2F2ZXMEAAA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QAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAAV3cml0ZQUAAAAIdHJhbnNmZXIAAAAAl6d/JQ==",
"chainId": 84,
"height": 666888,
"spentComplexity": 0
}
View: original | compacted
Prev: 4rnxG9m88jNcQZaJBX6ZegGZQY2sRhopcv16PnRjrK7s
Next: BP7f7B1xVBVbQkqcxx5F8ANt8ZqKsQEPZQjE7hNjND7w
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | |
---|
| 4 | + | let nullHome = "0" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func sethome (homeId) = { |
---|
8 | | - | let sellerPublicKeyBase58 = toBase58String(i.callerPublicKey) |
---|
| 8 | + | let sellerPublicKeyBase58 = toBase58String(i.caller.bytes) |
---|
9 | 9 | | let write = WriteSet([DataEntry(sellerPublicKeyBase58, homeId)]) |
---|
10 | 10 | | ScriptResult(write, TransferSet(nil)) |
---|
11 | 11 | | } |
---|
|
18 | 18 | | if (isDefined(pmt.assetId)) |
---|
19 | 19 | | then throw("payment is only waves") |
---|
20 | 20 | | else { |
---|
21 | | - | let buerPublicKeyBase58 = toBase58String(i.callerPublicKey) |
---|
22 | | - | let sellerPublicKeyBase58 = toBase58String(sellerPublicKey) |
---|
| 21 | + | let buerPublicKeyBase58 = toBase58String(i.caller.bytes) |
---|
| 22 | + | let sellerPublicKeyBase58 = toBase58String(addressFromPublicKey(sellerPublicKey).bytes) |
---|
23 | 23 | | let dataFromStorage = match getString(this, sellerPublicKeyBase58) { |
---|
24 | 24 | | case home: String => |
---|
25 | 25 | | home |
---|
26 | 26 | | case _ => |
---|
27 | | - | "0" |
---|
| 27 | + | nullHome |
---|
28 | 28 | | } |
---|
29 | | - | if ((dataFromStorage == "0")) |
---|
| 29 | + | if ((dataFromStorage == nullHome)) |
---|
30 | 30 | | then { |
---|
31 | 31 | | let write = WriteSet([DataEntry(sellerPublicKeyBase58, "N")]) |
---|
32 | 32 | | ScriptResult(write, TransferSet(nil)) |
---|
33 | 33 | | } |
---|
34 | 34 | | else { |
---|
35 | 35 | | let transfer = TransferSet([ScriptTransfer(Address(sellerPublicKey), pmt.amount, unit)]) |
---|
36 | | - | let write = WriteSet([DataEntry(sellerPublicKeyBase58, "0"), DataEntry(buerPublicKeyBase58, homeId)]) |
---|
| 36 | + | let write = WriteSet([DataEntry(sellerPublicKeyBase58, nullHome), DataEntry(buerPublicKeyBase58, homeId)]) |
---|
37 | 37 | | ScriptResult(write, transfer) |
---|
38 | 38 | | } |
---|
39 | 39 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | |
---|
| 4 | + | let nullHome = "0" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func sethome (homeId) = { |
---|
8 | | - | let sellerPublicKeyBase58 = toBase58String(i.callerPublicKey) |
---|
| 8 | + | let sellerPublicKeyBase58 = toBase58String(i.caller.bytes) |
---|
9 | 9 | | let write = WriteSet([DataEntry(sellerPublicKeyBase58, homeId)]) |
---|
10 | 10 | | ScriptResult(write, TransferSet(nil)) |
---|
11 | 11 | | } |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
15 | 15 | | @Callable(i) |
---|
16 | 16 | | func main (sellerPublicKey,homeId) = { |
---|
17 | 17 | | let pmt = extract(i.payment) |
---|
18 | 18 | | if (isDefined(pmt.assetId)) |
---|
19 | 19 | | then throw("payment is only waves") |
---|
20 | 20 | | else { |
---|
21 | | - | let buerPublicKeyBase58 = toBase58String(i.callerPublicKey) |
---|
22 | | - | let sellerPublicKeyBase58 = toBase58String(sellerPublicKey) |
---|
| 21 | + | let buerPublicKeyBase58 = toBase58String(i.caller.bytes) |
---|
| 22 | + | let sellerPublicKeyBase58 = toBase58String(addressFromPublicKey(sellerPublicKey).bytes) |
---|
23 | 23 | | let dataFromStorage = match getString(this, sellerPublicKeyBase58) { |
---|
24 | 24 | | case home: String => |
---|
25 | 25 | | home |
---|
26 | 26 | | case _ => |
---|
27 | | - | "0" |
---|
| 27 | + | nullHome |
---|
28 | 28 | | } |
---|
29 | | - | if ((dataFromStorage == "0")) |
---|
| 29 | + | if ((dataFromStorage == nullHome)) |
---|
30 | 30 | | then { |
---|
31 | 31 | | let write = WriteSet([DataEntry(sellerPublicKeyBase58, "N")]) |
---|
32 | 32 | | ScriptResult(write, TransferSet(nil)) |
---|
33 | 33 | | } |
---|
34 | 34 | | else { |
---|
35 | 35 | | let transfer = TransferSet([ScriptTransfer(Address(sellerPublicKey), pmt.amount, unit)]) |
---|
36 | | - | let write = WriteSet([DataEntry(sellerPublicKeyBase58, "0"), DataEntry(buerPublicKeyBase58, homeId)]) |
---|
| 36 | + | let write = WriteSet([DataEntry(sellerPublicKeyBase58, nullHome), DataEntry(buerPublicKeyBase58, homeId)]) |
---|
37 | 37 | | ScriptResult(write, transfer) |
---|
38 | 38 | | } |
---|
39 | 39 | | } |
---|
40 | 40 | | } |
---|
41 | 41 | | |
---|
42 | 42 | | |
---|