Nativo is an advanced and more efficient version of Wrapped Ether (WETH). It extends the functionality of WETH, optimizing gas usage and user experience while maintaining full ERC20 compliance.
Key features
Follow the ERC20 compliance
Unlike WETH, Nativo fully complies with the ERC20 standard. While WETH does not emit a Transfer event from address(0)
to the user after minting tokens or from the user to address(0)
after burning tokens, Nativo does.
Gas Savings
Nativo implements several methods to improve gas usage efficiency. These methods not only result in a more cost-effective contract but also provide a superior user experience.
Improved UX with Advanced Methods
Nativo extends the functionality of the classic deposit{value: AMOUNT}()
and withdraw(uint256 amount)
. The new methods provided are as follows:
depositTo(address recipient)
: Wraps the deposit amount and transfers the same amount to the recipient address.
NATIVO.depositTo{ value: amount }(recipient);
// This replaces:
WETH9.deposit{ value: amount}();
WETH9.transfer(recipient, amount);
withdrawTo(address recipient, uint256 amount)
: Unwraps the withdraw amount and transfers the same amount to the recipient address.
NATIVO.withdrawTo(recipient);
// This replaces:
receive() external payable {
require(msg.sender == address(WETH));
}
// ...
WETH9.withdraw(amount);
SafeTransferLib.safeTransferETH(recipient, amount);
withdrawFromTo(address from, address recipient, uint256 amount)
: Unwraps the amount from thefrom
address, which has given approval to the contract, and transfers the same amount of native currency to the recipient address.
NATIVO.withdrawFromTo(from, recipient, amount);
// This replaces:
receive() external payable {
require(msg.sender == address(WETH));
}
// ...
WETH9.transferFrom(from, address(this), amount);
WETH9.withdraw(amount);
SafeTransferLib.safeTransferETH(recipient, amount);
ERC20Permit
Nativo also supports gasless approval of tokens, in compliance with ERC2612. This allows approvals to be made via signatures, as defined in EIP-2612.
ERC-1363: Payable Token
Nativo also tackles the lack of post-ERC-20 transfer or approval action execution through the use of ERC-1363. It implements transferAndCall
, transferFromAndCall
, which will call an onTransferReceived
on a ERC1363Receiver
contract, and approveAndCall
, which will call an onApprovalReceived
on a ERC1363Spender
contract.
Flashloans - ERC-3156
Nativo implements ERC-3156: Flash Loans. This enables the protocol to lend an amount of tokens without a requirement for collateral, on the condition that they are returned within the same transaction, with a fee of 0.09%.