comakery / comakery-eos-vesting Goto Github PK
View Code? Open in Web Editor NEWCoMakery compatible token vesting contract for EOS / Telos
License: MIT License
CoMakery compatible token vesting contract for EOS / Telos
License: MIT License
Make it easy to write automated javascript code by providing working example code in the README and automated tests.
Note that the scope of this issue isn't full test coverage in Javascript.
Make it easy to run a script and deploy the contract to an EOS or Telos blockchain
Acceptance:
Feel free to add, remove or modify steps for clarity or ease.
The employee received a 100 day vesting with a 100 day lockup for 100 tokens.
The start date is set to 50 days ago,
The employee is fired and the remaining vesting is canceled.
The admin reclaims the 50 unvested tokens.
The employee owns 50 tokens but they are still locked until the lockup period is over.
The admin tries to claim the 50 vested employee owned tokens but the reclaim fails.
99 days from the start date the employee tries to transfer 50 tokens but the transfer fails because they are still locked.
100 days from the start date the tokens unlock and the ex-employee transfers their 50 tokens successfully.
If it's not possible to set both the Vesting & Lockup at the same as specified in the scenario, modify the contract to be able to set them separately.
When running C ++ tests, an error occurs. After examining the repository, I realized that before starting the tests, the environment is set up, in which the contracts are deployed, which are used in tests and in the main cmkryvesting contract. All this is implemented in the file https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp. I found that the error is happening because the other contracts file is missing. Here is a list of files and contracts that are not in the repository.
dappservices.wasm
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L333
EOSDTNUTOKEN
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L337
EOSDTSTTOKEN
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L338
EOSDTKGTOKEN
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L339
EOSDTORCLIZE
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L353
EOSDTCNTRACT
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L354
provableconn.wasm
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L356
EOSDTLIQDATR
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L363
EOSDTGOVERNC
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L364
EOSDTEXCHANG
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L365
TOKENSWAP_EQ
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L366
EOSLOTTERYEQ
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L367
EOS2DTDOTCOM
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L373
I tried running the tests, but I got errors again. I found in the code that after connecting the contracts, they are still used. For example:
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L282
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L162
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/common.hpp#L538-L541
And in the tests themselves of the contract:
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/vesting_contract_test.cpp#L89
https://github.com/CoMakery/comakery-eos-vesting/blob/main/cmkryvesting_tests/vesting_contract_test.cpp#L217
So I think you still need contract files to run tests.
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.