tx · PPPqBKPWSyaeHr8hRciFUiDAMGP9jZPRn8jf5twyoQY 3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS: -0.01000000 Waves 2023.09.29 15:28 [2776712] smart account 3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS > SELF 0.00000000 Waves
{ "type": 13, "id": "PPPqBKPWSyaeHr8hRciFUiDAMGP9jZPRn8jf5twyoQY", "fee": 1000000, "feeAssetId": null, "timestamp": 1695990555587, "version": 2, "chainId": 84, "sender": "3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS", "senderPublicKey": "CMMtdSwXAf6tvNvyJDrdC5VGmRkcXU5CqmsapxKNPhLu", "proofs": [ "3WqiwTVZEHL4eZU7LE5Dkk8MK64Z2JerQB2k8ewcroZiVVQsbBSj1cTYHSrSCmG3UUioM9RVF8j7nXvHKDZAWxrV" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAYAAAAAEXRvdGFsVG9rZW5zQW1vdW50AAABxr9SY0AAAAAAAB9iYXNlVG9rZW5Db3VudEZvck9uZVJld2FyZFRva2VuAAAAAAAAmJaAAAAAAAVNVUxUOAAAAAAABfXhAAAAAAAVY3VycmVudFRva2Vuc0dpdmVkS2V5AgAAABRjdXJyZW50X3Rva2Vuc19naXZlZAEAAAAOY2FsY3VsYXRlS29lZmYAAAABAAAAEmN1cnJlbnRUb2tlbnNHaXZlZAMJAAAAAAAAAgUAAAASY3VycmVudFRva2Vuc0dpdmVkAAAAAAAAAAAABQAAAAVNVUxUOAkAAGUAAAACBQAAAAVNVUxUOAkAAGsAAAADBQAAABJjdXJyZW50VG9rZW5zR2l2ZWQFAAAABU1VTFQ4BQAAABF0b3RhbFRva2Vuc0Ftb3VudAEAAAASY2FsY3VsYXRlU0JUQW1vdW50AAAAAgAAABByZXdhcmRUb2tlbkNvdW50AAAAFWN1cnJlbnRTYnRUb2tlbnNHaXZlZAQAAAAUc2J0UGVyT25lUmV3YXJkVG9rZW4JAABrAAAAAwUAAAAfYmFzZVRva2VuQ291bnRGb3JPbmVSZXdhcmRUb2tlbgkBAAAADmNhbGN1bGF0ZUtvZWZmAAAAAQUAAAAVY3VycmVudFNidFRva2Vuc0dpdmVkBQAAAAVNVUxUOAkAAGgAAAACBQAAABRzYnRQZXJPbmVSZXdhcmRUb2tlbgUAAAAQcmV3YXJkVG9rZW5Db3VudAAAAAEAAAABaQEAAAAJY2FsY3VsYXRlAAAAAgAAABByZXdhcmRUb2tlbkNvdW50AAAAFWN1cnJlbnRTYnRUb2tlbnNHaXZlZAQAAAASY3VycmVudFRva2Vuc0dpdmVkCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHwAAAAEFAAAAFWN1cnJlbnRUb2tlbnNHaXZlZEtleQAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAGcmVzdWx0CQEAAAASY2FsY3VsYXRlU0JUQW1vdW50AAAAAgUAAAAQcmV3YXJkVG9rZW5Db3VudAUAAAAVY3VycmVudFNidFRva2Vuc0dpdmVkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleaMw2PI=", "height": 2776712, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 6mqZzafti4HwK2FEpzoXkeGy9Ud7cmXLNqrG86w17ha3 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let totalTokensAmount = 500000000000000 | |
5 | + | ||
6 | + | let baseTokenCountForOneRewardToken = 10000000 | |
7 | + | ||
8 | + | let MULT8 = 100000000 | |
9 | + | ||
10 | + | let currentTokensGivedKey = "current_tokens_gived" | |
11 | + | ||
12 | + | func calculateKoeff (currentTokensGived) = if ((currentTokensGived == 0)) | |
13 | + | then MULT8 | |
14 | + | else (MULT8 - fraction(currentTokensGived, MULT8, totalTokensAmount)) | |
15 | + | ||
16 | + | ||
17 | + | func calculateSBTAmount (rewardTokenCount,currentSbtTokensGived) = { | |
18 | + | let sbtPerOneRewardToken = fraction(baseTokenCountForOneRewardToken, calculateKoeff(currentSbtTokensGived), MULT8) | |
19 | + | (sbtPerOneRewardToken * rewardTokenCount) | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | @Callable(i) | |
24 | + | func calculate (rewardTokenCount,currentSbtTokensGived) = { | |
25 | + | let currentTokensGived = valueOrElse(getInteger(currentTokensGivedKey), 0) | |
26 | + | [IntegerEntry("result", calculateSBTAmount(rewardTokenCount, currentSbtTokensGived))] | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | @Verifier(tx) | |
31 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
32 | + |
github/deemru/w8io/169f3d6 32.86 ms ◑