Security Token Functions

This documentation provides detailed descriptions of various functions available in the Security Token smart contract. These functions allow for the management and control of the token's behavior.

ERC20 (Token Standard)

Approve

The approve function is used to approve the spending of a specific amount of tokens by a spender on behalf of the token holder. This function is essential for enabling token transfers by approved third parties.

Arguments

  • spender (address): The address of the spender.
  • value (uint256): The amount of tokens to approve for spending.

Returns

  • bool: Returns true if the approval was successful; otherwise, it returns false.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "approve",
  "parameters": [
    "0xb63E5025Ed630042Aa51DdF9e765e1C4f614E85c", // Spender (address)
    100 // Value (uint256)
  ]
}

Burn

The burn function allows the burning (destruction) of a specific amount of tokens, reducing the total token supply.

Arguments

  • account (address): The address from which tokens will be burned.
  • amount (uint256): The amount of tokens to burn.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "burn",
  "parameters": [
    "0x2B86618e122aC2Fe141f0DF4dC278FeBEaFceF02", // Account (address)
    100 // Amount (uint256)
  ]
}

Mint

The mint function allows the minting (creation) of a specific amount of tokens, increasing the total token supply.

Arguments

  • account (address): The address to which tokens will be minted.
  • amount (uint256): The amount of tokens to mint.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "mint",
  "parameters": [
    "0x7a2b6CD1c6f61c94a2cCe6AFC6f20BcD07b410DC", // Account (address)
    100 // Amount (uint256)
  ]
}

Set modules

The setModules function is used to set or update modules associated with the token. Modules can provide additional functionalities. Set empty array ([]) to remove all modules from a token.

Arguments

  • newModules (address[]): An array of module addresses to be associated with the partition.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "setModules",
  "parameters": [
    [
      "0xb9Df42a4050E3530ef9dC828123eC6393Db7bEbD",
      "0xf63706f7cABdfd822132253f310AB31d4ccE5a6F"
    ] // NewModules (address[])
  ]
}

Transfer

The transfer function is used to transfer a specific amount of tokens to another address.

Arguments

  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer. Returns
  • bool: Returns true if the transfer was successful; otherwise, it returns false.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transfer",
  "parameters": [
    "0x0cAd17156C2428ea86CbeC2DD9833e7b0B87da2F", // To (address)
    100 // Value (uint256)
  ]
}

Transfer with data

The transferWithData function is similar to the transfer function but allows for additional data to be included in the transaction.

Arguments

  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer.
  • data (bytes): Additional data associated with the transfer.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transferWithData",
  "parameters": [
    "0x8Bf5A9d6293228FF4f52acdB22a1df90e2e69717", // To (address)
    100, // Value (uint256)
    "0x" // Data (bytes)
  ]
}

Transfer from

The transferFrom function is used to transfer a specific amount of tokens from one address to another. It requires approval from the token holder.

Arguments

  • from (address): The address from which tokens will be transferred.
  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer. Returns
  • bool: Returns true if the transfer was successful; otherwise, it returns false.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transferFrom",
  "parameters": [
    "0xbF3b83CDbd8a8dE12E01Ad5066d84C7779A202C0", // From (address)
    "0x0976A831e744e47415D83b84d9a3707770E30b5e", // To (address)
    100 // Value (uint256)
  ]
}

Transfer from with data

The transferFromWithData function is similar to the transferFrom function but allows for additional data to be included in the transaction.

Arguments

  • from (address): The address from which tokens will be transferred.
  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer.
  • data (bytes): Additional data associated with the transfer.
  • operatorData (bytes): Operator-specific data associated with the transfer.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transferFromWithData",
  "parameters": [
    "0x744d8747127747770a2094066CD6401548b5eeAA", // From (address)
    "0x4e49AFFfF8e29D143B25cf1ebAbf67511bDed3B3", // To (address)
    100, // Value (uint256)
    "0x", // Data (bytes)
    "0x" // OperatorData (bytes)
  ]
}

ERC1400 (Security Token Standard)

Authorize operator

The authorizeOperator function allows an address to authorize another address to act on its behalf within the token ecosystem. This is often used for delegation of certain actions.

Arguments

  • operator (address): The address being authorized to act on behalf of the caller.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "authorizeOperator",
  "parameters": [
    "0x65Fd8c601FF6f570A2388751F1986ABE6D1311Ef" // Operator (address)
  ]
}

