tx · 7cmNATEo5iXEkBbHWHPKzPEewQ9DmwYUjt5dc3qm7xY5

3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d:  -0.01000000 Waves

2023.10.02 10:11 [2780698] smart account 3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d > SELF 0.00000000 Waves

{ "type": 13, "id": "7cmNATEo5iXEkBbHWHPKzPEewQ9DmwYUjt5dc3qm7xY5", "fee": 1000000, "feeAssetId": null, "timestamp": 1696230687284, "version": 2, "chainId": 84, "sender": "3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d", "senderPublicKey": "2xepYpePcdoBmD6T455w9bKmTxgot7zSjzpg4wbQ7HLQ", "proofs": [ "2taWhjDx3DRGJgkY3fbAB8N8Rk1WdPB9bPEPeVbRKPiHn6sYmSeFpeQ23WR8xn6ZkzE6fHj19o1aQJfT4U6uWjVe" ], "script": "base64:BgIdCAISBAoCCAgSBAoCCAESBQoDAgEIEgQKAgIBEgAIAANTRVACAl9fABFrZXlGYWN0b3J5QWRkcmVzcwkAuQkCCQDMCAICAiVzCQDMCAICB2ZhY3RvcnkFA25pbAUDU0VQAA5mYWN0b3J5QWRkcmVzcwkBEUBleHRyTmF0aXZlKDEwNjIpAQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwURa2V5RmFjdG9yeUFkZHJlc3MADmtleUltcGxBZGRyZXNzCQC5CQIJAMwIAgICJXMJAMwIAgIEaW1wbAUDbmlsBQNTRVAAC2ltcGxBZGRyZXNzCQERQGV4dHJOYXRpdmUoMTA2MikBCQERQGV4dHJOYXRpdmUoMTA1MykCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5SW1wbEFkZHJlc3MBD2Fzc2V0SWRUb1N0cmluZwEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDYBAEFAWICBVdBVkVTAQttdXN0QWRkcmVzcwIBa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dW50BAxwcmljZUFzc2V0SWQJAQ9hc3NldElkVG9TdHJpbmcBCAkAkQMCCAUBaQhwYXltZW50cwABB2Fzc2V0SWQEEHByaWNlQXNzZXRBbW91bnQICQCRAwIIBQFpCHBheW1lbnRzAAEGYW1vdW50BAZyZXN1bHQJAP0HBAULaW1wbEFkZHJlc3MCA3B1dAkAzAgCBQ1hbW91bnRBc3NldElkCQDMCAIFEWFtb3VudEFzc2V0QW1vdW50CQDMCAIFDHByaWNlQXNzZXRJZAkAzAgCBRBwcmljZUFzc2V0QW1vdW50BQNuaWwFA25pbAMJAAACBQZyZXN1bHQFBnJlc3VsdAkAlAoCBQNuaWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDdm6JB", "height": 2780698, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AvgFWFUhwU4sjFr24mgjeUunQ4NwQfVQxDNyohjnzamR Next: 6H8j5An5EUCS74dyyvMFnvdyLeuWUEv6LrXMQQX1CMAS Diff:
OldNewDifferences
1919 }
2020
2121
22+func mustAddress (i,address) = if ((i.caller == address))
23+ then true
24+ else throw()
25+
26+
27+func mustImpl (i) = mustAddress(i, implAddress)
28+
29+
30+@Callable(i)
31+func stringEntry (key,val) = if (mustImpl(i))
32+ then $Tuple2([StringEntry(key, val)], key)
33+ else $Tuple2(nil, unit)
34+
35+
36+
37+@Callable(i)
38+func integerEntry (key,val) = if (mustImpl(i))
39+ then $Tuple2([IntegerEntry(key, val)], key)
40+ else $Tuple2(nil, unit)
41+
42+
43+
44+@Callable(i)
45+func transferAsset (recipientBytes,amount,assetIdString) = {
46+ let assetId = if ((assetIdString == "WAVES"))
47+ then unit
48+ else fromBase58String(assetIdString)
49+ if (mustImpl(i))
50+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount)
51+ else $Tuple2(nil, unit)
52+ }
53+
54+
55+
56+@Callable(i)
57+func transferWaves (recipientBytes,amount) = if (mustImpl(i))
58+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount)
59+ else $Tuple2(nil, unit)
60+
61+
62+
2263 @Callable(i)
2364 func put () = {
2465 let amountAssetId = assetIdToString(i.payments[0].assetId)
2768 let priceAssetAmount = i.payments[1].amount
2869 let result = reentrantInvoke(implAddress, "put", [amountAssetId, amountAssetAmount, priceAssetId, priceAssetAmount], nil)
2970 if ((result == result))
30- then {
31- let res = match result {
32- case t: List[Any] =>
33- t
34- case _ =>
35- throw("ERR")
36- }
37- $Tuple2(nil, res)
38- }
71+ then $Tuple2(nil, nil)
3972 else throw("Strict value is not equal to itself.")
4073 }
4174
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let keyFactoryAddress = makeString(["%s", "factory"], SEP)
77
88 let factoryAddress = addressFromStringValue(getStringValue(this, keyFactoryAddress))
99
1010 let keyImplAddress = makeString(["%s", "impl"], SEP)
1111
1212 let implAddress = addressFromStringValue(getStringValue(factoryAddress, keyImplAddress))
1313
1414 func assetIdToString (assetId) = match assetId {
1515 case b: ByteVector =>
1616 toBase58String(b)
1717 case _ =>
1818 "WAVES"
1919 }
2020
2121
22+func mustAddress (i,address) = if ((i.caller == address))
23+ then true
24+ else throw()
25+
26+
27+func mustImpl (i) = mustAddress(i, implAddress)
28+
29+
30+@Callable(i)
31+func stringEntry (key,val) = if (mustImpl(i))
32+ then $Tuple2([StringEntry(key, val)], key)
33+ else $Tuple2(nil, unit)
34+
35+
36+
37+@Callable(i)
38+func integerEntry (key,val) = if (mustImpl(i))
39+ then $Tuple2([IntegerEntry(key, val)], key)
40+ else $Tuple2(nil, unit)
41+
42+
43+
44+@Callable(i)
45+func transferAsset (recipientBytes,amount,assetIdString) = {
46+ let assetId = if ((assetIdString == "WAVES"))
47+ then unit
48+ else fromBase58String(assetIdString)
49+ if (mustImpl(i))
50+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount)
51+ else $Tuple2(nil, unit)
52+ }
53+
54+
55+
56+@Callable(i)
57+func transferWaves (recipientBytes,amount) = if (mustImpl(i))
58+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount)
59+ else $Tuple2(nil, unit)
60+
61+
62+
2263 @Callable(i)
2364 func put () = {
2465 let amountAssetId = assetIdToString(i.payments[0].assetId)
2566 let amountAssetAmount = i.payments[0].amount
2667 let priceAssetId = assetIdToString(i.payments[1].assetId)
2768 let priceAssetAmount = i.payments[1].amount
2869 let result = reentrantInvoke(implAddress, "put", [amountAssetId, amountAssetAmount, priceAssetId, priceAssetAmount], nil)
2970 if ((result == result))
30- then {
31- let res = match result {
32- case t: List[Any] =>
33- t
34- case _ =>
35- throw("ERR")
36- }
37- $Tuple2(nil, res)
38- }
71+ then $Tuple2(nil, nil)
3972 else throw("Strict value is not equal to itself.")
4073 }
4174
4275

github/deemru/w8io/169f3d6 
26.08 ms