CLI tool to sync tokens amounts of a custodial with offchain balance
Goal
Create CLI endpoints to aid us in mirroring the off-chain system to SKALE.
What needs to be done
Create a sync function in CLI that given a username, will add OR remove tokens the necessary tokens to a user's custodial SKALE wallet to make it match their off-chain balance. This can be used to manually update a user's wallet if things get out of sync.
Create a syncAll function that will iterate through all users with off-chain wallets and sync the SKALE balance to the off-chain one - outputting details whenever a sync occurs.
QA
Test via CLI - instructions will be provided in the merge request.
UX/Design
N/A - CLI tool
Personas
Developers of SKALE MINDS system
Experiments
N/A
Acceptance Criteria
-
Balance functions in CLI should be changed to also output offchain system balance, so we can verify the tools work. -
Create sync tool. -
Sync tool should take a username as a param. -
If users custodial wallet has LESS than the amount of MINDS requires, tokens should be sent to the user to make up the difference to match their offchain balance. -
If users custodial wallet has MORE than the amount of MINDS requires, tokens should be sent FROM the user to either minds
, the sFuel distributor user, OR another dedicated token holding user - to make their offchain balance match their SKALE balance. -
Create syncAll tool that performs sync for all users, and outputs info if a sync is made. -
syncAll should have a dry run option to allow us to easily verify if anything drifted out without acting - sufficient details for debugging should be included in logs.
Definition of Ready Checklist
-
Definition Of Done (DoD) -
Acceptance criteria -
Weighted -
QA -
UX/Design -
Personas -
Experiments
Edited by Ben