Authorize operator by partition

The authorizeOperatorByPartition function is similar to the authorizeOperator function but is specific to a partition within the token. Partitions are used to categorize and manage tokens in different ways.

Arguments

  • partition (bytes32): The partition for which the operator is being authorized.
  • operator (address): The address being authorized to act on behalf of the caller within the specified partition.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "authorizeOperatorByPartition",
  "parameters": [
    "0xb4d2b39bddc436dd81e1903ee3fa8c1f289bffb7c47068ee8d2fe872eb6f4c40", // Partition (bytes32)
    "0x133d2A25903D885029c0E5E0C861d22d8e09500a" // Operator (address)
  ]
}

Issue by partition

The issueByPartition function is used to issue tokens from a specific partition to a token holder.

Arguments

  • partition (bytes32): The partition from which tokens will be issued.
  • tokenHolder (address): The address of the token holder receiving the tokens.
  • value (uint256): The amount of tokens to issue.
  • data (bytes): Additional data associated with the issuance.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "issueByPartition",
  "parameters": [
    "0x09e2138213d8c92fff33e457eb957ddafb9a9d66ce79361253e939b0bcc0c9fd", // Partition (bytes32)
    "0xF08e0457d17ec64d994dD745F509aF2C871cBb4a", // TokenHolder (address)
    100, // Value (uint256)
    "0x" // Data (bytes)
  ]
}

Operator redeem by partition

The operatorRedeemByPartition function is used to perform token redemption by an operator on behalf of a token holder within a specific partition.

Arguments

  • partition (bytes32): The partition from which tokens will be redeemed.
  • tokenHolder (address): The address of the token holder on whose behalf the redemption is performed.
  • value (uint256): The amount of tokens to redeem.
  • data (bytes): Additional data associated with the redemption.
  • operatorData (bytes): Operator-specific data associated with the transfer.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "operatorRedeemByPartition",
  "parameters": [
    "0xcd1f0ffaa8ba4a297c845902a48f2c4a1afbc2dc230e19fc3d70b086bca937fb", // Partition (bytes32)
    "0x918658bc3bDe7051248311D55b063a300731C695", // TokenHolder (address)
    100, // Value (uint256)
    "0x", // Data (bytes)
    "0x" // OperatorData (bytes)
  ]
}

Operator transfer by partition

The operatorTransferByPartition function is used to perform token transfers by an operator on behalf of a token holder within a specific partition.

Arguments

  • partition (bytes32): The partition from which tokens will be transferred.
  • from (address): The address from which tokens will be transferred.
  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer.
  • data (bytes): Additional data associated with the transfer.
  • operatorData (bytes): Operator-specific data associated with the transfer.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "operatorTransferByPartition",
  "parameters": [
    "0xdf81d402f233ed808b2a852664efcb43b978a84e996a271c9bfe663cd71f2bd2", // Partition (bytes32)
    "0xaE086570B22E91c203B9814a1850F7006aEBd4A5", // From (address)
    "0x326c649040D4C714691b3E156E98afa3b37fa491", // To (address)
    100, // Value (uint256)
    "0x", // Data (bytes)
    "0x" // OperatorData (bytes)
  ]
}

Redeem by partition

The redeemByPartition function is used to redeem tokens from a specific partition, reducing the token balance of the token holder.

Arguments

  • partition (bytes32): The partition from which tokens will be redeemed.
  • value (uint256): The amount of tokens to redeem.
  • data (bytes): Additional data associated with the redemption.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "redeemByPartition",
  "parameters": [
    "0xa313de3cd4d8fa1e7b79694d2a6b6fbf6224071b3b1babf7f272fb5f0078e4ed", // Partition (bytes32)
    100, // Value (uint256)
    "0x" // Data (bytes)
  ]
}

Revoke operator

The revokeOperator function is used to revoke the authorization of an operator to act on behalf of the caller within the token ecosystem.

Arguments

  • operator (address): The address of the operator to be revoked.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "revokeOperator",
  "parameters": [
    "0x33B74338f58DB3D6f9cd297e9d7F832a3FB5C55a" // Operator (address)
  ]
}

Revoke operator by partition

The revokeOperatorByPartition function is similar to the revokeOperator function but is specific to a partition within the token.

