tx · HP8QZfFYaQwrf1N4jixeeADCPMRYKwRe5ZFK7ben4mG5

3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp:  -0.01400000 Waves

2021.04.17 19:49 [1486710] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves

{ "type": 13, "id": "HP8QZfFYaQwrf1N4jixeeADCPMRYKwRe5ZFK7ben4mG5", "fee": 1400000, "feeAssetId": null, "timestamp": 1618678199951, "version": 2, "chainId": 84, "sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp", "senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb", "proofs": [ "4iG879qNS6rFx4gsDWH81sbievYdzKZzvhaAR8wQ6pNkewxrnTUJhN4iMTpMEjfMCim2YYuxS8EHxHQrTFC5jPdQ" ], "script": "base64:AAIEAAAAAAAAABIIAhIFCgMIAQESBwoFCAEBAQgAAAABAAAAAAZwYXI3SWQBAAAAIJedbhD+DwLKhAB/H26DYx4Zv6xpfO57kM3OSOXSB0EjAAAAAgAAAAFpAQAAAA5zcG9uc29yRGVwb3NpdAAAAAMAAAALY29tcGVOdW1iZXIAAAARY29tcGVFbmRUaW1lc3RhbXAAAAAJdGltZXN0YW1wBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQAAZgAAAAIFAAAACXRpbWVzdGFtcAUAAAARY29tcGVFbmRUaW1lc3RhbXAJAAACAAAAAQIAAAAXQ29tcGV0aXRpb24gaXMgZmluaXNoZWQDCQAAAAAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAGcGFyN0lkCQAAAgAAAAECAAAAIENhbiBob2RsIFBBUjcgb25seSBhdCB0aGUgbW9tZW50BAAAAAljdXJyZW50SWQJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkBAAAAApjdXJyZW50S2V5CQACWAAAAAEICA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50AwkAAGYAAAACBQAAAAl0aW1lc3RhbXAFAAAAE2NvbXBlU3RhcnRUaW1lc3RhbXAJAAACAAAAAQIAAAAfQ29tcGV0aXRpb24gaGFzIGFscmVhZHkgc3RhcnRlZAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACHNwb25zb3JfBQAAAApjdXJyZW50S2V5AgAAAAFfBQAAAAdhc3NldElkAgAAAAFfBQAAAAtjb21wZU51bWJlcgUAAAAJbmV3QW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAALY29tcGVOdW1iZXICAAAAAV8FAAAAB2Fzc2V0SWQFAAAACW5ld0Ftb3VudAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkIWhlU", "height": 1486710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FoYhckbmVawhzQvsWRNpSaTBRuKZMY1XG4q2Shx1uwXk Next: 4svxSQUQ9GaFPnQXgqdgYnJSK2eWvjBqv8AskFqTXQqu Diff:
OldNewDifferences
1111 else if ((pmt.assetId == par7Id))
1212 then throw("Can hodl PAR7 only at the moment")
1313 else {
14+ let currentId = toBase58String(value(pmt.assetId))
1415 let currentKey = toBase58String(i.caller.bytes)
1516 let currentAmount = match getInteger(this, currentKey) {
1617 case a: Int =>
1920 0
2021 }
2122 let newAmount = (currentAmount + pmt.amount)
22-[IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)]
23+[IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), newAmount)]
2324 }
2425 }
2526
2627
2728
2829 @Callable(i)
29-func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount) = {
30+func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount,assetId) = {
3031 let currentKey = toBase58String(i.caller.bytes)
3132 let currentAmount = match getInteger(this, ((currentKey + "_") + compeNumber)) {
3233 case a: Int =>
4142 then throw("Can't withdraw negative amount")
4243 else if ((0 > newAmount))
4344 then throw("Not enough balance")
44- else [IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)]
45+ else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), newAmount)]
4546 }
4647
4748
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4'
55
66 @Callable(i)
77 func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp) = {
88 let pmt = i.payments[0]
99 if ((timestamp > compeEndTimestamp))
1010 then throw("Competition is finished")
1111 else if ((pmt.assetId == par7Id))
1212 then throw("Can hodl PAR7 only at the moment")
1313 else {
14+ let currentId = toBase58String(value(pmt.assetId))
1415 let currentKey = toBase58String(i.caller.bytes)
1516 let currentAmount = match getInteger(this, currentKey) {
1617 case a: Int =>
1718 a
1819 case _ =>
1920 0
2021 }
2122 let newAmount = (currentAmount + pmt.amount)
22-[IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)]
23+[IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), newAmount)]
2324 }
2425 }
2526
2627
2728
2829 @Callable(i)
29-func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount) = {
30+func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount,assetId) = {
3031 let currentKey = toBase58String(i.caller.bytes)
3132 let currentAmount = match getInteger(this, ((currentKey + "_") + compeNumber)) {
3233 case a: Int =>
3334 a
3435 case _ =>
3536 0
3637 }
3738 let newAmount = (currentAmount - amount)
3839 if ((timestamp > compeStartTimestamp))
3940 then throw("Competition has already started")
4041 else if ((0 > amount))
4142 then throw("Can't withdraw negative amount")
4243 else if ((0 > newAmount))
4344 then throw("Not enough balance")
44- else [IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)]
45+ else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), newAmount)]
4546 }
4647
4748
4849 @Verifier(tx)
4950 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5051

github/deemru/w8io/169f3d6 
25.68 ms