tx · 6AjVp3zBookgTckkr4aoSFzPA6jAQdaYVZjahmHgtoY4
3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8: -0.00100000 Waves
2023.01.13 18:26 [2403351] smart account 3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8 > SELF 0.00000000 Waves
{
"type": 13,
"id": "6AjVp3zBookgTckkr4aoSFzPA6jAQdaYVZjahmHgtoY4",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1673623638816,
"version": 2,
"chainId": 84,
"sender": "3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8",
"senderPublicKey": "ATuPi6fn8277fNiCoRgPTav9QG15CJoW95GEGcDmfYt8",
"proofs": [
"5KDzmLKkDGr9UHbch29xoMV7SJTPxnzyhufYYdTCBP99iWh9TbBFq7n1WLws5kvGiBYedNaJEy6cUgoCpS9dYEZU"
],
"script": "base64:BgIECAISAAcABXdjZElkAiw1V0U2SEJWc21BYmFwVG1US3BteVdtVVI2N2ZjMTZ5YkZyTmp4em1EQnRQYQETdG90YWxTaGFyZUJ5VXNlcktFWQEFb3duZXIJALkJAgkAzAgCAgZzaGFyZXMJAMwIAgUFb3duZXIFA25pbAIBXwEUdG90YWxTaGFyZUJ5VXNlclJFQUQBBW93bmVyCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMJARN0b3RhbFNoYXJlQnlVc2VyS0VZAQUFb3duZXIAAAARdG90YWxJc3N1ZWRXQ0RLRVkCEHRvdGFsX2lzc3VlZF9XQ0QBDnRvdGFsSXNzdWVkV0NEAAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBRF0b3RhbElzc3VlZFdDREtFWQAAAA50b3RhbFNoYXJlc0tFWQIMdG90YWxfc2hhcmVzAQt0b3RhbFNoYXJlcwAJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUOdG90YWxTaGFyZXNLRVkAAAEBaQENZGVwb3NpdF9zaGFyZQAEA3BtdAMJAAACCQCQAwEIBQFpCHBheW1lbnRzAAEJAJEDAggFAWkIcGF5bWVudHMAAAkAAgECHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEJaXNEZWZpbmVkAQgFA3BtdAdhc3NldElkCQACAQIWT25seSBXQVZFUyBpcyBhbGxvd2VkLgQHYWNjb3VudAkApQgBCAUBaQZjYWxsZXIEEHRvdGFsU2hhcmVCeVVzZXIJARR0b3RhbFNoYXJlQnlVc2VyUkVBRAEFB2FjY291bnQED3RvdGFsU2hhcmVzUHJldgkBC3RvdGFsU2hhcmVzAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE3RvdGFsU2hhcmVCeVVzZXJLRVkBBQdhY2NvdW50CQBkAgUQdG90YWxTaGFyZUJ5VXNlcggFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFDnRvdGFsU2hhcmVzS0VZCQBkAgUPdG90YWxTaGFyZXNQcmV2CAUDcG10BmFtb3VudAUDbmlsAASJNDI=",
"height": 2403351,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 57m8vJRwg4WqwYheS5VgPfd3BrGoNdtJSySky7ek7gcS
Next: BEWKpjcYDdoy5XrQZNazuT3i9J4YFb5AqebabARtUAvq
Diff:
Old | New | | Differences |
---|
7 | 7 | | |
---|
8 | 8 | | |
---|
9 | 9 | | func totalShareByUserREAD (owner) = valueOrElse(getInteger(this, totalShareByUserKEY(owner)), 0) |
---|
| 10 | + | |
---|
| 11 | + | |
---|
| 12 | + | let totalIssuedWCDKEY = "total_issued_WCD" |
---|
| 13 | + | |
---|
| 14 | + | func totalIssuedWCD () = valueOrElse(getInteger(this, totalIssuedWCDKEY), 0) |
---|
| 15 | + | |
---|
| 16 | + | |
---|
| 17 | + | let totalSharesKEY = "total_shares" |
---|
| 18 | + | |
---|
| 19 | + | func totalShares () = valueOrElse(getInteger(this, totalSharesKEY), 0) |
---|
10 | 20 | | |
---|
11 | 21 | | |
---|
12 | 22 | | @Callable(i) |
---|
|
19 | 29 | | else { |
---|
20 | 30 | | let account = toString(i.caller) |
---|
21 | 31 | | let totalShareByUser = totalShareByUserREAD(account) |
---|
22 | | - | [IntegerEntry(totalShareByUserKEY(account), (totalShareByUser + pmt.amount))] |
---|
| 32 | + | let totalSharesPrev = totalShares() |
---|
| 33 | + | [IntegerEntry(totalShareByUserKEY(account), (totalShareByUser + pmt.amount)), IntegerEntry(totalSharesKEY, (totalSharesPrev + pmt.amount))] |
---|
23 | 34 | | } |
---|
24 | 35 | | } |
---|
25 | 36 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let wcdId = "5WE6HBVsmAbapTmTKpmyWmUR67fc16ybFrNjxzmDBtPa" |
---|
5 | 5 | | |
---|
6 | 6 | | func totalShareByUserKEY (owner) = makeString(["shares", owner], "_") |
---|
7 | 7 | | |
---|
8 | 8 | | |
---|
9 | 9 | | func totalShareByUserREAD (owner) = valueOrElse(getInteger(this, totalShareByUserKEY(owner)), 0) |
---|
| 10 | + | |
---|
| 11 | + | |
---|
| 12 | + | let totalIssuedWCDKEY = "total_issued_WCD" |
---|
| 13 | + | |
---|
| 14 | + | func totalIssuedWCD () = valueOrElse(getInteger(this, totalIssuedWCDKEY), 0) |
---|
| 15 | + | |
---|
| 16 | + | |
---|
| 17 | + | let totalSharesKEY = "total_shares" |
---|
| 18 | + | |
---|
| 19 | + | func totalShares () = valueOrElse(getInteger(this, totalSharesKEY), 0) |
---|
10 | 20 | | |
---|
11 | 21 | | |
---|
12 | 22 | | @Callable(i) |
---|
13 | 23 | | func deposit_share () = { |
---|
14 | 24 | | let pmt = if ((size(i.payments) == 1)) |
---|
15 | 25 | | then i.payments[0] |
---|
16 | 26 | | else throw("Attached payment is required") |
---|
17 | 27 | | if (isDefined(pmt.assetId)) |
---|
18 | 28 | | then throw("Only WAVES is allowed.") |
---|
19 | 29 | | else { |
---|
20 | 30 | | let account = toString(i.caller) |
---|
21 | 31 | | let totalShareByUser = totalShareByUserREAD(account) |
---|
22 | | - | [IntegerEntry(totalShareByUserKEY(account), (totalShareByUser + pmt.amount))] |
---|
| 32 | + | let totalSharesPrev = totalShares() |
---|
| 33 | + | [IntegerEntry(totalShareByUserKEY(account), (totalShareByUser + pmt.amount)), IntegerEntry(totalSharesKEY, (totalSharesPrev + pmt.amount))] |
---|
23 | 34 | | } |
---|
24 | 35 | | } |
---|
25 | 36 | | |
---|
26 | 37 | | |
---|