Rebase Token (RBT) is an ERC20-compliant smart contract built using OpenZeppelin, Solidity, and Foundry. It is designed for extensibility, security, and ease of integration into Ethereum-based DeFi protocols. The contract provides a robust foundation for projects requiring a standard ERC20 token, with the flexibility to add rebase or other advanced tokenomics features.
- ERC20 standard compliance
- Built with OpenZeppelin contracts
- Designed for extensibility (e.g., rebase logic)
- Secure and gas-efficient
- Fully tested with Foundry
The following diagram illustrates the high-level architecture of the Rebase Token contract:
classDiagram
ERC20 <|-- RebaseToken
class ERC20 {
+balanceOf(address)
+transfer(address, uint256)
+approve(address, uint256)
+transferFrom(address, address, uint256)
+totalSupply()
}
class RebaseToken {
+constructor(initialSupply)
+_mint(address, uint256)
}
- Clone the repository:
git clone <repo-url> cd Rebase-Token
- Install dependencies:
forge install
- Main contract:
src/RebaseToken.sol - Uses OpenZeppelin's ERC20 implementation
- All contracts are written in Solidity ^0.8.20
Run the test suite using Foundry:
forge testTest files are located in the test/ directory.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature) - Commit your changes
- Push to the branch (
git push origin feature/your-feature) - Open a pull request
Please ensure your code follows the project's style and passes all tests.
This project is licensed under the MIT License. See the LICENSE file for details.