tx · RSuFynWZP5qthAjRoCy2WHyEWJN6QfzL4TcGhLmzufU
3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4: -0.01400000 Waves
2021.07.21 16:28 [1623439] smart account 3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4 > SELF 0.00000000 Waves
{
"type": 13,
"id": "RSuFynWZP5qthAjRoCy2WHyEWJN6QfzL4TcGhLmzufU",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1626874126475,
"version": 2,
"chainId": 84,
"sender": "3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4",
"senderPublicKey": "5CqqMkmtXXt35KRH9LdWA3ap6TffPvTT5SHQzYrVFbBw",
"proofs": [
"4PC3gFskCb2BqVwLqVpjFcwgyYR5RxPYaeHYpZ3gDwxXQh1dF6SJDcAv7niDpzVLgmjeSQ7L1Q3aeBNMv6zgfb7W"
],
"script": "base64:AAIFAAAAAAAAAAIIAgAAAAgAAAAAEWdvdmVybmFuY2VBZGRyZXNzCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUqvpp3oH0E1KFyj8uOohRsxnqmBxZ8g0tAAAAAA5mYXJtaW5nQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVCxLgnZGje8ZMj0pqQTMC/r2IdKOt5kvZgAAAAANb3JhY2xlQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVOlFqh6QLzqu8boO5i6akl8amITh82KzCAAAAAALYWRtaW5JbnZva2UBAAAAIATPdeVk0MEPTme5HxNkxBoN6oQkQjF9M5BdQFgKnZNKAAAAAAxhZG1pblB1YktleTEBAAAAIOKnjEA7hs0X5rRLh9vloYOsriqh7DcuXmUFE/K17O8EAAAAAAxhZG1pblB1YktleTIBAAAAIOo4rLkBtYg8cqOeKD2B1BoiZRETjd+Og418/VfxmxFZAAAAAAxhZG1pblB1YktleTMBAAAAIKc0loKwo8nHXTJiAX87RSdPM+q/NsQBzxC3dHCqJ8xuAAAAABFrZX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wQ2FsbAkAAAAAAAACCQABkAAAAAEIBQAAAANpbnYAAAAIcGF5bWVudHMAAAAAAAAAAAEHBgMDBQAAABNpc1VwZGF0ZVdlaWdodHNDYWxsBgUAAAAUaXNVcGRhdGVQb29sSW50ZXJlc3QJAAAAAAAAAgkAAZAAAAABCAUAAAADaW52AAAACHBheW1lbnRzAAAAAAAAAAAABwUAAAANc2lnbmVkQnlBZG1pbgcEAAAAEmFkbWluUHViS2V5MVNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxhZG1pblB1YktleTEAAAAAAAAAAAEAAAAAAAAAAAAEAAAAEmFkbWluUHViS2V5MlNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAAxhZG1pblB1YktleTIAAAAAAAAAAAEAAAAAAAAAAAAEAAAAEmFkbWluUHViS2V5M1NpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAAxhZG1pblB1YktleTMAAAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAINHP/a",
"height": 1623439,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 4NxBsde9mSep3D6BsC3u8DcWpgDNe841hco9nKJMW2gt
Next: 91t6MwCENtSTq864kxaZHMDYVR69NJEoHLuyivfx1DYB
Diff:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 4 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') |
---|
|
9 | 9 | | |
---|
10 | 10 | | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
11 | 11 | | |
---|
12 | | - | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 12 | + | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' |
---|
13 | 13 | | |
---|
14 | | - | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 14 | + | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' |
---|
15 | 15 | | |
---|
16 | | - | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 16 | + | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' |
---|
17 | 17 | | |
---|
18 | 18 | | let keyPrefixPoolName = "pool_" |
---|
19 | 19 | | |
---|
20 | 20 | | |
---|
21 | 21 | | @Verifier(tx) |
---|
22 | 22 | | func verify () = match tx { |
---|
23 | | - | case invoke: InvokeScriptTransaction => |
---|
24 | | - | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
25 | | - | then (invoke.function == "exchange") |
---|
| 23 | + | case inv: InvokeScriptTransaction => |
---|
| 24 | + | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) |
---|
| 25 | + | then (inv.function == "exchange") |
---|
26 | 26 | | else false |
---|
27 | | - | let isAirdropCall = if ((invoke.dApp == governanceAddress)) |
---|
28 | | - | then (invoke.function == "airDrop") |
---|
| 27 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) |
---|
| 28 | + | then (inv.function == "airDrop") |
---|
29 | 29 | | else false |
---|
30 | | - | let isUpdateWeightsCall = if ((invoke.dApp == governanceAddress)) |
---|
31 | | - | then (invoke.function == "updateWeights") |
---|
| 30 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) |
---|
| 31 | + | then (inv.function == "updateWeights") |
---|
32 | 32 | | else false |
---|
33 | | - | let isUpdatePoolInterest = if ((invoke.dApp == farmingAddress)) |
---|
34 | | - | then (invoke.function == "updatePoolInterest") |
---|
| 33 | + | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) |
---|
| 34 | + | then (inv.function == "updatePoolInterest") |
---|
35 | 35 | | else false |
---|
36 | 36 | | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) |
---|
37 | | - | if (if (if (isExchangeCall) |
---|
| 37 | + | if (if (if (if (isExchangeCall) |
---|
38 | 38 | | then true |
---|
39 | 39 | | else isAirdropCall) |
---|
40 | | - | then (size(invoke.payments) == 1) |
---|
| 40 | + | then (size(inv.payments) == 1) |
---|
41 | 41 | | else false) |
---|
42 | 42 | | then true |
---|
43 | 43 | | else if (if (isUpdateWeightsCall) |
---|
44 | 44 | | then true |
---|
45 | 45 | | else isUpdatePoolInterest) |
---|
46 | | - | then (size(invoke.payments) == 0) |
---|
47 | | - | else false |
---|
| 46 | + | then (size(inv.payments) == 0) |
---|
| 47 | + | else false) |
---|
| 48 | + | then signedByAdmin |
---|
| 49 | + | else false |
---|
48 | 50 | | case _ => |
---|
49 | | - | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
| 51 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
| 52 | + | then 1 |
---|
| 53 | + | else 0 |
---|
| 54 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) |
---|
| 55 | + | then 1 |
---|
| 56 | + | else 0 |
---|
| 57 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) |
---|
| 58 | + | then 1 |
---|
| 59 | + | else 0 |
---|
| 60 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) |
---|
50 | 61 | | } |
---|
51 | 62 | | |
---|
Full:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 4 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') |
---|
5 | 5 | | |
---|
6 | 6 | | let farmingAddress = Address(base58'3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT') |
---|
7 | 7 | | |
---|
8 | 8 | | let oracleAddress = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') |
---|
9 | 9 | | |
---|
10 | 10 | | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
11 | 11 | | |
---|
12 | | - | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 12 | + | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' |
---|
13 | 13 | | |
---|
14 | | - | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 14 | + | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' |
---|
15 | 15 | | |
---|
16 | | - | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' |
---|
| 16 | + | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' |
---|
17 | 17 | | |
---|
18 | 18 | | let keyPrefixPoolName = "pool_" |
---|
19 | 19 | | |
---|
20 | 20 | | |
---|
21 | 21 | | @Verifier(tx) |
---|
22 | 22 | | func verify () = match tx { |
---|
23 | | - | case invoke: InvokeScriptTransaction => |
---|
24 | | - | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(invoke.dApp)))))) |
---|
25 | | - | then (invoke.function == "exchange") |
---|
| 23 | + | case inv: InvokeScriptTransaction => |
---|
| 24 | + | let isExchangeCall = if (isDefined(getString(oracleAddress, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) |
---|
| 25 | + | then (inv.function == "exchange") |
---|
26 | 26 | | else false |
---|
27 | | - | let isAirdropCall = if ((invoke.dApp == governanceAddress)) |
---|
28 | | - | then (invoke.function == "airDrop") |
---|
| 27 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) |
---|
| 28 | + | then (inv.function == "airDrop") |
---|
29 | 29 | | else false |
---|
30 | | - | let isUpdateWeightsCall = if ((invoke.dApp == governanceAddress)) |
---|
31 | | - | then (invoke.function == "updateWeights") |
---|
| 30 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) |
---|
| 31 | + | then (inv.function == "updateWeights") |
---|
32 | 32 | | else false |
---|
33 | | - | let isUpdatePoolInterest = if ((invoke.dApp == farmingAddress)) |
---|
34 | | - | then (invoke.function == "updatePoolInterest") |
---|
| 33 | + | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) |
---|
| 34 | + | then (inv.function == "updatePoolInterest") |
---|
35 | 35 | | else false |
---|
36 | 36 | | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) |
---|
37 | | - | if (if (if (isExchangeCall) |
---|
| 37 | + | if (if (if (if (isExchangeCall) |
---|
38 | 38 | | then true |
---|
39 | 39 | | else isAirdropCall) |
---|
40 | | - | then (size(invoke.payments) == 1) |
---|
| 40 | + | then (size(inv.payments) == 1) |
---|
41 | 41 | | else false) |
---|
42 | 42 | | then true |
---|
43 | 43 | | else if (if (isUpdateWeightsCall) |
---|
44 | 44 | | then true |
---|
45 | 45 | | else isUpdatePoolInterest) |
---|
46 | | - | then (size(invoke.payments) == 0) |
---|
47 | | - | else false |
---|
| 46 | + | then (size(inv.payments) == 0) |
---|
| 47 | + | else false) |
---|
| 48 | + | then signedByAdmin |
---|
| 49 | + | else false |
---|
48 | 50 | | case _ => |
---|
49 | | - | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
| 51 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
| 52 | + | then 1 |
---|
| 53 | + | else 0 |
---|
| 54 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) |
---|
| 55 | + | then 1 |
---|
| 56 | + | else 0 |
---|
| 57 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) |
---|
| 58 | + | then 1 |
---|
| 59 | + | else 0 |
---|
| 60 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) |
---|
50 | 61 | | } |
---|
51 | 62 | | |
---|