Skip to content

exec009/evm-token-base

Repository files navigation

evm-token-base

A BEP-20 token contract with staking mechanics deployed on Binance Smart Chain. Built with the Brownie framework and OpenZeppelin contracts.

What is included

  • contracts/Token.sol - BEP-20 token with locked balance tracking and configurable stake rate
  • scripts/deploy.py - deploys the token contract to a target network
  • scripts/interact.py - reads on-chain token state for a given address
  • scripts/verifySmartContract.py - publishes contract source to the block explorer
  • tests/ - Brownie test suite covering balance, ownership, and transfer behavior
  • bsc-testnet.yaml - Brownie network configuration for BSC and common EVM networks

Requirements

  • Python 3 with Brownie
  • Node.js and npm

Setup

Install Solidity dependencies:

npm install

Install Python dependencies:

pip install eth-brownie

Test

brownie test

Deploy

Import the network config:

brownie networks import bsc-testnet.yaml True

Add BSC mainnet manually if not already present:

brownie networks add BSC bsc-mainnet chainid=56 explorer=https://api.bscscan.com/api host=https://bsc-dataseed1.binance.org name="bsc-mainnet"

Set up a Brownie account:

brownie accounts new deployer

Deploy to BSC testnet:

brownie run scripts/deploy.py --network bsc-testnet

Deploy to BSC mainnet:

brownie run scripts/deploy.py --network bsc-mainnet

Interact

export CONTRACT_ADDRESS=<deployed_contract_address>
export USER_ADDRESS=<wallet_address>
brownie run scripts/interact.py --network bsc-mainnet

Verify

Publish the contract source to BSCScan after deployment:

export CONTRACT_ADDRESS=<deployed_contract_address>
brownie run scripts/verifySmartContract.py --network bsc-mainnet

Notes

  • Token supply is 100,000,000,000 with 18 decimal places.
  • setStakeRate and changeLastStake are owner-only operations.
  • The WEB3_INFURA_PROJECT_ID environment variable is required when using Infura-hosted Ethereum networks in the network config.

Security

This code has not been audited. Do not deploy with real funds without a thorough review of the contract logic.

License

MIT

About

BEP-20 token contract with staking mechanics, built with Brownie and OpenZeppelin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors