tx · 2ytuT7dzFYGXBCEJ1tNGSNLYCgxKDpny1GeTeSiQ9jhp
3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC: -0.01400000 Waves
2019.10.24 14:35 [734130] smart account 3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC > SELF 0.00000000 Waves
{
"type": 13,
"id": "2ytuT7dzFYGXBCEJ1tNGSNLYCgxKDpny1GeTeSiQ9jhp",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1571916967202,
"version": 1,
"sender": "3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC",
"senderPublicKey": "AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP",
"proofs": [
"2u5k9kjfUVqrLUkQam1qaBsqos8wG7nageggA2VVNxz15wyGmufCwfc1EjhgsPYuby5ncGBAwQYW8CcGdRHgdA6Q"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAgAAAAALb3duZXJQdWJLZXkBAAAAIJLVH1aKS7GiLdMgBtKumrDgMoaT5BFPrNSzSjm7iLMkAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAABGxhc3QEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAEdGVzdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAABYQUAAAAHJG1hdGNoMAEAAAAMV2F2ZXNMb3R0b1YyCQEAAAAFdGhyb3cAAAAABAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAkAAfcAAAABBQAAAARyYW5kAAAAAQAAAANpbnYBAAAABHRlc3QAAAAACQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAR0ZXN0CQAAagAAAAIJAASxAAAAAQkBAAAACnJhbmRvbWl6ZXIAAAABBQAAAANpbnYAAAAAAAAAAGQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHrWye4w==",
"chainId": 84,
"height": 734130,
"spentComplexity": 0
}
View: original | compacted
Prev: B2xSijxSANfqrWR9cVfGT9ZbgFuLJ22U3R6hPwRPLNFp
Next: J9XzMd5vLGowibNrZEwrgLzQcgzb8bec84X1PLi5nry
Diff:
Old | New | | Differences |
---|
4 | 4 | | let ownerPubKey = base58'AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP' |
---|
5 | 5 | | |
---|
6 | 6 | | func randomizer (inv) = { |
---|
| 7 | + | let last = match getBinary(this, "test") { |
---|
| 8 | + | case s: ByteVector => |
---|
| 9 | + | s |
---|
| 10 | + | case a: Unit => |
---|
| 11 | + | base58'2ee4oFDYriWJ9EMeR' |
---|
| 12 | + | case _ => |
---|
| 13 | + | throw() |
---|
| 14 | + | } |
---|
7 | 15 | | let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
8 | 16 | | sha256(rand) |
---|
9 | 17 | | } |
---|
10 | 18 | | |
---|
11 | 19 | | |
---|
12 | 20 | | @Callable(inv) |
---|
13 | | - | func test () = WriteSet([DataEntry("test", (toInt(randomizer(inv)) % 10))]) |
---|
| 21 | + | func test () = WriteSet([DataEntry("test", (toInt(randomizer(inv)) % 100))]) |
---|
14 | 22 | | |
---|
15 | 23 | | |
---|
16 | 24 | | @Verifier(tx) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ownerPubKey = base58'AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP' |
---|
5 | 5 | | |
---|
6 | 6 | | func randomizer (inv) = { |
---|
| 7 | + | let last = match getBinary(this, "test") { |
---|
| 8 | + | case s: ByteVector => |
---|
| 9 | + | s |
---|
| 10 | + | case a: Unit => |
---|
| 11 | + | base58'2ee4oFDYriWJ9EMeR' |
---|
| 12 | + | case _ => |
---|
| 13 | + | throw() |
---|
| 14 | + | } |
---|
7 | 15 | | let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
8 | 16 | | sha256(rand) |
---|
9 | 17 | | } |
---|
10 | 18 | | |
---|
11 | 19 | | |
---|
12 | 20 | | @Callable(inv) |
---|
13 | | - | func test () = WriteSet([DataEntry("test", (toInt(randomizer(inv)) % 10))]) |
---|
| 21 | + | func test () = WriteSet([DataEntry("test", (toInt(randomizer(inv)) % 100))]) |
---|
14 | 22 | | |
---|
15 | 23 | | |
---|
16 | 24 | | @Verifier(tx) |
---|
17 | 25 | | func verify () = match tx { |
---|
18 | 26 | | case t: SetScriptTransaction => |
---|
19 | 27 | | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) |
---|
20 | 28 | | case c: InvokeScriptTransaction => |
---|
21 | 29 | | true |
---|
22 | 30 | | case d: DataTransaction => |
---|
23 | 31 | | true |
---|
24 | 32 | | case _ => |
---|
25 | 33 | | false |
---|
26 | 34 | | } |
---|
27 | 35 | | |
---|