massalabs / coin-vester Goto Github PK
View Code? Open in Web Editor NEWA simple coin vesting smart contract
License: MIT License
A simple coin vesting smart contract
License: MIT License
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)...
On hold until massalabs/massa-web3#517 is fixed
To do:
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
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.');
}
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
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.
To do:
Technical solution:
To do:
To do:
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:
0.001 + 4*10^-9
if the address does not exist, 3*10^-9
if the address has 1 nanoMAS).A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.