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

BasexERC20

isol/contracts/base/BasexERC20.sol

Base The BasexERC20 is a basic starting point for creating your own ERC20 token easily. Set the name, symbol, and initial supply right away.

Import

import "isol/contracts/base/BasexERC20.sol";

Usage

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
 
import "isol/contracts/base/BasexERC20.sol";
 
contract Base is BasexERC20 {
	constructor() 
		BasexERC20(
			"Base Token",
			"BASE",
			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 Base is BasexERC20 {
	constructor() 
		BasexERC20(
			"Base Token", // Name (string)
			"BASE", // Symbol (string)
			1000000 // Initial Supply (number: uint256)
		)
	{}
}

symbol

  • Type: string

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

contract Base is BasexERC20 {
	constructor() 
		BasexERC20(
			"Base Token", // Name (string)
			"BASE", // 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 Base is BasexERC20 {
	constructor() 
		BasexERC20(
			"Base Token", // Name (string)
			"BASE", // 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
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
transferuserto (address), value (uint256)Send tokens to another address
transferFromuserfrom (address), to (address), value (uint256)Move tokens using allowance

Events

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

Features

FunctionTypeInteractArgumentsDescription
-----

References

Source code: BasexERC20
OpenZeppelin: ERC20

Examples

Deploy

./MyToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
 
import "isol/contracts/base/BasexERC20.sol";
 
contract MyToken is BasexERC20 {
    constructor() 
        BasexERC20(
            "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...