npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

weth10

v0.0.1

Published

Wrapped Ether with ERC2612 and Flash Minting

Readme

WETH10

This twitter hackathon project 🐦 updates the canonical "Wrapped Ether" WETH(9) contract with minor but significant upgrades to save Ethereum network users gas and time in making transactions with tokenized ETH on lo-trust, lo-code 🍬⛽.

Mainnet deployment of commit (34d2712) 🔨. The contract has been deployed at the same address in Kovan, Goerli, Rinkeby and Ropsten.

Total Supply

The supply of WETH10 is capped at type(uint112).max.

Wrapping Ether

Any operation that ends with this contract holding Wrapped Ether is prohibited.

deposit Ether in this contract to receive Wrapped Ether (WETH), which implements the ERC20 standard. WETH is interchangeable with Ether in a 1:1 basis.

withdraw Ether from this contract by unwrapping WETH from your wallet.

The depositTo and withdrawTo convenience functions allow to place the resulting WETH or Ether in an address other than the caller.

The withdrawFrom function allows to unwrap Ether from an owner wallet to a recipient wallet, as long as the owner called approve

Approvals

When an approval is set to type(uint256).max it will not decrease through transferFrom or withdrawFrom calls.

WETH10 implements EIP2612 to set approvals through off-chain signatures

Call Chaining

The depositAndCall and transferAndCall functions allow to deposit Ether or transfer WETH, executing a call in a user-defined contract immediately afterwards, but within the same transaction.

This function will call onTokenTransfer on the recipient address, receiving and passing along a bytes parameter which can be used by the calling contract to process the callback. See EIP667.

Flash Loans

This contract implements EIP3156 that allows to flashLoan an arbitrary amount of Wrapped Ether, unbacked by real Ether, with the condition that it is burned before the end of the transaction. No fees are charged.

This function will call onFlashLoan on the calling address, receiving and passing along a bytes parameter which can be used by the calling contract to process the callback.

Function unrolling

For a minimal gas cost, all functions in WETH10 are external, and a great deal of code repetition exists. To help in understanding the code, blocks that are used recurrently are preceded by a commented-out function call such as // _transferFrom(msg.sender, to, value) that describes the functionality of the block, and followed by a blank line.