BlacklistToken
is a fungible ERC-20 token implemented on Ethereum, featuring administrative controls that allow specified addresses to be banned from sending and receiving tokens. This functionality is useful for adhering to regulatory requirements and enforcing sanctions.
- ERC-20 compliance: The token adheres to the standard ERC-20 interface.
- Blacklisting: Admins can add or remove addresses from a blacklist.
- Transfer controls: Blacklisted addresses cannot send or receive tokens.
The token is implemented using Solidity 0.8.20 and relies on OpenZeppelin's contracts for standard functionality, including ERC20 and access control.
- Node.js and npm
- Foundry (for local deployment and testing)
-
Install Foundry if it's not already installed:
curl -L https://foundry.paradigm.xyz | bash foundryup
-
Clone the repository:
git clone https://github.com/jocoders/blacklist-token.git cd blacklist-token
-
Install dependencies:
forge install
Run tests using Foundry:
forge test
Deploy the token to a local blockchain using Foundry:
forge create BlacklistToken --rpc-url http://localhost:8545
const tx = await token.addToBlacklist("0xADDRESS");
await tx.wait();
const tx = await token.removeFromBlacklist("0xADDRESS");
await tx.wait();
const tx = await token.transfer("0xRECIPIENT", amount);
await tx.wait();
Contributions are welcome! Please fork the repository and open a pull request with your features or fixes.
This project is unlicensed and free for use by anyone.