Arguments

  • partition (bytes32): The partition for which the operator's authorization is being revoked.
  • operator (address): The address of the operator to be revoked within the specified partition.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "revokeOperatorByPartition",
  "parameters": [
    "0x82d3c4d0f7e4c7fe15a5791676856c3fcd28a1c3e8efc12464b4223e8f60da32", // Partition (bytes32)
    "0xbAAD1089b77347764D244025e9770B988c8556c0" // Operator (address)
  ]
}

Set modules by partition

The setModulesByPartition function is used to set or update modules associated with a specific partition within the token. Modules can provide additional functionalities. Set empty array ([]) to remove all modules from a partition.

Arguments

  • partition (bytes32): The partition for which modules are being set or updated.
  • newModules (address[]): An array of module addresses to be associated with the partition.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "setModulesByPartition",
  "parameters": [
    "0x0e718b22c8f9375ec0b1db1978d08e4edec63e428aed59afbaf3d981bb15c3fc", // Partition (bytes32)
    [
      "0xb9Df42a4050E3530ef9dC828123eC6393Db7bEbD",
      "0xf63706f7cABdfd822132253f310AB31d4ccE5a6F"
    ] // NewModules (address[])
  ]
}

Set state by partition

The setStateByPartition function is used to set a new state to the specified partition.

Arguments

  • partition (bytes32): The partition for which the next state will be set.
  • nextState (uint256): The next state to transition.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0xf1D4D16aAc4E116120312BA0D5670cF0662650AD",
  "method": "setStateByPartition",
  "parameters": [
    "0x0e718b22c8f9375ec0b1db1978d08e4edec63e428aed59afbaf3d981bb15c3fc", // Partition (bytes32)
    8 // NextState (uint256)
  ]
}

Setup states

The setupStates function is used to set the states lifecycle of the defined instrument. The states must be defined as powers of two and it can be combined by using the or (|) operator of boolean arithmetic.

Example:

  • 1 First state
  • 2 Second state
  • 4 State state

Combined second and third state 6 = 2 | 4 In binary 10 | 100 = 110

Arguments

  • initState (uint256): The initial state that will be assigned to newly created partitions.

  • state (uint256[]): The list of supported states.

  • transition (uint256[]): The list of states that can lead to the state from the previous list in the same position

    * It must have the same length as the previous list.

  • transferStates (uint256): The combination of states that allows transfers executions.

  • issueStates (uint256): The combination of states that allows issuance executions.

  • redeemStates (uint256): The combination of states that allows redemption executions.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0xf1D4D16aAc4E116120312BA0D5670cF0662650AD",
  "method": "setupStates",
  "parameters": [
    1, // InitState (uint256)
    [1, 2, 4, 8], // State (uint256[])
    [0, 1, 3, 5], // Transition (uint256[])
    2, // TransferStates (uint256)
    1, // IssueStates (uint256)
    4 // RedeemStates (uint256)
  ]
}

Transfer by partition

The transferByPartition function is used to transfer tokens from one partition to another within the same token holder's balance.

Arguments

  • partition (bytes32): The partition from which tokens will be transferred.
  • to (address): The address to which tokens will be transferred.
  • value (uint256): The amount of tokens to transfer.
  • data (bytes): Additional data associated with the transfer.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transferByPartition",
  "parameters": [
    "0xcf92518c5d53792fd0a1f40c8ec82fe7c637945f9b7d5cea0a9e07857db5b4e4", // Partition (bytes32)
    "0x52cA5C632131491ef1409b1eFA0a4dC969C53e4F", // To (address)
    100, // Value (uint256)
    "0x" // Data (bytes)
  ]
}

Common

Add role

The addRole function allows the addition of a role to a specific account. Roles are used to grant certain privileges or permissions to accounts within the token ecosystem.

Arguments

  • role (bytes32): The role to be added to the account.
  • account (address): The address to which the role will be added.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "addRole",
  "parameters": [
    "WHITELIST_EDITOR", // Role (bytes32)
    "0xfA8c354563c939eA938866E80f5A36948306AE91" // Account (address)
  ]
}

Execute meta transaction

The executeMetaTransaction function allows the execution of meta-transactions, which are transactions initiated by a user but paid for by a third party. It is often used for gasless transactions.

