tx · CBmUfgwJ6H3VyFs6q2MJ4F6Z2qmiJ2E6NtJVDTCz2sVJ

3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c:  -0.01000000 Waves

2023.09.27 14:04 [2773731] smart account 3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c > SELF 0.00000000 Waves

{ "type": 13, "id": "CBmUfgwJ6H3VyFs6q2MJ4F6Z2qmiJ2E6NtJVDTCz2sVJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1695812700722, "version": 2, "chainId": 84, "sender": "3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c", "senderPublicKey": "5FyjUYCR5Q8jvG6ri6Ysz574HerUK6r1LJzzQ7DvSkLk", "proofs": [ "5nkrhJ2Y1UxCYDLKVfUmyhGWhKwyXrcCAeRcCZK7KXpJLNsiUDc88wxxP8Hq1pDzZF4iFTY71BQrWBLo9hJLtL7u" ], "script": "base64:BgISCAISBgoEAgICARIAEgQKAggCEwAJc2VwYXJhdG9yAgJfXwELbXVzdEFkZHJlc3MCAWkHYWRkcmVzcwMJAAACCAUBaQZjYWxsZXIFB2FkZHJlc3MGCQEFdGhyb3cAAQhtdXN0VGhpcwEBaQkBC211c3RBZGRyZXNzAgUBaQUEdGhpcwARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA1rQm90UHVibGljS2V5AhAlc19fYm90UHVibGljS2V5ABFrRmFjdG9yeVB1YmxpY0tleQIUJXNfX2ZhY3RvcnlQdWJsaWNLZXkAD2tPd25lclB1YmxpY0tleQISJXNfX293bmVyUHVibGljS2V5ABJrQWNjb3VudFNjcmlwdEhhc2gCFSVzX19hY2NvdW50U2NyaXB0SGFzaAERYWNjb3VudFNjcmlwdEhhc2gACQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJwIAgUEdGhpcwUSa0FjY291bnRTY3JpcHRIYXNoAh5hY2NvdW50IHNjcmlwdCBoYXNoIGlzIG5vdCBzZXQACGtDb3Vud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5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQhjb21wbGV0ZQIJcmVxdWVzdElkEnJlY2lwaWVudFB1YmxpY0tleQQGY2hlY2tzCQDMCAIDCQEBIQEJARByZXF1ZXN0Q29tcGxldGVkAQUJcmVxdWVzdElkBgkAAgECHHJlcXVlc3QgaXMgYWxyZWFkeSBjb21wbGV0ZWQJAMwIAgMJAAACCQDxBwEIBQFpBmNhbGxlcgkBEWFjY291bnRTY3JpcHRIYXNoAAYJAAIBAg5pbnZhbGlkIHNjcmlwdAkAzAgCAwQHJG1hdGNoMAkAnAgCCAUBaQZjYWxsZXIFEWtGYWN0b3J5UHVibGljS2V5AwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAWIFByRtYXRjaDAJAAACCQCnCAEFAWIFBHRoaXMHBgkAAgECGmludmFsaWQgZmFjdG9yeSBwdWJsaWMga2V5CQDMCAIDBAckbWF0Y2gwCQCcCAIIBQFpBmNhbGxlcgUPa093bmVyUHVibGljS2V5AwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAWIFByRtYXRjaDAJAAACBQFiCQEMcmVxdWVzdE93bmVyAQUJcmVxdWVzdElkBwYJAAIBAhhpbnZhbGlkIG93bmVyIHB1YmxpYyBrZXkFA25pbAMJAAACBQZjaGVja3MFBmNoZWNrcwQGcmVzdWx0CQD9BwQIBQFpBmNhbGxlcgIHYXBwcm92ZQUDbmlsBQNuaWwJAJQKAgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBEWtSZXF1ZXN0Q29tcGxldGVkAQUJcmVxdWVzdElkBgUDbmlsBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AHy+HHA==", "height": 2773731, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BxgXfV6myP6xqbHqYHeDFCKsKgV2PUdcjVdaa8NBAAjp Next: FVzZgwHLVW79Tz8ymrpPrZEWTi3PNoEiLXGj43m5aiGD Diff:
OldNewDifferences
102102 else throw("invalid owner public key")]
103103 if ((checks == checks))
104104 then {
105- let result = invoke(i.caller, "approve", nil, nil)
105+ let result = reentrantInvoke(i.caller, "approve", nil, nil)
106106 $Tuple2([BooleanEntry(kRequestCompleted(requestId), true)], result)
107107 }
108108 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 func mustAddress (i,address) = if ((i.caller == address))
77 then true
88 else throw()
99
1010
1111 func mustThis (i) = mustAddress(i, this)
1212
1313
1414 let kServicePublicKey = "%s__servicePublicKey"
1515
1616 let kBotPublicKey = "%s__botPublicKey"
1717
1818 let kFactoryPublicKey = "%s__factoryPublicKey"
1919
2020 let kOwnerPublicKey = "%s__ownerPublicKey"
2121
2222 let kAccountScriptHash = "%s__accountScriptHash"
2323
2424 func accountScriptHash () = valueOrErrorMessage(getBinary(this, kAccountScriptHash), "account script hash is not set")
2525
2626
2727 let kCounter = "%s__counter"
2828
2929 func counter () = valueOrElse(getInteger(this, kCounter), 0)
3030
3131
3232 let kRewardAmount = "%s__rewardAmount"
3333
3434 func rewardAmount () = valueOrErrorMessage(getInteger(this, kRewardAmount), "reward amount is not set")
3535
3636
3737 func kRequestCompleted (requestId) = makeString(["%s%s", requestId, "completed"], separator)
3838
3939
4040 func requestCompleted (requestId) = valueOrErrorMessage(getBoolean(this, kRequestCompleted(requestId)), "request is not found")
4141
4242
4343 func kRequestOwner (requestId) = makeString(["%s%s", requestId, "owner"], separator)
4444
4545
4646 func requestOwner (requestId) = valueOrErrorMessage(getBinary(this, kRequestOwner(requestId)), "request is not found")
4747
4848
4949 let serviceAddress = addressFromPublicKey(getBinaryValue(this, kServicePublicKey))
5050
5151 let botPublicKey = getBinaryValue(this, kBotPublicKey)
5252
5353 @Callable(i)
5454 func init (servicePublicKey,botPublicKey,accountScriptHash,rewardAmount) = {
5555 let checkCaller = mustThis(i)
5656 if ((checkCaller == checkCaller))
5757 then $Tuple2([BinaryEntry(kServicePublicKey, servicePublicKey), BinaryEntry(kBotPublicKey, botPublicKey), BinaryEntry(kAccountScriptHash, accountScriptHash), IntegerEntry(kRewardAmount, rewardAmount)], unit)
5858 else throw("Strict value is not equal to itself.")
5959 }
6060
6161
6262
6363 @Callable(i)
6464 func request () = {
6565 let checks = [if ((size(i.payments) == 1))
6666 then true
6767 else throw("1 payment is required"), if ((i.payments[0].assetId == unit))
6868 then true
6969 else throw("invalid asset"), if ((i.payments[0].amount == rewardAmount()))
7070 then true
7171 else throw("invalid amount")]
7272 if ((checks == checks))
7373 then {
7474 let requestId = toBase58String(sha256((i.caller.bytes + toBytes(counter()))))
7575 $Tuple2([BooleanEntry(kRequestCompleted(requestId), false), BinaryEntry(kRequestOwner(requestId), i.callerPublicKey), IntegerEntry(kCounter, (counter() + 1))], unit)
7676 }
7777 else throw("Strict value is not equal to itself.")
7878 }
7979
8080
8181
8282 @Callable(i)
8383 func complete (requestId,recipientPublicKey) = {
8484 let checks = [if (!(requestCompleted(requestId)))
8585 then true
8686 else throw("request is already completed"), if ((scriptHash(i.caller) == accountScriptHash()))
8787 then true
8888 else throw("invalid script"), if ( match getBinary(i.caller, kFactoryPublicKey) {
8989 case b: ByteVector =>
9090 (addressFromPublicKey(b) == this)
9191 case _ =>
9292 false
9393 })
9494 then true
9595 else throw("invalid factory public key"), if ( match getBinary(i.caller, kOwnerPublicKey) {
9696 case b: ByteVector =>
9797 (b == requestOwner(requestId))
9898 case _ =>
9999 false
100100 })
101101 then true
102102 else throw("invalid owner public key")]
103103 if ((checks == checks))
104104 then {
105- let result = invoke(i.caller, "approve", nil, nil)
105+ let result = reentrantInvoke(i.caller, "approve", nil, nil)
106106 $Tuple2([BooleanEntry(kRequestCompleted(requestId), true)], result)
107107 }
108108 else throw("Strict value is not equal to itself.")
109109 }
110110
111111

github/deemru/w8io/026f985 
27.77 ms