tx · 4sGdn9ccxzz3DX2awKU7kZ7dkNr5mshxTfyzXSfeMH4K
3NBkfbAAqPqkY4d3LK36hdDUpDXViEAHfDE: -0.01400000 Waves
2019.09.08 14:56 [667072] smart account 3NBkfbAAqPqkY4d3LK36hdDUpDXViEAHfDE > SELF 0.00000000 Waves
{
"type": 13,
"id": "4sGdn9ccxzz3DX2awKU7kZ7dkNr5mshxTfyzXSfeMH4K",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1567939971114,
"version": 1,
"sender": "3NBkfbAAqPqkY4d3LK36hdDUpDXViEAHfDE",
"senderPublicKey": "FUCE44aWkQuFEKpfWRe3zoW8pGN2caDm1vqoK55FTnLP",
"proofs": [
"5V5SzLWt7aZkgeCQGabBXcM74BKg7TsFonCYG39gWiz8PyyamiYLxWLny6Yg6BUZU4A2aQdGn9tsZhizRamKZYL1"
],
"script": "base64:AAIDAAAAAAAAAAAAAAACAQAAABR2b3RlcklzQWxsb3dlZFRvVm90ZQAAAAEAAAAOdm90ZXJQdWJsaWNLZXkEAAAADGF1ZGl0b3Ixb3BlbgEAAAAgTOH7xS01EPXuKJWTnxxjNR2ezIws9jQx04+962nHjyQEAAAADGZhY3Rvcnkxb3BlbgEAAAAgmKQJPfQtwWEG3Uomcd12TJmvXUIMK+zQKCau0mej4h8DAwkBAAAAAiE9AAAAAgUAAAAOdm90ZXJQdWJsaWNLZXkFAAAADGF1ZGl0b3Ixb3BlbgkBAAAAAiE9AAAAAgUAAAAOdm90ZXJQdWJsaWNLZXkFAAAADGZhY3Rvcnkxb3BlbgcHBgEAAAAJaXNBdWRpdG9yAAAAAQAAAA52b3RlclB1YmxpY0tleQQAAAAMYXVkaXRvcjFvcGVuAQAAACBM4fvFLTUQ9e4olZOfHGM1HZ7MjCz2NDHTj73racePJAMJAQAAAAIhPQAAAAIFAAAADnZvdGVyUHVibGljS2V5BQAAAAxhdWRpdG9yMW9wZW4HBgAAAAIAAAABaQEAAAAEdm90ZQAAAAEAAAAHdGhlVm90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0LUg0LTQvtCx0LDQstC70Y/RgtGMINC00LDQvdC90YvQtSwg0LLRiyDQvdC1INC30LDQutCw0LfRh9C40LoJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAB2F1ZGl0b3IFAAAADGF1ZGl0b3Ixb3BlbgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAHZmFjdG9yeQUAAAAMZmFjdG9yeTFvcGVuBQAAAANuaWwAAAAAIvPqhg==",
"chainId": 84,
"height": 667072,
"spentComplexity": 0
}
View: original | compacted
Prev: 13yXkvkpLf9h8jJRQaZBfyiTdV7yE4swJ6fFdP5icGbL
Next: FJN1tPN1GjZNG3Ny5jc7GKVhsDkqWcsJu3FEVoX3yhMq
Diff:
Old | New | | Differences |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func voterIsAllowedToVote (voterPublicKey) = { |
---|
5 | | - | let alekseiPubKey = base58'8QvKvspfNF6cUv2DFMCfvT8SrbraERqXpNMEMqBfJZ3e' |
---|
6 | | - | let annaPubKey = base58'AtYwJTqWNfwYrPnWVvfmnPTSTEioiLFzUTcZVttgDj1x' |
---|
7 | | - | if (if ((voterPublicKey != alekseiPubKey)) |
---|
8 | | - | then (voterPublicKey != annaPubKey) |
---|
| 5 | + | let auditor1open = base58'6B7r4pWd3dB79ojogTFvQ2tspsav6gsL4iWqzsRG2rhR' |
---|
| 6 | + | let factory1open = base58'BGr3aRnHxWYKViZ9AKkqE7CdczJtRGk2vCzbGF5mX7dp' |
---|
| 7 | + | if (if ((voterPublicKey != auditor1open)) |
---|
| 8 | + | then (voterPublicKey != factory1open) |
---|
9 | 9 | | else false) |
---|
| 10 | + | then false |
---|
| 11 | + | else true |
---|
| 12 | + | } |
---|
| 13 | + | |
---|
| 14 | + | |
---|
| 15 | + | func isAuditor (voterPublicKey) = { |
---|
| 16 | + | let auditor1open = base58'6B7r4pWd3dB79ojogTFvQ2tspsav6gsL4iWqzsRG2rhR' |
---|
| 17 | + | if ((voterPublicKey != auditor1open)) |
---|
10 | 18 | | then false |
---|
11 | 19 | | else true |
---|
12 | 20 | | } |
---|
|
14 | 22 | | |
---|
15 | 23 | | @Callable(i) |
---|
16 | 24 | | func vote (theVote) = if (!(voterIsAllowedToVote(i.callerPublicKey))) |
---|
17 | | - | then throw("Вы не можете голосовать, так как вас нет в списке голосующих!") |
---|
| 25 | + | then throw("У вас нет прав доступа") |
---|
18 | 26 | | else { |
---|
19 | 27 | | let dataFromStorage = getInteger(this, toBase58String(i.callerPublicKey)) |
---|
| 28 | + | let getAuditor = getStringValue(this, "Auditor") |
---|
| 29 | + | let getFactory = getStringValue(this, "Factory") |
---|
20 | 30 | | if (isDefined(dataFromStorage)) |
---|
21 | | - | then throw("Вы уже голосовали! Повтороное голосование запрещено.") |
---|
| 31 | + | then throw("Ваша подпись уже поставлена") |
---|
22 | 32 | | else WriteSet([DataEntry(toBase58String(i.callerPublicKey), theVote)]) |
---|
23 | 33 | | } |
---|
24 | 34 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func voterIsAllowedToVote (voterPublicKey) = { |
---|
5 | | - | let alekseiPubKey = base58'8QvKvspfNF6cUv2DFMCfvT8SrbraERqXpNMEMqBfJZ3e' |
---|
6 | | - | let annaPubKey = base58'AtYwJTqWNfwYrPnWVvfmnPTSTEioiLFzUTcZVttgDj1x' |
---|
7 | | - | if (if ((voterPublicKey != alekseiPubKey)) |
---|
8 | | - | then (voterPublicKey != annaPubKey) |
---|
| 5 | + | let auditor1open = base58'6B7r4pWd3dB79ojogTFvQ2tspsav6gsL4iWqzsRG2rhR' |
---|
| 6 | + | let factory1open = base58'BGr3aRnHxWYKViZ9AKkqE7CdczJtRGk2vCzbGF5mX7dp' |
---|
| 7 | + | if (if ((voterPublicKey != auditor1open)) |
---|
| 8 | + | then (voterPublicKey != factory1open) |
---|
9 | 9 | | else false) |
---|
| 10 | + | then false |
---|
| 11 | + | else true |
---|
| 12 | + | } |
---|
| 13 | + | |
---|
| 14 | + | |
---|
| 15 | + | func isAuditor (voterPublicKey) = { |
---|
| 16 | + | let auditor1open = base58'6B7r4pWd3dB79ojogTFvQ2tspsav6gsL4iWqzsRG2rhR' |
---|
| 17 | + | if ((voterPublicKey != auditor1open)) |
---|
10 | 18 | | then false |
---|
11 | 19 | | else true |
---|
12 | 20 | | } |
---|
13 | 21 | | |
---|
14 | 22 | | |
---|
15 | 23 | | @Callable(i) |
---|
16 | 24 | | func vote (theVote) = if (!(voterIsAllowedToVote(i.callerPublicKey))) |
---|
17 | | - | then throw("Вы не можете голосовать, так как вас нет в списке голосующих!") |
---|
| 25 | + | then throw("У вас нет прав доступа") |
---|
18 | 26 | | else { |
---|
19 | 27 | | let dataFromStorage = getInteger(this, toBase58String(i.callerPublicKey)) |
---|
| 28 | + | let getAuditor = getStringValue(this, "Auditor") |
---|
| 29 | + | let getFactory = getStringValue(this, "Factory") |
---|
20 | 30 | | if (isDefined(dataFromStorage)) |
---|
21 | | - | then throw("Вы уже голосовали! Повтороное голосование запрещено.") |
---|
| 31 | + | then throw("Ваша подпись уже поставлена") |
---|
22 | 32 | | else WriteSet([DataEntry(toBase58String(i.callerPublicKey), theVote)]) |
---|
23 | 33 | | } |
---|
24 | 34 | | |
---|
25 | 35 | | |
---|
26 | 36 | | |
---|
27 | 37 | | @Callable(i) |
---|
28 | 38 | | func record (theInteger) = { |
---|
29 | 39 | | let auditor1open = base58'6B7r4pWd3dB79ojogTFvQ2tspsav6gsL4iWqzsRG2rhR' |
---|
30 | 40 | | let factory1open = base58'BGr3aRnHxWYKViZ9AKkqE7CdczJtRGk2vCzbGF5mX7dp' |
---|
31 | 41 | | let myOpen = base58'FUCE44aWkQuFEKpfWRe3zoW8pGN2caDm1vqoK55FTnLP' |
---|
32 | 42 | | if ((i.callerPublicKey != myOpen)) |
---|
33 | 43 | | then throw("Вы не можете добавлять данные, вы не заказчик") |
---|
34 | 44 | | else WriteSet([DataEntry("auditor", auditor1open), DataEntry("factory", factory1open)]) |
---|
35 | 45 | | } |
---|
36 | 46 | | |
---|
37 | 47 | | |
---|