tx · Apj2QtegJziViG87eXxodQzCVjEBkbLPUkbYP6ph4CyV

3PNskFtDjfpFKZmutnSE5zdnNuhoYN7JVdQ:  -0.00700000 Waves

2022.08.27 22:06 [3268756] smart account 3PNskFtDjfpFKZmutnSE5zdnNuhoYN7JVdQ > SELF 0.00000000 Waves

{ "type": 13, "id": "Apj2QtegJziViG87eXxodQzCVjEBkbLPUkbYP6ph4CyV", "fee": 700000, "feeAssetId": null, "timestamp": 1661627206378, "version": 2, "chainId": 87, "sender": "3PNskFtDjfpFKZmutnSE5zdnNuhoYN7JVdQ", "senderPublicKey": "9gx1f9wXFYg2kEiFodVfG9q8pWmeHL1rW8xc91zWZPSi", "proofs": [ "28T5rP9REPSx77RL8dMz39vjQQky9CAjhKJE33QwbBteS1tnaJLyih99GtiKcs4qkD4PhoVhVqJD8aLcR3n4fjNU" ], "script": "base64:AAIFAAAAAAAAAA4IAhIDCgEIEgUKAwgICAAAAA0AAAAAEWNlcnRTdGF0dXNSZXZva2VkAgAAAAdSRVZPS0VEAAAAABBjZXJ0U3RhdHVzQWN0aXZlAgAAAAZBQ1RJVkUAAAAACW9yYWNsZUtleQIAAAAJb3JhY2xlS2V5AQAAAAZnZXRTdHIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAAAAAAZvcmFjbGUJAQAAAAZnZXRTdHIAAAABBQAAAAlvcmFjbGVLZXkAAAAACW9yYWNsZUZlZQkBAAAABXZhbHVlAAAAAQkABCYAAAABBQAAAAZvcmFjbGUAAAAACnJlc2VsbERhcHAJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAACW9yYWNsZUZlZQIAAAAKcmVzZWxsRGFwcAIAAAAUcmVzZWxsRGFwcCBub3QgZm91bmQAAAAACnN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nkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFY2VydF8FAAAABmNlcnRJZAIAAAAGX25mdElkBQAAAAVuZnRJZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFY2VydF8FAAAABmNlcnRJZAIAAAAGX293bmVyBQAAAAhuZnRPd25lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFY2VydF8FAAAABmNlcnRJZAIAAAAHX2FydGlzdAUAAAANYXJ0aXN0QWRkcmVzcwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFY2VydF8FAAAABmNlcnRJZAIAAAAHX3N0YXR1cwUAAAAQY2VydFN0YXR1c0FjdGl2ZQUAAAADbmlsCQAETgAAAAIFAAAACnJldm9rZURhdGEFAAAACmNyZWF0ZURhdGEJAAACAAAAAQkAASwAAAACAgAAABdUaGUgTkZUIGlzbid0IG93bmVkIGJ5IAUAAAAIbmZ0T3duZXIJAAACAAAAAQIAAAAfVGhpcyBkYXBwIGNhbiBub3QgY3JlYXRlIGNlcnRzIQAAAADV/epb", "height": 3268756, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Z5cN3adXSg7qWtLRweyJkq2YFpzrFccwFc3byZ5Up1w Next: CVWALshkhkKnP82fYaEitnYWh6MwgVn6WroqdypqDwi9 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let certStatusRevoked = "REVOKED"
55
66 let certStatusActive = "ACTIVE"
77
88 let oracleKey = "oracleKey"
99
1010 func getStr (key) = match getString(this, key) {
1111 case b: String =>
1212 b
1313 case _ =>
1414 ""
1515 }
1616
1717
1818 let oracle = getStr(oracleKey)
1919
2020 let oracleFee = value(addressFromString(oracle))
2121
2222 let resellDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "resellDapp"), "resellDapp not found"))
2323
2424 let sconexDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "sconexDapp"), "sconexDapp not found"))
2525
2626 let allowedDapps = [resellDapp, sconexDapp]
2727
2828 func getStringByKey (key) = valueOrElse(getString(this, key), "")
2929
3030
3131 func tryGetNftInfo (assetId) = {
3232 let x = match assetInfo(assetId) {
3333 case asset: Asset =>
3434 asset.quantity
3535 case _ =>
3636 throw("Invalid NFT id")
3737 }
3838 x
3939 }
4040
4141
4242 func doesAddressOwnNft (assetId,address) = if ((assetBalance(Address(fromBase58String(address)), assetId) != 1))
4343 then false
4444 else true
4545
4646
4747 func revokeOldCert (nftId) = {
4848 let certId = getStringByKey(("cert_" + nftId))
4949 if ((certId != ""))
5050 then [StringEntry((("cert_" + certId) + "_status"), certStatusRevoked)]
5151 else nil
5252 }
5353
5454
5555 @Callable(i)
5656 func initDapp (dappKey) = if ((i.caller != this))
5757 then throw("You cannot do this action")
5858 else if ((oracle != ""))
5959 then throw("oracle already set, you can't override!")
6060 else [StringEntry(oracleKey, dappKey)]
6161
6262
6363
6464 @Callable(i)
6565 func createCert (nftOwner,nftId,artistAddress) = if (containsElement(allowedDapps, i.caller))
6666 then {
6767 let certId = toBase58String(i.transactionId)
6868 let assetIdBytes = fromBase58String(nftId)
6969 let assetInfoOutput = tryGetNftInfo(assetIdBytes)
7070 if ((assetInfoOutput != 1))
7171 then throw("This is not an NFT!")
7272 else if (doesAddressOwnNft(assetIdBytes, nftOwner))
7373 then {
7474 let revokeData = revokeOldCert(nftId)
7575 let createData = [StringEntry(("cert_" + nftId), certId), StringEntry((("cert_" + certId) + "_nftId"), nftId), StringEntry((("cert_" + certId) + "_owner"), nftOwner), StringEntry((("cert_" + certId) + "_artist"), artistAddress), StringEntry((("cert_" + certId) + "_status"), certStatusActive)]
7676 (revokeData ++ createData)
7777 }
7878 else throw(("The NFT isn't owned by " + nftOwner))
7979 }
8080 else throw("This dapp can not create certs!")
8181
8282

github/deemru/w8io/fabc49c 
138.54 ms