l00k / devphase

Development tool for Phala Phat contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto stake to the contracts

h4x3rotab opened this issue · comments

In the Phat Contract tokenomic, every contract will need to have some stake in order to get the access to resources, including the CPU resource (for query) and RAM for local cache. Without staking, contract can still receive queries. It will just be put at the lowest scheduling priority. However it will get zero RAM for local cache, making the local cache unusable at all. When the contract uses the local cache, it will not be functional.

My suggestion is to add a small stake (e.g. 1 PHA) to all the contracts we instantiated like below:

const stake = '1000000000000';
api.tx.phalaFatTokenomic.adjustStake(contract.address, stake);
commented

Hmm.. I was sure it is enough to execute phalaFatContracts.transferToCluster.
At least it was working in my case.

Now it understand it is also required to adjust stake.
Thx.

commented

Added in v0.0.24