SC CODE: // ---------------------------------------------------------------
// ICE Token – G45‑FAT standard
// Total supply : 13 794 880 500 000 (13.79 trillion ICE)
// Decimals : 5 (1 ICE = 100 000 atomic units)
// Mint per call: 12 461 500 (≈124.615 ICE)
// ---------------------------------------------------------------
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 200
// ───── HEADER / UI METADATA (must come BEFORE core metadata) ─────
12 STORE("nameHdr", "ICE")
13 STORE("tickerHdr", "ICE")
14 STORE("ownerHdr", "ahmedv")
15 STORE("iconURLHdr", "https://raw.githubusercontent.com/ahmedv-D/ice/main/Untitled.jpeg")
// ───── CORE TOKEN METADATA ─────
20 STORE("owner", SIGNER())
30 STORE("image_url", "https://raw.githubusercontent.com/ahmedv-D/ice/main/Untitled.jpeg")
31 STORE("type", "G45-FAT")
32 STORE("timestamp", BLOCK_TIMESTAMP())
40 STORE("name", "ICE")
50 STORE("symbol", "ICE")
55 STORE("native_symbol", "ICE")
60 STORE("decimals", 5)
65 STORE("native_decimals", 0)
70 STORE("totalsupply", 13794880500000)
75 STORE("minted", 0)
100 RETURN 0
200 RETURN 1
End Function
// ---------------------------------------------------------------
// Public Mint – 12 461 500 atomic units (≈124.615 ICE) per call
// ---------------------------------------------------------------
Function MintICE() Uint64
10 DIM minted, totalSupply as Uint64
20 LET minted = LOAD("minted")
30 LET totalSupply = LOAD("totalsupply")
40 IF minted >= totalSupply THEN GOTO 110
50 SEND_ASSET_TO_ADDRESS(SIGNER(), 12461500, SCID())
60 STORE("minted", minted + 12461500)
100 RETURN 0
110 RETURN 1
End Function
// ---------------------------------------------------------------
// Burn – reduces totalSupply by the amount of ICE sent with the tx
// ---------------------------------------------------------------
Function Burn() Uint64
10 STORE("totalsupply", LOAD("totalsupply") - ASSETVALUE(SCID()))
20 RETURN 0
End Function
// ---------------------------------------------------------------
// G45‑FAT wallet balance sync
// ---------------------------------------------------------------
Function DisplayToken() Uint64
10 DIM amount, stored as Uint64
20 DIM signerStr as String
30 LET signerStr = ADDRESS_STRING(SIGNER())
40 IF signerStr == "" THEN GOTO 100
50 LET amount = ASSETVALUE(SCID())
60 IF EXISTS("owner_" + signerStr) == 0 THEN GOTO 80
70 LET stored = LOAD("owner_" + signerStr)
80 STORE("owner_" + signerStr, amount + stored)
90 RETURN 0
100 RETURN 1
End Function
// ---------------------------------------------------------------
// Withdraw stored off‑chain balance
// ---------------------------------------------------------------
Function RetrieveToken(amount Uint64) Uint64
10 DIM stored as Uint64
20 DIM signerStr as String
30 LET signerStr = ADDRESS_STRING(SIGNER())
40 IF EXISTS("owner_" + signerStr) == 0 THEN GOTO 130
50 LET stored = LOAD("owner_" + signerStr)
60 IF amount > stored THEN GOTO 130
70 SEND_ASSET_TO_ADDRESS(SIGNER(), amount, SCID())
80 LET stored = stored - amount
90 IF stored == 0 THEN GOTO 110
100 STORE("owner_" + signerStr, stored)
110 RETURN 0
120 DELETE("owner_" + signerStr)
130 RETURN 1
End Function |
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'// ---------------------------------------------------------------
// ICE Token – G45‑FAT standard
// Total supply : 13 794 880 500 000 (13.79 trillion ICE)
// Decimals : 5 (1 ICE = 100 000 atomic units)
// Mint per call: 12 461 500 (≈124.615 ICE)
// ---------------------------------------------------------------
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 200
// ───── HEADER / UI METADATA (must come BEFORE core metadata) ─────
12 STORE("nameHdr", "ICE")
13 STORE("tickerHdr", "ICE")
14 STORE("ownerHdr", "ahmedv")
15 STORE("iconURLHdr", "https://raw.githubusercontent.com/ahmedv-D/ice/main/Untitled.jpeg")
// ───── CORE TOKEN METADATA ─────
20 STORE("owner", SIGNER())
30 STORE("image_url", "https://raw.githubusercontent.com/ahmedv-D/ice/main/Untitled.jpeg")
31 STORE("type", "G45-FAT")
32 STORE("timestamp", BLOCK_TIMESTAMP())
40 STORE("name", "ICE")
50 STORE("symbol", "ICE")
55 STORE("native_symbol", "ICE")
60 STORE("decimals", 5)
65 STORE("native_decimals", 0)
70 STORE("totalsupply", 13794880500000)
75 STORE("minted", 0)
100 RETURN 0
200 RETURN 1
End Function
// ---------------------------------------------------------------
// Public Mint – 12 461 500 atomic units (≈124.615 ICE) per call
// ---------------------------------------------------------------
Function MintICE() Uint64
10 DIM minted, totalSupply as Uint64
20 LET minted = LOAD("minted")
30 LET totalSupply = LOAD("totalsupply")
40 IF minted >= totalSupply THEN GOTO 110
50 SEND_ASSET_TO_ADDRESS(SIGNER(), 12461500, SCID())
60 STORE("minted", minted + 12461500)
100 RETURN 0
110 RETURN 1
End Function
// ---------------------------------------------------------------
// Burn – reduces totalSupply by the amount of ICE sent with the tx
// ---------------------------------------------------------------
Function Burn() Uint64
10 STORE("totalsupply", LOAD("totalsupply") - ASSETVALUE(SCID()))
20 RETURN 0
End Function
// ---------------------------------------------------------------
// G45‑FAT wallet balance sync
// ---------------------------------------------------------------
Function DisplayToken() Uint64
10 DIM amount, stored as Uint64
20 DIM signerStr as String
30 LET signerStr = ADDRESS_STRING(SIGNER())
40 IF signerStr == "" THEN GOTO 100
50 LET amount = ASSETVALUE(SCID())
60 IF EXISTS("owner_" + signerStr) == 0 THEN GOTO 80
70 LET stored = LOAD("owner_" + signerStr)
80 STORE("owner_" + signerStr, amount + stored)
90 RETURN 0
100 RETURN 1
End Function
// ---------------------------------------------------------------
// Withdraw stored off‑chain balance
// ---------------------------------------------------------------
Function RetrieveToken(amount Uint64) Uint64
10 DIM stored as Uint64
20 DIM signerStr as String
30 LET signerStr = ADDRESS_STRING(SIGNER())
40 IF EXISTS("owner_" + signerStr) == 0 THEN GOTO 130
50 LET stored = LOAD("owner_" + signerStr)
60 IF amount > stored THEN GOTO 130
70 SEND_ASSET_TO_ADDRESS(SIGNER(), amount, SCID())
80 LET stored = stored - amount
90 IF stored == 0 THEN GOTO 110
100 STORE("owner_" + signerStr, stored)
110 RETURN 0
120 DELETE("owner_" + signerStr)
130 RETURN 1
End Function'] |