-
Notifications
You must be signed in to change notification settings - Fork 11
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
authorize enrico script #153
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/python3 | ||
|
||
|
||
from ape import project | ||
from eth_utils import to_checksum_address | ||
|
||
from deployment.constants import ARTIFACTS_DIR | ||
from deployment.params import Transactor | ||
from deployment.registry import contracts_from_registry | ||
from deployment.utils import check_plugins | ||
|
||
REGISTRY_FILEPATH = ARTIFACTS_DIR / "lynx.json" | ||
|
||
|
||
def main(): | ||
check_plugins() | ||
transactor = Transactor() | ||
deployments = contracts_from_registry(filepath=REGISTRY_FILEPATH) | ||
global_allow_list = deployments[project.GlobalAllowList.contract_type.name] | ||
ritual_id = int(input("Enter ritual ID: ")) | ||
addresses = [to_checksum_address(input("Enter address to authorize: "))] | ||
transactor.transact(global_allow_list.authorize, ritual_id, addresses) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this could be done as part of #154 as well, but should we check global_allow_list.isAddressAuthorized(...) first to potentially save some gas in case enrico is already authorized. Similar to what we do here - https://github.com/nucypher/nucypher/blob/development/scripts/hooks/nucypher_dkg.py#L336. Just something to think about. |
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.
What do you think about moving this script to the common set of scripts
scripts/
and useclick
options? We'll probably have to do something similar fortapir
/mainnet
.Could do something like
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.
sounds like a great idea 👍🏻 we're gonna need documentation 😅
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.
opened #154
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.
✔️