Integration guides and smart contract references
0xa7b5ede742DEfE344AF15194a738b81857cA8229
| Property | Value |
|---|---|
name() |
NextGenCoin |
symbol() |
NGC |
decimals() |
18 |
totalSupply() |
1,000,000,000 (1 billion) |
maxTxAmount() |
10,000,000 (1% of supply) |
network |
Base Mainnet (Chain ID: 8453) |
const Web3 = require('web3');
const web3 = new Web3('https://mainnet.base.org');
const contractAddress = '0xa7b5ede742DEfE344AF15194a738b81857cA8229';
const contractABI = [/* NGC ABI */];
const ngcContract = new web3.eth.Contract(contractABI, contractAddress);
// Get balance
async function getBalance(address) {
const balance = await ngcContract.methods.balanceOf(address).call();
console.log('Balance:', web3.utils.fromWei(balance, 'ether'));
}
// Transfer tokens
async function transfer(to, amount) {
const amountWei = web3.utils.toWei(amount.toString(), 'ether');
await ngcContract.methods.transfer(to, amountWei).send({
from: yourAddress,
gas: 100000
});
}
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider(
'https://bsc-dataseed.binance.org/'
);
const contractAddress = 'YOUR_CONTRACT_ADDRESS';
const contractABI = [/* NGC ABI */];
const ngcContract = new ethers.Contract(
contractAddress,
contractABI,
provider
);
// Get balance
async function getBalance(address) {
const balance = await ngcContract.balanceOf(address);
console.log('Balance:', ethers.utils.formatEther(balance));
}
// Transfer with signer
async function transfer(signer, to, amount) {
const contractWithSigner = ngcContract.connect(signer);
const tx = await contractWithSigner.transfer(
to,
ethers.utils.parseEther(amount.toString())
);
await tx.wait();
}
from web3 import Web3
# Connect to BSC
w3 = Web3(Web3.HTTPProvider('https://bsc-dataseed.binance.org/'))
contract_address = 'YOUR_CONTRACT_ADDRESS'
contract_abi = [...] # NGC ABI
ngc = w3.eth.contract(address=contract_address, abi=contract_abi)
# Get balance
def get_balance(address):
balance = ngc.functions.balanceOf(address).call()
return w3.from_wei(balance, 'ether')
# Transfer tokens
def transfer(to, amount):
amount_wei = w3.to_wei(amount, 'ether')
tx = ngc.functions.transfer(to, amount_wei).build_transaction({
'from': your_address,
'gas': 100000,
'nonce': w3.eth.get_transaction_count(your_address),
})
signed = w3.eth.account.sign_transaction(tx, private_key)
return w3.eth.send_raw_transaction(signed.rawTransaction)
| Function | Description |
|---|---|
balanceOf(address) |
Get token balance of an address |
totalSupply() |
Get total token supply |
allowance(owner, spender) |
Get approved spending amount |
paused() |
Check if contract is paused |
tradingEnabled() |
Check if trading is enabled |
maxTxAmount() |
Get maximum transaction amount |
| Function | Description |
|---|---|
transfer(to, amount) |
Transfer tokens to an address |
approve(spender, amount) |
Approve spending allowance |
transferFrom(from, to, amount) |
Transfer tokens on behalf of another address |
burn(amount) |
Burn (destroy) your tokens |
{
"chainId": 56,
"chainName": "Binance Smart Chain",
"nativeCurrency": {
"name": "BNB",
"symbol": "BNB",
"decimals": 18
},
"rpcUrls": [
"https://bsc-dataseed.binance.org/",
"https://bsc-dataseed1.defibit.io/",
"https://bsc-dataseed1.ninicoin.io/"
],
"blockExplorerUrls": ["https://bscscan.com/"]
}
paused() status before transfersJoin our developer community on GitHub or Telegram
🐦 Twitter | 📢 Telegram | ← Back to Website