tx · 2PUYpnv6jyUi3BHj3v5btGiaNqbTCET2P4a5Nd5SS1BQ 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00200000 Waves 2023.03.05 00:37 [2475870] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "2PUYpnv6jyUi3BHj3v5btGiaNqbTCET2P4a5Nd5SS1BQ", "fee": 200000, "feeAssetId": null, "timestamp": 1677965843103, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "mW66Px1WoJQ1ZjPYN3gzjDazvPYzn4MZ4hVU3MhaEGDMJHaP1emnysp3kTx4jJ3c1eK5UDskWzXig7ixuCRTr1y" ], "script": "base64:BgIPCAISBQoDCAgIEgQKAggIBQAOY29sbGVjdGlvbk5hbWUJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMCDmNvbGxlY3Rpb25OYW1lAAZzeW1ib2wJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMCDmNvbGxlY3Rpb25OYW1lAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzAgt0b3RhbEFtb3VudAENdHJhbnNmZXJPck5vdAICdG8HYXNzZXRJZAMJAAACBQJ0bwUEdGhpcwcJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUCdG8AAQUHYXNzZXRJZAUDbmlsAgFpAQRpbml0Aw5jb2xsZWN0aW9uTmFtZQZzeW1ib2wLZGVzY3JpcHRpb24DCQAAAggFAWkGY2FsbGVyBQR0aGlzCQDMCAIJAQtTdHJpbmdFbnRyeQICDmNvbGxlY3Rpb25OYW1lBQ5jb2xsZWN0aW9uTmFtZQkAzAgCCQELU3RyaW5nRW50cnkCAgZzeW1ib2wFBnN5bWJvbAkAzAgCCQELU3RyaW5nRW50cnkCAgtkZXNjcmlwdGlvbgULZGVzY3JpcHRpb24JAMwIAgkBDEludGVnZXJFbnRyeQICC3RvdGFsQW1vdW50AAAFA25pbAkAAgECCW9ubHkgZEFwcAFpAQRtaW50AgJ0bwh0b2tlblVSSQMJAAACCAUBaQZjYWxsZXIFBHRoaXMEB3Rva2VuSWQJAGQCBQt0b3RhbEFtb3VudAABBAdwcmVOYW1lCQCsAgIJAKwCAgUGc3ltYm9sAgEjCQCkAwEFB3Rva2VuSWQEBG5hbWUDCQBmAgkAsQIBBQdwcmVOYW1lABAJAKQDAQUHdG9rZW5JZAUHcHJlTmFtZQQFYXNzZXQJAMMIBwUEbmFtZQULZGVzY3JpcHRpb24AAQAABwUEdW5pdAUGaGVpZ2h0BAdhc3NldElkCQC4CAEFBWFzc2V0BAl0b0FkZHJlc3MJAQdBZGRyZXNzAQkA2QQBBQJ0bwkAzAgCAwkAAAIFCXRvQWRkcmVzcwUEdGhpcwkBDlNjcmlwdFRyYW5zZmVyAwUJdG9BZGRyZXNzAAAFB2Fzc2V0SWQJAQ5TY3JpcHRUcmFuc2ZlcgMFCXRvQWRkcmVzcwABBQdhc3NldElkCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgt0b3RhbEFtb3VudAUHdG9rZW5JZAkAzAgCCQELU3RyaW5nRW50cnkCBQRuYW1lBQh0b2tlblVSSQUDbmlsCQACAQIJb25seSBkQXBwADhsYyo=", "height": 2475870, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C8sYBtfqNvttRwE3xphfotNLAdQScTaAt2ThqRsjSGZk Next: EW8FKQzPSEzC4ZykyHADcve2Sk3CjxzuXYKfDBdLPPYn Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let description = getStringValue(this, "description") | |
9 | 9 | ||
10 | 10 | let totalAmount = getIntegerValue(this, "totalAmount") | |
11 | + | ||
12 | + | func transferOrNot (to,assetId) = if ((to == this)) | |
13 | + | then false | |
14 | + | else [ScriptTransfer(to, 1, assetId)] | |
15 | + | ||
11 | 16 | ||
12 | 17 | @Callable(i) | |
13 | 18 | func init (collectionName,symbol,description) = if ((i.caller == this)) | |
27 | 32 | let asset = Issue(name, description, 1, 0, false, unit, height) | |
28 | 33 | let assetId = calculateAssetId(asset) | |
29 | 34 | let toAddress = Address(fromBase58String(to)) | |
30 | - | [ScriptTransfer(toAddress, 1, assetId), IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
35 | + | [if ((toAddress == this)) | |
36 | + | then ScriptTransfer(toAddress, 0, assetId) | |
37 | + | else ScriptTransfer(toAddress, 1, assetId), IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
31 | 38 | } | |
32 | 39 | else throw("only dApp") | |
33 | 40 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let collectionName = getStringValue(this, "collectionName") | |
5 | 5 | ||
6 | 6 | let symbol = getStringValue(this, "collectionName") | |
7 | 7 | ||
8 | 8 | let description = getStringValue(this, "description") | |
9 | 9 | ||
10 | 10 | let totalAmount = getIntegerValue(this, "totalAmount") | |
11 | + | ||
12 | + | func transferOrNot (to,assetId) = if ((to == this)) | |
13 | + | then false | |
14 | + | else [ScriptTransfer(to, 1, assetId)] | |
15 | + | ||
11 | 16 | ||
12 | 17 | @Callable(i) | |
13 | 18 | func init (collectionName,symbol,description) = if ((i.caller == this)) | |
14 | 19 | then [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)] | |
15 | 20 | else throw("only dApp") | |
16 | 21 | ||
17 | 22 | ||
18 | 23 | ||
19 | 24 | @Callable(i) | |
20 | 25 | func mint (to,tokenURI) = if ((i.caller == this)) | |
21 | 26 | then { | |
22 | 27 | let tokenId = (totalAmount + 1) | |
23 | 28 | let preName = ((symbol + "#") + toString(tokenId)) | |
24 | 29 | let name = if ((size(preName) > 16)) | |
25 | 30 | then toString(tokenId) | |
26 | 31 | else preName | |
27 | 32 | let asset = Issue(name, description, 1, 0, false, unit, height) | |
28 | 33 | let assetId = calculateAssetId(asset) | |
29 | 34 | let toAddress = Address(fromBase58String(to)) | |
30 | - | [ScriptTransfer(toAddress, 1, assetId), IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
35 | + | [if ((toAddress == this)) | |
36 | + | then ScriptTransfer(toAddress, 0, assetId) | |
37 | + | else ScriptTransfer(toAddress, 1, assetId), IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
31 | 38 | } | |
32 | 39 | else throw("only dApp") | |
33 | 40 | ||
34 | 41 |
github/deemru/w8io/169f3d6 39.72 ms ◑