tx · CA5rLdXaHyannn8KYgoP21B9DxDfraSwst9CUk34s5Go

3NDCSwfcXHAZTnU9kjy6uNh9qc8fmxDwR5z:  -0.01000000 Waves

2022.05.21 16:07 [2061475] smart account 3NDCSwfcXHAZTnU9kjy6uNh9qc8fmxDwR5z > SELF 0.00000000 Waves

{ "type": 13, "id": "CA5rLdXaHyannn8KYgoP21B9DxDfraSwst9CUk34s5Go", "fee": 1000000, "feeAssetId": null, "timestamp": 1653138474991, "version": 2, "chainId": 84, "sender": "3NDCSwfcXHAZTnU9kjy6uNh9qc8fmxDwR5z", "senderPublicKey": "DUtFhhkvLNyPXUNKpphwkCBAJukZbuPrZ4FANUUUbydd", "proofs": [ "3ndWiCQKzYfQVjwkWbNKCWnAJibAnEdQRXYAMHf2XRCLyww67oCgjhg8vDxEUzutEz7HT2BdoZ4E7aqwkwQFWFAz" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAwAAAAAQdmlyZXNNYWluQWRkcmVzcwEAAAAaAVdewZYZMMmiQ3hGadYm1vHmuEPQvfZMHrgAAAAAEHZpcmVzVXNkY0FkZHJlc3MBAAAAGgFXnJHW61bfY7G/f+SNMyTkHKjj+EDnO+0DAAAAAARVU0RDAQAAACBSM9nhl4gm5eIfwv3qiDS4h3ajjLGD78hgHH4KElQmJQAAAAEAAAABaQEAAAANd2l0aGRyYXdfdXNkYwAAAAAEAAAABWFkbWluAgAAACMzTkRDU3dmY1hIQVpUblU5a2p5NnVOaDlxYzhmbXhEd1I1egMJAQAAAAIhPQAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAAAVhZG1pbgkAAAIAAAABAgAAABdvbmx5IGFkbWluIGNhbiB3aXRoZHJhdwQAAAADaW52CQAD/AAAAAQJAQAAAAdBZGRyZXNzAAAAAQUAAAAQdmlyZXNNYWluQWRkcmVzcwIAAAAId2l0aGRyYXcJAARMAAAAAgkAAlgAAAABBQAAAARVU0RDCQAETAAAAAIAAAAAADuaygAFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAAANpbnYFAAAAA2ludgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAACK05dC", "height": 2061475, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DqJsxhKJHd86PBb2rWoJ9LzFsPyMyvEM4qdL5gatkiLr Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let answersCount = 20
4+let viresMainAddress = base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT'
55
6-let answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."]
6+let viresUsdcAddress = base58'3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S'
77
8-func getAnswer (question,previousAnswer) = {
9- let hash = sha256(toBytes((question + previousAnswer)))
10- let index = toInt(hash)
11-answers[(index % answersCount)]
12- }
13-
14-
15-func getPreviousAnswer (address) = match getString(this, (address + "_a")) {
16- case a: String =>
17- a
18- case _ =>
19- address
20-}
21-
8+let USDC = base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ'
229
2310 @Callable(i)
24-func tellme (question) = {
25- let callerAddress = toBase58String(i.caller.bytes)
26- let answer = getAnswer(question, getPreviousAnswer(callerAddress))
27- WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)])
11+func withdraw_usdc () = {
12+ let admin = "3NDCSwfcXHAZTnU9kjy6uNh9qc8fmxDwR5z"
13+ if ((toString(i.caller) != admin))
14+ then throw("only admin can withdraw")
15+ else {
16+ let inv = invoke(Address(viresMainAddress), "withdraw", [toBase58String(USDC), 1000000000], nil)
17+ if ((inv == inv))
18+ then nil
19+ else throw("Strict value is not equal to itself.")
20+ }
2821 }
2922
3023

github/deemru/w8io/026f985 
24.81 ms