Inspiration
The inspiration for Nativo came from the need to improve the efficiency and functionality of Wrapped Ether (WETH) in the DeFi space. We recognized the necessity for a more gas-efficient alternative that could simplify the use of wrapped tokens on Ethereum, enhance transaction efficiency, and improve interoperability within the Ethereum ecosystem.
What it does
Nativo serves as a modernized and more efficient version of Wrapped Ether, providing a gas-efficient alternative for the DeFi space. It allows for unique arbitrage opportunities by letting users borrow an arbitrary amount of Wrapped Ether, unbacked by actual Ether, with the condition that it is burned before the end of the transaction. Nativo simplifies the use of wrapped tokens, enhances transaction efficiency, and improves interoperability in the Ethereum ecosystem, making staking, providing liquidity, and interacting with DApps more accessible, efficient, and cost-effective.
ERC20 Compliance: Nativo is fully ERC20 compliant, making it compatible with any contract or DApp that uses the ERC20 standard. This allows for seamless interaction and reduced transaction friction across the Ethereum ecosystem.
Improved UX with Advanced Methods: Nativo introduces novel methods such as
depositTo,withdrawToandwithdrawFromTo. These functionalities enable more direct and efficient transfer of tokens, making the wrapping and unwrapping process simpler and faster for users.ERC20Permit and ERC-1363 Support: Nativo supports ERC20Permit (EIP2612), enabling token approvals through off-chain signatures, and ERC-1363, allowing post-transfer action execution. These features offer users greater flexibility and improved user experience.
Flash Loans (ERC-3156): By implementing ERC-3156, Nativo allows users to borrow an arbitrary amount of Wrapped Ether, unbacked by actual Ether, with the condition that it is burned before the end of the transaction. This can provide unique arbitrage opportunities in the DeFi space.
Gas Efficiency: With several gas optimization techniques and deployment on vanity addresses across chains, Nativo achieves significant gas savings, reducing the cost of transactions for users.
In essence, Nativo simplifies the use of wrapped tokens on Ethereum, improves the interoperability of the Ethereum ecosystem, and enhances transaction efficiency. Whether it's staking, providing liquidity, or interacting with DApps, Nativo aims to make these tasks more accessible, efficient, and cost-effective.
How we built it
Nativo was built by implementing the ERC-3156 standard, allowing users to borrow Wrapped Ether unbacked by actual Ether, with the condition of burning it before the transaction's end. We focused on gas optimization techniques and utilized vanity addresses across chains to achieve significant gas savings. The development process involved a detailed analysis of storage layouts and slots, especially for deployment across multiple chains, ensuring efficient and secure contract functionality.
Challenges we ran into
One of the main challenges encountered during the development of Nativo was related to slots and storage layout, especially considering the deployment across multiple chains. As you might know, contract storage is a key aspect to consider when writing and deploying contracts in Solidity. Mismanagement of storage, particularly when dealing with complex contract upgrades, can potentially lead to severe issues.
When we initially developed and tested Nativo, we discovered some inconsistencies in the way data was being stored and accessed. This was traced back to the improper use of storage slots, leading to overwriting of storage values in certain cases, which is a critical bug.
Overcoming this challenge required a deep understanding of how Solidity manages storage at a low level. Through detailed analysis of our contract's storage layout, we were able to identify the source of the problem and reorganize our storage structures in a way that prevented any possible overwrites.
This process highlighted the importance of maintaining a solid and consistent testing strategy. Thanks to our extensive test coverage and invariant testing approach, we were able to detect and address these issues promptly. Such testing methodologies are crucial in the blockchain development space due to the immutable nature of smart contracts.
Accomplishments that we're proud of
We are particularly proud of overcoming the complex challenges related to slots and storage layout in Solidity. Our ability to identify and rectify a critical bug involving the overwriting of storage values showcases our team's technical expertise and commitment to creating a robust and reliable DeFi solution. Additionally, our extensive test coverage and invariant testing approach allowed us to address these issues effectively, highlighting our dedication to quality and security in blockchain development.
What we learned
Through the development of Nativo, we learned about the intricacies of Solidity's storage management at a low level and the importance of a consistent testing strategy in blockchain development. We gained valuable insights into addressing and preventing potential issues in smart contract development, especially those related to complex contract upgrades and storage mismanagement.
What's next for Nativo Wrapper
Moving forward, Nativo aims to expand its functionalities and reach within the DeFi space. We plan to introduce new features that further enhance the efficiency and usability of Nativo in various blockchain applications. Our goal is to continuously improve and adapt to the evolving needs of the DeFi community, ensuring Nativo remains at the forefront of decentralized finance innovation.
Built With
- foundry
- solidity
Log in or sign up for Devpost to join the conversation.