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