Coder Social home page Coder Social logo

imanhaghian68 / advanced-weth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uniswap/advanced-weth

0.0 0.0 0.0 243 KB

A smart contract that wraps WETH that adds functionality for transparently dealing in WETH

License: GNU General Public License v3.0

JavaScript 100.00%

advanced-weth's Introduction

advanced-weth

A smart contract that adds functionality to the Wrapped Ether smart contract which allows users to interact with other smart contracts that consume WETH transparently as if they are using ETH directly.

Requires a single approval from the user for the AdvancedWETH contract to spend any amount of their WETH, and thus benefits from widespread use of a canonical advanced WETH contract. Because this approval never runs out or expires, this is a once-per-account requirement to permanently enhance the capabilities of WETH.

The benefit of removing special handling of ETH from your contract is that you can reduce your interface size significantly, i.e. you can pretend that ETH already implements the ERC20 interface and consume ETH via the AdvancedWETH contract.

Methods documentation

All methods are documented inline in the contract interface.

Deploying a test version

For unit tests, you can depend on the advanced-weth npm package for access to the contract interface and the build artifacts.

npm install --save advanced-weth

You can browse the build artifacts included in the npm package via unpkg.com/[email protected]/.

Use the bytecode stored in the import path advanced-weth/build/contracts/AdvancedWETH.json file to deploy the contract for unit tests.

Note only the interface solidity code is shared in the npm package. This is because to deploy the contract on a testnet, you should use the build artifact to get an exact copy of the AdvancedWETH contract regardless of local solc compiler settings.

The constructor has a single argument, the WETH contract address.

Deploy addresses

The build artifacts in the npm package contain the deployment addresses for programmatic consumption.

The AdvancedWETH contract is deployed and verified to the address 0x27E90122950c9E4E669edcC90Fac6c105770420b on the networks:

Disclaimer

This contract has not been audited, nor formally verified. Use at your own risk.

advanced-weth's People

Contributors

moodysalem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.