SC CODE: // Silkroad (SILK) Smart Contract
// Total Supply: 21,000,000.00000
// Premine: 2,000,000.00000 (To Contract Deployer)
// Mining: 3.075 SILK every 600 seconds (10 minutes) per wallet
Function Initialize() Uint64
10 STORE("tokenName", "silkroad")
20 STORE("tokenSymbol", "SILK")
30 STORE("decimals", 5)
40 STORE("maxSupply", 2100000000000)
50 STORE("circulatingSupply", 200000000000)
60 STORE("owner", SIGNER())
70 // Assign Premine to the owner's address
80 STORE("balance_" + SIGNER(), 200000000000)
90 RETURN 0
End Function
// Minting function: allows any user to claim 3.075 SILK every 10 minutes
Function Mint() Uint64
10 DIM addr AS String
20 DIM lastClaim AS Uint64
30 DIM now AS Uint64
40 DIM reward AS Uint64
50 DIM currentSupply AS Uint64
60 DIM limit AS Uint64
70 SET addr = SIGNER()
80 SET now = BLOCK_TIMESTAMP()
90 SET reward = 307500 // 3.075 with 5 decimals
100 SET limit = LOAD("maxSupply")
110 SET currentSupply = LOAD("circulatingSupply")
// Check if Max Supply is reached
120 IF currentSupply + reward > limit THEN GOTO 500
// Time Lock Logic: Check if 600 seconds (10 mins) have passed since last mint
130 IF EXISTS("last_mint_" + addr) THEN GOTO 150 ELSE GOTO 200
150 SET lastClaim = LOAD("last_mint_" + addr)
160 IF now - lastClaim < 600 THEN GOTO 500
// Update Ledger
200 STORE("balance_" + addr, LOAD("balance_" + addr) + reward)
210 STORE("circulatingSupply", currentSupply + reward)
220 STORE("last_mint_" + addr, now)
// Trigger Asset Transfer to Wallet
230 SEND_ASSET_TO_ADDRESS(addr, reward, SCID())
240 RETURN 0
500 RETURN 1 // Revert if time-lock active or supply full
End Function
// Standard Transfer Function
Function Transfer(to String, amount Uint64) Uint64
10 DIM senderBalance AS Uint64
20 SET senderBalance = LOAD("balance_" + SIGNER())
30 IF senderBalance < amount THEN GOTO 100
40 STORE("balance_" + SIGNER(), senderBalance - amount)
50 STORE("balance_" + to, LOAD("balance_" + to) + amount)
60 SEND_ASSET_TO_ADDRESS(to, amount, SCID())
70 RETURN 0
100 RETURN 1
End Function
// Burn Function: Permanently removes tokens from circulation
Function Burn(amount Uint64) Uint64
10 DIM senderBalance AS Uint64
20 SET senderBalance = LOAD("balance_" + SIGNER())
30 IF senderBalance < amount THEN GOTO 100
40 STORE("balance_" + SIGNER(), senderBalance - amount)
50 STORE("circulatingSupply", LOAD("circulatingSupply") - amount)
// Tokens are burned by decreasing the sender balance and supply without a recipient
60 RETURN 0
100 RETURN 1
End Function |
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'// Silkroad (SILK) Smart Contract
// Total Supply: 21,000,000.00000
// Premine: 2,000,000.00000 (To Contract Deployer)
// Mining: 3.075 SILK every 600 seconds (10 minutes) per wallet
Function Initialize() Uint64
10 STORE("tokenName", "silkroad")
20 STORE("tokenSymbol", "SILK")
30 STORE("decimals", 5)
40 STORE("maxSupply", 2100000000000)
50 STORE("circulatingSupply", 200000000000)
60 STORE("owner", SIGNER())
70 // Assign Premine to the owner's address
80 STORE("balance_" + SIGNER(), 200000000000)
90 RETURN 0
End Function
// Minting function: allows any user to claim 3.075 SILK every 10 minutes
Function Mint() Uint64
10 DIM addr AS String
20 DIM lastClaim AS Uint64
30 DIM now AS Uint64
40 DIM reward AS Uint64
50 DIM currentSupply AS Uint64
60 DIM limit AS Uint64
70 SET addr = SIGNER()
80 SET now = BLOCK_TIMESTAMP()
90 SET reward = 307500 // 3.075 with 5 decimals
100 SET limit = LOAD("maxSupply")
110 SET currentSupply = LOAD("circulatingSupply")
// Check if Max Supply is reached
120 IF currentSupply + reward > limit THEN GOTO 500
// Time Lock Logic: Check if 600 seconds (10 mins) have passed since last mint
130 IF EXISTS("last_mint_" + addr) THEN GOTO 150 ELSE GOTO 200
150 SET lastClaim = LOAD("last_mint_" + addr)
160 IF now - lastClaim < 600 THEN GOTO 500
// Update Ledger
200 STORE("balance_" + addr, LOAD("balance_" + addr) + reward)
210 STORE("circulatingSupply", currentSupply + reward)
220 STORE("last_mint_" + addr, now)
// Trigger Asset Transfer to Wallet
230 SEND_ASSET_TO_ADDRESS(addr, reward, SCID())
240 RETURN 0
500 RETURN 1 // Revert if time-lock active or supply full
End Function
// Standard Transfer Function
Function Transfer(to String, amount Uint64) Uint64
10 DIM senderBalance AS Uint64
20 SET senderBalance = LOAD("balance_" + SIGNER())
30 IF senderBalance < amount THEN GOTO 100
40 STORE("balance_" + SIGNER(), senderBalance - amount)
50 STORE("balance_" + to, LOAD("balance_" + to) + amount)
60 SEND_ASSET_TO_ADDRESS(to, amount, SCID())
70 RETURN 0
100 RETURN 1
End Function
// Burn Function: Permanently removes tokens from circulation
Function Burn(amount Uint64) Uint64
10 DIM senderBalance AS Uint64
20 SET senderBalance = LOAD("balance_" + SIGNER())
30 IF senderBalance < amount THEN GOTO 100
40 STORE("balance_" + SIGNER(), senderBalance - amount)
50 STORE("circulatingSupply", LOAD("circulatingSupply") - amount)
// Tokens are burned by decreasing the sender balance and supply without a recipient
60 RETURN 0
100 RETURN 1
End Function'] |