tx · CRRGwH4MohyuvNyhaK3id6JnHMqkT2GtAc2oswAaAbJ3 3Mz3A1UYGJv1646xRXHZzTy4nofAbg4QPaH: -0.01400000 Waves 2023.03.06 13:20 [2478098] smart account 3Mz3A1UYGJv1646xRXHZzTy4nofAbg4QPaH > SELF 0.00000000 Waves
{ "type": 13, "id": "CRRGwH4MohyuvNyhaK3id6JnHMqkT2GtAc2oswAaAbJ3", "fee": 1400000, "feeAssetId": null, "timestamp": 1678098111997, "version": 2, "chainId": 84, "sender": "3Mz3A1UYGJv1646xRXHZzTy4nofAbg4QPaH", "senderPublicKey": "8wkcC4wZzidr4PipMnDKcJn4CP25PZn9Mj15Tx51kiB9", "proofs": [ "28RCzJGkpmeKpCunHUjK4RCsafJKJ5hsfMK2s5vSf7FJxf5oq8kuYxCxSprfw5Q3SPtWn2pCLtCb3pU773ryfdXZ" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAAAAAAAAEAAAABaQEAAAASSXNzdWVPcHRpb25MUFRva2VuAAAAAQAAAAxFbnRlckFzc2V0SUQEAAAABGluZm8JAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkAA+wAAAABCQACWQAAAAEFAAAADEVudGVyQXNzZXRJRAkAASwAAAACCQABLAAAAAICAAAABkFzc2V0IAUAAAAMRW50ZXJBc3NldElEAgAAAB0gZG9lc24ndCBleGlzdCBvbiBCbG9ja2NoYWluLgQAAAAEbmFtZQgFAAAABGluZm8AAAAEbmFtZQQAAAAHTFBpc3N1ZQkABEIAAAAFCQABLAAAAAIJAAEsAAAAAgIAAAAET3B0LQkAAS8AAAACBQAAAARuYW1lAAAAAAAAAAAHAgAAAAUtVVNEQwkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAET3B0LQkAAS8AAAACBQAAAARuYW1lAAAAAAAAAAAHAgAAAAUtVVNEQwIAAABEIGlzIGEgTGlxdWlkaXR5IFByb3ZpZGVyIFRva2VuIElzc3VlZCBBZ2FpbnN0IE9wdGlvbiBTbWFydCBDb250cmFjdC4AAAAAAAAAAAEAAAAAAAAAAAgGBAAAAAdhc3NldElkCQAEOAAAAAEFAAAAB0xQaXNzdWUEAAAAGWNoZWNraWZhc3NldGFscmVhZHlpc3N1ZWQJAAQdAAAAAgUAAAAEdGhpcwkAASwAAAACCQABLwAAAAIFAAAABG5hbWUAAAAAAAAAAAcCAAAAEV9MUF9Ub2tlbl9Bc3NldElEAwkAAAAAAAACBQAAABljaGVja2lmYXNzZXRhbHJlYWR5aXNzdWVkBQAAAAxFbnRlckFzc2V0SUQJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAMRW50ZXJBc3NldElEAgAAAA4gTFAgVG9rZW4gZm9yIAUAAAAMRW50ZXJBc3NldElEAgAAABMgaXMgYWxyZWFkeSBpc3N1ZWQuCQAETAAAAAIFAAAAB0xQaXNzdWUJAARMAAAAAgkBAAAABEJ1cm4AAAACBQAAAAdhc3NldElkAAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAAS8AAAACBQAAAARuYW1lAAAAAAAAAAAHAgAAABFfTFBfVG9rZW5fQXNzZXRJRAkAAlgAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAAA4sSFTg==", "height": 2478098, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ZyYmHYVunKjdQ4eBhnJhRwmfsmWH8HdPmt8kBZcQVyn Next: 72j6GXxHhkL8ayto7iceR9oGMcrhWvibFy15e5e5Zw8i Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func call () = { | |
8 | - | let b = if ((size(a.payments) == 1)) | |
9 | - | then a.payments[0] | |
10 | - | else throw("No payment attached, Please Attach Tokens in payment[1].") | |
11 | - | let c = [11149000, 1149000] | |
12 | - | func d (e,f) = (f + b.amount) :: e | |
13 | - | ||
14 | - | let g = { | |
15 | - | let h = c | |
16 | - | let i = size(h) | |
17 | - | let j = nil | |
18 | - | func k (l,m) = if ((m >= i)) | |
19 | - | then l | |
20 | - | else d(l, h[m]) | |
21 | - | ||
22 | - | func n (l,m) = if ((m >= i)) | |
23 | - | then l | |
24 | - | else throw("List size exceeds 2") | |
25 | - | ||
26 | - | n(k(k(j, 0), 1), 2) | |
27 | - | } | |
28 | - | [IntegerEntry("List", g[0])] | |
7 | + | func IssueOptionLPToken (b) = { | |
8 | + | let c = valueOrErrorMessage(assetInfo(fromBase58String(b)), (("Asset " + b) + " doesn't exist on Blockchain.")) | |
9 | + | let d = c.name | |
10 | + | let e = Issue((("Opt-" + take(d, 7)) + "-USDC"), ((("Opt-" + take(d, 7)) + "-USDC") + " is a Liquidity Provider Token Issued Against Option Smart Contract."), 1, 8, true) | |
11 | + | let f = calculateAssetId(e) | |
12 | + | let g = getString(this, (take(d, 7) + "_LP_Token_AssetID")) | |
13 | + | if ((g == b)) | |
14 | + | then throw((((b + " LP Token for ") + b) + " is already issued.")) | |
15 | + | else [e, Burn(f, 1), StringEntry((take(d, 7) + "_LP_Token_AssetID"), toBase58String(f))] | |
29 | 16 | } | |
30 | 17 | ||
31 | - | ||
32 | - | @Verifier(o) | |
33 | - | func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey) | |
34 | 18 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func call () = { | |
8 | - | let b = if ((size(a.payments) == 1)) | |
9 | - | then a.payments[0] | |
10 | - | else throw("No payment attached, Please Attach Tokens in payment[1].") | |
11 | - | let c = [11149000, 1149000] | |
12 | - | func d (e,f) = (f + b.amount) :: e | |
13 | - | ||
14 | - | let g = { | |
15 | - | let h = c | |
16 | - | let i = size(h) | |
17 | - | let j = nil | |
18 | - | func k (l,m) = if ((m >= i)) | |
19 | - | then l | |
20 | - | else d(l, h[m]) | |
21 | - | ||
22 | - | func n (l,m) = if ((m >= i)) | |
23 | - | then l | |
24 | - | else throw("List size exceeds 2") | |
25 | - | ||
26 | - | n(k(k(j, 0), 1), 2) | |
27 | - | } | |
28 | - | [IntegerEntry("List", g[0])] | |
7 | + | func IssueOptionLPToken (b) = { | |
8 | + | let c = valueOrErrorMessage(assetInfo(fromBase58String(b)), (("Asset " + b) + " doesn't exist on Blockchain.")) | |
9 | + | let d = c.name | |
10 | + | let e = Issue((("Opt-" + take(d, 7)) + "-USDC"), ((("Opt-" + take(d, 7)) + "-USDC") + " is a Liquidity Provider Token Issued Against Option Smart Contract."), 1, 8, true) | |
11 | + | let f = calculateAssetId(e) | |
12 | + | let g = getString(this, (take(d, 7) + "_LP_Token_AssetID")) | |
13 | + | if ((g == b)) | |
14 | + | then throw((((b + " LP Token for ") + b) + " is already issued.")) | |
15 | + | else [e, Burn(f, 1), StringEntry((take(d, 7) + "_LP_Token_AssetID"), toBase58String(f))] | |
29 | 16 | } | |
30 | 17 | ||
31 | - | ||
32 | - | @Verifier(o) | |
33 | - | func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey) | |
34 | 18 |
github/deemru/w8io/169f3d6 21.44 ms ◑