Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ServiceRegistry (without parameter reconfiguration) #1116
ServiceRegistry (without parameter reconfiguration) #1116
Changes from all commits
9764a2a
f3b0744
8567da5
0ef446f
6dba747
29f6e9b
0903166
1ba3e90
9b112ef
5b1b6da
ae72e12
95b3406
4d99852
6b70ba6
6d96854
b27023f
a715003
4b96f41
a430667
fc3b464
d6036d5
0adaa62
41b6832
b0ab66a
514c6b1
95b333e
137aba2
dfbbc1c
f5e16ca
8e64cce
b16bfa5
f085044
0143fdc
fcb2d56
5f59f7a
d002a6b
8da6fba
9ec2205
fc68cc1
a7051ee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Why is this it's own contract? Couldn't you also model this as a struct inside the
ServiceRegistry
contract?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.
Yes, everything could be in
ServiceRegistry
and that would be gas-efficient.The current choice follows security-in-depth. Even if
ServiceRegistry
is compromized, the deposits made earlier would not be affected.Is this conceptual security worth more than the additional gas? I don't know for sure, but the deposits are rarer and bigger than usual Raiden transfers.
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.
That argument makes sense to me, but I don't have much experience. The question was aimed at understanding the trade-off better!
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.
Is it possible to forbid this behaviour and only allow deposits with a
deposit
function, where one could check the token?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.
Unfortunately, contracts cannot refuse incoming ERC20 tokens.
In the beginning, I had a
deposit()
function, but it did nothing useful. So I removed it.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.
Should
min_price
be settable as well?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.
This follows in the next PR.
min_price
,6/5
bumping ratio and200 days
will be configurable.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.
I'm not sure about low-level differences, but why do you use
assert
here?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.
Because I know the assert is always true. So I use
assert
and then the SMT solver insolc
tries to find a counterexample.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.
To say it in a different way:
assert
should only fail for bugs in the contract,require
is for all other cases.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.
Above you write that all functions should return
true
, so this one as well?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.
I believe so. I'll add
return true
.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.
Same here, should this return
true
?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.
That's also true.
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.
Nice approach, works great!
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.
Once you make
A
configurable, you might have to check for an overflow here as well.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.
Yes, the next PR will contain lots of those checks. I hope nobody needs the price decaying over billions of years.