Open ctindogaru opened 2 years ago
@mikedotexe
@ilblackdragon this is just a draft, but let me know if this is what you want! The TBD
in the code needs your attention in particular.
Added unit tests + simulation tests. This PR is ready to be reviewed. @mikedotexe @ilblackdragon
This PR includes the changes in https://github.com/near-daos/sputnik-dao-contract/pull/68
The self-destruct is triggered if the DAO is inactive for too long.
This PR tries to address https://github.com/near-daos/sputnik-dao-contract/issues/39
After this PR gets merged, we should register the following job to croncat:
near call cron.in.testnet create_task '{"contract_id": "sputnik_dao_factory.in.testnet","function_id": "check_daos_activity","cadence": "0 0 * * * *","recurring": true,"deposit": 0,"gas": 30000000000000}' --accountId funds_account.testnet --amount 10
We made the assumption thatsputnik_dao_factory.in.testnet
is the account where the sputnik factory is deployed andfunds_account.testnet
is the account that pays for the gas fees necessary to run the cron job each time.This cron job will run each day at 00:00 and it will check for all the inactive DAOs. If inactive DAO is fund, the funds locked in the DAO (except the funds used for storage) are transferred to the dedicated account.