Implement admin container and pausable contracts #759
Merged
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.
fixes #718
fixes #675
This PR is quite big, but it's mainly additive code. It creates an administrator container from which one can call all of the 'onlyOwner' functions in the polygon-nightfall smart contracts (except for registering a new verifying key, which shouldn't be a manual process). Currently we have no simple way to call these functions. It also adds a 'pausable' interface to our critical contracts (
State
,Shield
) so that these can be paused (frozen) in the event of an attack.Testing is manual (this may change in future but there isn't time now) but easy:
./start-nightfall -g -s -d
). This will now also create anadmin
container.docker-compose exec administrator bash
../admin
).docker-compose.ganache.yml
. The owner key is the first of the four listed there. You can use the others to test some of the functions that require private keys. The key will be remembered until you exit the./admin
application.Most of the actions will emit an event which will be picked up (and then ignored) by
optimist
so that you can tell if the call has worked. Note thatclient
will see events emitted by theState
contract but not theShield
contract because it doesn't listen to that.