tx · AH384wpaMq4yhrCTUzNXFKij2JRHhb5AW5Lh8hhwqx9J 3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa: -0.01400000 Waves 2019.09.08 14:57 [667073] smart account 3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa > SELF 0.00000000 Waves
{ "type": 13, "id": "AH384wpaMq4yhrCTUzNXFKij2JRHhb5AW5Lh8hhwqx9J", "fee": 1400000, "feeAssetId": null, "timestamp": 1567943896186, "version": 1, "sender": "3MvqUEAdK8oa1jDS82eqYYVoHTX3S71rRPa", "senderPublicKey": "HktRLq8bnL31myXeh7WVXAuMw8Qb7yrhPfMVxucQVeU", "proofs": [ "eTshw88XpZ1u98FHVDjemRUL9nKtj7GEKYp4iHhDAW87odMhjZvi7nhUDKxWbMBJA1DaionDSid1rUFbE66xMud" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAhudWxsSG9tZQIAAAABMAAAAAIAAAABaQEAAAAHc2V0aG9tZQAAAAEAAAAGaG9tZUlkBAAAAAxzZWxsZXJCYXNlNTgJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFd3JpdGUJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADHNlbGxlckJhc2U1OAUAAAAGaG9tZUlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAApzZXRob21lTG9nCQABLAAAAAIJAAEsAAAAAgUAAAAMc2VsbGVyQmFzZTU4AgAAAAQgLT4gBQAAAAZob21lSWQFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAABXdyaXRlCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAABaQEAAAAEbWFpbgAAAAIAAAAGaG9tZUlkAAAAB2FkZHJlc3MEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZ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AAQkAASwAAAACAgAAABxzYWxsZXIgZG9lc24ndCBvd24gYSBob3VzZTogBQAAAAZob21lSWQJAAACAAAAAQIAAAAPc2FsbGVyIGhvbWVsZXNzCQAAAgAAAAECAAAAD0ludmFsaWQgYWRkcmVzcwAAAADAZWGJ", "chainId": 84, "height": 667073, "spentComplexity": 0 } View: original | compacted Prev: A8E2ZTyJqvFnB2gHk6i2NbxG7xVz23ASTKXaqhPYdum Next: none Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | case addressObject: Address => | |
24 | 24 | match getString(this, address) { | |
25 | 25 | case home: String => | |
26 | - | let transfer = TransferSet([ScriptTransfer(addressObject, pmt.amount, pmt.assetId)]) | |
27 | - | let write = WriteSet([DataEntry(address, nullHome), DataEntry(buerBase58, homeId), DataEntry("mainLog", ((address + " -> ") + buerBase58))]) | |
28 | - | ScriptResult(write, transfer) | |
26 | + | if ((home == "0")) | |
27 | + | then throw("saller homeless") | |
28 | + | else if ((home == homeId)) | |
29 | + | then { | |
30 | + | let transfer = TransferSet([ScriptTransfer(addressObject, pmt.amount, pmt.assetId)]) | |
31 | + | let write = WriteSet([DataEntry(address, nullHome), DataEntry(buerBase58, homeId), DataEntry("mainLog", ((address + " -> ") + buerBase58))]) | |
32 | + | ScriptResult(write, transfer) | |
33 | + | } | |
34 | + | else throw(("saller doesn't own a house: " + homeId)) | |
29 | 35 | case _ => | |
30 | 36 | throw("saller homeless") | |
31 | 37 | } |
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 | 8 | let sellerBase58 = toBase58String(i.caller.bytes) | |
9 | 9 | let write = WriteSet([DataEntry(sellerBase58, homeId), DataEntry("sethomeLog", ((sellerBase58 + " -> ") + homeId))]) | |
10 | 10 | ScriptResult(write, TransferSet(nil)) | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(i) | |
16 | 16 | func main (homeId,address) = { | |
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 | 21 | let buerBase58 = toBase58String(i.caller.bytes) | |
22 | 22 | match addressFromString(address) { | |
23 | 23 | case addressObject: Address => | |
24 | 24 | match getString(this, address) { | |
25 | 25 | case home: String => | |
26 | - | let transfer = TransferSet([ScriptTransfer(addressObject, pmt.amount, pmt.assetId)]) | |
27 | - | let write = WriteSet([DataEntry(address, nullHome), DataEntry(buerBase58, homeId), DataEntry("mainLog", ((address + " -> ") + buerBase58))]) | |
28 | - | ScriptResult(write, transfer) | |
26 | + | if ((home == "0")) | |
27 | + | then throw("saller homeless") | |
28 | + | else if ((home == homeId)) | |
29 | + | then { | |
30 | + | let transfer = TransferSet([ScriptTransfer(addressObject, pmt.amount, pmt.assetId)]) | |
31 | + | let write = WriteSet([DataEntry(address, nullHome), DataEntry(buerBase58, homeId), DataEntry("mainLog", ((address + " -> ") + buerBase58))]) | |
32 | + | ScriptResult(write, transfer) | |
33 | + | } | |
34 | + | else throw(("saller doesn't own a house: " + homeId)) | |
29 | 35 | case _ => | |
30 | 36 | throw("saller homeless") | |
31 | 37 | } | |
32 | 38 | case _ => | |
33 | 39 | throw("Invalid address") | |
34 | 40 | } | |
35 | 41 | } | |
36 | 42 | } | |
37 | 43 | ||
38 | 44 |
github/deemru/w8io/026f985 21.18 ms ◑