-
Notifications
You must be signed in to change notification settings - Fork 31
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
Destructing staker proxy via ost composer contract #777
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.
@sarvesh-ost thanks for changes. Please, have a look into my comments.
@@ -0,0 +1,49 @@ | |||
// Copyright 2019 OpenST Ltd. |
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 would propose to test the followings in addition:
- That contract was actually
selfdestruct -ed
. (web3.eth.getCode(address) can be helpful I would assume). - That remaining
ether
was sent to the owner.
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.
We can add contract code assertion, to ensure that selfdestruct
is called. Asserting ether will be more like testing solidity selfdestruct
works fine or not. Also, I don't think this contract can hold ether. There is not payable function.
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've thought, like this:
we do: selfdestruct(owner)
and we want to test that, and not that we do selfdestruct()
or selfdestruct(non-owner-address)
. What do you think?
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.
Looks great. Approved.
fixes #771
This PR updates the flow of self-destructing staker proxy contract. With this PR, staker(owner) can call
destructStakerProxy
on composer contract.This PR also delete ComposerInterface used in stakerProxy contract as there is no method call from staker proxy to composer.