tx · GLLNGG9rSyG7fesMARvVaaUftH2XFJR3AsboDQyGtyxE 3N4nuuU1RHiiGh5qukdEoPff81c5idJAYQi: -0.01400000 Waves 2019.12.16 15:31 [811452] smart account 3N4nuuU1RHiiGh5qukdEoPff81c5idJAYQi > SELF 0.00000000 Waves
{ "type": 13, "id": "GLLNGG9rSyG7fesMARvVaaUftH2XFJR3AsboDQyGtyxE", "fee": 1400000, "feeAssetId": null, "timestamp": 1576499532718, "version": 1, "sender": "3N4nuuU1RHiiGh5qukdEoPff81c5idJAYQi", "senderPublicKey": "FtFfC9tULuEf2b5WVZhS948Yxi3vRFCiuxLdyrkquPtj", "proofs": [ "4KKLC8XnXyRy5v9LbP9hf8ffdqdC6NRfYR7ek5Q4EpacuBSFQbx5UFo3jPAbL3STrwbhjs9LF2SbnNhjQijkQfBi" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAADAAAAAANZGVhbGVyQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVIIvZsveTY8YvUj9QbUNXQSwv3NN2tEbNAAAAAAQd2hpdGVsaXN0QWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVJDHIIUGzZ6WUTT7eDRBXvzmo+8NTa6YKgAAAAAUZEFwcFdoaXRlbGlzdEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVTjb3DY4EpS1I3pGV9/Mjfqvvd5yJ9vYR8AAAAACXBBZGRyZXNzMQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM05DVkRhVDFBU2JSZDQyaEJTdzRFRzZvakdWUkd0dk1pejEAAAAACXBBZGRyZXNzMgkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM01zMmtUQXhkcmNYRHh3ZWRmYk5qU2k2ZXdHQ1VxdDNoZVoAAAAACXBBZGRyZXNzMwkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM042b2dubTd4blFTR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1cwAAAAAAAAAAAAkAAAIAAAABAgAAABlEZWFsZXIgZEFwcCBpcyBub3QgYWN0aXZlBAAAAAtjYWxsZXJDaGVjawkBAAAADGNoZWNrQWRkcmVzcwAAAAEJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAOcmVjaXBpZW50Q2hlY2sJAQAAAAxjaGVja0FkZHJlc3MAAAABBQAAAAl0b0FkZHJlc3MDAwUAAAALY2FsbGVyQ2hlY2sFAAAADnJlY2lwaWVudENoZWNrBwQAAAAHcGF5bWVudAkBAAAACmdldFBheW1lbnQAAAABBQAAAAFpCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAJdG9BZGRyZXNzCAUAAAAHcGF5bWVudAAAAAZhbW91bnQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAACxUaGlzIGFjY291bnQgaGFzIG5vIHJpZ2h0IHRvIHNlbmQvZ2V0IGZ1bmRzLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGB+DAML8=", "chainId": 84, "height": 811452, "spentComplexity": 0 } View: original | compacted Prev: Ci44FoWG48rxX61F5J7iWnA843EWU7nA19TYde6sXfy Next: none Diff:
Old | New | Differences | |
---|---|---|---|
36 | 36 | case _ => | |
37 | 37 | -255 | |
38 | 38 | } | |
39 | - | if ((validState > isAccountAllow)) | |
40 | - | then throw("This account has no right to send/get funds.") | |
41 | - | else true | |
39 | + | (isAccountAllow == validState) | |
42 | 40 | } | |
43 | 41 | ||
44 | 42 | ||
55 | 53 | else { | |
56 | 54 | let callerCheck = checkAddress(toBase58String(i.caller.bytes)) | |
57 | 55 | let recipientCheck = checkAddress(toAddress) | |
58 | - | let payment = getPayment(i) | |
59 | - | TransferSet([ScriptTransfer(addressFromStringValue(toAddress), payment.amount, payment.assetId)]) | |
56 | + | if (if (callerCheck) | |
57 | + | then recipientCheck | |
58 | + | else false) | |
59 | + | then { | |
60 | + | let payment = getPayment(i) | |
61 | + | TransferSet([ScriptTransfer(addressFromStringValue(toAddress), payment.amount, payment.assetId)]) | |
62 | + | } | |
63 | + | else throw("This account has no right to send/get funds.") | |
60 | 64 | } | |
61 | 65 | } | |
62 | 66 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let dealerAddress = Address(base58'3N1nSQNkUmZtgmgsgYSg54cu25jLFWBUAcB') | |
5 | 5 | ||
6 | 6 | let whitelistAddress = Address(base58'3N37bd8eggz2AFnEXFFgMMtfYQMgMvXLPaZ') | |
7 | 7 | ||
8 | 8 | let dAppWhitelistAddress = Address(base58'3NAeefWVGWNzuSeVij5nJYZHkiimqQv8ysc') | |
9 | 9 | ||
10 | 10 | let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1") | |
11 | 11 | ||
12 | 12 | let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ") | |
13 | 13 | ||
14 | 14 | let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe") | |
15 | 15 | ||
16 | 16 | let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC") | |
17 | 17 | ||
18 | 18 | let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg") | |
19 | 19 | ||
20 | 20 | let ver = "0.0.1-otc-testnet" | |
21 | 21 | ||
22 | 22 | let validState = 1000 | |
23 | 23 | ||
24 | 24 | func getPayment (i) = match i.payment { | |
25 | 25 | case p: AttachedPayment => | |
26 | 26 | p | |
27 | 27 | case _ => | |
28 | 28 | throw("Payment must be attached") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func checkAddress (account) = { | |
33 | 33 | let isAccountAllow = match getInteger(whitelistAddress, account) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | -255 | |
38 | 38 | } | |
39 | - | if ((validState > isAccountAllow)) | |
40 | - | then throw("This account has no right to send/get funds.") | |
41 | - | else true | |
39 | + | (isAccountAllow == validState) | |
42 | 40 | } | |
43 | 41 | ||
44 | 42 | ||
45 | 43 | @Callable(i) | |
46 | 44 | func transfer (toAddress) = { | |
47 | 45 | let dAppStatus = match getInteger(dAppWhitelistAddress, toString(this)) { | |
48 | 46 | case a: Int => | |
49 | 47 | a | |
50 | 48 | case _ => | |
51 | 49 | 0 | |
52 | 50 | } | |
53 | 51 | if ((dAppStatus == 0)) | |
54 | 52 | then throw("Dealer dApp is not active") | |
55 | 53 | else { | |
56 | 54 | let callerCheck = checkAddress(toBase58String(i.caller.bytes)) | |
57 | 55 | let recipientCheck = checkAddress(toAddress) | |
58 | - | let payment = getPayment(i) | |
59 | - | TransferSet([ScriptTransfer(addressFromStringValue(toAddress), payment.amount, payment.assetId)]) | |
56 | + | if (if (callerCheck) | |
57 | + | then recipientCheck | |
58 | + | else false) | |
59 | + | then { | |
60 | + | let payment = getPayment(i) | |
61 | + | TransferSet([ScriptTransfer(addressFromStringValue(toAddress), payment.amount, payment.assetId)]) | |
62 | + | } | |
63 | + | else throw("This account has no right to send/get funds.") | |
60 | 64 | } | |
61 | 65 | } | |
62 | 66 | ||
63 | 67 | ||
64 | 68 | @Verifier(tx) | |
65 | 69 | func verify () = match tx { | |
66 | 70 | case tx: SetScriptTransaction => | |
67 | 71 | true | |
68 | 72 | case _ => | |
69 | 73 | false | |
70 | 74 | } | |
71 | 75 |
github/deemru/w8io/169f3d6 40.95 ms ◑