Giter VIP home page Giter VIP logo

ens-erc20's Introduction

ENS ERC20 token designed to enable simple token bridging of ENS name ownership artifacts to L2s.

Factory is deployed to 0x000000008B009D81C933a72545Ed7500cbB5B9D1 and the base implementation is deployed to 0xEBb49317E567a40cF468c409409aD59a8f67ddE6.

Each created ERC20 token is a minimal proxy clone with the immutable argument of an ENS node bytes32 that also serves as the salt of its create2 deterministic deployment. This is overall just very gas efficient. There will only ever be one ERC20 for each ENS node. Ultimate control of these ERC20 tokens are left to the then-current owner of the ENS name or node or accounts that receive an approval. This means that there is a revokable permission to send these tokens. The use case for this is to allow L2 bridges to pull and return tokens. This may or not work but let's try and see. For the avoidance of doubt, the L1 ENS ERC20 token will always ultimately be under the control of whoever owns the underlying ENS name and NFT. This ownership updates in real-time with changes in ENS ownership without the need for any intervention on behalf of the ERC20. Also to be clear: There is no need to move the ENS name or NFT to take advantage of this system. Users can deploy the ERC20 equivalent of their ENS name or a relayer can. The ENS owner can mint and burn at their pleasure and transfer the tokens from any address on L1 once deployed. On L2, they may consider giving less than the full amount on L2 to delegate permissions. An intuitive check of "who owns the L1 ENS" on L2 will just be checking who owns a majority of the ERC20 artifacts on the relevant L2.

Getting Started

Run: curl -L https://foundry.paradigm.xyz | bash && source ~/.bashrc && foundryup

Build the foundry project with forge build. Run contract tests with forge test. Measure gas fees with forge snapshot. Format code with forge fmt.

Blueprint

lib
├─ forge-std — https://github.com/foundry-rs/forge-std
├─ solady — https://github.com/vectorized/solady
src
├─ ENS_ERC20 — ENS_ERC20 Contract
test
└─ ENS_ERC20.t - Test ENS_ERC20 Contract

Disclaimer

These smart contracts and testing suite are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of anything provided herein or through related user interfaces. This repository and related code have not been audited and as such there can be no assurance anything will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

License

See LICENSE for more details.

ens-erc20's People

Contributors

z0r0z avatar

Stargazers

Michael Demarais avatar shiv avatar 开来超 avatar Cimply avatar Carter Carlson avatar Lawrence Forman avatar Kell (K42) avatar H8 avatar  avatar clandestine.eth avatar

Watchers

Michael Demarais avatar  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.