tx · BFvYmLvnhrXDY1kgaRohJuLQP9uuaDQD1Pju5wb87tyA
3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4: -0.05000000 Waves
2022.04.12 19:29 [2005600] smart account 3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4 > SELF 0.00000000 Waves
{
"type": 13,
"id": "BFvYmLvnhrXDY1kgaRohJuLQP9uuaDQD1Pju5wb87tyA",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1649780905540,
"version": 2,
"chainId": 84,
"sender": "3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4",
"senderPublicKey": "5CqqMkmtXXt35KRH9LdWA3ap6TffPvTT5SHQzYrVFbBw",
"proofs": [
"Gew14BFqAMWECHXPfDDgxXDFcd3r5Aaf6uCm7SPPxPwM6DDsZgwxFvUknwvEZuh8xgt2Bbyu1M5HSWPhKw7U6zQ",
"629BcSPW1Lpwwviu6m7TKx7WdPWaJt14oEkaZB4Qib2dvE4xQd3bzEiAbPDa5iuquEYBxLcBGcXc5ngv1TjHLc77"
],
"script": "base64:AAIEAAAAAAAAAAIIAgAAABEAAAAABm9yYWNsZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVOlFqh6QLzqu8boO5i6akl8amITh82KzCAEAAAATZ2V0QmFzZTU4RnJvbU9yYWNsZQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABm9yYWNsZQUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAABnN0cmluZwUAAAAHJG1hdGNoMAkAAlkAAAABBQAAAAZzdHJpbmcEAAAAB25vdGhpbmcFAAAAByRtYXRjaDAJAAACAAAAAQkAASwAAAACBQAAAANrZXkCAAAACGlzIGVtcHR5AAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2F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QAAZAAAAAIJAABkAAAAAgUAAAASYWRtaW5QdWJLZXkxU2lnbmVkBQAAABJhZG1pblB1YktleTJTaWduZWQFAAAAEmFkbWluUHViS2V5M1NpZ25lZAAAAAAAAAAAAltcYFI=",
"height": 2005600,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 91t6MwCENtSTq864kxaZHMDYVR69NJEoHLuyivfx1DYB
Next: none
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') |
---|
| 4 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') |
---|
5 | 5 | | |
---|
6 | | - | let farmingAddress = Address(base58'3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT') |
---|
| 6 | + | func getBase58FromOracle (key) = match getString(oracle, key) { |
---|
| 7 | + | case string: String => |
---|
| 8 | + | fromBase58String(string) |
---|
| 9 | + | case nothing => |
---|
| 10 | + | throw((key + "is empty")) |
---|
| 11 | + | } |
---|
7 | 12 | | |
---|
8 | | - | let oracleAddress = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') |
---|
9 | 13 | | |
---|
10 | | - | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 14 | + | let kAdminPubKey1 = "admin_pub_1" |
---|
11 | 15 | | |
---|
12 | | - | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' |
---|
| 16 | + | let kAdminPubKey2 = "admin_pub_2" |
---|
13 | 17 | | |
---|
14 | | - | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' |
---|
| 18 | + | let kAdminPubKey3 = "admin_pub_3" |
---|
15 | 19 | | |
---|
16 | | - | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' |
---|
| 20 | + | let kAdminInvokePubKey = "admin_invoke_pub" |
---|
| 21 | + | |
---|
| 22 | + | let kGovAddress = "governance_address" |
---|
| 23 | + | |
---|
| 24 | + | let kFarmAddress = "farming_address" |
---|
| 25 | + | |
---|
| 26 | + | let kSurveysAddress = "surveys_address" |
---|
| 27 | + | |
---|
| 28 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) |
---|
| 29 | + | |
---|
| 30 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) |
---|
| 31 | + | |
---|
| 32 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) |
---|
| 33 | + | |
---|
| 34 | + | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) |
---|
| 35 | + | |
---|
| 36 | + | let governanceAddress = Address(getBase58FromOracle(kGovAddress)) |
---|
| 37 | + | |
---|
| 38 | + | let farmingAddress = Address(getBase58FromOracle(kFarmAddress)) |
---|
| 39 | + | |
---|
| 40 | + | let surveysAddress = Address(getBase58FromOracle(kSurveysAddress)) |
---|
17 | 41 | | |
---|
18 | 42 | | let keyPrefixPoolName = "pool_" |
---|
19 | 43 | | |
---|
|
21 | 45 | | @Verifier(tx) |
---|
22 | 46 | | func verify () = match tx { |
---|
23 | 47 | | case invoke: InvokeScriptTransaction => |
---|
24 | | - | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
| 48 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
25 | 49 | | then (invoke.function == "exchange") |
---|
26 | 50 | | else false |
---|
27 | 51 | | let isAirdropCall = if ((invoke.dApp == governanceAddress)) |
---|
|
33 | 57 | | let isUpdatePoolInterest = if ((invoke.dApp == farmingAddress)) |
---|
34 | 58 | | then (invoke.function == "updatePoolInterest") |
---|
35 | 59 | | else false |
---|
36 | | - | let isTakenIntoAccount = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
| 60 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
37 | 61 | | then (invoke.function == "takeIntoAccountExtraFunds") |
---|
| 62 | + | else false |
---|
| 63 | + | let isWriteTotal = if ((invoke.dApp == surveysAddress)) |
---|
| 64 | + | then (invoke.function == "writeTotals") |
---|
38 | 65 | | else false |
---|
39 | 66 | | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) |
---|
40 | 67 | | if (if (if (if (isExchangeCall) |
---|
|
43 | 70 | | then (size(invoke.payments) == 1) |
---|
44 | 71 | | else false) |
---|
45 | 72 | | then true |
---|
46 | | - | else if (if (if (isUpdateWeightsCall) |
---|
| 73 | + | else if (if (if (if (isUpdateWeightsCall) |
---|
47 | 74 | | then true |
---|
48 | 75 | | else isUpdatePoolInterest) |
---|
49 | 76 | | then true |
---|
50 | 77 | | else isTakenIntoAccount) |
---|
| 78 | + | then true |
---|
| 79 | + | else isWriteTotal) |
---|
51 | 80 | | then (size(invoke.payments) == 0) |
---|
52 | 81 | | else false) |
---|
53 | 82 | | then signedByAdmin |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') |
---|
| 4 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') |
---|
5 | 5 | | |
---|
6 | | - | let farmingAddress = Address(base58'3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT') |
---|
| 6 | + | func getBase58FromOracle (key) = match getString(oracle, key) { |
---|
| 7 | + | case string: String => |
---|
| 8 | + | fromBase58String(string) |
---|
| 9 | + | case nothing => |
---|
| 10 | + | throw((key + "is empty")) |
---|
| 11 | + | } |
---|
7 | 12 | | |
---|
8 | | - | let oracleAddress = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') |
---|
9 | 13 | | |
---|
10 | | - | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 14 | + | let kAdminPubKey1 = "admin_pub_1" |
---|
11 | 15 | | |
---|
12 | | - | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' |
---|
| 16 | + | let kAdminPubKey2 = "admin_pub_2" |
---|
13 | 17 | | |
---|
14 | | - | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' |
---|
| 18 | + | let kAdminPubKey3 = "admin_pub_3" |
---|
15 | 19 | | |
---|
16 | | - | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' |
---|
| 20 | + | let kAdminInvokePubKey = "admin_invoke_pub" |
---|
| 21 | + | |
---|
| 22 | + | let kGovAddress = "governance_address" |
---|
| 23 | + | |
---|
| 24 | + | let kFarmAddress = "farming_address" |
---|
| 25 | + | |
---|
| 26 | + | let kSurveysAddress = "surveys_address" |
---|
| 27 | + | |
---|
| 28 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) |
---|
| 29 | + | |
---|
| 30 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) |
---|
| 31 | + | |
---|
| 32 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) |
---|
| 33 | + | |
---|
| 34 | + | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) |
---|
| 35 | + | |
---|
| 36 | + | let governanceAddress = Address(getBase58FromOracle(kGovAddress)) |
---|
| 37 | + | |
---|
| 38 | + | let farmingAddress = Address(getBase58FromOracle(kFarmAddress)) |
---|
| 39 | + | |
---|
| 40 | + | let surveysAddress = Address(getBase58FromOracle(kSurveysAddress)) |
---|
17 | 41 | | |
---|
18 | 42 | | let keyPrefixPoolName = "pool_" |
---|
19 | 43 | | |
---|
20 | 44 | | |
---|
21 | 45 | | @Verifier(tx) |
---|
22 | 46 | | func verify () = match tx { |
---|
23 | 47 | | case invoke: InvokeScriptTransaction => |
---|
24 | | - | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
| 48 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
25 | 49 | | then (invoke.function == "exchange") |
---|
26 | 50 | | else false |
---|
27 | 51 | | let isAirdropCall = if ((invoke.dApp == governanceAddress)) |
---|
28 | 52 | | then (invoke.function == "airDrop") |
---|
29 | 53 | | else false |
---|
30 | 54 | | let isUpdateWeightsCall = if ((invoke.dApp == governanceAddress)) |
---|
31 | 55 | | then (invoke.function == "updateWeights") |
---|
32 | 56 | | else false |
---|
33 | 57 | | let isUpdatePoolInterest = if ((invoke.dApp == farmingAddress)) |
---|
34 | 58 | | then (invoke.function == "updatePoolInterest") |
---|
35 | 59 | | else false |
---|
36 | | - | let isTakenIntoAccount = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
| 60 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
37 | 61 | | then (invoke.function == "takeIntoAccountExtraFunds") |
---|
| 62 | + | else false |
---|
| 63 | + | let isWriteTotal = if ((invoke.dApp == surveysAddress)) |
---|
| 64 | + | then (invoke.function == "writeTotals") |
---|
38 | 65 | | else false |
---|
39 | 66 | | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) |
---|
40 | 67 | | if (if (if (if (isExchangeCall) |
---|
41 | 68 | | then true |
---|
42 | 69 | | else isAirdropCall) |
---|
43 | 70 | | then (size(invoke.payments) == 1) |
---|
44 | 71 | | else false) |
---|
45 | 72 | | then true |
---|
46 | | - | else if (if (if (isUpdateWeightsCall) |
---|
| 73 | + | else if (if (if (if (isUpdateWeightsCall) |
---|
47 | 74 | | then true |
---|
48 | 75 | | else isUpdatePoolInterest) |
---|
49 | 76 | | then true |
---|
50 | 77 | | else isTakenIntoAccount) |
---|
| 78 | + | then true |
---|
| 79 | + | else isWriteTotal) |
---|
51 | 80 | | then (size(invoke.payments) == 0) |
---|
52 | 81 | | else false) |
---|
53 | 82 | | then signedByAdmin |
---|
54 | 83 | | else false |
---|
55 | 84 | | case _ => |
---|
56 | 85 | | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
57 | 86 | | then 1 |
---|
58 | 87 | | else 0 |
---|
59 | 88 | | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) |
---|
60 | 89 | | then 1 |
---|
61 | 90 | | else 0 |
---|
62 | 91 | | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) |
---|
63 | 92 | | then 1 |
---|
64 | 93 | | else 0 |
---|
65 | 94 | | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) |
---|
66 | 95 | | } |
---|
67 | 96 | | |
---|