|
| 1 | +# Using the OpenZeppelin Wizard |
| 2 | + |
| 3 | +## What is the OpenZeppelin Wizard? |
| 4 | + |
| 5 | +The OpenZeppelin Wizard is a powerful interactive tool that simplifies the creation of secure, standard-compliant smart contracts for Sei EVM. It provides a user-friendly interface for generating production-ready contract code based on OpenZeppelin's battle-tested libraries. |
| 6 | + |
| 7 | +## Benefits of Using the Wizard |
| 8 | + |
| 9 | +- **Security First**: All generated contracts use audited, industry-standard implementations |
| 10 | +- **Time-Saving**: Eliminate boilerplate code and common setup configurations |
| 11 | +- **Customizable**: Tailor contracts to your specific requirements through an intuitive UI |
| 12 | +- **Educational**: Learn best practices by examining professionally structured contract code |
| 13 | +- **Up-to-Date**: Always generates code compatible with the latest Solidity versions and standards |
| 14 | + |
| 15 | +## Available Contract Types |
| 16 | + |
| 17 | +<div className="overflow-x-auto max-w-full"> |
| 18 | + <table className="w-full divide-y divide-neutral-200 dark:divide-neutral-800"> |
| 19 | + <thead> |
| 20 | + <tr> |
| 21 | + <th className="px-4 py-3 text-left text-sm font-medium text-neutral-500 dark:text-neutral-400">Contract Type</th> |
| 22 | + <th className="px-4 py-3 text-left text-sm font-medium text-neutral-500 dark:text-neutral-400">Description</th> |
| 23 | + <th className="px-4 py-3 text-left text-sm font-medium text-neutral-500 dark:text-neutral-400">Common Use Cases</th> |
| 24 | + </tr> |
| 25 | + </thead> |
| 26 | + <tbody className="divide-y divide-neutral-200 dark:divide-neutral-800"> |
| 27 | + <tr> |
| 28 | + <td className="px-4 py-3 text-sm text-neutral-900 dark:text-neutral-100 whitespace-nowrap font-medium">ERC20</td> |
| 29 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400 whitespace-nowrap">Standard fungible token</td> |
| 30 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400">Cryptocurrencies, utility tokens, governance tokens</td> |
| 31 | + </tr> |
| 32 | + <tr> |
| 33 | + <td className="px-4 py-3 text-sm text-neutral-900 dark:text-neutral-100 whitespace-nowrap font-medium">ERC721</td> |
| 34 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400 whitespace-nowrap">Non-fungible token (NFT)</td> |
| 35 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400">Digital collectibles, art, real estate, certifications</td> |
| 36 | + </tr> |
| 37 | + <tr> |
| 38 | + <td className="px-4 py-3 text-sm text-neutral-900 dark:text-neutral-100 whitespace-nowrap font-medium">ERC1155</td> |
| 39 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400 whitespace-nowrap">Multi-token standard</td> |
| 40 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400">Gaming assets, mixed fungible/non-fungible collections</td> |
| 41 | + </tr> |
| 42 | + <tr> |
| 43 | + <td className="px-4 py-3 text-sm text-neutral-900 dark:text-neutral-100 whitespace-nowrap font-medium">Governor</td> |
| 44 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400 whitespace-nowrap">On-chain governance</td> |
| 45 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400">DAO voting systems, protocol management</td> |
| 46 | + </tr> |
| 47 | + <tr> |
| 48 | + <td className="px-4 py-3 text-sm text-neutral-900 dark:text-neutral-100 whitespace-nowrap font-medium">Custom</td> |
| 49 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400 whitespace-nowrap">Specialized contracts</td> |
| 50 | + <td className="px-4 py-3 text-sm text-neutral-600 dark:text-neutral-400">Access control, payment systems, timelock functions</td> |
| 51 | + </tr> |
| 52 | + </tbody> |
| 53 | + </table> |
| 54 | +</div> |
| 55 | + |
| 56 | +## Step-by-Step Guide |
| 57 | + |
| 58 | +1. **Access the Wizard**: Use the embedded widget (from OpenZeppelin) below or visit [wizard.openzeppelin.com](https://wizard.openzeppelin.com/) |
| 59 | +2. **Select Contract Type**: Choose the standard that matches your project needs (ERC20, ERC721, etc.) |
| 60 | +3. **Configure Basic Settings**: |
| 61 | + - Set token name and symbol |
| 62 | + - Choose Solidity version |
| 63 | + - Select access control mechanism (Ownable, Roles, etc.) |
| 64 | +4. **Add Security Features**: |
| 65 | + - Pausable functionality |
| 66 | + - Permit extensions |
| 67 | + - Flash minting capabilities |
| 68 | + - Voting mechanisms |
| 69 | +5. **Customize Token Behavior**: |
| 70 | + - Premint options |
| 71 | + - Burning capabilities |
| 72 | + - Token transfer rules |
| 73 | + - Supply management |
| 74 | +6. **Review Generated Code**: The code updates in real-time as you make selections |
| 75 | +7. **Copy and Implement**: Use the "Copy to clipboard" button to export your contract code |
| 76 | +8. **Deploy**: The generated code is ready for compilation and deployment |
| 77 | + |
| 78 | +## Interactive OpenZeppelin Wizard |
| 79 | + |
| 80 | +Explore and create your custom smart contracts using the embedded wizard below: |
| 81 | + |
| 82 | +<div className="my-5 p-5 border-0 !border-0 bg-gray-50"> |
| 83 | + <iframe src="https://wizard.openzeppelin.com/embed" className="w-full h-[700px] border-0 !border-0 bg-black" title="OpenZeppelin Contract Wizard" /> |
| 84 | +</div> |
| 85 | + |
| 86 | +## Tips for Effective Use |
| 87 | + |
| 88 | +- **Start Simple**: Begin with minimal features and add complexity incrementally |
| 89 | +- **Understand Each Option**: Hover over the information icons (ℹ️) for detailed explanations |
| 90 | +- **Review Dependencies**: Note which OpenZeppelin libraries your contract imports |
| 91 | +- **Consider Gas Costs**: More features generally mean higher deployment and operation costs |
| 92 | +- **Customize Post-Generation**: The wizard provides a starting point—most projects will require additional customization |
| 93 | + |
| 94 | +## Beyond the Wizard |
| 95 | + |
| 96 | +While the wizard is excellent for starting development, consider these next steps: |
| 97 | + |
| 98 | +1. **Test Thoroughly**: Create comprehensive test suites for your generated contracts |
| 99 | +2. **Security Audit**: Consider professional audits for high-value contracts |
| 100 | +3. **Documentation**: Add detailed comments and generate documentation |
| 101 | +4. **Optimization**: Review for gas optimization opportunities |
| 102 | +5. **Upgradability**: Consider implementing upgrade patterns for long-lived contracts |
| 103 | + |
| 104 | +## Learn More |
| 105 | + |
| 106 | +- [OpenZeppelin Contracts Documentation](https://docs.openzeppelin.com/contracts/) |
| 107 | +- [Smart Contract Security Best Practices](https://docs.openzeppelin.com/contracts/4.x/security-considerations) |
| 108 | +- [OpenZeppelin GitHub Repository](https://github.com/OpenZeppelin/openzeppelin-contracts) |
| 109 | +- [OpenZeppelin Community Forum](https://forum.openzeppelin.com/) |
0 commit comments