Giter VIP home page Giter VIP logo

cli-bidding's People

Contributors

druiz0992 avatar invocamanman avatar krlosmata avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

pinkdiamond1

cli-bidding's Issues

Simple BID undefined variables amountUnits and bidAmountUnits

let dataPermit;
  if(command === "BID" || command === "MULTIBID") {
    // Create Permit Signature
    const nonce = await HezContract.nonces(wallet.getAddress());
    const deadline = ethers.constants.MaxUint256;

    let amountUnits = amount
    let bidAmountUnits = bidAmount
    let maxBidUnits = maxBid
    let minBidUnits = minBid
    if (units == "ether") {
      amountUnits = ethers.utils.parseEther(amount);
      bidAmountUnits = ethers.utils.parseEther(bidAmount);
      maxBidUnits = ethers.utils.parseEther(maxBid);
      minBidUnits = ethers.utils.parseEther(minBid);
   }

amountUnits and bidAmountUnits are defined in a limited scope, but then are used after the if block

List possible changes

  • Add tests
    • setup github actions
  • change ./src/.env.example
    • set PRIVATE_KEY_CLI_BIDDING (it must include 0x)
    • set NODE_ETHEREUM_URL to https://localhost:8545
  • explain amount and bidAmount when bidding in quick guide (or just link to the explanation)
  • explain amount is set with 18 decimals since HEZ is used in quick guide (or just link to the explanation)
  • it may be useful to add an option to perform an infinite approval (just to safe gas if you perform multiple bids)
  • add eslint --> https://github.com/hermeznetwork/circuits/blob/master/.eslintrc.js
  • add package-lock.json to ensure node_modules versions
  • this repo should be public and it should have an npm package
    • improve package.json id npm package is fianlly done
  • code already supports 3 chainId (1, 4, 5). We could hardcode smart contracts addresses on those three environments and in environemnt ile the user should choose between mainnet, rinkeby or goerli. Contracts addressescould be overwritten is set actual environment vars HERMEZ_AUCTION_ADDRESS & HEZ_TOKEN_ADDRESS
  • It would be nice to separate console client and functionality, just to keep the repo best organized and probably functionality could be used externally (in a webApp for bidding for example)

Publish npm package

  • create a proper package.json to publish npm package @hermeznetwork/cli-bidding
  • publish package on npm

Simple BID undefined variables `maxBid` and `minBid`

maxBid and minBid parameters are used for multibid. However, the code uses them in the simple bid scenario and returns an error.

  if(command === "BID" || command === "MULTIBID") {
    // Create Permit Signature
    const nonce = await HezContract.nonces(wallet.getAddress());
    const deadline = ethers.constants.MaxUint256;

    amountUnits = amount
    bidAmountUnits = bidAmount
    let maxBidUnits = maxBid
    let minBidUnits = minBid
    if (units == "ether") {
      amountUnits = ethers.utils.parseEther(amount);
      bidAmountUnits = ethers.utils.parseEther(bidAmount);
      maxBidUnits = ethers.utils.parseEther(maxBid);
      minBidUnits = ethers.utils.parseEther(minBid);
    }

First biddable slot is incorrec

If I do node src/biddingCLI.js slotinfo --startingSlot 4350 --endingSlot 4370 to get the first biddable slot, and then bid in the returned first biddable slot, the bid returns an AUTION_CLOSED error

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.