Git Product home page Git Product logo

coin-vester's People

Contributors

damip avatar dependabot[bot] avatar sydhds avatar thomas-senechal avatar thykof avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gilead12

coin-vester's Issues

Send page: add date time picker

For the start date time, we create a component in the ui kit that use massalabs/massa-web3#539 and customize the design following the design system and using the color in the preset theme.

For the duration input (cliff duration, linear duration)...

Spinner & Buttons improvements - UX

To do:

  • Change the spinner colour so we can see it more.
  • Add a spinner on all buttons when an action is in progress. Ex: the delete and send buttons.
  • Disable the delete and send button when an action is in progress

Vester checklist

  • in the frontend:
    • put the tutorial message on top just below the title (see below)
    • make the "send vested coins" part foldable, folded by default
    • in the claim part, if the wallet is not connected, put a message saying it and redirecting to station.massa.net
    • for the claim part, explicitly write "There are no active vesting sessions for your address [addr]" if there is nothing to display

Tutorial message:

This tool allows sending and receiving vested MAS tokens securely.
This app requires a compatible Massa wallet. We recommend https://station.massa.net .
The "Claim Received Funds" section displays the active vesting sessions targeting your wallet address.
For each session, the currently available amount that can be claimed is displayed as "Available to Claim (nMAS)".
In order to claim a certain amount from the available amount of a session, simply enter the amount you want to claim and press the green "Claim" button.
Note that in order to preserve precision and remove any ambiguity, all displayed amounts, as well as the amounts you are expected to input are in nano-MAS (nMAS).
This means for example that in order to claim 123.456 MAS  you should input 123456000000

Check input coins Amount in claim function

In claimVestingSession, the Amount given as argument should be checked:

    // check that the amounts have the right currency and precision (MAS, 1e-9)
    if (
      amount.currency.name !== 'MAS' ||
      amount.currency.minorUnit !== 9
    ) {
      throw new Error('amount must be in MAS.');
    }

Review

https://github.com/massalabs/coin-vester/blob/master/smart-contract/assembly/contracts/main.ts#L42 => missing caller_credits in comment

https://github.com/massalabs/coin-vester/blob/master/smart-contract/assembly/contracts/main.ts#L182 => this error messages should mention the args parameter to be more clear

No permissions can be expose to spam and potentially overflow the ids

https://github.com/massalabs/coin-vester/blob/master/smart-contract/assembly/contracts/main.ts#L102C9-L102C28 => typo in variable name

IProvider.listenAccountChanges only works first time

When I changed accounts on Bearby wallet, account changes were only detected only once but did not work later.

const observer = currentProvider.listenAccountChanges(
              (newAddress: string) => {
                handleBearbyAccountChange(newAddress);
              },
            );

The above listener only works once.
If I keep changing accounts, changes are not reflected on dapp.

Estimate the average latest average fees to update the platform fees

To do:

  • Find a simple way to get the fees from the latest period and do an average (or smarter mechanism) to estimate the needed fees and automatically update the fees of the vesting sessions.

Technical solution:

  • Proposition (please challenge or feel free to think about sth else): create an endpoint that read the fees of the latest period and calculate an average.

Improve toaster UI & Errors messages

To do:

  • Improve the UI of the toaster with a bit of shadow and fuzzy borders.
  • Create an error library and list all the errors possible coming from the node. We need to be more specific about why the operation failed. ATM, we only have one error message that may be wrong based on the error. Let's improve this.
    Feel free to ping PM for the errors messages to the user if needed (PM: Solène)
  • Update the toaster so it reflects the relevant errors.
  • tech: move airdrop transaction into the write hook, to show to user prettier toast

Add network connection button

To do:

  • Enable users to easily switch network between the buildnet and the mainnet.
  • When users change network, refresh the page and update the info.

Send MAS to cover fees for addresses that do not have them

If receiver address balance is < 4 nanoMAS, then the user cannot claim their coins.
When checking if the address exists in the ledger, we should:

  • Also check whether the balance is < of the default fees
  • Send the appropriate amount so that they have the fees covered (0.001 + 4*10^-9 if the address does not exist, 3*10^-9 if the address has 1 nanoMAS).

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.