SC CODE: // Silkroad (SILK) - Compatible with DVM-BASIC Interpreter
// Total Supply: 21,000,000 | Premine: 2,000,000
Function Initialize() Uint64
10 STORE("name", "Silkroad")
20 STORE("symbol", "SILK")
30 STORE("decimals", 5)
40 STORE("max_supply", 2100000000000)
50 STORE("circulating_supply", 200000000000)
60 STORE("owner", SIGNER())
70 STORE("balance_" + SIGNER(), 200000000000)
80 SEND_ASSET_TO_ADDRESS(SIGNER(), 200000000000, SCID())
90 RETURN 0
End Function
Function Mint() Uint64
10 IF (LOAD("circulating_supply") + 307500) > LOAD("max_supply") THEN GOTO 100
20 IF EXISTS("last_mint_" + SIGNER()) THEN GOTO 40
30 GOTO 60
40 IF (BLOCK_TIMESTAMP() - LOAD("last_mint_" + SIGNER())) < 600 THEN GOTO 100
// Logic: Update storage and send asset
60 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) + 307500)
70 STORE("circulating_supply", LOAD("circulating_supply") + 307500)
80 STORE("last_mint_" + SIGNER(), BLOCK_TIMESTAMP())
90 SEND_ASSET_TO_ADDRESS(SIGNER(), 307500, SCID())
95 RETURN 0
100 RETURN 1
End Function
Function Transfer(to String, amount Uint64) Uint64
10 IF LOAD("balance_" + SIGNER()) < amount THEN GOTO 50
20 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) - amount)
30 STORE("balance_" + to, LOAD("balance_" + to) + amount)
40 SEND_ASSET_TO_ADDRESS(to, amount, SCID())
45 RETURN 0
50 RETURN 1
End Function
Function Burn(amount Uint64) Uint64
10 IF LOAD("balance_" + SIGNER()) < amount THEN GOTO 50
20 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) - amount)
30 STORE("circulating_supply", LOAD("circulating_supply") - amount)
40 RETURN 0
50 RETURN 1
End Function |
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'// Silkroad (SILK) - Compatible with DVM-BASIC Interpreter
// Total Supply: 21,000,000 | Premine: 2,000,000
Function Initialize() Uint64
10 STORE("name", "Silkroad")
20 STORE("symbol", "SILK")
30 STORE("decimals", 5)
40 STORE("max_supply", 2100000000000)
50 STORE("circulating_supply", 200000000000)
60 STORE("owner", SIGNER())
70 STORE("balance_" + SIGNER(), 200000000000)
80 SEND_ASSET_TO_ADDRESS(SIGNER(), 200000000000, SCID())
90 RETURN 0
End Function
Function Mint() Uint64
10 IF (LOAD("circulating_supply") + 307500) > LOAD("max_supply") THEN GOTO 100
20 IF EXISTS("last_mint_" + SIGNER()) THEN GOTO 40
30 GOTO 60
40 IF (BLOCK_TIMESTAMP() - LOAD("last_mint_" + SIGNER())) < 600 THEN GOTO 100
// Logic: Update storage and send asset
60 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) + 307500)
70 STORE("circulating_supply", LOAD("circulating_supply") + 307500)
80 STORE("last_mint_" + SIGNER(), BLOCK_TIMESTAMP())
90 SEND_ASSET_TO_ADDRESS(SIGNER(), 307500, SCID())
95 RETURN 0
100 RETURN 1
End Function
Function Transfer(to String, amount Uint64) Uint64
10 IF LOAD("balance_" + SIGNER()) < amount THEN GOTO 50
20 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) - amount)
30 STORE("balance_" + to, LOAD("balance_" + to) + amount)
40 SEND_ASSET_TO_ADDRESS(to, amount, SCID())
45 RETURN 0
50 RETURN 1
End Function
Function Burn(amount Uint64) Uint64
10 IF LOAD("balance_" + SIGNER()) < amount THEN GOTO 50
20 STORE("balance_" + SIGNER(), LOAD("balance_" + SIGNER()) - amount)
30 STORE("circulating_supply", LOAD("circulating_supply") - amount)
40 RETURN 0
50 RETURN 1
End Function'] |