tx · BgSGeuxYyjuBvCE2oPxsnfkPKFHNKDMYdNTEBUrU49ty 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.05.31 10:43 [2601861] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "BgSGeuxYyjuBvCE2oPxsnfkPKFHNKDMYdNTEBUrU49ty", "fee": 1000000, "feeAssetId": null, "timestamp": 1685519066334, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "3Ck4KQbq6RppNWCpDt1LR1BNRHhFM8tYt4Zmz3cDjq6CNyHvyn24HUans1zmciZ7YvnTBKcTJkEjHeF3zEcE3ENm" ], "script": "base64:BgIQCAISBQoDCAgBEgUKAwgIAQACAWkBBmJvcnJvdwMPc21hcnRjb250cmFjdElkCmFzc2V0SWRTdHILYXNzZXRBbW91bnQEB2FkZHJlc3MJAKUIAQgFAWkGY2FsbGVyBANyZXMJAPwHBAkBEUBleHRyTmF0aXZlKDEwNjIpAQUPc21hcnRjb250cmFjdElkAgZib3Jyb3cJAMwIAgUKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfYm9ycm93ZWRfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBCHdpdGhkcmF3Aw9zbWFydGNvbnRyYWN0SWQKYXNzZXRJZFN0cgthc3NldEFtb3VudAQHYWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEA3JlcwkA/AcECQERQGV4dHJOYXRpdmUoMTA2MikBBQ9zbWFydGNvbnRyYWN0SWQCCHdpdGhkcmF3CQDMCAIFCmFzc2V0SWRTdHIJAMwIAgULYXNzZXRBbW91bnQFA25pbAUDbmlsAwkAAAIFA3JlcwUDcmVzCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIJAKwCAgUHYWRkcmVzcwIKX3dpdGhkcmV3XwUKYXNzZXRJZFN0cgULYXNzZXRBbW91bnQFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkX/bbU", "height": 2601861, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hy2PemtwWrFuSEw1Y562JqC3bbL6YJJcsosnwcyY6E1w Next: 2Y1paP1Wi1vuvAiMsfarrZSZi91wXjfRxiAkhmt4nAv4 Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func borrow (smartcontractId,assetIdStr,assetAmount) = { | |
8 | - | let tokenId = Address(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT') | |
9 | 8 | let address = toString(i.caller) | |
10 | 9 | let res = invoke(addressFromStringValue(smartcontractId), "borrow", [assetIdStr, assetAmount], nil) | |
11 | 10 | if ((res == res)) | |
16 | 15 | ||
17 | 16 | ||
18 | 17 | @Callable(i) | |
19 | - | func withdraw (assetIdStr,assetAmount) = { | |
20 | - | let smartcontractId = Address(base58'3N3DnVffnUyZtz2MRbk5U7giN112WempMNd') | |
21 | - | let tokenId = Address(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT') | |
18 | + | func withdraw (smartcontractId,assetIdStr,assetAmount) = { | |
22 | 19 | let address = toString(i.caller) | |
23 | - | let res = invoke(smartcontractId, "withdraw", [ | |
20 | + | let res = invoke(addressFromStringValue(smartcontractId), "withdraw", [assetIdStr, assetAmount], nil) | |
24 | 21 | if ((res == res)) | |
25 | - | then match res { | |
26 | - | case r: Int => | |
27 | - | $Tuple2([IntegerEntry(((address + "_withdrew_") + assetIdStr), r)], r) | |
28 | - | case _ => | |
29 | - | throw("Incorrect invoke result") | |
30 | - | } | |
22 | + | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
31 | 23 | else throw("Strict value is not equal to itself.") | |
32 | 24 | } | |
33 | 25 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func borrow (smartcontractId,assetIdStr,assetAmount) = { | |
8 | - | let tokenId = Address(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT') | |
9 | 8 | let address = toString(i.caller) | |
10 | 9 | let res = invoke(addressFromStringValue(smartcontractId), "borrow", [assetIdStr, assetAmount], nil) | |
11 | 10 | if ((res == res)) | |
12 | 11 | then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)] | |
13 | 12 | else throw("Strict value is not equal to itself.") | |
14 | 13 | } | |
15 | 14 | ||
16 | 15 | ||
17 | 16 | ||
18 | 17 | @Callable(i) | |
19 | - | func withdraw (assetIdStr,assetAmount) = { | |
20 | - | let smartcontractId = Address(base58'3N3DnVffnUyZtz2MRbk5U7giN112WempMNd') | |
21 | - | let tokenId = Address(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT') | |
18 | + | func withdraw (smartcontractId,assetIdStr,assetAmount) = { | |
22 | 19 | let address = toString(i.caller) | |
23 | - | let res = invoke(smartcontractId, "withdraw", [ | |
20 | + | let res = invoke(addressFromStringValue(smartcontractId), "withdraw", [assetIdStr, assetAmount], nil) | |
24 | 21 | if ((res == res)) | |
25 | - | then match res { | |
26 | - | case r: Int => | |
27 | - | $Tuple2([IntegerEntry(((address + "_withdrew_") + assetIdStr), r)], r) | |
28 | - | case _ => | |
29 | - | throw("Incorrect invoke result") | |
30 | - | } | |
22 | + | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
31 | 23 | else throw("Strict value is not equal to itself.") | |
32 | 24 | } | |
33 | 25 | ||
34 | 26 | ||
35 | 27 | @Verifier(tx) | |
36 | 28 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
37 | 29 |
github/deemru/w8io/026f985 42.73 ms ◑