SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:' /*
CYPHER VIKINGS
*/
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 110
20 STORE("owner", ADDRESS_RAW("dero1qypj3sctlt7mefhvdhrvrygj55m40ugl7ml2dukzypxdtd2agpgsjqq2v3n6h"))
30 STORE("image_url", "https://github.com/Notoriousjoshyb/CypherVikings-NFA/blob/main/CypherViking-IC.png")
31 STORE("type", "G45-FAT")
32 STORE("timestamp", BLOCK_TIMESTAMP())
40 STORE("name", "cyph")
50 STORE("symbol", "cyph")
55 STORE("native_symbol", "cyph")
60 STORE("decimals", 5)
65 STORE("native_decimals", 5)
70 STORE("totalsupply", 1337000000000)
75 STORE("minted", 0)
100 RETURN 0
110 RETURN 1
End Function
Function MintCyph() Uint64
10 DIM minted as Uint64
80 LET minted = LOAD("minted")
85 IF minted >= LOAD("totalsupply") THEN GOTO 110
90 SEND_ASSET_TO_ADDRESS(SIGNER(), 133700000, SCID())
95 STORE("minted", minted + 133700000)
100 RETURN 0
110 RETURN 1
End Function
Function DisplayToken() Uint64
1 DIM amount as Uint64
2 DIM signerString as String
3 LET signerString = ADDRESS_STRING(SIGNER())
4 IF signerString == "" THEN GOTO 10
5 LET amount = ASSETVALUE(SCID())
6 IF EXISTS("owner_" + signerString) == 0 THEN GOTO 8
7 LET amount = amount + LOAD("owner_" + signerString)
8 STORE("owner_" + signerString, amount)
9 RETURN 0
10 RETURN 1
End Function
Function RetrieveToken(amount Uint64) Uint64
1 DIM storedAmount as Uint64
2 DIM signerString as String
3 LET signerString = ADDRESS_STRING(SIGNER())
4 LET storedAmount = LOAD("owner_" + signerString)
5 IF amount > storedAmount THEN GOTO 13
6 SEND_ASSET_TO_ADDRESS(SIGNER(), amount, SCID())
7 LET storedAmount = storedAmount - amount
8 IF storedAmount == 0 THEN GOTO 11
9 STORE("owner_" + signerString, storedAmount)
10 RETURN 0
11 DELETE("owner_" + signerString)
12 RETURN 0
13 RETURN 1
End Function'] |