-
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
Deployment Tools: Constructor Parameter and Artifact Tracking + Lynx Alpha 13 Deployent #119
Conversation
…lication. Create deployment script for Lynx testnet.
c14f07f
to
6f5e137
Compare
Derive json configuration file to provide constructor params to contracts for deployment scripts.
Co-authored-by: Kieran Prasch <[email protected]>
Fix parameters to deploy() command to include ContractContainer value. Add check_etherscan_plugin to utils Rename ConstructorParams to DeploymentConfig; get_params to get_constructor_params.
Deployment now works locally, as of 9eab251. You can run locally: $ ape run deploy_lynx --network ethereum:local:test when prompted for an account use Example output: [145] → ape run deploy_lynx --network ethereum:local:test
WARNING: ...
0. deployer
Or 'TEST::account_idx', where `account_idx` is in [0..{len_test_accounts}]
Select an account: TEST::0
(i) No constructor parameters for LynxRootApplication; proceeding
SUCCESS: Contract 'LynxRootApplication' deployed to: 0x274b028b03A250cA03644E6c578D81f019eE1323
Resolved constructor parameters for LynxTACoChildApplication
_rootApplication=0x274b028b03A250cA03644E6c578D81f019eE1323
Continue Y/N? y
SUCCESS: Contract 'LynxTACoChildApplication' deployed to: 0xBcF7FFFD8B256Ec51a36782a52D0c34f6474D951
Resolved constructor parameters for LynxRitualToken
_totalSupplyOfTokens=10000000000000000000000000
Continue Y/N? y
SUCCESS: Contract 'LynxRitualToken' deployed to: 0x4B3E65104805A303c274f078127D5a7E9F9b47b2
Resolved constructor parameters for Coordinator
_application=0xBcF7FFFD8B256Ec51a36782a52D0c34f6474D951
_timeout=3600
_maxDkgSize=4
_admin=0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600
_currency=0x4B3E65104805A303c274f078127D5a7E9F9b47b2
_feeRatePerSecond=1
Continue Y/N? y
SUCCESS: Contract 'Coordinator' deployed to: 0x6Af9BB9Cf7307AC439cc7E37859bdD844874ebc1 |
… use contract container as first entry so that it isn't repeated in the deployment script.
…nd reorg of constructor parameter utilities
a237bf5
to
0e81248
Compare
…s constructor_parameters.
…kwargs can now be obtained from ApeDeploymentParameters (formerly DeploymentParameters)
…quire state, ensure named return values, more type hints, and inline commentary.
…nal artifact destruction
…dency versions for some reason.
…of local constants.
…loymentParameters) with added variable suport.
50da098
to
34b586b
Compare
Space out actions in deployment scripts for clarity.
… confirmation messages during deployment.
…n and includes validation and annotated information. Use Transactor in scripts which only perform transactions based on already deployed contracts i.e. no fresh deployments. Update configure_staking script to use MockPolygonChild entry from child registry.
For reviewers: I know that @KPrasch and I have been making rapid code updates to this PR, 😅, but we are now enacting a PR freeze unless there are RFCs. We intend to leave the functionality as is - and any new functionality will be done in follow-up PRs. This PR provides a great base for future work. |
"TransparentUpgradeableProxy": { | ||
"_logic": "$TACoApplication", | ||
"admin_": "$ProxyAdmin", | ||
"_data": "$bytes:0x" |
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.
Still thinks that in the same way the parser needs to process "$bytes:0x"
into b""
, it would be simpler to try to process ""
into b""
, since we already know the type of _data
. In any case, not for this PR. We can definitely accept current version.
def verify_contracts(contracts: List[ContractInstance]) -> None: | ||
explorer = networks.provider.network.explorer | ||
for instance in contracts: | ||
print(f"(i) Verifying {instance.contract_type.name}...") |
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.
☝️
|
||
|
||
def _validate_transaction_args(args: typing.Tuple[Any, ...], abi) -> typing.Dict[str, Any]: | ||
"""Validates the transaction arguments against the function ABI.""" |
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 think this is already performed by either web3py or perhaps ape.
@@ -308,21 +300,52 @@ def resolve(self, contract_name: str) -> OrderedDict: | |||
return result | |||
|
|||
|
|||
class Deployer: | |||
class Transactor: |
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.
Consider repurposing this class to wrap the ape project instead, so you can maintain the same ape syntax for transactions (plus any additional processing you want):
from nucypher.ape import project
...
project.Contract[-1].method(param1, param2, sender=alice, interactive=True)
and in nucypher.ape
:
from ape import project
project = Transactor(project)
In any case, not a blocker for this PR.
Required Approvals
3
What this does
This PR introduces a comprehensive short and long-term solution for contract constructor parameters, scripting, and artifact tracking.
authorizationIncreased
toTestnetThresholdStaking
SPDX-License-Identifier: AGPL-3.0-or-later
Issues
mumbai
appears twice in deployments config #88Notes for reviewers