Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eugenioclrc/erc403
https://github.com/eugenioclrc/erc403
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/eugenioclrc/erc403
- Owner: eugenioclrc
- Created: 2024-07-13T11:53:00.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-21T10:30:01.000Z (5 months ago)
- Last Synced: 2024-11-11T18:44:54.858Z (about 1 month ago)
- Language: Solidity
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ERC-403: Bridging ERC-1155 and ERC-20 Token Standards
=====================================================Overview
--------ERC-403 is a new Ethereum token standard designed to seamlessly integrate the capabilities of ERC-1155 and ERC-20. By combining these standards, ERC-403 enables efficient, flexible, and gas-optimized management of both fungible and non-fungible tokens within a single contract. This standard is ideal for applications requiring fractional ownership of non-fungible tokens, enhanced liquidity, and simplified token management.
Features
--------- **Multi-Token Capability**: Supports the creation and management of both fungible (ERC-20) and non-fungible (ERC-1155) tokens.
- **Batch Operations**: Efficient batch transfers and operations, reducing gas costs.
- **Mint-and-Burn Mechanism**: Allows for the fractionalization of NFTs and the reassembly of fractionalized tokens.
- **Metadata Management**: Handles metadata for ERC-1155 tokens effectively.
- **Security and Compatibility**: Implements secure transfer and approval mechanisms, ensuring compatibility with existing ERC standards.Smart Contract Implementation
-----------------------------### ERC403 Contract
The ERC403 contract leverages Solmate's minimalist and gas-efficient templates to implement the core functionalities of ERC-1155 and ERC-20 within a unified framework.
### Token Contract
The `Token` contract should implement the ERC-20 standard functionalities to interact seamlessly with the ERC403 contract.
How to Use
----------### Deploying the Contract
Deploy the ERC403 contract to the Ethereum network. Ensure that the `Token` contract is deployed and properly referenced.
### Minting Tokens
Use the `_mint` and `_batchMint` functions to create new ERC-1155 tokens that are linked to their ERC-20 counterparts.
### Transferring Tokens
Utilize `safeTransferFrom` and `safeBatchTransferFrom` for transferring tokens securely between addresses.
### Checking Balances
Use `balanceOf` and `balanceOfBatch` to check the balances of ERC-1155 tokens.
### Approvals
Manage token approvals with the `setApprovalForAll` function.
Conclusion
----------ERC-403 aims to bridge the gap between ERC-1155 and ERC-20, providing a flexible and efficient standard for managing a wide variety of tokens on the Ethereum blockchain. This standard is ideal for applications in DeFi, gaming, digital art, and more, offering enhanced liquidity and simplified token management.
License
-------This project is licensed under the MIT License. See the LICENSE file for more details.