tx · 5bgQwdmxfFfFCcYYDU1y5vycz1imviBojKEciesrKr95 3NAg879tKUJh949h21umkwiaRQhwZftz1BE: -0.01400000 Waves 2019.08.09 13:58 [623353] smart account 3NAg879tKUJh949h21umkwiaRQhwZftz1BE > SELF 0.00000000 Waves
{ "type": 13, "id": "5bgQwdmxfFfFCcYYDU1y5vycz1imviBojKEciesrKr95", "fee": 1400000, "feeAssetId": null, "timestamp": 1565348322959, "version": 1, "sender": "3NAg879tKUJh949h21umkwiaRQhwZftz1BE", "senderPublicKey": "BqY2jhkQCcbidtQdQZu6f9RV3AkFAS8VPToHxwYu1KdJ", "proofs": [ "3Kah6hvufXdQzah812oiee2pURYYk2hVwqGD3xVMSWLwZhFMV6xMAFxDxDDt1DErDHduvZqizow4Pcd4NdXwHdkW" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAABZkZXNjcmlwdGlvblVwZGF0ZVByaWNlAAAAAAAF9eEAAAAAAA9saW5rVXBkYXRlUHJpY2UAAAAAAAX14QAAAAAAEXRpY2tlclVwZGF0ZVByaWNlAAAAAAAL68IAAAAAABx0aWNrZXJDYXRhbG9ndWVPcmFjbGVBZGRyZXNzCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNNeEh4VzVWV3E0S3JXY2JoRmZ4S3JhZlhtNG1MNnJaSGZqAQAAABRnZXRTdHJpbmdGcm9tQWNjb3VudAAAAAIAAAAOYWNjb3VudEFkZHJlc3MAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAADmFjY291bnRBZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwUAAAAEdW5pdAAAAAIAAAABaQEAAAARdXBkYXRlRGVzY3JpcHRpb24AAAADAAAAB2Fzc2V0SWQAAAANaXNzdWVyQWRkcmVzcwAAAAtkZXNjcmlwdGlvbgQAAAAHcGF5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K7vgcvA7pSo5nKN78 Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let tickerUpdatePrice = 200000000 | |
9 | 9 | ||
10 | + | let tickerCatalogueOracleAddress = addressFromStringValue("3MxHxW5VWq4KrWcbhFfxKrafXm4mL6rZHfj") | |
11 | + | ||
12 | + | func getStringFromAccount (accountAddress,key) = match getString(accountAddress, key) { | |
13 | + | case s: String => | |
14 | + | s | |
15 | + | case _ => | |
16 | + | unit | |
17 | + | } | |
18 | + | ||
19 | + | ||
10 | 20 | @Callable(i) | |
11 | 21 | func updateDescription (assetId,issuerAddress,description) = { | |
12 | - | let asset = assetInfo(value(fromBase58String(assetId))) | |
13 | 22 | let payment = extract(i.payment) | |
14 | 23 | let callerAddress = toBase58String(i.caller.bytes) | |
15 | 24 | let issuerDescriptionKey = ((("issuerDescription_" + "<") + assetId) + ">") | |
23 | 32 | } | |
24 | 33 | ||
25 | 34 | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func updateTicker (assetId,issuerAddress,ticker) = { | |
38 | + | let payment = extract(i.payment) | |
39 | + | let callerAddress = toBase58String(i.caller.bytes) | |
40 | + | let issuerTickerKey = ((("issuerTicker_" + "<") + assetId) + ">") | |
41 | + | if (isDefined(payment.assetId)) | |
42 | + | then throw("error#1. The service can only be paid in waves") | |
43 | + | else if ((payment.amount >= tickerUpdatePrice)) | |
44 | + | then if ((callerAddress == issuerAddress)) | |
45 | + | then { | |
46 | + | let tickerFromOracle = getStringFromAccount(tickerCatalogueOracleAddress, ticker) | |
47 | + | if ((tickerFromOracle != unit)) | |
48 | + | then throw("Asset with such ticker is already exist") | |
49 | + | else WriteSet([DataEntry(issuerTickerKey, ticker)]) | |
50 | + | } | |
51 | + | else throw("error#3. Only asset issuer can update asset description") | |
52 | + | else throw("error#2. Insufficient payment for asset description updaate service.") | |
53 | + | } | |
54 | + | ||
55 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let descriptionUpdatePrice = 100000000 | |
5 | 5 | ||
6 | 6 | let linkUpdatePrice = 100000000 | |
7 | 7 | ||
8 | 8 | let tickerUpdatePrice = 200000000 | |
9 | 9 | ||
10 | + | let tickerCatalogueOracleAddress = addressFromStringValue("3MxHxW5VWq4KrWcbhFfxKrafXm4mL6rZHfj") | |
11 | + | ||
12 | + | func getStringFromAccount (accountAddress,key) = match getString(accountAddress, key) { | |
13 | + | case s: String => | |
14 | + | s | |
15 | + | case _ => | |
16 | + | unit | |
17 | + | } | |
18 | + | ||
19 | + | ||
10 | 20 | @Callable(i) | |
11 | 21 | func updateDescription (assetId,issuerAddress,description) = { | |
12 | - | let asset = assetInfo(value(fromBase58String(assetId))) | |
13 | 22 | let payment = extract(i.payment) | |
14 | 23 | let callerAddress = toBase58String(i.caller.bytes) | |
15 | 24 | let issuerDescriptionKey = ((("issuerDescription_" + "<") + assetId) + ">") | |
16 | 25 | if (isDefined(payment.assetId)) | |
17 | 26 | then throw("error#1. The service can only be paid in waves") | |
18 | 27 | else if ((payment.amount >= descriptionUpdatePrice)) | |
19 | 28 | then if ((callerAddress == issuerAddress)) | |
20 | 29 | then WriteSet([DataEntry(issuerDescriptionKey, description)]) | |
21 | 30 | else throw("error#3. Only asset issuer can update asset description") | |
22 | 31 | else throw("error#2. Insufficient payment for asset description updaate service.") | |
23 | 32 | } | |
24 | 33 | ||
25 | 34 | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func updateTicker (assetId,issuerAddress,ticker) = { | |
38 | + | let payment = extract(i.payment) | |
39 | + | let callerAddress = toBase58String(i.caller.bytes) | |
40 | + | let issuerTickerKey = ((("issuerTicker_" + "<") + assetId) + ">") | |
41 | + | if (isDefined(payment.assetId)) | |
42 | + | then throw("error#1. The service can only be paid in waves") | |
43 | + | else if ((payment.amount >= tickerUpdatePrice)) | |
44 | + | then if ((callerAddress == issuerAddress)) | |
45 | + | then { | |
46 | + | let tickerFromOracle = getStringFromAccount(tickerCatalogueOracleAddress, ticker) | |
47 | + | if ((tickerFromOracle != unit)) | |
48 | + | then throw("Asset with such ticker is already exist") | |
49 | + | else WriteSet([DataEntry(issuerTickerKey, ticker)]) | |
50 | + | } | |
51 | + | else throw("error#3. Only asset issuer can update asset description") | |
52 | + | else throw("error#2. Insufficient payment for asset description updaate service.") | |
53 | + | } | |
54 | + | ||
55 | + |
github/deemru/w8io/169f3d6 47.27 ms ◑