Comment on page
JSON RPC SCT API
SCT uses write and get methods differently. In the case of recording, a generic transaction is generated to process the SCT and the stored contract can be confirmed via the next (# JSON-RPC SCT).
To offer these APIs over the Gsym RPC endpoints, please specify them with the
--${interface}api
command line argument (where ${interface}
can be rpc
for the HTTP endpoint, ws
for the WebSocket endpoint and ipc
for the unix socket (Unix) or named pipe (Windows) endpoint).For example:
gsym --ipcapi sct --rpcapi sct --wsapi sct --ws --rpc
- Enables the official sct API over the IPC interface
- Enables the official sct API over the HTTP interface
- Enables the official sct API over the WebSoket interface
The HTTP RPC interface must be explicitly enabled using the
--rpc
flag.Contracts APIs based on SCT Type and Method.
SCT20
: Contract template that implements the interface of ERC20.SCT21
: Contract added lock function to sct20.SCT22
: Contract template that implements the authorized transfer.SCT30
: Contract template that implements the interface of ERC721.SCT40
: SCT30 based coupon contract template.SCT51
: Contract template that implements the management of Vote service.SCT52
: Contract template that implements the Voting service.
SCT20 | SCT30 | SCT40 |
SCT20_CREATE | SCT30_CREATE | SCT40_CREATE |
SCT20_TRANSFER | SCT30_CREATE_ITEM | SCT40_CREATE_COUPON |
SCT20_TRANSFER_FROM | SCT30_TRANSFER | SCT40_TRANSFER |
SCT20_APPROVE | SCT30_TRANSFER_FROM | SCT40_TRANSFER_FROM |
SCT20_DECREASE_APPROVE | | |
SCT20_MINT | SCT30_APPROVE | SCT40_APPROVE |
SCT20_BURN | SCT30_ITEM_PAUSE | SCT40_COUPON_USE |
SCT20_PAUSE | SCT30_ITEM_UNPAUSE | SCT40_COUPON_PAUSE |
SCT20_UNPAUSE | | SCT40_COUPON_UNPAUSE |
SCT20_TRANSFER_OWNER | SCT30_TRANSFER_OWNER | SCT40_TRANSFER_OWNER |
SCT21 | SCT22 |
SCT21_CREATE | SCT22_CREATE |
SCT21_TRANSFER | SCT22_TRANSFER |
SCT21_TRANSFER_FROM | |
SCT21_APPROVE | |
SCT21_DECREASE_APPROVE | |
SCT21_MINT | SCT22_MINT |
SCT21_BURN | SCT22_BURN |
SCT21_PAUSE | SCT22_PAUSE |
SCT21_UNPAUSE | SCT22_UNPAUSE |
SCT21_TRANSFER_OWNER | SCT22_TRANSFER_OWNER |
SCT21_LOCK_TRANSFER | SCT22_SET_AUTHORITY |
SCT21_UNLOCK_AMOUNT | |
SCT21_RESTORE_LOCK_AMOUNT | |
SCT21_ADD_LOCK_AMOUNT | |
SCT21_SUB_LOCK_AMOUNT | |
SCT21_ACCOUNT_LOCK | |
SCT21_ACCOUNT_UNLOCK | |
SCT50 | SCT51 |
SCT50_CREATE | SCT51_CREATE_POLL |
SCT50_ADD_POLL_CREATORS | SCT51_VOTE_IN_POLL |
SCT50_ROMOVE_POLL_CREATORS | SCT51_UNSTAKE_TOKENS |
| SCT51_EMERGENCY_STOP_POLL |
| SCT51_FINISH_POLL |
| SCT51_WRITE_POLL_RESULTS |
SCT20 is a template that implements ERC20 Interface. You can use the same features as Total Supply, Transfer, Balance Of, Transfer From, and Approve.
Create an SCT20 contract.
- Type : 20
- Method : 0
- Parameters :
- 1.
Name
:STRING
- Contract(Token) Name - 2.
Symbol
:STRING
- Contract(Token) Symbol. The length should be from 3 to 10. - 3.
Amount
:QUANTITY
- Total Supply - 4.
Owner
:DATA
, 10 Bytes - address of the contract owner.
Example
// Create SCT20 Token whose name is "SymToken" and
// symbol is "STK" and
// total supply is 100 * 10^18 STK (="0x56bc75e2d63100000") and
// contract owner is "0x00020000000000070002"
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x14", "method": "0x0", "params": {"name": "SymToken", "symbol": "STK", "amount": "0x56bc75e2d63100000", "owner": "0x00020000000000070002"}})
// Result: RLP encoded SCT data
"0xe51480e28853796d546f6b656e8353544b89056bc75e2d631000008a00020000000000070002"
// Send SCT Transaction
sym.sendTransaction({"from": "0x00020000000000070002", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x0", "type": "0x1", "input": "0xe51480e28853796d546f6b656e8353544b89056bc75e2d631000008a00020000000000070002"})
// Result: Transaction Hash
"0xa90be0a11140b1fb2e5e11f4c3702791dc4467f6e2a3616b261ca45107faadb9"
// <Validate: Create>
// Get contract address from transaction hash
sym.getTransactionReceipt("0xa90be0a11140b1fb2e5e11f4c3702791dc4467f6e2a3616b261ca45107faadb9").contractAddress
// Result: contractAddress.
"0xeda14153a4cb151daeae"
// Get Contract information from contract address.
sct.getContract("0xeda14153a4cb151daeae")
// Result: Contract information created with SCT20 create method.
{
creator: "0x00020000000000070002",
name: "SymToken",
owner: "0x00020000000000070002",
state: "active",
symbol: "STK",
total: "0x56bc75e2d63100000",
type: "sct20"
}
Ownership token transfer capability
(Authorization: all)
- Type : 20
- Method : 1
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to receive sct20 token. - 2.
Amount
:QUANTITY
- value to transfer sct20 token.
Example
// Transfer 50 * 10^18 STK (="0x2b5e3af16b1880000") token created from above example to "0x00020000000000060002"
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x14", "method": "0x1", "params": {"to": "0x00020000000000060002", "amount":"0x2b5e3af16b1880000"}})
// Result
"0xd81401d58a000200000000000600028902b5e3af16b1880000"
// Send SCT Transaction
sym.sendTransaction({"from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x1", "type": "0x1", "input": "0xd81401d58a000200000000000600028902b5e3af16b1880000"})
// Result
"0x39bd90c419da2114fca9b61bdd6287b29545a39f2e53ac3c1e4fae1dc9ac1c32"
// <Validate: Transfer>
// Get token holder's balance
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2b5e3af16b1880000"
}
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000060002")
{
balance: "0x2b5e3af16b1880000"
}
Send a delegated token via APPROVE
(Authorization: all)
- Type : 20
- Method : 2
- Parameters :
- 1.
From
:DATA
, 10 Bytes - address to transfer. - 2.
To
:DATA
, 10 Bytes - address to receive sct20 token. - 3.
Amount
:QUANTITY
- value to transfer sct20 token.
Example
// <Pre-setting: Approve>
// Approve 1 * 10^18 STK(="0xde0b6b3a7640000") to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x3", "params": {"to": "0x00020000000000060002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xd71403d48a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x3", "type": "0x1", "input": "0xd71403d48a00020000000000060002880de0b6b3a7640000"})
// Result
"0xafa11d55043ec1c85b100fd52cfe8b4127129224d8171d5a3fe995190480349d"
// <Tranfer From>
// Transfer 1 * 10^18 STK(="0xde0b6b3a7640000") from "0x00020000000000070002" to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x2", "params": {"from": "0x00020000000000070002", "to": "0x00020000000000060002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xe21402df8a000200000000000700028a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x0", "type": "0x1", "input": "0xe21402df8a000200000000000700028a00020000000000060002880de0b6b3a7640000"})
// Result
"0x6ddb04417211b33776c15e5921a280bf27d1c1c96ffe967988e621d68125c5ee"
// <Validate: Transfer From>
// Before Transfer From
// Get Approved receiver account's allowance
> sct.getAllowance("0xeda14153a4cb151daeae","0x00020000000000070002","0x00020000000000060002")
{
balance: "0xde0b6b3a7640000"
}
// Get Approved receiver account's balance
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000060002")
{
balance: "0x0"
}
// Get token holder's balance
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2b5e3af16b1880000"
}
// After Transfer From
// Get Approved receiver account's allowance
> sct.getAllowance("0xeda14153a4cb151daeae","0x00020000000000070002","0x00020000000000060002")
{
balance: "0x0"
}
// Get Approved receiver account's balance
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000060002")
{
balance: "0xde0b6b3a7640000"
}
// Get Token holder's balance
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2a802f8630a240000"
}
Delegate some tokens to other users
(Authorization: all)
- Type : 20
- Method : 3
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address of the spender. - 2.
Amount
:QUANTITY
- value to transfer sct20 token.
Example
// Approve 1 * 10^18 STK(="0xde0b6b3a7640000") to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x3", "params": {"to": "0x00020000000000060002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xd71403d48a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x3", "type": "0x1", "input": "0xd71403d48a00020000000000060002880de0b6b3a7640000"})
// Result
"0xafa11d55043ec1c85b100fd52cfe8b4127129224d8171d5a3fe995190480349d"
// Validate Approve
// Get Approved receiver account's allowance
> sct.getAllowance("0xeda14153a4cb151daeae","0x00020000000000070002","0x00020000000000060002")
{
balance: "0xde0b6b3a7640000"
}
Decrease the amount of tokens that an owner allowed to a spender.
(Authorization: all)
- Type : 20
- Method : 4
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address of the spender. - 2.
Amount
:QUANTITY
- value to transfer sct20 token.
Example
// Decrease approve 1 * 10^18 STK(="0xde0b6b3a7640000") to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x4", "params": {"to": "0x00020000000000060002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xd71404d48a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x4", "type": "0x1", "input": "0xd71404d48a00020000000000060002880de0b6b3a7640000"})
// Result
"0x8bf97d0a2582fc5bbc7e4fd2ea69d1585cac0fe61d88350c847627f5b06c754a"
// <Validate: Decrease Approve>
// Get De-Approved receiver account's allowance
> sct.getAllowance("0xeda14153a4cb151daeae","0x00020000000000070002","0x00020000000000060002")
{
balance: "0x0"
}
Token amount mint
(Authorization: owner, creator)
- Type : 20
- Method : 5
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to receive sct20 token. - 2.
Amount
:QUANTITY
- amount to mint sct20 token.
Example
// Issue 1 * 10^18 STK (="0xde0b6b3a7640000") to "0x00020000000000070002".
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x5", "params": {"to": "0x00020000000000070002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xd71405d48a00020000000000070002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x5", "type": "0x1", "input": "0xd71405d48a00020000000000070002880de0b6b3a7640000"})
// Result
"0x042bf7bdd76a2a2832429b5904e3f152b35ec55b5368a880a93ebae9ad63e8e6"
// <Validate: Mint>
// Before Mint
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2a802f8630a240000"
}
// After Mint
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2b5e3af16b1880000"
}
Token amount burn
(Authorization: owner, creator)
- Type : 20
- Method : 6
- Parameters :
- 1.
From
:DATA
, 10 Bytes - address to remove sct20 token. - 2.
Amount
:QUANTITY
- amount to remove sct20 token.
Example
// Remove 1 * 10^18 STK (="0xde0b6b3a7640000") from "0x00020000000000070002"'s balance.
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x6", "params": {"from": "0x00020000000000070002", "amount":"0xde0b6b3a7640000"}})
// Result
"0xd71406d48a00020000000000070002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x6", "type": "0x1", "input": "0xd71406d48a00020000000000070002880de0b6b3a7640000"})
// Result
"0x29e18e05ffd2a75aba4966542c6088e3128d26b10ea68821b86fb4cca537809b"
// <Validate: Burn>
// Before Burn
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2b5e3af16b1880000"
}
// After Burn
> sct.getContractAccount("0xeda14153a4cb151daeae","0x00020000000000070002")
{
balance: "0x2a802f8630a240000"
}
Pause the sct20 transaction
(Authorization: owner, creator)
- Type : 20
- Method : 7
- Parameters : Null
Example
// Get SCT rlp encoded string
> debug.getSCTRlp({ "type": "0x14", "method": "0x7"})
// Result
"0xc31407c0"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x7", "type": "0x1", "input": "0xc31407c0"})
// Result
"0x02eef9e76f076f557f05dbd40f09d59d293feb47a3b84a162b581c3f4040ad0d"
Unpause the sct20 transaction
(Authorization: owner, creator)
- Type : 20
- Method : 8
- Parameters : Null
Example
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x14", "method": "0x8"})
// Result
"0xc31408c0"
// Send SCT Transaction
sym.sendTransaction({"from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x8", "type": "0x1", "input": "0xc31408c0"})
// Result
"0xa7c27b6375ed8379d022453ab5305dd27a5b7ad9c8f88e4592b983357654eeb1"
change owner permissions
(Authorization: owner, creator)
- Type : 20
- Method : 9
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to be contract owner
Example
// Transfer contract ownership to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x14", "method": "0x9", "params": {"to": "0x00020000000000060002"}})
// Result
"0xce1409cb8a00020000000000060002"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000070002", "to": "0xeda14153a4cb151daeae", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x9", "type": "0x1", "input": "0xce1409cb8a00020000000000060002"})
// Result
"0x2edae8387e79e05d16bb5eb08deeff905a2171a74d5b7ab9cd0da664d82102ff"
// <Validate: Transfer Owner>
// Before Transfer Owner
> sct.getContract("0xeda14153a4cb151daeae").owner
"0x00020000000000070002"
// After Transfer Owner
> sct.getContract("0xeda14153a4cb151daeae").owner
"0x00020000000000060002"
SCT21 is the addition of a lock function to SCT20. You can manage tokens in greater detail by locking accounts or locking amounts.
Create an SCT21 contract.
- Type : 21
- Method : 0
- Parameters :
- 1.
Name
:STRING
- Contract(Token) Name - 2.
Symbol
:STRING
- Contract(Token) Symbol. The length should be from 3 to 10. - 3.
Amount
:QUANTITY
- Total supply - 4.
LockAmount
:QUANTITY
- Locked amount - 5.
Owner
:DATA
, 10 Bytes - address of the contract owner
Example
// Create SCT21 Token whose name is "SymToken" and
// symbol is "STK" and
// total supply is 100 * 10^18 STK (="0x56bc75e2d63100000") and
// locked amount is 100 * 10^18 STK (="0x56bc75e2d63100000") and
// contract owner is "0x00020000000000060002"
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x0", "params": {"name": "SymToken", "symbol": "STK", "amount": "0x56bc75e2d63100000", "lockAmount": "0x56bc75e2d63100000", "owner": "0x00020000000000060002"}})
// Result: RLP encoded SCT data
"0xef1580ec8853796d546f6b656e8353544b89056bc75e2d6310000089056bc75e2d631000008a00020000000000060002"
// Send SCT Transaction
sym.sendTransaction({"from": "0x00020000000000060002", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x0", "type": "0x1", "input": "0xef1580ec8853796d546f6b656e8353544b89056bc75e2d6310000089056bc75e2d631000008a00020000000000060002"})
// Result: Transaction Hash
"0xc821c83439f0000f4dd83f98b2d097c21a108ddf6b2031b918cd7da8c4ddd432"
// Validate Create
// Get Transaction Recipt from transaction hash
sym.getTransactionReceipt("0xc821c83439f0000f4dd83f98b2d097c21a108ddf6b2031b918cd7da8c4ddd432").contractAddress
// Result: Transaction information with contractAddress.
"0x32731dbab5dc4134790c"
// Get Contract information from contract address.
sct.getContract("0x32731dbab5dc4134790c")
// Result: Contract information created with SCT20 create method.
{
creator: "0x00020000000000060002",
lock: "0x56bc75e2d63100000",
name: "SymToken",
owner: "0x00020000000000060002",
state: "active",
symbol: "STK",
total: "0x56bc75e2d63100000",
type: "sct21"
}
Ownership token transfer capability
(Authorization: all)
- Type : 21
- Method : 1
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to receive sct21 token. - 2.
Amount
:QUANTITY
- value transferred in sct21 token.
Example
// Transfer 50 * 10^18 STK (="0x2b5e3af16b1880000") token created from above example to "0x00020000000000050002"
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x1", "params": {"to": "0x00020000000000050002", "amount": "0x2b5e3af16b1880000"}})
// Result
"0xd81501d58a000200000000000500028902b5e3af16b1880000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x1", "type": "0x1", "input": "0xd81501d58a000200000000000500028902b5e3af16b1880000"})
// Result
"0xf4d15813040b80c260dafdd8c1037ad7156dc3cb7349c193bec46ad67c212a57"
Send a delegated token via APPROVE
(Authorization: all)
- Type : 21
- Method : 2
- Parameters :
- 1.
From
:DATA
, 10 Bytes - address to transfer. - 2.
To
:DATA
, 10 Bytes - address to receive sct21 token. - 3.
Amount
:QUANTITY
- value to transfer sct21 token.
Example
// Transfer 1 * 10^18 STK(="0xde0b6b3a7640000") from "0x00020000000000060002" to "0x00020000000000050002". (from address should be preceded approve. Refer to SCT20 Transfer From example.)
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x2", "params": {"from": "0x00020000000000060002", "to": "0x00020000000000050002", "amount": "0xde0b6b3a7640000"}})
// Result
"0xe21502df8a000200000000000600028a00020000000000050002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({"from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x2", "type": "0x1", "input": "0xe21502df8a000200000000000600028a00020000000000050002880de0b6b3a7640000"})
// Result
"0x5c65b7e678423611fa19f13bb333d1c8cd2152ede2fcb94f83da72d3c4a88d1c"
Delegate some tokens to other users
(Authorization: all)
- Type : 21
- Method : 3
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address of the spender. - 2.
Amount
:QUANTITY
- value to transfer sct21 token.
Example
// Approve 1 * 10^18 STK(="0xde0b6b3a7640000") to "0x00020000000000050002".
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x3", "params": {"to": "0x00020000000000050002", "amount": "0xde0b6b3a7640000"}})
// Result
"0xd71503d48a00020000000000050002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x3", "type": "0x1", "input": "0xd71503d48a00020000000000050002880de0b6b3a7640000"})
// Result
"0x635fadbec85b1ca7368cb32d48832d0a58935f121900a4d052e032e8e2634b1b"
Decrease the amount of tokens that an owner allowed to a spender.
(Authorization: all)
- Type : 21
- Method : 4
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address of the spender. - 2.
Amount
:QUANTITY
- value to transfer sct21 token.
Example
// Decrease approve 1 * 10^18 STK(="0xde0b6b3a7640000") to "0x00020000000000050002".
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x4", "params": {"to": "0x00020000000000050002", "amount": "0xde0b6b3a7640000"}})
// Result
"0xd71504d48a00020000000000050002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x4", "type": "0x1", "input": "0xd71504d48a00020000000000050002880de0b6b3a7640000"})
// Result
"0x24e0ddc8e56060161448e1cceef9a9407ff77ddc25e1dbf3bf7c0c48d70f6b0e"
Token amount mint
(Authorization: all)
- Type : 21
- Method : 5
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to receive sct21 token. - 2.
Amount
:QUANTITY
- amount to issue in sct21 token.
Example
// Issue 1 * 10^18 STK (="0xde0b6b3a7640000") to "0x00020000000000060002".
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x5", "params": {"from": "0x00020000000000060002", "amount": "0xde0b6b3a7640000"}})
// Result
"0xd71505d48a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x5", "type": "0x1", "input": "0xd71505d48a00020000000000060002880de0b6b3a7640000"})
// Result
"0xd750609cdc4723d244efd34dea8d129debf10be574ea94d7d084386c092b53ae"
Token amount burn
(Authorization: owner, creator)
- Type : 21
- Method : 6
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to remove sct21 token. - 2.
Amount
:QUANTITY
- amount to remove sct21 token.
Example
// Remove 1 * 10^18 STK (="0xde0b6b3a7640000") from "0x00020000000000060002"'s balance.
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x6", "params": {"to": "0x00020000000000060002", "amount": "0xde0b6b3a7640000"}})
// Result
"0xd71506d48a00020000000000060002880de0b6b3a7640000"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x6", "type": "0x1", "input": "0xd71506d48a00020000000000060002880de0b6b3a7640000"})
// Result
"0xfde9237efaa328e2ce0a289defd31d1a265e2eb2d4f79859b48611db7cfa25dd"
Pause the sct21 contract
(Authorization: owner, creator)
- Type : 21
- Method : 7
- Parameters : Null
Example
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x7"})
// Result
"0xc31507c0"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x7", "type": "0x1", "input": "0xc31507c0"})
// Result
"0x417915b3b4e6b22c079b0cdceca7372cf7ba3df682507a73d91d685149153ba1"
Unpause the sct21 contract
(Authorization: owner, creator)
- Type : 21
- Method : 8
- Parameters : Null
Example
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x8"})
// Result
"0xc31508c0"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x8", "type": "0x1", "input": "0xc31508c0"})
// Result
"0x5b6ffe84611df757659a52f6313b252d021ed75ab88e428009de253117402fdc"
change owner permissions
(Authorization: owner, creator)
- Type : 21
- Method : 9
- Parameters :
- 1.
To
:DATA
, 10 Bytes - address to be the contract owner
Example
// Transfer contract ownership to "0x00020000000000040002".
// Get SCT rlp encoded string
> debug.getSCTRlp({"type": "0x15", "method": "0x9", "params": {"to": "0x00020000000000040002"}})
// Result
"0xce1509cb8a00020000000000040002"
// Send SCT Transaction
sym.sendTransaction({ "from": "0x00020000000000060002", "to": "0x32731dbab5dc4134790c", "gas": "0x76cff0", "gasPrice": "0x5d21dba00", "nonce": "0x9", "type": "0x1", "input": "0xce1509cb8a00020000000000040002"})
// Result
"0x785118298e2a32bb08c51cf3d68fdcf1e52b8111cabea94ad042ddba7a5db168"
Send amount of locked token
(Authorization: owner, creator)
- Type : 21