tx · GNX6u2aoB7XtC8i2ymWMgfdUzW9Kb4n88jp3BsfF5MW9

3PM8mbHyAiku9A81ieC4HU4PPJtLtGLcZUF:  -0.01400000 Waves

2021.01.29 16:48 [2438597] smart account 3PM8mbHyAiku9A81ieC4HU4PPJtLtGLcZUF > SELF 0.00000000 Waves

{ "type": 13, "id": "GNX6u2aoB7XtC8i2ymWMgfdUzW9Kb4n88jp3BsfF5MW9", "fee": 1400000, "feeAssetId": null, "timestamp": 1611928125619, "version": 2, "chainId": 87, "sender": "3PM8mbHyAiku9A81ieC4HU4PPJtLtGLcZUF", "senderPublicKey": "DR46z5vZXXjPczv6ecdnik6g9GQJqv3L2e8Jpi6UVX4z", "proofs": [ "QuM7i7GD78rMTndG4r1MLSXfnWjC1uoeXHnQHZqLnnSMG4FjtDYfJeYjpE5TeXdSHdNtdCKFe8qSmNh9s6qdB2m" ], "script": "base64:AAIEAAAAAAAAABkIAhIAEgASABIAEgASABIAEgASABIDCgEBAAAAAAAAAAoAAAABaQEAAAANc3dhcFRSRFRvVVNETgAAAAAEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAZhc3NldDEBAAAAIMrUGxh/N4xRKllBeKQz94vNRfmyyo9LdPYPE1u3x1PhAwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAZhc3NldDEJAAACAAAAAQIAAABZSW5jb3JyZWN0IGFzc2V0IGF0dGFjaGVkLCBwbGVhc2Ugc2VuZCBFZWt3ZkxTQWtiUkVuZUJIclhkWlNSQUVQdm1panE3MU5mMkdETnFCU3R6NCAoVFJEKS4JAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAWVFJEVG9VU0ROX1N3YXBfQWRkcmVzcwUAAAAKY3VycmVudEtleQkABEwA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AAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleUTTOyY=", "height": 2438597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6gGwKL8WoCVBoCo25ZqGRBfyStH9eHHKrE1ccgNMG783 Next: AoRNqoAs7eAQNqz7HL5cyJZmXxwhKrvZcbnEV2uPM3eL Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
66 @Callable(i)
77 func swapTRDToUSDN () = {
88 let currentKey = toBase58String(i.caller.bytes)
9- let pmt = extract(i.payment)
9+ let pmt = value(i.payments[0])
1010 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
1111 if ((pmt.assetId != asset1))
1212 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
13- else ScriptResult(WriteSet([DataEntry("TRDToUSDN_Swap_Address", currentKey), DataEntry("TRDToUSDN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 1000), base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p')]))
13+ else [StringEntry("TRDToUSDN_Swap_Address", currentKey), IntegerEntry("TRDToUSDN_Swap_Height", height), DeleteEntry("Blocks_Gap"), DeleteEntry("Blocks_Gap_3P8FF73N7ZvvNJ34vnJ3h9Tfmh7oQCnRz8E"), DeleteEntry("Blocks_Gap_3PNQvgNwpFxm6nonoVnAh1N43WVwAnz5Rfc"), DeleteEntry("TRDToUSDN_Swap_Address_3P8FF73N7ZvvNJ34vnJ3h9Tfmh7oQCnRz8E"), DeleteEntry("TRDToUSDN_Swap_Address_3PNQvgNwpFxm6nonoVnAh1N43WVwAnz5Rfc"), ScriptTransfer(i.caller, (pmt.amount / 1000), base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p')]
1414 }
1515
1616
1818 @Callable(i)
1919 func swapUSDNToTRD () = {
2020 let currentKey = toBase58String(i.caller.bytes)
21- let pmt = extract(i.payment)
21+ let pmt = value(i.payments[0])
2222 let asset1 = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
2323 if ((pmt.assetId != asset1))
2424 then throw("Incorrect asset attached, please send DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p (USDN).")
25- else ScriptResult(WriteSet([DataEntry("USDNToTRD_Swap_Address", currentKey), DataEntry("USDNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
25+ else [StringEntry("USDNToTRD_Swap_Address", currentKey), IntegerEntry("USDNToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
2626 }
2727
2828
3030 @Callable(i)
3131 func swapTRDToUSDT () = {
3232 let currentKey = toBase58String(i.caller.bytes)
33- let pmt = extract(i.payment)
33+ let pmt = value(i.payments[0])
3434 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
3535 if ((pmt.assetId != asset1))
3636 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
37- else ScriptResult(WriteSet([DataEntry("TRDToUSDT_Swap_Address", currentKey), DataEntry("TRDToUSDT_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 1000), base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ')]))
37+ else [StringEntry("TRDToUSDT_Swap_Address", currentKey), IntegerEntry("TRDToUSDT_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount / 1000), base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ')]
3838 }
3939
4040
4242 @Callable(i)
4343 func swapUSDTToTRD () = {
4444 let currentKey = toBase58String(i.caller.bytes)
45- let pmt = extract(i.payment)
45+ let pmt = value(i.payments[0])
4646 let asset1 = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ'
4747 if ((pmt.assetId != asset1))
4848 then throw("Incorrect asset attached, please send 34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ (USDT).")
49- else ScriptResult(WriteSet([DataEntry("USDTToTRD_Swap_Address", currentKey), DataEntry("USDTToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
49+ else [StringEntry("USDTToTRD_Swap_Address", currentKey), IntegerEntry("USDTToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
5050 }
5151
5252
5454 @Callable(i)
5555 func swapTRDToNGNN () = {
5656 let currentKey = toBase58String(i.caller.bytes)
57- let pmt = extract(i.payment)
57+ let pmt = value(i.payments[0])
5858 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
5959 if ((pmt.assetId != asset1))
6060 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
61- else ScriptResult(WriteSet([DataEntry("TRDToNGNN_Swap_Address", currentKey), DataEntry("TRDToNGNN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, ((pmt.amount * 38) / 100), base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN')]))
61+ else [StringEntry("TRDToNGNN_Swap_Address", currentKey), IntegerEntry("TRDToNGNN_Swap_Height", height), ScriptTransfer(i.caller, ((pmt.amount * 38) / 100), base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN')]
6262 }
6363
6464
6666 @Callable(i)
6767 func swapNGNNToTRD () = {
6868 let currentKey = toBase58String(i.caller.bytes)
69- let pmt = extract(i.payment)
69+ let pmt = value(i.payments[0])
7070 let asset1 = base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN'
7171 if ((pmt.assetId != asset1))
7272 then throw("Incorrect asset attached, please send 5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN (NGNN).")
73- else ScriptResult(WriteSet([DataEntry("NGNNToTRD_Swap_Address", currentKey), DataEntry("NGNNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, ((pmt.amount / 38) * 100), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
73+ else [StringEntry("NGNNToTRD_Swap_Address", currentKey), IntegerEntry("NGNNToTRD_Swap_Height", height), ScriptTransfer(i.caller, ((pmt.amount / 38) * 100), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
7474 }
7575
7676
7878 @Callable(i)
7979 func swapTRDToTN () = {
8080 let currentKey = toBase58String(i.caller.bytes)
81- let pmt = extract(i.payment)
81+ let pmt = value(i.payments[0])
8282 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
8383 if ((pmt.assetId != asset1))
8484 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
85- else ScriptResult(WriteSet([DataEntry("TRDToTN_Swap_Address", currentKey), DataEntry("TRDToTN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 10), base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD')]))
85+ else [StringEntry("TRDToTN_Swap_Address", currentKey), IntegerEntry("TRDToTN_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 10), base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD')]
8686 }
8787
8888
9090 @Callable(i)
9191 func swapTNToTRD () = {
9292 let currentKey = toBase58String(i.caller.bytes)
93- let pmt = extract(i.payment)
93+ let pmt = value(i.payments[0])
9494 let asset1 = base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD'
9595 if ((pmt.assetId != asset1))
9696 then throw("Incorrect asset attached, please send bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD (TN).")
97- else ScriptResult(WriteSet([DataEntry("TNToTRD_Swap_Address", currentKey), DataEntry("TNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 10), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
97+ else [StringEntry("TNToTRD_Swap_Address", currentKey), IntegerEntry("TNToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount / 10), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
9898 }
9999
100100
101101
102102 @Callable(i)
103103 func depositTRD () = {
104- let pmt = extract(i.payment)
104+ let pmt = value(i.payments[0])
105105 let assetid = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
106106 if ((pmt.assetId != assetid))
107107 then throw("Kindly Deposit Only EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
114114 0
115115 }
116116 let newAmount = (currentAmount + pmt.amount)
117- let useramount = DataEntry(currentKey, newAmount)
118- let userdepositheight = DataEntry(("Deposit_Height_Of_" + currentKey), height)
119- WriteSet([useramount, userdepositheight])
117+ let useramount = IntegerEntry(currentKey, newAmount)
118+ let userdepositheight = IntegerEntry(("Deposit_Height_Of_" + currentKey), height)
119+[useramount, userdepositheight]
120120 }
121121 }
122122
133133 }
134134 let newAmount = (currentAmount - (amount * 1000000))
135135 let swapheightkeyname = ("Deposit_Height_Of_" + currentKey)
136- let diff = (height - extract(getInteger(this, swapheightkeyname)))
136+ let diff = (height - value(getInteger(this, swapheightkeyname)))
137137 if ((0 > amount))
138138 then throw("Can't withdraw negative TRD amount")
139139 else if ((0 > newAmount))
140140 then throw("Not enough TRD balance")
141- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, (amount * 1000000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'), ScriptTransfer(i.caller, (((diff * amount) * 4) / 1440), unit)]))
141+ else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, (amount * 1000000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'), ScriptTransfer(i.caller, (((diff * amount) * 4) / 1440), unit)]
142142 }
143143
144144
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func swapTRDToUSDN () = {
88 let currentKey = toBase58String(i.caller.bytes)
9- let pmt = extract(i.payment)
9+ let pmt = value(i.payments[0])
1010 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
1111 if ((pmt.assetId != asset1))
1212 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
13- else ScriptResult(WriteSet([DataEntry("TRDToUSDN_Swap_Address", currentKey), DataEntry("TRDToUSDN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 1000), base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p')]))
13+ else [StringEntry("TRDToUSDN_Swap_Address", currentKey), IntegerEntry("TRDToUSDN_Swap_Height", height), DeleteEntry("Blocks_Gap"), DeleteEntry("Blocks_Gap_3P8FF73N7ZvvNJ34vnJ3h9Tfmh7oQCnRz8E"), DeleteEntry("Blocks_Gap_3PNQvgNwpFxm6nonoVnAh1N43WVwAnz5Rfc"), DeleteEntry("TRDToUSDN_Swap_Address_3P8FF73N7ZvvNJ34vnJ3h9Tfmh7oQCnRz8E"), DeleteEntry("TRDToUSDN_Swap_Address_3PNQvgNwpFxm6nonoVnAh1N43WVwAnz5Rfc"), ScriptTransfer(i.caller, (pmt.amount / 1000), base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p')]
1414 }
1515
1616
1717
1818 @Callable(i)
1919 func swapUSDNToTRD () = {
2020 let currentKey = toBase58String(i.caller.bytes)
21- let pmt = extract(i.payment)
21+ let pmt = value(i.payments[0])
2222 let asset1 = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
2323 if ((pmt.assetId != asset1))
2424 then throw("Incorrect asset attached, please send DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p (USDN).")
25- else ScriptResult(WriteSet([DataEntry("USDNToTRD_Swap_Address", currentKey), DataEntry("USDNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
25+ else [StringEntry("USDNToTRD_Swap_Address", currentKey), IntegerEntry("USDNToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
2626 }
2727
2828
2929
3030 @Callable(i)
3131 func swapTRDToUSDT () = {
3232 let currentKey = toBase58String(i.caller.bytes)
33- let pmt = extract(i.payment)
33+ let pmt = value(i.payments[0])
3434 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
3535 if ((pmt.assetId != asset1))
3636 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
37- else ScriptResult(WriteSet([DataEntry("TRDToUSDT_Swap_Address", currentKey), DataEntry("TRDToUSDT_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 1000), base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ')]))
37+ else [StringEntry("TRDToUSDT_Swap_Address", currentKey), IntegerEntry("TRDToUSDT_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount / 1000), base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ')]
3838 }
3939
4040
4141
4242 @Callable(i)
4343 func swapUSDTToTRD () = {
4444 let currentKey = toBase58String(i.caller.bytes)
45- let pmt = extract(i.payment)
45+ let pmt = value(i.payments[0])
4646 let asset1 = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ'
4747 if ((pmt.assetId != asset1))
4848 then throw("Incorrect asset attached, please send 34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ (USDT).")
49- else ScriptResult(WriteSet([DataEntry("USDTToTRD_Swap_Address", currentKey), DataEntry("USDTToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
49+ else [StringEntry("USDTToTRD_Swap_Address", currentKey), IntegerEntry("USDTToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 1000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
5050 }
5151
5252
5353
5454 @Callable(i)
5555 func swapTRDToNGNN () = {
5656 let currentKey = toBase58String(i.caller.bytes)
57- let pmt = extract(i.payment)
57+ let pmt = value(i.payments[0])
5858 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
5959 if ((pmt.assetId != asset1))
6060 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
61- else ScriptResult(WriteSet([DataEntry("TRDToNGNN_Swap_Address", currentKey), DataEntry("TRDToNGNN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, ((pmt.amount * 38) / 100), base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN')]))
61+ else [StringEntry("TRDToNGNN_Swap_Address", currentKey), IntegerEntry("TRDToNGNN_Swap_Height", height), ScriptTransfer(i.caller, ((pmt.amount * 38) / 100), base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN')]
6262 }
6363
6464
6565
6666 @Callable(i)
6767 func swapNGNNToTRD () = {
6868 let currentKey = toBase58String(i.caller.bytes)
69- let pmt = extract(i.payment)
69+ let pmt = value(i.payments[0])
7070 let asset1 = base58'5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN'
7171 if ((pmt.assetId != asset1))
7272 then throw("Incorrect asset attached, please send 5NmV5VAhkqormdwvaQjE54yPEkNwSRtcXxhLkJbVQqkN (NGNN).")
73- else ScriptResult(WriteSet([DataEntry("NGNNToTRD_Swap_Address", currentKey), DataEntry("NGNNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, ((pmt.amount / 38) * 100), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
73+ else [StringEntry("NGNNToTRD_Swap_Address", currentKey), IntegerEntry("NGNNToTRD_Swap_Height", height), ScriptTransfer(i.caller, ((pmt.amount / 38) * 100), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
7474 }
7575
7676
7777
7878 @Callable(i)
7979 func swapTRDToTN () = {
8080 let currentKey = toBase58String(i.caller.bytes)
81- let pmt = extract(i.payment)
81+ let pmt = value(i.payments[0])
8282 let asset1 = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
8383 if ((pmt.assetId != asset1))
8484 then throw("Incorrect asset attached, please send EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
85- else ScriptResult(WriteSet([DataEntry("TRDToTN_Swap_Address", currentKey), DataEntry("TRDToTN_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 10), base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD')]))
85+ else [StringEntry("TRDToTN_Swap_Address", currentKey), IntegerEntry("TRDToTN_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount * 10), base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD')]
8686 }
8787
8888
8989
9090 @Callable(i)
9191 func swapTNToTRD () = {
9292 let currentKey = toBase58String(i.caller.bytes)
93- let pmt = extract(i.payment)
93+ let pmt = value(i.payments[0])
9494 let asset1 = base58'bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD'
9595 if ((pmt.assetId != asset1))
9696 then throw("Incorrect asset attached, please send bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD (TN).")
97- else ScriptResult(WriteSet([DataEntry("TNToTRD_Swap_Address", currentKey), DataEntry("TNToTRD_Swap_Height", height)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 10), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]))
97+ else [StringEntry("TNToTRD_Swap_Address", currentKey), IntegerEntry("TNToTRD_Swap_Height", height), ScriptTransfer(i.caller, (pmt.amount / 10), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4')]
9898 }
9999
100100
101101
102102 @Callable(i)
103103 func depositTRD () = {
104- let pmt = extract(i.payment)
104+ let pmt = value(i.payments[0])
105105 let assetid = base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'
106106 if ((pmt.assetId != assetid))
107107 then throw("Kindly Deposit Only EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4 (TRD).")
108108 else {
109109 let currentKey = toBase58String(i.caller.bytes)
110110 let currentAmount = match getInteger(this, currentKey) {
111111 case a: Int =>
112112 a
113113 case _ =>
114114 0
115115 }
116116 let newAmount = (currentAmount + pmt.amount)
117- let useramount = DataEntry(currentKey, newAmount)
118- let userdepositheight = DataEntry(("Deposit_Height_Of_" + currentKey), height)
119- WriteSet([useramount, userdepositheight])
117+ let useramount = IntegerEntry(currentKey, newAmount)
118+ let userdepositheight = IntegerEntry(("Deposit_Height_Of_" + currentKey), height)
119+[useramount, userdepositheight]
120120 }
121121 }
122122
123123
124124
125125 @Callable(i)
126126 func withdrawTRD (amount) = {
127127 let currentKey = toBase58String(i.caller.bytes)
128128 let currentAmount = match getInteger(this, currentKey) {
129129 case a: Int =>
130130 a
131131 case _ =>
132132 0
133133 }
134134 let newAmount = (currentAmount - (amount * 1000000))
135135 let swapheightkeyname = ("Deposit_Height_Of_" + currentKey)
136- let diff = (height - extract(getInteger(this, swapheightkeyname)))
136+ let diff = (height - value(getInteger(this, swapheightkeyname)))
137137 if ((0 > amount))
138138 then throw("Can't withdraw negative TRD amount")
139139 else if ((0 > newAmount))
140140 then throw("Not enough TRD balance")
141- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, (amount * 1000000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'), ScriptTransfer(i.caller, (((diff * amount) * 4) / 1440), unit)]))
141+ else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, (amount * 1000000), base58'EekwfLSAkbREneBHrXdZSRAEPvmijq71Nf2GDNqBStz4'), ScriptTransfer(i.caller, (((diff * amount) * 4) / 1440), unit)]
142142 }
143143
144144
145145 @Verifier(tx)
146146 func verify () = match tx {
147147 case _ =>
148148 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
149149 }
150150

github/deemru/w8io/3ef1775 
85.62 ms