tx · 4yHA6D8nUKpwNpKpo1sFYFQhoNxxLUD87CNveMtdNf2F 3MsfgrMQRpX1Qw43kM6QoiRm9fK9kL2owRk: -0.01000000 Waves 2023.03.17 14:58 [2493965] smart account 3MsfgrMQRpX1Qw43kM6QoiRm9fK9kL2owRk > SELF 0.00000000 Waves
{ "type": 13, "id": "4yHA6D8nUKpwNpKpo1sFYFQhoNxxLUD87CNveMtdNf2F", "fee": 1000000, "feeAssetId": null, "timestamp": 1679054287585, "version": 2, "chainId": 84, "sender": "3MsfgrMQRpX1Qw43kM6QoiRm9fK9kL2owRk", "senderPublicKey": "5Pyz7UWU89wE7dyDwbD3bJztMvbS8dYbCFFimzPMT1PV", "proofs": [ "knHyNWWdUWbSNg35KUPkZcgQJr2QWc6oivgg3JFxP9VPT5quNJPMYm4hBMdJpnmdmhw8HQMoiYzGTMRrdbSp89U" ], "script": "base64:BgILCAISBQoDAQEBEgACAANTRVACAl9fAQ9rZXlUb3RhbEJhbGFuY2UACQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICBmJsYUJsYQkAzAgCAgV0b3RhbAkAzAgCAgNiYWwFA25pbAUDU0VQAgFpAQRjYWxsAwtmaXJzdE51bWJlcgxzZWNvbmROdW1iZXIIbXVsdGlwbHkECnByb3BvcnRpb24JAL0CBAkAtgIBBQtmaXJzdE51bWJlcgkAtgIBBQhtdWx0aXBseQkAtgIBBQxzZWNvbmROdW1iZXIFBkhBTEZVUAQGcmVzdWx0CQCgAwEFCnByb3BvcnRpb24ECGJhY2t3YXJkCQC9AgQFCnByb3BvcnRpb24JALYCAQUMc2Vjb25kTnVtYmVyCQC2AgEFCG11bHRpcGx5BQZIQUxGVVAJAMwIAgkBDEludGVnZXJFbnRyeQICBnJlc3VsdAUGcmVzdWx0CQDMCAIJAQxJbnRlZ2VyRW50cnkCAg5iYWNrd2FyZFJlc3VsdAkAoAMBBQhiYWNrd2FyZAUDbmlsAWkBCXRlc3RXcml0ZQAJAMwIAgkBC1N0cmluZ0VudHJ5AgkBD2tleVRvdGFsQmFsYW5jZQACBHRlc3QFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmjaUdg", "height": 2493965, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 94q4CCZVtkErA1qfY9mMGCvHTFSCRbcGR9ZRXynHQCWT Next: 4x1WfvpM4kRGLuwS66LU5LKUPStrEeprSRbw2oVxtUy4 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let SEP = "__" | |
5 | 5 | ||
6 | - | ||
6 | + | func keyTotalBalance () = makeString(["%s%s%s", "blaBla", "total", "bal"], SEP) | |
7 | 7 | ||
8 | - | let viresFinanceUSDTStakeAddress = base58'3MpWdTGf7g4WqgCF16vRCm47r3jqWR4x3rH' | |
9 | - | ||
10 | - | let viresFinanceUSDTWithdrawAddress = base58'3MpWdTGf7g4WqgCF16vRCm47r3jqWR4x3rH' | |
11 | - | ||
12 | - | let usdtAssetId = base58'6rJsnE4NsDjdJdk1qvYiPGKSdURV8g4XedTkipyskmh7' | |
13 | 8 | ||
14 | 9 | @Callable(i) | |
15 | - | func requestUSDT (amount) = { | |
16 | - | let res = invoke(Address(assetIssuerAddress), "sendInternalAssetsToTheCaller", [0, amount], nil) | |
17 | - | if ((res == res)) | |
18 | - | then if ((res == res)) | |
19 | - | then nil | |
20 | - | else throw("Strict value is not equal to itself.") | |
21 | - | else throw("Strict value is not equal to itself.") | |
10 | + | func call (firstNumber,secondNumber,multiply) = { | |
11 | + | let proportion = fraction(toBigInt(firstNumber), toBigInt(multiply), toBigInt(secondNumber), HALFUP) | |
12 | + | let result = toInt(proportion) | |
13 | + | let backward = fraction(proportion, toBigInt(secondNumber), toBigInt(multiply), HALFUP) | |
14 | + | [IntegerEntry("result", result), IntegerEntry("backwardResult", toInt(backward))] | |
22 | 15 | } | |
23 | 16 | ||
24 | 17 | ||
25 | 18 | ||
26 | 19 | @Callable(i) | |
27 | - | func stakeInViresFinance (amount) = { | |
28 | - | let res = invoke(Address(viresFinanceAddress), "deposit", [viresFinanceUSDTStakeAddress, false], [AttachedPayment(usdtAssetId, amount)]) | |
29 | - | if ((res == res)) | |
30 | - | then if ((res == res)) | |
31 | - | then nil | |
32 | - | else throw("Strict value is not equal to itself.") | |
33 | - | else throw("Strict value is not equal to itself.") | |
34 | - | } | |
35 | - | ||
36 | - | ||
37 | - | ||
38 | - | @Callable(i) | |
39 | - | func withdrawInViresFinance (amount) = { | |
40 | - | let res = invoke(Address(viresFinanceAddress), "withdraw2", [viresFinanceUSDTWithdrawAddress, amount], nil) | |
41 | - | if ((res == res)) | |
42 | - | then if ((res == res)) | |
43 | - | then nil | |
44 | - | else throw("Strict value is not equal to itself.") | |
45 | - | else throw("Strict value is not equal to itself.") | |
46 | - | } | |
20 | + | func testWrite () = [StringEntry(keyTotalBalance(), "test")] | |
47 | 21 | ||
48 | 22 | ||
49 | 23 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let SEP = "__" | |
5 | 5 | ||
6 | - | ||
6 | + | func keyTotalBalance () = makeString(["%s%s%s", "blaBla", "total", "bal"], SEP) | |
7 | 7 | ||
8 | - | let viresFinanceUSDTStakeAddress = base58'3MpWdTGf7g4WqgCF16vRCm47r3jqWR4x3rH' | |
9 | - | ||
10 | - | let viresFinanceUSDTWithdrawAddress = base58'3MpWdTGf7g4WqgCF16vRCm47r3jqWR4x3rH' | |
11 | - | ||
12 | - | let usdtAssetId = base58'6rJsnE4NsDjdJdk1qvYiPGKSdURV8g4XedTkipyskmh7' | |
13 | 8 | ||
14 | 9 | @Callable(i) | |
15 | - | func requestUSDT (amount) = { | |
16 | - | let res = invoke(Address(assetIssuerAddress), "sendInternalAssetsToTheCaller", [0, amount], nil) | |
17 | - | if ((res == res)) | |
18 | - | then if ((res == res)) | |
19 | - | then nil | |
20 | - | else throw("Strict value is not equal to itself.") | |
21 | - | else throw("Strict value is not equal to itself.") | |
10 | + | func call (firstNumber,secondNumber,multiply) = { | |
11 | + | let proportion = fraction(toBigInt(firstNumber), toBigInt(multiply), toBigInt(secondNumber), HALFUP) | |
12 | + | let result = toInt(proportion) | |
13 | + | let backward = fraction(proportion, toBigInt(secondNumber), toBigInt(multiply), HALFUP) | |
14 | + | [IntegerEntry("result", result), IntegerEntry("backwardResult", toInt(backward))] | |
22 | 15 | } | |
23 | 16 | ||
24 | 17 | ||
25 | 18 | ||
26 | 19 | @Callable(i) | |
27 | - | func stakeInViresFinance (amount) = { | |
28 | - | let res = invoke(Address(viresFinanceAddress), "deposit", [viresFinanceUSDTStakeAddress, false], [AttachedPayment(usdtAssetId, amount)]) | |
29 | - | if ((res == res)) | |
30 | - | then if ((res == res)) | |
31 | - | then nil | |
32 | - | else throw("Strict value is not equal to itself.") | |
33 | - | else throw("Strict value is not equal to itself.") | |
34 | - | } | |
35 | - | ||
36 | - | ||
37 | - | ||
38 | - | @Callable(i) | |
39 | - | func withdrawInViresFinance (amount) = { | |
40 | - | let res = invoke(Address(viresFinanceAddress), "withdraw2", [viresFinanceUSDTWithdrawAddress, amount], nil) | |
41 | - | if ((res == res)) | |
42 | - | then if ((res == res)) | |
43 | - | then nil | |
44 | - | else throw("Strict value is not equal to itself.") | |
45 | - | else throw("Strict value is not equal to itself.") | |
46 | - | } | |
20 | + | func testWrite () = [StringEntry(keyTotalBalance(), "test")] | |
47 | 21 | ||
48 | 22 | ||
49 | 23 | @Verifier(tx) | |
50 | 24 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
51 | 25 |
github/deemru/w8io/169f3d6 28.37 ms ◑