Arguments

  • userAddress (address): The address of the user initiating the meta-transaction.
  • functionSignature (bytes): The function signature of the intended transaction.
  • sigR (bytes32): The R component of the transaction signature.
  • sigS (bytes32): The S component of the transaction signature.
  • sigV (uint8): The V component of the transaction signature.

Returns

  • bytes: The result of the executed meta-transaction.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "executeMetaTransaction",
  "parameters": [
    "0xdDA1a0fa7861198600d298DDd3a2cC516E70428F", // UserAddress (address)
    "0xa9059cbb000000000000000000000000a1d3b1598567007c1d78e5562dbf075b98f9937100000000000000000000000000000000000000000000000000000000000000c8", // FunctionSignature (bytes)
    "0xf296516f55b3788e3f4dcf887faac5ca005c90aa4ceda011bef7dfda132413bc", // SigR (bytes32)
    "0x050aaf655047f05c2ac7a8bb7413c6b352d982a800c9bc94b464631ee57e853d", // SigS (bytes32)
    "27::uint8" // SigV (uint8)
  ]
}

Multicall

The multicall function is a batch calling mechanism that allows multiple calls to be executed in a single transaction. It is often used to optimize contract interactions.

Arguments

  • data (bytes[]): An array of encoded function call data. Returns
  • results (bytes[]): An array of results from the executed function calls.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "multicall",
  "parameters": [
    ["0x123456", "0x789ABC"] // Data (bytes[])
  ]
}

Pause

The pause function is used to pause certain token functionalities, preventing further actions. It is often used in emergency situations or for temporary maintenance.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "pause",
  "parameters": []
}

Remove role

The removeRole function allows the removal of a role from a specific account. This function is used to revoke privileges or permissions previously granted to accounts.

Arguments

  • role (bytes32): The role to be removed from the account.
  • account (address): The address from which the role will be removed.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "removeRole",
  "parameters": [
    "REDEEMER", // Role (bytes32)
    "0xed203b06Ca9a5e7A64F94873585EBb116949A3cd" // Account (address)
  ]
}

Renounce control

The renounceControl function allows an address to renounce control over certain token functionalities. This function is used when an address no longer wishes to control these functionalities.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "renounceControl",
  "parameters": []
}

Renounce issuance

The renounceIssuance function allows an address to renounce the issuance of tokens. This function is used when an address no longer wishes to issue tokens.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "renounceIssuance",
  "parameters": []
}

Renounce role

The renounceRole function allows an address to renounce a specific role. This function is used when an address no longer wishes to hold a particular role.

Arguments

  • role (bytes32): The role to be renounced.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "renounceRole",
  "parameters": [
    "CONTROLLER" // Role (bytes32)
  ]
}

Set cap

The setCap function is used to set a new cap (maximum limit) for the total supply or the maximum number of tokens that can be issued.

Arguments

  • newCap (uint256): The new cap value to be set.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "setCap",
  "parameters": [
    1000000 // NewCap (uint256)
  ]
}

Set document

The setDocument function is used to create or update a document associated with the token. Documents can include legal agreements or whitepapers.

Arguments

  • documentName (bytes32): The name or title of the document.
  • uri (string): The URI or URL where the document can be accessed.
  • documentHash (bytes32): The hash of the document for verification purposes.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "setDocument",
  "parameters": [
    "0xb137637eb7ffe4de310227001651d4afdfbdbe3a4f603660d6af50b216b618f9", // DocumentName (bytes32)
    "https://example.com/document.pdf", // URI (string)
    "0x70de0eec2b3be51311e9760490affff22a04c660053b52c6c8d8be6400e0b222" // DocumentHash (bytes32)
  ]
}

Transfer ownership

The transferOwnership function allows the transfer of ownership of the Security Token contract to a new owner.

Arguments

  • newOwner (address): The address of the new owner.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "transferOwnership",
  "parameters": [
    "0xa799b1E7c257Df50C01e97430C610596BbC0dBD0" // NewOwner (address)
  ]
}

Unpause

The unpause function is used to resume token functionalities that were previously paused using the pause function.

Payload

{
  "contractAddress": "0x1bb54F1f226773d267c192b2583E97f004E7E8B5",
  "from": "0x77C7A1Be852efE1Dbe29e596774eD93C2A0F4D39",
  "method": "unpause",
  "parameters": []
}

Was this page helpful?