tx · E1FsukQH3am6VF6xLP6SkQRJcT76HqUzFSkUzmD6PqF7

3NCTUyjM4SX4hK2kaFTkYv4J2fzcQHtvSjv:  -0.05000000 Waves

2020.06.21 21:08 [1053711] smart account 3NCTUyjM4SX4hK2kaFTkYv4J2fzcQHtvSjv > SELF 0.00000000 Waves

{ "type": 13, "id": "E1FsukQH3am6VF6xLP6SkQRJcT76HqUzFSkUzmD6PqF7", "fee": 5000000, "feeAssetId": null, "timestamp": 1592762873659, "version": 1, "sender": "3NCTUyjM4SX4hK2kaFTkYv4J2fzcQHtvSjv", "senderPublicKey": "CCEAkP4AnTM1HmKyRheQLmgNxPKACsL5hcH72JUeCiDJ", "proofs": [ "42jS1bkpFpSWAgt6YCp2EiyN9Go12mPa4HCRR3ZeAj3UG6RsSKzT2Tis5eTWFWYek7P14zVUSuYcDZ5zJgHXc8eF" ], "script": "base64:AAIDAAAAAAAAABoIARIHCgUIAQEICBIDCgEIEgMKAQgSAwoBCAAAAAMAAAAADm93bmVyUHVibGljS2V5AQAAACCmUNWS0Pf/tmct+/B/I05Ro9F4HTOauOin2of4SgTvNQEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAkAAfcAAAABBQAAAARyYW5kAQAAABFvZmZlckVycm9ySGFuZGxlcgAAAAYAAAAFdG9rZW4AAAAGYW1vdW50AAAABXByaWNlAAAABHR5cGUAAAAFYXNzZXQAAAADaW52AwMDAwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAFd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XB0VHJhbnNhY3Rpb24JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B1wb4VA=", "chainId": 84, "height": 1053711, "spentComplexity": 0 } View: original | compacted Prev: 3wN3ts1993P5bc8L2oG91GHeGas5UyG4uijjc15FFjAg Next: none Diff:
OldNewDifferences
4949 func acceptOffer (r) = {
5050 let s = getString(this, (r + "_type"))
5151 let t = getString(this, r)
52- let u = getString(this, (r + "_assetId"))
52+ let u = getStringValue(this, (r + "_assetId"))
5353 let v = getInteger(this, (r + "_amount"))
5454 if ((t == "open"))
5555 then if ((s == "buy"))
5959 let k = extract(l.payment)
6060 if ((k.amount != v))
6161 then throw("Insufficient Payment Amount")
62- else if ((k.assetId != u))
62+ else if ((k.assetId != fromBase58String(u)))
6363 then throw("AssetId invalid")
6464 else WriteSet([DataEntry(r, "accepted"), DataEntry((r + "_secondParty"), toBase58String(l.caller.bytes))])
6565 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'CCEAkP4AnTM1HmKyRheQLmgNxPKACsL5hcH72JUeCiDJ'
55
66 func b (c) = {
77 let d = ((((c.transactionId + c.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
88 sha256(d)
99 }
1010
1111
1212 func e (f,g,h,i,j,c) = if (if (if (if (!(isDefined(f)))
1313 then true
1414 else !(isDefined(g)))
1515 then true
1616 else !(isDefined(h)))
1717 then true
1818 else !(isDefined(i)))
1919 then throw("Invalid Transaction")
2020 else if (if ((i == "sell"))
2121 then !(isDefined(c.payment))
2222 else false)
2323 then throw("No payment attached")
2424 else if (if ((i == "sell"))
2525 then isDefined(c.payment)
2626 else false)
2727 then {
2828 let k = extract(c.payment)
2929 if ((k.amount != g))
3030 then throw("Payment amount insufficient")
3131 else if ((toBase58String(value(k.assetId)) != j))
3232 then throw("AssetId invalid")
3333 else true
3434 }
3535 else true
3636
3737
3838 @Callable(l)
3939 func postOffer (m,n,o,p,q) = if (e(m, n, o, p, q, l))
4040 then {
4141 let r = toBase64String(b(l))
4242 WriteSet([DataEntry(r, "open"), DataEntry((r + "_tokenId"), m), DataEntry((r + "_amount"), n), DataEntry((r + "_price"), o), DataEntry((r + "_type"), p), DataEntry((r + "_firstParty"), toBase58String(l.caller.bytes)), DataEntry((r + "_assetId"), q)])
4343 }
4444 else throw("Conditions not met")
4545
4646
4747
4848 @Callable(l)
4949 func acceptOffer (r) = {
5050 let s = getString(this, (r + "_type"))
5151 let t = getString(this, r)
52- let u = getString(this, (r + "_assetId"))
52+ let u = getStringValue(this, (r + "_assetId"))
5353 let v = getInteger(this, (r + "_amount"))
5454 if ((t == "open"))
5555 then if ((s == "buy"))
5656 then if (!(isDefined(l.payment)))
5757 then throw("Payment needed for buy offer")
5858 else {
5959 let k = extract(l.payment)
6060 if ((k.amount != v))
6161 then throw("Insufficient Payment Amount")
62- else if ((k.assetId != u))
62+ else if ((k.assetId != fromBase58String(u)))
6363 then throw("AssetId invalid")
6464 else WriteSet([DataEntry(r, "accepted"), DataEntry((r + "_secondParty"), toBase58String(l.caller.bytes))])
6565 }
6666 else if ((s == "sell"))
6767 then WriteSet([DataEntry(r, "accepted"), DataEntry((r + "_secondParty"), toBase58String(l.caller.bytes))])
6868 else throw("Offer Type Error")
6969 else throw("Wrong offer status - forbidden")
7070 }
7171
7272
7373
7474 @Callable(l)
7575 func signOffer (r) = {
7676 let t = getString(this, r)
7777 let w = getString(this, (r + "_firstParty"))
7878 let x = getStringValue(this, (r + "_secondParty"))
7979 let s = getString(this, (r + "_type"))
8080 let g = getIntegerValue(this, (r + "_amount"))
8181 let u = getStringValue(this, (r + "_assetId"))
8282 if ((t == "accepted"))
8383 then if ((w != toBase58String(l.caller.bytes)))
8484 then throw("User not allowed to sign")
8585 else if ((s == "buy"))
8686 then ScriptResult(WriteSet([DataEntry(r, "closed")]), TransferSet([ScriptTransfer(l.caller, g, fromBase58String(u))]))
8787 else if ((s == "sell"))
8888 then ScriptResult(WriteSet([DataEntry(r, "closed")]), TransferSet([ScriptTransfer(addressFromStringValue(x), g, fromBase58String(u))]))
8989 else throw("Offer Type Error")
9090 else throw("Wrong offer status - forbidden")
9191 }
9292
9393
9494
9595 @Callable(l)
9696 func deleteOffer (r) = {
9797 let w = getString(this, (r + "_firstParty"))
9898 if ((w != toBase58String(l.caller.bytes)))
9999 then throw("User not allowed to sign")
100100 else WriteSet([DataEntry(r, "deleted")])
101101 }
102102
103103
104104 @Verifier(y)
105105 func z () = {
106106 let A = y
107107 if ($isInstanceOf(A, "SetScriptTransaction"))
108108 then sigVerify(y.bodyBytes, y.proofs[0], a)
109109 else if ($isInstanceOf(A, "InvokeScriptTransaction"))
110110 then sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey)
111111 else false
112112 }
113113

github/deemru/w8io/169f3d6 
32.41 ms