A comprehensive collection of base smart contracts for blockchain applications, built with security and best practices in mind.
contracts/
├── interfaces/ # ERC standard interfaces
│ ├── IERC20.sol
│ ├── IERC20Metadata.sol
│ ├── IERC721.sol
│ ├── IERC721Receiver.sol
│ ├── IERC721Metadata.sol
│ ├── IERC1155.sol
│ └── IERC165.sol
├── tokens/ # Token implementations
│ ├── ERC20.sol
│ └── ERC721.sol
├── utils/ # Utility libraries
│ ├── Context.sol
│ ├── Strings.sol
│ ├── Address.sol
│ ├── Math.sol
│ └── ERC165.sol
├── access/ # Access control
│ └── Ownable.sol
├── security/ # Security patterns
│ ├── Pausable.sol
│ └── ReentrancyGuard.sol
└── examples/ # Example implementations
├── BaseToken.sol
├── BaseNFT.sol
└── BaseStaking.sol
- ERC20: Fungible token standard with metadata support
- ERC721: Non-fungible token standard with metadata
- ERC1155: Multi-token standard (interface only)
- ERC165: Interface detection standard
- Ownable: Basic ownership access control
- Pausable: Emergency pause functionality
- ReentrancyGuard: Protection against reentrancy attacks
- Context: Safe message sender and data access
- Strings: String manipulation utilities
- Address: Address validation and interaction utilities
- Math: Mathematical operations and rounding
- BaseToken: ERC20 token with minting capabilities
- BaseNFT: ERC721 NFT with batch minting and pause functionality
- BaseStaking: Token staking contract with rewards
- Clone the repository:
git clone https://github.com/llinsss/base_lytics.git
cd base_lytics- Install dependencies:
npm installnpx hardhat compilenpx hardhat testnpx hardhat run scripts/deploy.js --network <network>A simple ERC20 token with:
- Minting capabilities (owner only)
- Burning functionality
- Maximum supply limit
- Standard ERC20 features
An ERC721 NFT collection with:
- Public minting with price
- Batch minting
- Owner minting
- Pause functionality
- Withdrawal mechanism
A staking contract featuring:
- Token staking and unstaking
- Reward calculation
- Claimable rewards
- Configurable reward rates
- Emergency functions
- All contracts include proper access controls
- Reentrancy protection where needed
- Pause functionality for emergency situations
- Input validation and error handling
- Gas optimization considerations
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For questions and support, please open an issue on GitHub.
Built with ❤️ for the Base ecosystem Modified content