Appearance
Token Commands
Create:
It is used to create a new Skucode token on a specified network using the Skucode Factory contract. This token can be either mintable or wrappable based on the type
specified.
Usage
sct token create --name <token-name> --category <item-category> --itemId <item-id> --denom <denomination> --type <token-type> --from_privKey <private-key-or-vault> --skucodeFactoryContract <factory-contract-address> --network <rpc-url> [--from_address <sender-address>] [--from_name <sender-name>] [--memo <token-memo>] [--saveToFile] [--localFile <file-path>]
--name
(required): The name of the token.--category
(required): The category of the item.--itemId
(required): The unique item ID.--denom
(required): The denomination for the token.--description
: A description of the item.--type
: The type of the token, either "Mintable" or "Wrappable" (default:Mintable
).--from_address
: The sender's address (required iffrom_privKey
is set to "vault").--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
: The sender's name (required when using "vault" as--from_privKey
).--memo
: Optional memo for token creation.--skucodeFactoryContract
: (required): The Skucode Factory contract address.--network
(required): The network details (RPC URL) to use for the transaction.--saveToFile
: Toggle saving the command output to a database (default:false
).--localFile
: Path to the local file to be processed.
Example
sct token create --name="MyToken" --category="Electronics" --itemId="12345" --denom="ETH" --type="Wrappable" --from_privKey="vault" --from_name="alice" --from_address="0xSenderAddress" --skucodeFactoryContract="0xFactoryAddress" --network="http://localhost:8545"
Mint:
It is used to mint supply chain tokens.
Usage
sct token mint --tokenAddress <token-address> --amount <mint-amount> --to <recipient-address> --from_privKey <private-key-or-vault> --network <rpc-url> [--from_address <sender-address>] [--from_name <sender-name>] [--memo <minting-memo>]
--tokenAddress
(required): The address of the token to mint.--amount
(required): Amount of tokens to mint (in string format).--from_address
: Sender address (required if--from_privKey
is "vault").--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".---from_name
: Sender name (required when--from_privKey
is "vault").--to
(required): Recipient address for the minted tokens.--memo
: Optional memo for minting tokens.--network
(required): Network details (RPC URL).
Example
sct token mint --tokenAddress="0xTokenAddress" --amount="100" --to="0xRecipientAddress" --from_privKey="0xYourPrivateKey" --network="http://localhost:8545"
Set Wrap Ratio:
Set a wrap ratio between two tokens, where one token is the wrapper (child token) and the other is the wrap token (parent token). The wrap ratio defines the value of the wrapped token relative to the wrapper token.
Usage
sct token setWrapRatio --from_token <child-token-address> --to_token <parent-token-address> --ratio <wrap-ratio> --from_privKey <private-key-or-vault> --network <rpc-url> [--from_address <sender-address>] [--from_name <sender-name>] [--memo <transaction-memo>]
--from_token
(required): The address of the wrapper token (child token).--to_token
(required): The address of the wrap token (parent token).--ratio
(required): The wrap ratio between the two tokens (numeric value, e.g.,2
for a 2:1 ratio).--from_address
: Sender address (required if--from_privKey
is "vault").--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
: Sender name (required when--from_privKey
is "vault").--memo
: Optional memo for the transaction (e.g., notes for record-keeping).--network
(required): Network details (RPC URL to interact with the blockchain).
Example
- Set a wrap ratio of
2
between a child token and a parent token, using file based signing with a specified sender name:
sct token setWrapRatio --from_token="0xChildTokenAddress" --to_token="0xParentTokenAddress" --ratio="2" --from_privKey="file" --from_name="alice" --from_address="0xSenderAddress" --network="http://localhost:8545" --userFile "../user/user.json"
Wrap:
Wrap tokens from one type (Parent token) to another type (Child token) based on the wrap ratio. This operation uses the wrap ratio to determine how tokens are converted and transferred between the Parent and Child tokens.
Usage
sct token wrap --from_token <parent-token-address> --to_token <child-token-address> --amount <amount-to-wrap> --from_privKey <private-key-or-vault> --network <rpc-url> [--from_address <sender-address>] [--to_address <recipient-address>] [--from_name <sender-name>] [--memo <transaction-memo>]
--from_token
(required): The address of the Parent token (the token being wrapped).--to_token
(required): The address of the Child token (the resulting token after wrapping).--amount
(required): The amount of tokens to wrap (in the base unit, e.g., 1000, 1.5).--from_address
: Sender address (required if--from_privKey
is "vault").--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--to_address
: The address of the recipient of the wrapped tokens (optional if you want to use the sender's address).--from_name
: Sender name (required when--from_privKey
is "vault").--memo
: Optional memo for the transaction (e.g., notes for record-keeping).--network
(required): Network details (RPC URL to interact with the blockchain).
Example
- Wrap 1000 Parent tokens to Child tokens using a private key for signing:
sct token wrap --from_token="0xParentTokenAddress" --to_token="0xChildTokenAddress" --amount="1000" --from_privKey="0xYourPrivateKey" --network="http://localhost:8545"
Unwrap:
Unwrap tokens from one type (Child token) to another type (Parent token) based on the registered wrap ratio. This operation converts tokens from the Child type back to the Parent type.
Usage
sct token unwrap --from_token <child-token-address> --to_token <parent-token-address> --amount <amount-to-unwrap> --from_privKey <private-key-or-vault> --network <rpc-url> [--from_address <sender-address>] [--to_address <recipient-address>] [--from_name <sender-name>] [--memo <transaction-memo>]
--from_token
(required): The address of the Child token (the token being unwrapped).--to_token
(required): The address of the Parent token (the resulting token after unwrapping).--amount
(required): The amount of tokens to unwrap (in base units, e.g., 1000, 1.5).--from_address
: Sender address (required if--from_privKey
is "vault").--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--to_address
: The address of the recipient of the unwrapped tokens (optional if you want to use the sender's address).--from_name
: Sender name (required when--from_privKey
is "vault").--memo
: Optional memo for the transaction (e.g., notes for record-keeping).--network
(required): Network details (RPC URL to interact with the blockchain).
Example
- Unwrap 500 Child tokens to Parent tokens, using vault signing with a specified sender name and sending to a different address:
sct token unwrap --from_token="0xChildTokenAddress" --to_token="0xParentTokenAddress" --amount="500" --from_privKey="vault" --from_name="bob" --from_address="0xSenderAddress" --to_address="0xRecipientAddress" --network="http://localhost:8545"
Transfer:
Transfers tokens from the sender to a specified recipient. This command supports both direct transfers from a token contract and transfers through an ERC-1155 token ledger.
Usage
sct token transfer --from_privKey <private-key-or-vault> --to <recipient-address> --amount <amount-to-transfer> --tokenAddress <token-id> --network <rpc-url> [--from_address <sender-address>] [--from_name <sender-name>] [--tokenLedgerAddress <ledger-address>] [--memo <transfer-memo>]
--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_address
: Sender's address (required if--from_privKey
is "vault").--from_name
: Sender's name (required if--from_privKey
is "vault").--to
(required): Recipient's address.--amount
(required): Amount of tokens to transfer.--tokenAddress
(required): Token ID or address of the token to transfer.--tokenLedgerAddress
: Optional address of an ERC-1155 token ledger for token transfers involving ERC-1155 tokens.--memo
: Optional memo for the transfer, stored as a note with the transaction.--network
(required): Network details (RPC URL for blockchain interaction).
Example
- Transfer 100 tokens through an ERC-1155 token ledger using file based priv key signing.
sct token transfer --to "0xRecipientAddress" --amount "100" --tokenAddress "1" --tokenLedgerAddress "0xLedgerAddress" --from_privKey "file" --from_name "vault_user" --from_address "0xSenderAddress" --network "http://localhost:8545" --memo "Transfer memo" --userFile "../user/user.json"
Details:
Retrieves detailed information for a specific token address within the Skucode system on the specified network.
Usage
sct token details --tokenAddress <token-address> --network <network-details>
--tokenAddress
(required): The token address for which details are requested.--network
(required): Network RPC URL to connect to and retrieve token information.
Example
- Retrieve details for a token using the local network.
sct token details --tokenAddress "0x9abcd123..." --network "http://localhost:8545"