Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

KitxERC20

isol/contracts/kit/KitxERC20.sol

Kit The KitxERC20 is a comprehensive and efficient core ERC20 smart contract suite, providing all essential features for token development.

Import

import "isol/contracts/kit/KitxERC20.sol";

Usage

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
 
import "isol/contracts/kit/KitxERC20.sol";
 
contract Kit is KitxERC20 {
	constructor() 
		KitxERC20(
			"Kit Token",
			"KIT",
			1000000
		)
	{}
}

Arguments

ParameterTypeDescription
namestringThe name of your token
symbolstringThe symbol (ticker) of your token
initialSupplyuint256The initial supply (whole number, no decimals needed)

name

  • Type: string

The name of your ERC20 token, e.g., "MyToken".

contract Kit is KitxERC20 {
	constructor() 
		KitxERC20(
			"Kit Token", // Name (string)
			"KIT", // Symbol (string)
			1000000 // Initial Supply (number: uint256)
		)
	{}
}

symbol

  • Type: string

The symbol (ticker) of your ERC20 token, e.g., "MTK".

contract Kit is KitxERC20 {
	constructor() 
		KitxERC20(
			"Kit Token", // Name (string)
			"KIT", // Symbol (string)
			1000000 // Initial Supply (number: uint256)
		)
	{}
}

initialSupply

  • Type: uint256 (number || bigint)

The initial supply of your ERC20 token, specified as a whole number. This amount will be minted to the deployer's address upon deployment.

contract Kit is KitxERC20 {
	constructor() 
		KitxERC20(
			"Kit Token", // Name (string)
			"KIT", // Symbol (string)
			1000000 // Initial Supply (number: uint256)
		)
	{}
}

Functions

Read

FunctionArgumentsDescription
allowanceowner (address), spender (address)Check approved amount for spender
balanceOfaccount (address)Get token balance of an address
decimals-Get number of decimals used by the token
name-Get the name of the token
owner-Get the owner of the token
symbol-Get the symbol of the token
totalSupply-Get the total supply of the token

Write

FunctionInteractArgumentsDescription
approveuserspender (address), value (uint256)Allow spender to use your tokens
burnuservalue (uint256)Burn a specific amount of your tokens
burnFromuseraccount (address), value (uint256)Burn a specific amount of your tokens from an account
renounceOwnershipowner-Renounce ownership of the token
transferuserto (address), value (uint256)Send tokens to another address
transferFromuserfrom (address), to (address), value (uint256)Move tokens using allowance
transferOwnershipownernewOwner (address)Transfer ownership of the token

Events

Logs
Transfer(address indexed from, address indexed to, uint256 value)
Approval(address indexed owner, address indexed spender, uint256 value)
OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Features

Functions are inherited from BasexERC20, with additional new features below.

FunctionTypeInteractArgumentsDescription
ownerread--Get the owner of the token
burnwriteuservalue (uint256)Burn a specific amount of your tokens
burnFromwriteuseraccount (address), value (uint256)Burn a specific amount of your tokens from an account
renounceOwnershipwriteowner-Renounce ownership of the token
transferOwnershipwriteownernewOwner (address)Transfer ownership of the token

References

Source code: KitxERC20
OpenZeppelin: ERC20, ERC20Burnable, Ownable

Examples

Deploy

./MyToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
 
import "isol/contracts/kit/KitxERC20.sol";
 
contract MyToken is KitxERC20 {
    constructor() 
        KitxERC20(
            "MyToken", // Name (string)
            "MTK", // Symbol (string)
            5000000 // Initial Supply (number: uint256)
        )
    {}
}

Interact

./interact.ts
import { daccSendToken } from 'dacc-js';
 
import { optimismSepolia } from 'viem/chains'; // used `viem` - npm i viem
 
const tx = await daccSendToken({
  // account: "0xPrivatekey...", // Can call with `allowDaccWallet` function
  daccPublickey: 'daccPublickey_0x123_XxX..',
  // address: '0x123address...', // Only the address created is set to `publicEncryption: true`
  passwordSecretkey: 'my+Password#123..',
  network: optimismSepolia,
  tokenAddress: '0xTokenContract...',
  to: '0xRecipient...',
  amount: 0.1
  // decimals: 6
});
 
console.log(tx); // {txHash, chainId, from, to, tokenAddress, amount, decimals}
console.log(tx?.txHash); // 0xTransactionHash...