tx · 8g6cLM8gBeo4CTSUvYNAiDwxFh1SodqncDLQNhyKKsjD

3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF:  -0.01400000 Waves

2020.03.10 03:02 [902288] smart account 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF > SELF 0.00000000 Waves

{ "type": 13, "id": "8g6cLM8gBeo4CTSUvYNAiDwxFh1SodqncDLQNhyKKsjD", "fee": 1400000, "feeAssetId": null, "timestamp": 1583798524284, "version": 1, "sender": "3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF", "senderPublicKey": "9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3", "proofs": [ "322AxzisuuEz9BnStpRSm8xV6mraUYoNyWqmbBq55WXe29CrH8hA4NVVVVRsbNggNPQCFt6L1zacpyn6zJE2b77U" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASABIDCgEBAAAAAwAAAAAGRVVDb2luAQAAACDJofoUphCC2vgdQrn0R0tQm4QOreBLRVolNScltI/WUQAAAAAGVVNDb2luAQAAACCWpimiLpI8FZFaHXIW3ZwI74bEgcPecoAv5ODcRcQ7/QAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIIR0OzhzTJc1ozXjp3CfISpQxO2vbrCrTGSiFABFRe8mAAAABAAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkAwkAAAAAAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABlVTQ29pbgQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAKY3VycmVudEtleQIAAAAHX3VzY29pbgMJAAABAAA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QAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgeMfdyW", "chainId": 84, "height": 902288, "spentComplexity": 0 } View: original | compacted Prev: CQZ5DUYy7TYDzQWinGESEPHpUKHiBRoAuMFmzYwzTv8L Next: A6A9x5vkBwtWGJH4chRb8GTtoLHeFDKzLDFB6SFoA2wr Diff:
OldNewDifferences
9292
9393
9494 @Callable(i)
95-func getFaucet (amount) = if ((0 > amount))
96- then throw("Can't withdraw negative amount")
97- else TransferSet([ScriptTransfer(i.caller, amount, EUCoin)])
95+func getFaucet (amount) = {
96+ let currentKey = toBase58String(i.caller.bytes)
97+ let currentAmount = match getInteger(this, (currentKey + "_faucet")) {
98+ case a: Int =>
99+ a
100+ case _ =>
101+ 0
102+ }
103+ if ((0 > amount))
104+ then throw("Can't withdraw negative amount")
105+ else if ((currentAmount > 0))
106+ then throw("Faucet already taken")
107+ else ScriptResult(WriteSet([DataEntry((currentKey + "_faucet"), amount)]), TransferSet([ScriptTransfer(i.caller, amount, EUCoin)]))
108+ }
98109
99110
100111 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let EUCoin = base58'Ea6CdDfumo8ZFecxUSWKAjZpQXmkRC79WB4ktu3KffPn'
55
66 let USCoin = base58'B957NA5BEM8quCDhe1fUPkqBSdCZdJunNxjGE8FRJkWx'
77
88 let ownerPublicKey = base58'9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3'
99
1010 @Callable(i)
1111 func deposit () = {
1212 let pmt = extract(i.payment)
1313 if (isDefined(pmt.assetId))
1414 then if ((pmt.assetId == USCoin))
1515 then {
1616 let currentKey = toBase58String(i.caller.bytes)
1717 let currentAmount = match getInteger(this, (currentKey + "_uscoin")) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
2323 let newAmount = (currentAmount + pmt.amount)
2424 ScriptResult(WriteSet([DataEntry((currentKey + "_uscoin"), newAmount)]), TransferSet([ScriptTransfer(i.caller, pmt.amount, EUCoin)]))
2525 }
2626 else throw("can hodl USCoin only at the moment")
2727 else {
2828 let currentKey = toBase58String(i.caller.bytes)
2929 let currentAmount = match getInteger(this, (currentKey + "_waves")) {
3030 case a: Int =>
3131 a
3232 case _ =>
3333 0
3434 }
3535 let newAmount = (currentAmount + (pmt.amount / 100))
3636 ScriptResult(WriteSet([DataEntry((currentKey + "_waves"), newAmount)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount / 100), EUCoin)]))
3737 }
3838 }
3939
4040
4141
4242 @Callable(i)
4343 func withdrawUSCoin () = {
4444 let pmt = extract(i.payment)
4545 if (isDefined(pmt.assetId))
4646 then if ((pmt.assetId == EUCoin))
4747 then {
4848 let currentKey = toBase58String(i.caller.bytes)
4949 let currentAmount = match getInteger(this, (currentKey + "_uscoin")) {
5050 case a: Int =>
5151 a
5252 case _ =>
5353 0
5454 }
5555 let newAmount = (currentAmount - pmt.amount)
5656 if ((0 > pmt.amount))
5757 then throw("Can't withdraw negative amount")
5858 else if ((0 > newAmount))
5959 then throw("Not enough USCoin Deposited")
6060 else ScriptResult(WriteSet([DataEntry((currentKey + "_uscoin"), newAmount)]), TransferSet([ScriptTransfer(i.caller, pmt.amount, USCoin)]))
6161 }
6262 else throw("You Can Withdraw with EUCoin only")
6363 else throw("You Can Withdraw with EUCoin only")
6464 }
6565
6666
6767
6868 @Callable(i)
6969 func withdrawWaves () = {
7070 let pmt = extract(i.payment)
7171 if (isDefined(pmt.assetId))
7272 then if ((pmt.assetId == EUCoin))
7373 then {
7474 let currentKey = toBase58String(i.caller.bytes)
7575 let currentAmount = match getInteger(this, (currentKey + "_waves")) {
7676 case a: Int =>
7777 a
7878 case _ =>
7979 0
8080 }
8181 let newAmount = (currentAmount - pmt.amount)
8282 if ((0 > pmt.amount))
8383 then throw("Can't withdraw negative amount")
8484 else if ((0 > newAmount))
8585 then throw("Not enough Waves Deposited")
8686 else ScriptResult(WriteSet([DataEntry((currentKey + "_waves"), newAmount)]), TransferSet([ScriptTransfer(i.caller, (pmt.amount * 100), unit)]))
8787 }
8888 else throw("You Can Withdraw with EUCoin only")
8989 else throw("You Can Withdraw with EUCoin only")
9090 }
9191
9292
9393
9494 @Callable(i)
95-func getFaucet (amount) = if ((0 > amount))
96- then throw("Can't withdraw negative amount")
97- else TransferSet([ScriptTransfer(i.caller, amount, EUCoin)])
95+func getFaucet (amount) = {
96+ let currentKey = toBase58String(i.caller.bytes)
97+ let currentAmount = match getInteger(this, (currentKey + "_faucet")) {
98+ case a: Int =>
99+ a
100+ case _ =>
101+ 0
102+ }
103+ if ((0 > amount))
104+ then throw("Can't withdraw negative amount")
105+ else if ((currentAmount > 0))
106+ then throw("Faucet already taken")
107+ else ScriptResult(WriteSet([DataEntry((currentKey + "_faucet"), amount)]), TransferSet([ScriptTransfer(i.caller, amount, EUCoin)]))
108+ }
98109
99110
100111 @Verifier(tx)
101112 func verify () = match tx {
102113 case d: SetScriptTransaction =>
103114 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
104115 case d: DataTransaction =>
105116 true
106117 case _ =>
107118 false
108119 }
109120

github/deemru/w8io/169f3d6 
43.62 ms