Conversation
c45bb4b to
fff04c8
Compare
4c2771b to
151408c
Compare
9808bb2 to
06ed49a
Compare
h4x3rotab
left a comment
There was a problem hiding this comment.
If a contract has a weight of 0 (by default for public good cluster), will pruntime refuse to serve any query? What if it's the system contract?
|
|
||
| let mut total = ContractTotalStakes::<T>::get(&contract); | ||
| let orig = ContractUserStakes::<T>::get(&user, &contract); | ||
| if amount > orig { |
There was a problem hiding this comment.
If not changed, maybe we are going to return directly without emitting any events?
There was a problem hiding this comment.
It did return directly. I removed the return because users may stake before the contract is deployed and the stake wouldn't take effect when the contract launches later. Users can re-stake with the same amount to resend the message to contract.
There was a problem hiding this comment.
Got it. That's a good point. Let's mention in the docstring
There was a problem hiding this comment.
Let's mention in the docstring
Docstring added
|
|
Maybe need to give it a higher priority. Not sure how much to set. So far there's no much case that needs to query System, but maybe in the future it will be different. |
|
Either the system contract itself or a driver can set a large weight to the system contract if it is needed in the future. |
57ee7ff to
c09b3f3
Compare
This PR implements the fat contract tokenomic according to the design.
Additionally, adds pRPCs to get contract info from pruntime.