This repository contains Solidity smart contracts implementing ERC-6551 token-bound accounts (TBAs), enabling NFTs to control wallets capable of holding ERC20, ERC721, and ETH assets.
This project showcases an implementation of the ERC‑6551: Token‑Bound Account standard. It includes contracts for:
- Creating and managing TBAs.
- Minting profile NFTs that act as account controllers.
- Minting and transferring in‑game spaceship NFTs.
- An ERC20 game token with minting and transfer logic.
Players can:
- Mint a Profile NFT that owns a TBA.
- Have their TBA hold ETH, ERC20 (GameToken), and ERC721 (SpaceShipNFT).
- Transfer assets from their TBA to their wallet in a fully trustless way.
This project was developed as a portfolio demonstration of ERC-6551 token-bound account mechanics.
The repository includes:
- TBAAccount: ERC-6551-compatible account contract capable of executing transactions on behalf of an NFT owner.
- TBARegistry: Registry contract that deploys token-bound accounts as minimal proxies with deterministic addresses.
- ProfileNFT: ERC721 contract representing player identity.
- SpaceShipNFT: ERC721 contract representing in-game assets.
- GameToken: ERC20 token used as an example in-game currency.
The project also includes deployment, verification, and test scripts demonstrating the creation and usage of token-bound accounts.
| Contract | Description |
|---|---|
ProfileNFT.sol |
ERC721 Profile NFT that represents the player identity. |
SpaceShipNFT.sol |
ERC721 representing in‑game spaceship assets. |
GameToken.sol |
ERC20 token used as in‑game currency, mintable by owner. |
TBAAccount.sol |
ERC‑6551‑compatible TBA that executes transactions on behalf of the NFT owner. |
TBARegistry.sol |
Registry contract that deploys TBAs as minimal proxies with deterministic addresses. |
- ✅ ERC‑6551‑compatible TBA with
initializemethod. - ✅ Profile NFT controlling the TBA.
- ✅ TBAs holding ERC20, ERC721, and ETH.
- ✅ Fully owner‑restricted execution on TBAs.
- ✅ Deployment & verification scripts.
- ✅ Comprehensive Hardhat tests & interaction scripts.
🧪 Testnet – Base Sepolia
Contracts Owner: 0xB94503C6a717BDD677ad9dAB7B450AF86d3Aa3F5
| Contract | Address |
|---|---|
| ProfileNFT | 0x578b1f439cb5678f4Dd28E5dB1092b43519c13d7 |
| SpaceShipNFT | 0xaC3E7E08345d498963021d73a1988ef193b2ab14 |
| GameToken | 0x44F69196d5b89a1b5013e660EfF1c2fACe44d2DD |
| TBAAccount | 0x6f6F4103014B739cc9564FdaBCd7Edd81df392F9 |
| TBARegistry | 0xD1889B34CD1D11b91DFaD4C239f7487c56E361c3 |
Personal portfolio project demonstrating ERC-6551 token-bound account mechanics on an EVM Layer 2 test network.
Dantis Minurland Constantin
Full-Stack Software Developer
🌐 https://mdantis.dev
✉️ hello@mdantis.dev
This repository is licensed under the MIT License. See LICENSE for details.
If you are interested in similar smart contract development or blockchain integrations, feel free to get in touch.