core-contracts
core-contracts copied to clipboard
Staking pool does not check whether owner account exists upon creation
When a staking pool is created, there is no check on whether the owner account exists. Since staking pool is usually locked (when created from the factory for example), the owner cannot do anything but abandon this staking pool if this happens.
Granted, there is no easy way to check whether an account exists from the smart contract, but I think we can find some hacky solution (for example try sending some small amount to the owner account and check whether the promise succeeds).
Can't frontend or something like this check the existence of the owner's account? E.g. for testnet lockup contract deployment we verify that the master account exists: https://github.com/near/core-contracts/blob/4f245101d7d029ffb3450c560770db244fc7b3ce/scripts/deploy_lockup.sh#L24-L30
For staking pool, we should provide a similar script to do the same
@evgenykuzyakov sure let's do it