tx · 5LXxyoMZZd3K8XBeAVhYiRVG4dvuBASV7vqXTsjNeEms

3N3Aq1GcHD8bZMGyVgyvaTHrBM7EySFtJ1H:  -0.00700000 Waves

2022.06.18 20:07 [2102090] smart account 3N3Aq1GcHD8bZMGyVgyvaTHrBM7EySFtJ1H > SELF 0.00000000 Waves

{ "type": 13, "id": "5LXxyoMZZd3K8XBeAVhYiRVG4dvuBASV7vqXTsjNeEms", "fee": 700000, "feeAssetId": null, "timestamp": 1655572086562, "version": 2, "chainId": 84, "sender": "3N3Aq1GcHD8bZMGyVgyvaTHrBM7EySFtJ1H", "senderPublicKey": "69Rez9g3wdeHPiCsmjaaaK1GBhFjL79pxMPX9Fpk8S5e", "proofs": [ "51xQhnSDfRiHpNzZBn5oK8nLZ78BVLgVsL2TiM9y3dLjEgDsVy9zScQKYbzeDB8c7JDkJ6nFJADSrnbm2X4M6j8Z" ], "script": "base64:AAIFAAAAAAAAAA8IAhIGCgQICAEBEgMKAQgAAAAUAAAAAANTRVACAAAAAl9fAAAAAAVNVUxUNgAAAAAAAA9CQAAAAAAFTVVMVDgAAAAAAAX14QAAAAAACkFOT1RFSURTVFICAAAABVdBVkVTAAAAAAdBTk9URUlECQACWQAAAAEFAAAACkFOT1RFSURTVFIBAAAADGdldEludE9yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPTWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAMZ2V0U3RyT3JFbHNlAAAAAgAAAANrZXkAAAAKZGVmYXVsdFZhbAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkFAAAACmRlZmF1bHRWYWwBAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWV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QxCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWJlbmlmaWNhcnlBZGRyZXNzBQAAAA1iZW5pZmljYXJ5QW10BQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADGFub3RlQWRkcmVzcwUAAAAMcHJvdG9jb2xBbXQxBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEW1hc3Rlck5vZGVBZGRyZXNzBQAAAAxwcm90b2NvbEFtdDIFAAAABHVuaXQJAARMAAAAAgkBAAAAElJld2FyZEhpc3RvcnlFbnRyeQAAAAcFAAAADG1pbmVyQWRkcmVzcwgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAUAAAAIbWluZWRBbXQFAAAADWJlbmlmaWNhcnlBbXQFAAAAC3Byb3RvY29sQW10BQAAAAxwcm90b2NvbEFtdDEFAAAADHByb3RvY29sQW10MgkABEwAAAACCQEAAAARUmV3YXJkVG90YWxzRW50cnkAAAAGBQAAAAxtaW5lckFkZHJlc3MFAAAACG1pbmVkQW10BQAAAA1iZW5pZmljYXJ5QW10BQAAAAtwcm90b2NvbEFtdAUAAAAMcHJvdG9jb2xBbXQxBQAAAAxwcm90b2NvbEFtdDIFAAAAA25pbAAAAAC24CsY", "height": 2102090, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EewFjiWNwdizpSKNbhNMtGwwVGBmABmcjCMsPTNfvcH9 Next: CrwXXfUoWCYXC7pWT61hJjAtCPERRzq3nahKWGdgaArt Diff:
OldNewDifferences
77
88 let MULT8 = 100000000
99
10-let WAVESIDSTR = "WAVES"
10+let ANOTEIDSTR = "WAVES"
1111
12-let WAVESID = fromBase58String(WAVESIDSTR)
12+let ANOTEID = fromBase58String(ANOTEIDSTR)
1313
1414 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined"))
1515
3434 func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address)
3535
3636
37-func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress"
37+func keyAnoteAddressStr () = "%s%s__cfg__anoteAddress"
3838
3939
40-func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress"
40+func keyMasterNodeAddressStr () = "%s%s__cfg__mainAnoteNodeAddress"
4141
4242
4343 func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6"
4949 func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP)
5050
5151
52-func dataRewardHistory (wavesAmountTotal,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(wavesAmountTotal), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
52+func dataRewardHistory (anoteAmountTotal,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(anoteAmountTotal), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
5353
5454
5555 func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2))
7171
7272
7373 @Callable(i)
74-func constructor (neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this))
74+func constructor (anoteAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this))
7575 then throw("permissions denied")
7676 else if ((0 > protocolPartX6))
7777 then throw("protocolPartX6 less then zero")
7979 then throw("benificaryPartX6 less then zero")
8080 else if (((protocolPartX6 + benificaryPartX6) != MULT6))
8181 then throw("parts sum must be 1")
82- else [StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)]
82+ else [StringEntry(keyAnoteAddressStr(), validateAddressOrFail(anoteAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)]
8383
8484
8585
9191 else {
9292 let pmt = i.payments[0]
9393 let minedAmt = pmt.amount
94- let pmtAssetId = valueOrElse(pmt.assetId, WAVESID)
94+ let pmtAssetId = valueOrElse(pmt.assetId, ANOTEID)
9595 let feeAmt = i.fee
96- let feeAssetId = valueOrElse(i.feeAssetId, WAVESID)
97- if ((pmtAssetId != WAVESID))
96+ let feeAssetId = valueOrElse(i.feeAssetId, ANOTEID)
97+ if ((pmtAssetId != ANOTEID))
9898 then throw("only Waves can be used in payment")
99- else if ((feeAssetId != WAVESID))
99+ else if ((feeAssetId != ANOTEID))
100100 then throw("only Waves can be used in fees")
101101 else if ((feeAmt != ((5 * MULT8) / 1000)))
102102 then throw("fee amount couldn't exceed 0.005")
103103 else {
104- let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr())
104+ let anoteAddress = getAddressOrFail(keyAnoteAddressStr())
105105 let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr())
106106 let minerAddress = i.caller
107107 let benificaryAddress = addressFromStringValue(benificaryAddressStr)
115115 let protocolAmt = (minedAmt - benificaryAmt)
116116 let protocolAmt1 = (protocolAmt / 2)
117117 let protocolAmt2 = (protocolAmt - protocolAmt1)
118-[ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)]
118+[ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(anoteAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)]
119119 }
120120 }
121121 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let MULT6 = 1000000
77
88 let MULT8 = 100000000
99
10-let WAVESIDSTR = "WAVES"
10+let ANOTEIDSTR = "WAVES"
1111
12-let WAVESID = fromBase58String(WAVESIDSTR)
12+let ANOTEID = fromBase58String(ANOTEIDSTR)
1313
1414 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined"))
1515
1616
1717 func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal)
1818
1919
2020 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined"))
2121
2222
2323 func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(key)), (("Fail to convert this." + key) + " value into Address"))
2424
2525
2626 func validateAddressOrFail (addressStr) = {
2727 let address = valueOrErrorMessage(addressFromString(addressStr), ("fail to convert into address " + addressStr))
2828 if ((0 > wavesBalance(address).available))
2929 then throw()
3030 else addressStr
3131 }
3232
3333
3434 func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address)
3535
3636
37-func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress"
37+func keyAnoteAddressStr () = "%s%s__cfg__anoteAddress"
3838
3939
40-func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress"
40+func keyMasterNodeAddressStr () = "%s%s__cfg__mainAnoteNodeAddress"
4141
4242
4343 func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6"
4444
4545
4646 func keyBenificaryPartX6 () = "%s%s__cfg__benificaryPartX6"
4747
4848
4949 func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP)
5050
5151
52-func dataRewardHistory (wavesAmountTotal,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(wavesAmountTotal), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
52+func dataRewardHistory (anoteAmountTotal,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(anoteAmountTotal), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
5353
5454
5555 func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2))
5656
5757
5858 func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
5959
6060
6161 func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = {
6262 let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner))
6363 let nodeRewardsArray = split(getStrOrElse(nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP)
6464 let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt)
6565 let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt)
6666 let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt)
6767 let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1)
6868 let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2)
6969 StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2))
7070 }
7171
7272
7373 @Callable(i)
74-func constructor (neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this))
74+func constructor (anoteAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this))
7575 then throw("permissions denied")
7676 else if ((0 > protocolPartX6))
7777 then throw("protocolPartX6 less then zero")
7878 else if ((0 > benificaryPartX6))
7979 then throw("benificaryPartX6 less then zero")
8080 else if (((protocolPartX6 + benificaryPartX6) != MULT6))
8181 then throw("parts sum must be 1")
82- else [StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)]
82+ else [StringEntry(keyAnoteAddressStr(), validateAddressOrFail(anoteAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)]
8383
8484
8585
8686 @Callable(i)
8787 func distributeMinerReward (benificaryAddressStr) = if ((size(i.payments) != 1))
8888 then throw("exact 1 payment must be attached")
8989 else if ((i.caller != i.originCaller))
9090 then throw("dapp to dapp calls are not allowed")
9191 else {
9292 let pmt = i.payments[0]
9393 let minedAmt = pmt.amount
94- let pmtAssetId = valueOrElse(pmt.assetId, WAVESID)
94+ let pmtAssetId = valueOrElse(pmt.assetId, ANOTEID)
9595 let feeAmt = i.fee
96- let feeAssetId = valueOrElse(i.feeAssetId, WAVESID)
97- if ((pmtAssetId != WAVESID))
96+ let feeAssetId = valueOrElse(i.feeAssetId, ANOTEID)
97+ if ((pmtAssetId != ANOTEID))
9898 then throw("only Waves can be used in payment")
99- else if ((feeAssetId != WAVESID))
99+ else if ((feeAssetId != ANOTEID))
100100 then throw("only Waves can be used in fees")
101101 else if ((feeAmt != ((5 * MULT8) / 1000)))
102102 then throw("fee amount couldn't exceed 0.005")
103103 else {
104- let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr())
104+ let anoteAddress = getAddressOrFail(keyAnoteAddressStr())
105105 let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr())
106106 let minerAddress = i.caller
107107 let benificaryAddress = addressFromStringValue(benificaryAddressStr)
108108 let protocolPart = getIntOrFail(keyProtocolPartX6())
109109 let benificaryPart = getIntOrFail(keyBenificaryPartX6())
110110 let availableBalance = (wavesBalance(minerAddress).available - feeAmt)
111111 if ((availableBalance != 0))
112112 then throw((("all " + toString(availableBalance)) + " Wavelets from the Node balance must be attached into the payment"))
113113 else {
114114 let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6)
115115 let protocolAmt = (minedAmt - benificaryAmt)
116116 let protocolAmt1 = (protocolAmt / 2)
117117 let protocolAmt2 = (protocolAmt - protocolAmt1)
118-[ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)]
118+[ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(anoteAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)]
119119 }
120120 }
121121 }
122122
123123

github/deemru/w8io/026f985 
33.13 ms