This contract deploys lockup contracts. It allows any user to create and fund the lockup contract. The lockup factory contract packages the binary of the lockup contract within its own binary.
To create a new lockup contract a user should issue a transaction and attach the required minimum deposit. The entire deposit will be transferred to the newly created lockup contract including to cover the storage.
The benefits:
- Lockups can be funded from any account.
- No need to have access to the foundation keys to create lockup.
- Auto-generates the lockup from the owner account.
- Refund deposit on errors.
near dev-deploy --wasmFile=res/lockup_factory.wasm
near call lockup.nearnet new '{"whitelist_account_id":"whitelist.nearnet","foundation_account_id":"nearnet","master_account_id":"nearnet","lockup_master_account_id":"lockup.nearnet"}' --accountId lockup.nearnet
near call lockup.nearnet create '{"owner_account_id":"lockup_owner.testnet","lockup_duration":"63036000000000000"}' --accountId funding_account.testnet --amount 50000
near call lockup.nearnet create '{"owner_account_id":"lockup_owner.testnet","lockup_duration":"31536000000000000","vesting_schedule": { "VestingSchedule": {"start_timestamp": "1535760000000000000", "cliff_timestamp": "1567296000000000000", "end_timestamp": "1661990400000000000"}}}' --accountId funding_account.testnet --amount 50000 --gas 110000000000000