-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Economic Protocol scenario 3 - "contract earns fee" #1735
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the things mentioned below, there's one more thing I'd like to at least have discussed - what happens when the contract charges a fee and the amount goes over the gas limit?
re: "these should be two separate fields and have Rusk decide payings and refunds" (Federico) and " it can always be used by rusk itself to compute the refund" (Ed) - I think there is a misunderstanding here. There is no refund to be decided, refund has already been paid, and it is on contract's account by the time it reaches this point. So I think it is an incorrect idea about Rusk to be deciding something. We can add an extra field merely as information - this can be done and maybe makes life easier, as otherwise this info is available via events anyway. |
Re: what happens when the contract charges a fee and the amount goes over the gas limit? - if charge > cost, the charge is not applied, and the behaviour is just "normal", i.e., user pays the normal cost, and the charging contract does not earn anything. |
a9c4f04
to
2a82b72
Compare
b550f6f
to
ed5c807
Compare
27c56e7
to
30a4a95
Compare
No need for now to have 2 different contract balances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR implements Economic Protocol scenario 3 - "contract earns fee"
It contains new test contract Charlie, changes to the Transfer Contract,
relevant changes in the block generator, and tests for scenarios related to the EP scenario 3
(both wallet based and transaction based).
Implements issues:
#1603
#1604
#1630