Giter VIP home page Giter VIP logo

auto-buy-contract's Introduction

AutoBuyContract

a contract that uses any and all native currency it is sent to buy from a Uniswap pool.


To Deploy

  1. Install Foundry - you can get it by following the instructions here under the "Use Foundryup" section. Namely:
    • Run curl -L https://foundry.paradigm.xyz | bash
    • Run foundryup
  2. Run forge create AutoBuyContract --constructor-args <WETH_CONTRACT_ADDRESS> <WETH_UNISWAP_POOL_ADDRESS> <AUTO_BOUGHT_TOKEN_DESTINATION_ADDRESS> --rpc-url <RPC_URL> --private-key <YOUR_PRIVATE_KEY> where:
    • <WETH_CONTRACT_ADDRESS> = The contract address of the canonical wrapped version of the native currency of the chain you're deploying to
    • <WETH_UNISWAP_POOL_ADDRESS> = The contract address of the Uniswap Pool between the wrapped native currency and the token you want this contract to autobuy (make sure that the wrapped native token is token0 and the other token is token1 on that contract, you can check on the pool contract's Etherscan page)
    • <AUTO_BOUGHT_TOKEN_DESTINATION_ADDRESS> = The address that you want the tokens that are auto-bought to go to
    • <RPC_URL> = An RPC url by which to access the chain you want to deploy to (you can find a bunch of public ones here if you need)
    • <YOUR_PRIVATE_KEY> = The private key of the wallet (THIS SHOULD BE A HOT WALLET, DO NOT DEPLOY THINGS FROM WALLETS THAT HAVE A LOT OF MONEY IN THEM) you would like to deploy from - there are other ways connect a wallet with forge's create command if you'd like to check them out here too

Once you deploy, when you send the chain's native currency to this contract, it will take it, auto-buy the token you have configured it to, and then send that token where you have configured it to.

auto-buy-contract's People

Contributors

seanmc9 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.