tx · GJrMwgyTHdJ8LnCsW3LCACfG4G3mDYixFdZen5XYbKyb
3N3sVqNviLW8oXtNFids96WheCPVhVH6MxY: -0.01400000 Waves
2019.06.27 15:36 [560542] smart account 3N3sVqNviLW8oXtNFids96WheCPVhVH6MxY > SELF 0.00000000 Waves
{
"type": 13,
"id": "GJrMwgyTHdJ8LnCsW3LCACfG4G3mDYixFdZen5XYbKyb",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1561638758835,
"version": 1,
"sender": "3N3sVqNviLW8oXtNFids96WheCPVhVH6MxY",
"senderPublicKey": "1wL7DuULCyVDWMe1JNaLWiTTEcWUinaWX8h82hgH8k2",
"proofs": [
"2nw1ea2TkRQ6LijxobGoCxwZrCFtGpRwVmJHp8g7uyPvc4w9g6Ch3QxBYNNkS7V7t9PntRzfxd2JWKvECq9YNfXq"
],
"script": "base64:AgQAAAARZW1wbG95ZWVQdWJsaWNLZXkBAAAAIOhJV7T3E/sDzyx0gkPLAHSn7un5Ex1h6AiuiE07fmJaBAAAAA5vd25lclB1YmxpY0tleQEAAAAgLs9qIqF/gFv4H5JpbGM4G2/jXU6IPL5XKgU/j2tvSm0EAAAADmNvbXBhbnlBc3NldElEAQAAACDzuvEcY7lmVpwQTbK1RUBOWABWYh6eWrhgnGMBFaaCsgQAAAAOd2l0aGRyYXdBbW91bnQAAAAAAA7msoAEAAAADm51bU9mV2l0aGRyYXdzAAAAAAAAAAAEBAAAAA1wcmVtaXVtQnVkZ2V0AAAAAAA7msoABAAAAAR0aGlzCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAJ0eAAAAAZzZW5kZXIEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwBAAAAAlmcm9tT3duZXIJAAH0AAAAAwgFAAAAAXQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAF0AAAABnByb29mcwAAA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ZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5B2m/2yg=",
"chainId": 84,
"height": 560542,
"spentComplexity": 0
}
View: original | compacted
Prev: Eft2EKFKhJr8sEaffv4LiG9hY9Vo5LjpL8bCTwVJNDhG
Next: 27u99cDbUcJy2mVFzfzQ4dMUAj3ZtRXcCyEkKGhm4H1F
Diff:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let employeePublicKey = base58'GdkT8KewPT7fZGtCmmPx94SqTzSpMuhnpBVdaQaq5PSR' |
---|
4 | 4 | | let ownerPublicKey = base58'49jCAx3nnNQ9Xj5xUXwhjy5czmt1AWLHMYf6PxxjFzip' |
---|
|
6 | 6 | | let withdrawAmount = 250000000 |
---|
7 | 7 | | let numOfWithdraws = 4 |
---|
8 | 8 | | let premiumBudget = 1000000000 |
---|
| 9 | + | let this = extract(tx.sender) |
---|
9 | 10 | | match tx { |
---|
10 | 11 | | case t: TransferTransaction => |
---|
11 | 12 | | let fromOwner = sigVerify(t.bodyBytes, t.proofs[0], ownerPublicKey) |
---|
|
15 | 16 | | let fromEmployee = sigVerify(t.bodyBytes, t.proofs[0], employeePublicKey) |
---|
16 | 17 | | if (fromEmployee) |
---|
17 | 18 | | then { |
---|
18 | | - | let dates = if (isDefined(getString(this, "dates"))) |
---|
19 | | - | then extract(getString(this, "dates")) |
---|
20 | | - | else throw("No withdraw date specified") |
---|
21 | 19 | | let attempt = (numOfWithdraws - (assetBalance(t.sender, companyAssetID) / withdrawAmount)) |
---|
22 | | - | let targetDate = parseIntValue(split(dates, ",")[attempt]) |
---|
| 20 | + | let keyName = ("dates" + toString(attempt)) |
---|
| 21 | + | let targetDate = if (isDefined(getInteger(this, keyName))) |
---|
| 22 | + | then extract(getInteger(this, keyName)) |
---|
| 23 | + | else throw("Incorrect witdraw attempt or missing key on Smart account state") |
---|
23 | 24 | | if (if ((t.timestamp >= targetDate)) |
---|
24 | 25 | | then (t.amount == withdrawAmount) |
---|
25 | 26 | | else false) |
---|
Full:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let employeePublicKey = base58'GdkT8KewPT7fZGtCmmPx94SqTzSpMuhnpBVdaQaq5PSR' |
---|
4 | 4 | | let ownerPublicKey = base58'49jCAx3nnNQ9Xj5xUXwhjy5czmt1AWLHMYf6PxxjFzip' |
---|
5 | 5 | | let companyAssetID = base58'HQRQNF5iq1yAvSDqTvK8JC2D3dfn8tkkWPdBmDez2Riq' |
---|
6 | 6 | | let withdrawAmount = 250000000 |
---|
7 | 7 | | let numOfWithdraws = 4 |
---|
8 | 8 | | let premiumBudget = 1000000000 |
---|
| 9 | + | let this = extract(tx.sender) |
---|
9 | 10 | | match tx { |
---|
10 | 11 | | case t: TransferTransaction => |
---|
11 | 12 | | let fromOwner = sigVerify(t.bodyBytes, t.proofs[0], ownerPublicKey) |
---|
12 | 13 | | if (fromOwner) |
---|
13 | 14 | | then true |
---|
14 | 15 | | else { |
---|
15 | 16 | | let fromEmployee = sigVerify(t.bodyBytes, t.proofs[0], employeePublicKey) |
---|
16 | 17 | | if (fromEmployee) |
---|
17 | 18 | | then { |
---|
18 | | - | let dates = if (isDefined(getString(this, "dates"))) |
---|
19 | | - | then extract(getString(this, "dates")) |
---|
20 | | - | else throw("No withdraw date specified") |
---|
21 | 19 | | let attempt = (numOfWithdraws - (assetBalance(t.sender, companyAssetID) / withdrawAmount)) |
---|
22 | | - | let targetDate = parseIntValue(split(dates, ",")[attempt]) |
---|
| 20 | + | let keyName = ("dates" + toString(attempt)) |
---|
| 21 | + | let targetDate = if (isDefined(getInteger(this, keyName))) |
---|
| 22 | + | then extract(getInteger(this, keyName)) |
---|
| 23 | + | else throw("Incorrect witdraw attempt or missing key on Smart account state") |
---|
23 | 24 | | if (if ((t.timestamp >= targetDate)) |
---|
24 | 25 | | then (t.amount == withdrawAmount) |
---|
25 | 26 | | else false) |
---|
26 | 27 | | then (t.assetId == companyAssetID) |
---|
27 | 28 | | else false |
---|
28 | 29 | | } |
---|
29 | 30 | | else false |
---|
30 | 31 | | } |
---|
31 | 32 | | case s: DataTransaction|SetScriptTransaction => |
---|
32 | 33 | | sigVerify(s.bodyBytes, s.proofs[0], ownerPublicKey) |
---|
33 | 34 | | case _ => |
---|
34 | 35 | | false |
---|
35 | 36 | | } |
---|