tx · 6gx6rmeHWP2tJ5XGsyTYu7WJBmMtHJXcog2MzbohUKX2
3N1i8QSoM6oL6gxecKvXQ672yRiLt44HgXz: -0.01400000 Waves
2019.10.26 00:44 [736198] smart account 3N1i8QSoM6oL6gxecKvXQ672yRiLt44HgXz > SELF 0.00000000 Waves
{
"type": 13,
"id": "6gx6rmeHWP2tJ5XGsyTYu7WJBmMtHJXcog2MzbohUKX2",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1572039854990,
"version": 1,
"sender": "3N1i8QSoM6oL6gxecKvXQ672yRiLt44HgXz",
"senderPublicKey": "6vvHscsLo3kap5Q2GDgkBUKrk8ToJaoj2shtCDoo22uz",
"proofs": [
"3FGhj46m5gwMzbVxxpnF4F5QqrsRmNPy8WE8cNeJ7t2BCR69PJxxozXQshCTKG3eZe8fJjCaNTek4XZPaG9mv9Ev"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBvbmx5IFdBVkVTIGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAClwdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBwcmljZQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAK3B1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gcHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAgc3RhdHVzOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwIAAAAJY29uZmlybWVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAH3ByaWNlOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAAChnWfr",
"chainId": 84,
"height": 736198,
"spentComplexity": 0
}
View: original | compacted
Prev: Bkp1LvPAzApusNiETzoGgDuUZDy4PShDeU8TbNfusDJd
Next: CUCKadxCYxNGRDWGeibfdKuHt3dh5Ji8L42cwC4KqREv
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let aPubKey = base58'6WPou58ywAsW3bgC5yrCAPUbj7NbeogxH8cjJB6gRPDH' |
---|
5 | 4 | | |
---|
6 | | - | let cPubKey = base58'7S5nePywD1ZDbe9VEWphJsC73CGsRRCFV6v2kvtTM3HR' |
---|
7 | 5 | | |
---|
8 | 6 | | @Callable(i) |
---|
9 | 7 | | func purchase () = { |
---|
10 | 8 | | let pmt = extract(i.payment) |
---|
11 | 9 | | if (isDefined(pmt.assetId)) |
---|
12 | | - | then throw("only WAVES") |
---|
| 10 | + | then throw("can use only WAVES at the moment") |
---|
13 | 11 | | else { |
---|
14 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
15 | 13 | | let price = match getInteger(this, "item_A_coupon_price") { |
---|
|
19 | 17 | | 0 |
---|
20 | 18 | | } |
---|
21 | 19 | | if ((price > pmt.amount)) |
---|
22 | | - | then throw("less") |
---|
| 20 | + | then throw("purchase amount cannot be less than price") |
---|
23 | 21 | | else if ((pmt.amount > price)) |
---|
24 | | - | then throw("greater") |
---|
| 22 | + | then throw("purchase amount cannot be higher than price") |
---|
25 | 23 | | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
26 | 24 | | } |
---|
27 | 25 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let aPubKey = base58'6WPou58ywAsW3bgC5yrCAPUbj7NbeogxH8cjJB6gRPDH' |
---|
5 | 4 | | |
---|
6 | | - | let cPubKey = base58'7S5nePywD1ZDbe9VEWphJsC73CGsRRCFV6v2kvtTM3HR' |
---|
7 | 5 | | |
---|
8 | 6 | | @Callable(i) |
---|
9 | 7 | | func purchase () = { |
---|
10 | 8 | | let pmt = extract(i.payment) |
---|
11 | 9 | | if (isDefined(pmt.assetId)) |
---|
12 | | - | then throw("only WAVES") |
---|
| 10 | + | then throw("can use only WAVES at the moment") |
---|
13 | 11 | | else { |
---|
14 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
15 | 13 | | let price = match getInteger(this, "item_A_coupon_price") { |
---|
16 | 14 | | case a: Int => |
---|
17 | 15 | | a |
---|
18 | 16 | | case _ => |
---|
19 | 17 | | 0 |
---|
20 | 18 | | } |
---|
21 | 19 | | if ((price > pmt.amount)) |
---|
22 | | - | then throw("less") |
---|
| 20 | + | then throw("purchase amount cannot be less than price") |
---|
23 | 21 | | else if ((pmt.amount > price)) |
---|
24 | | - | then throw("greater") |
---|
| 22 | + | then throw("purchase amount cannot be higher than price") |
---|
25 | 23 | | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
26 | 24 | | } |
---|
27 | 25 | | } |
---|
28 | 26 | | |
---|
29 | 27 | | |
---|