Git Product home page Git Product logo

quick-wallet's People

Contributors

cwhinfrey avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

quick-wallet's Issues

Gas reward based on time

The actual implementation of the wallet contract allows the creation one tx with multiple fees, the user can create set different amount of fee to be paid based on certain time limit.

What if instead of that the user sends a maximum amount of gas to be payed with a time limit?
For this the relayer would need to also send how much gas is willing to spend in the wallet call execution.

The calculation would be like:

relayerWeiProfit = (totalGas - relayTxCost + quickTxCost) * maxRelayerGas / (now - txSignedTime)

  • totalGas: Can be obtained with gasLeft() at the beginning of the function.
  • relayTxCost: Fixed cost of gas pre calculated in the wallet contract.
  • quickTxCost: Total gas to be spend in the quickTx call, this has to be sent as parameter by the relayer. Is calculated by using estimateGas from web3.
  • maxRelayerGas: The maximum amount of gas to be payed by the wallet.
  • txSignedTime: The timestamp of the time that the quickTx was signed.

Based on discussion with @cwhinfrey

Improve gas calculation in js-lib

Add methods to improve the usability of the wallet with the js-lib when it is needed to calculate the gas in wei that will cost the execution of a call.
To use estimateGas the sender needs to specify the token and amount of the fee, there is two options here, it is payed with eth or erc20, get the estimate cost for both types of fee.

Improve tests in relayer

Right now to run the tests in the relayer the dev needs to run two processes at the same time, one for testnet and another for api, improve the tests scripts to do it in one process and watch for changes in src and tests.

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.