SC CODE: //Copyright (c) 2024, dero1qyfyqe9v72xaha3dgz0m7qxa0vyru3g9vc9vwagtdpluewmv0mx26qqsavvj9. All rights reserved. Licence scid: e0ca740d8df8a4c30be9c32e32fddf797a383042f6ddc87f636343711fcbe8e5
//Parts of the InitializePrivate() & Update() code are Copyright (c) 2022, Civilware. All rights reserved. Licence scid: e973273da5efbdd852ee5a0535e28c45d49f0bff7e9ce4d00544b5d95015bd89
//
/*
.----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | .--------------. || .--------------. || .--------------. |
| | _____ | || | ____ | || | _________ | || | _________ | || | ____ | | | | _______ | || | _______ | || | _______ | |
| | |_ _| | || | .' `. | || | | _ _ | | || | | _ _ | | || | .' `. | | | | | ___ | | || | | ___ | | || | | ___ | | |
| | | | | || | / .--. \ | || | |_/ | | \_| | || | |_/ | | \_| | || | / .--. \ | | | | |_/ / / | || | |_/ / / | || | |_/ / / | |
| | | | _ | || | | | | | | || | | | | || | | | | || | | | | | | | | | / / | || | / / | || | / / | |
| | _| |__/ | | || | \ `--' / | || | _| |_ | || | _| |_ | || | \ `--' / | | | | / / | || | / / | || | / / | |
| | |________| | || | `.____.' | || | |_____| | || | |_____| | || | `.____.' | | | | /_/ | || | /_/ | || | /_/ | |
| | | || | | || | | || | | || | | | | | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | | '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------'
<> N O W A R R A N T I E S , P L A Y A T Y O U R O W N R I S K ! <>
*/
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 999
20 STORE("owner", SIGNER())
40 STORE("name", "LOTTO tokens")
50 STORE("symbol", "LOTTO")
70 STORE("decimals", 5)
90 STORE("totalsupply", 7777777 * 100000)
100 STORE("minted", 0)
110 STORE("waitingtime", 777) // You have to wait 777 seconds before you can mint again.
120 STORE("adr_count", 0)
330 STORE("nameHdr", "LOTTO tokens")
340 STORE("descrHdr", "Early Minting 4 DERO OGs. Total Supply 7.77+ Mil. LOTTO tokens.")
350 STORE("typeHdr", "Token")
360 STORE("iconURLHdr", "https://i.ibb.co/hCvmhb9/LOTTO-tokens-100x100.png")
370 STORE("tagsHdr", "#LOTTO777 #LOTTO #EARLYMINT #PLAY #DEROLOTTO #777 #LOTTERY")
400 STORE("fileCheckC", "dd86b75c10409fa15f0d86dabcfb20c57e4e116a9f494e3a682693ca3002e59")
410 STORE("fileCheckS", "129f33cd11a8287e9051fe8f6cb55f0198d822ed5ede48d2b547882c5f8d5d6c")
420 STORE("fileURL", "https://ipfs.io/ipfs/QmXMaDCKjc9mpugR4Uh8bRMMr6Q9bZUrCGEQxLAC3JzG56")
430 STORE("fileSignURL", "https://ipfs.io/ipfs/QmPUcuVz5YEmU7aWKjn769ShoGmJYoxWbYtT4U2X7vFBHQ")
440 STORE("coverURL", "https://i.ibb.co/W2Rts8v/LOTTOtokens.png")
450 STORE("collection", "LOTTO777")
460 STORE("artificerAddr", ADDRESS_RAW("dero1qy0khp9s9yw2h0eu20xmy9lth3zp5cacmx3rwt6k45l568d2mmcf6qgcsevzx"))
470 STORE("withdrawal_fee", 2)
900 RETURN 0
999 RETURN 1
End Function
Function Withdraw_My_LOTTO_balance() Uint64
10 IF EXISTS(ADDRESS_STRING(SIGNER())) THEN GOTO 20 ELSE GOTO 999
20 DIM balance_to_withdraw, withdrawal_fee, amount_artificerAddr, amount_owner, amount_signer as Uint64
30 DIM scid_LOTTO_tokens, owner, artificerAddr as String
60 LET scid_LOTTO_tokens = scid()
70 LET balance_to_withdraw = LOAD(ADDRESS_STRING(SIGNER()))
80 LET withdrawal_fee = LOAD("withdrawal_fee")
90 LET owner = LOAD("owner")
95 LET artificerAddr = LOAD("artificerAddr")
96 IF SIGNER() == owner THEN GOTO 98
97 IF SIGNER() == artificerAddr THEN GOTO 98 ELSE GOTO 100
98 LET amount_signer = balance_to_withdraw
99 GOTO 160
100 LET amount_signer = balance_to_withdraw - balance_to_withdraw * withdrawal_fee / 100
110 LET amount_owner = balance_to_withdraw * withdrawal_fee / 100 * 95 / 100
120 LET amount_artificerAddr = balance_to_withdraw * withdrawal_fee / 100 * 5 / 100
125 IF EXISTS(ADDRESS_STRING(owner)) THEN GOTO 126 ELSE GOTO 130
126 LET amount_owner = amount_owner + LOAD(ADDRESS_STRING(owner))
130 STORE(ADDRESS_STRING(owner), amount_owner)
135 IF EXISTS(ADDRESS_STRING(artificerAddr)) THEN GOTO 136 ELSE GOTO 140
136 LET amount_artificerAddr = amount_artificerAddr + LOAD(ADDRESS_STRING(artificerAddr))
140 STORE(ADDRESS_STRING(artificerAddr), amount_artificerAddr)
160 SEND_ASSET_TO_ADDRESS(SIGNER(), amount_signer, scid_LOTTO_tokens)
170 DELETE(ADDRESS_STRING(SIGNER()))
900 RETURN 0
999 RETURN 1
End Function
Function UpdateCode(code String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function
|
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'//Copyright (c) 2024, dero1qyfyqe9v72xaha3dgz0m7qxa0vyru3g9vc9vwagtdpluewmv0mx26qqsavvj9. All rights reserved. Licence scid: e0ca740d8df8a4c30be9c32e32fddf797a383042f6ddc87f636343711fcbe8e5
//Parts of the InitializePrivate() & Update() code are Copyright (c) 2022, Civilware. All rights reserved. Licence scid: e973273da5efbdd852ee5a0535e28c45d49f0bff7e9ce4d00544b5d95015bd89
//
/*
.----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | .--------------. || .--------------. || .--------------. |
| | _____ | || | ____ | || | _________ | || | _________ | || | ____ | | | | _______ | || | _______ | || | _______ | |
| | |_ _| | || | .' `. | || | | _ _ | | || | | _ _ | | || | .' `. | | | | | ___ | | || | | ___ | | || | | ___ | | |
| | | | | || | / .--. \ | || | |_/ | | \_| | || | |_/ | | \_| | || | / .--. \ | | | | |_/ / / | || | |_/ / / | || | |_/ / / | |
| | | | _ | || | | | | | | || | | | | || | | | | || | | | | | | | | | / / | || | / / | || | / / | |
| | _| |__/ | | || | \ `--' / | || | _| |_ | || | _| |_ | || | \ `--' / | | | | / / | || | / / | || | / / | |
| | |________| | || | `.____.' | || | |_____| | || | |_____| | || | `.____.' | | | | /_/ | || | /_/ | || | /_/ | |
| | | || | | || | | || | | || | | | | | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | | '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------'
<> N O W A R R A N T I E S , P L A Y A T Y O U R O W N R I S K ! <>
*/
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 999
20 STORE("owner", SIGNER())
40 STORE("name", "LOTTO tokens")
50 STORE("symbol", "LOTTO")
70 STORE("decimals", 5)
90 STORE("totalsupply", 7777777 * 100000)
100 STORE("minted", 0)
110 STORE("waitingtime", 777) // You have to wait 777 seconds before you can mint again.
120 STORE("adr_count", 0)
330 STORE("nameHdr", "LOTTO tokens")
340 STORE("descrHdr", "Early Minting 4 DERO OGs. Total Supply 7.77+ Mil. LOTTO tokens.")
350 STORE("typeHdr", "Token")
360 STORE("iconURLHdr", "https://i.ibb.co/hCvmhb9/LOTTO-tokens-100x100.png")
370 STORE("tagsHdr", "#LOTTO777 #LOTTO #EARLYMINT #PLAY #DEROLOTTO #777 #LOTTERY")
400 STORE("fileCheckC", "dd86b75c10409fa15f0d86dabcfb20c57e4e116a9f494e3a682693ca3002e59")
410 STORE("fileCheckS", "129f33cd11a8287e9051fe8f6cb55f0198d822ed5ede48d2b547882c5f8d5d6c")
420 STORE("fileURL", "https://ipfs.io/ipfs/QmXMaDCKjc9mpugR4Uh8bRMMr6Q9bZUrCGEQxLAC3JzG56")
430 STORE("fileSignURL", "https://ipfs.io/ipfs/QmPUcuVz5YEmU7aWKjn769ShoGmJYoxWbYtT4U2X7vFBHQ")
440 STORE("coverURL", "https://i.ibb.co/W2Rts8v/LOTTOtokens.png")
450 STORE("collection", "LOTTO777")
460 STORE("artificerAddr", ADDRESS_RAW("dero1qy0khp9s9yw2h0eu20xmy9lth3zp5cacmx3rwt6k45l568d2mmcf6qgcsevzx"))
470 STORE("withdrawal_fee", 2)
900 RETURN 0
999 RETURN 1
End Function
Function Withdraw_My_LOTTO_balance() Uint64
10 IF EXISTS(ADDRESS_STRING(SIGNER())) THEN GOTO 20 ELSE GOTO 999
20 DIM balance_to_withdraw, withdrawal_fee, amount_artificerAddr, amount_owner, amount_signer as Uint64
30 DIM scid_LOTTO_tokens, owner, artificerAddr as String
60 LET scid_LOTTO_tokens = scid()
70 LET balance_to_withdraw = LOAD(ADDRESS_STRING(SIGNER()))
80 LET withdrawal_fee = LOAD("withdrawal_fee")
90 LET owner = LOAD("owner")
95 LET artificerAddr = LOAD("artificerAddr")
96 IF SIGNER() == owner THEN GOTO 98
97 IF SIGNER() == artificerAddr THEN GOTO 98 ELSE GOTO 100
98 LET amount_signer = balance_to_withdraw
99 GOTO 160
100 LET amount_signer = balance_to_withdraw - balance_to_withdraw * withdrawal_fee / 100
110 LET amount_owner = balance_to_withdraw * withdrawal_fee / 100 * 95 / 100
120 LET amount_artificerAddr = balance_to_withdraw * withdrawal_fee / 100 * 5 / 100
125 IF EXISTS(ADDRESS_STRING(owner)) THEN GOTO 126 ELSE GOTO 130
126 LET amount_owner = amount_owner + LOAD(ADDRESS_STRING(owner))
130 STORE(ADDRESS_STRING(owner), amount_owner)
135 IF EXISTS(ADDRESS_STRING(artificerAddr)) THEN GOTO 136 ELSE GOTO 140
136 LET amount_artificerAddr = amount_artificerAddr + LOAD(ADDRESS_STRING(artificerAddr))
140 STORE(ADDRESS_STRING(artificerAddr), amount_artificerAddr)
160 SEND_ASSET_TO_ADDRESS(SIGNER(), amount_signer, scid_LOTTO_tokens)
170 DELETE(ADDRESS_STRING(SIGNER()))
900 RETURN 0
999 RETURN 1
End Function
Function UpdateCode(code String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function
'] |