Skip to content
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

Merged
merged 2 commits into from
Oct 13, 2023
Merged

authorize enrico script #153

merged 2 commits into from
Oct 13, 2023

Conversation

KPrasch
Copy link
Member

@KPrasch KPrasch commented Oct 12, 2023

$ ape run authorize_enrico --network polygon:mumbai:infura -r ./deployment/artifacts/lynx.json

Checking plugins...

0. testnet-deployer
Or 'TEST::account_idx', where `account_idx` is in [0..{len_test_accounts}]

Select an account: 0
Enter ritual ID: 1
Enter address to authorize: 0x....

Transacting GlobalAllowList[0x7b521E78].authorize(uint32 ritualId, address[] addresses) with arguments:
	ritualId=1
	addresses=['...']
Continue Y/N? y

DynamicFeeTransaction:
  chainId: 80001
  to: ...
  from: ...
  gas: 61159
  nonce: 322
  value: 0
  data: 0x75ab31...0d4cd7
  type: 2
  maxFeePerGas: 2425000030
  maxPriorityFeePerGas: 2425000000
  accessList: []

Sign:  [y/N]: y
Enter passphrase to unlock 'testnet-deployer' []: 
Leave 'testnet-deployer' unlocked? [y/N]: y
Confirmations (1/1): 100%|████████████████████████████████████████████████████████████| 1/1 [00:04<00:00,  4.80s/it]
INFO: Confirmed 0x... (total fees paid = 148310575917385)

@KPrasch KPrasch marked this pull request as ready for review October 12, 2023 22:43
@@ -0,0 +1,22 @@
#!/usr/bin/python3
Copy link
Member

@derekpierre derekpierre Oct 12, 2023

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 use click options? We'll probably have to do something similar for tapir / mainnet.

Could do something like

ape run authorize_enrico --network polygon:mumbai:infura --registry-filepath <> --enrico <>

Copy link
Member Author

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 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened #154

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸

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)
Copy link
Member

Choose a reason for hiding this comment

The 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.

@KPrasch KPrasch merged commit 4eb503e into nucypher:main Oct 13, 2023
2 checks passed
"-e",
help="Enrico address",
type=str,
required=False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make this a multiple=True if you want to do more than one authorization for a single execution of the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants