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

Deployment Tools: Constructor Parameter and Artifact Tracking + Lynx Alpha 13 Deployent #119

Merged
merged 112 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
ce01a48
Create contracts for Lynx testnet deployment which only mocks RootApp…
derekpierre Sep 18, 2023
e3788e5
Use deployer semantics for lynx contract depoyment script.
KPrasch Sep 18, 2023
6f5e137
log mumbai deployment
KPrasch Sep 18, 2023
e4c1bed
Add ape dependencies to Pipfile for consistent environment. Relock de…
derekpierre Sep 19, 2023
a52550c
Generate registry from ape deployments.
derekpierre Sep 19, 2023
6e9cd69
Generate registry from lynx deployment and output to a file.
derekpierre Sep 19, 2023
bc094a3
Process deployment configuration file with contract variables in it.
derekpierre Sep 19, 2023
fdb4b08
Further extracts helper functionality for deployment utils
KPrasch Sep 19, 2023
88d80cb
intermediate commit for constructor parms usage in lynx script
KPrasch Sep 19, 2023
9eab251
Move deployment/registry python modules to scripts folder.
derekpierre Sep 19, 2023
5ebb1ac
Change get_constructor_params to instead by get_deployment_params and…
derekpierre Sep 19, 2023
0e81248
makes `ConstructorParameters` instances callable; assorted renaming a…
KPrasch Sep 19, 2023
faed0e5
ConstructorParameters.__call__ -> .get
KPrasch Sep 19, 2023
740642c
Rename work: ConstructorParameters -> DeploymentParameters which take…
derekpierre Sep 20, 2023
ae49437
Name contract registry output to reflect current lynx alpha-13 version.
derekpierre Sep 20, 2023
dfa87fe
Remove TODO.
derekpierre Sep 20, 2023
d80c4d3
Attempt to separate DeploymentParameters from ConstructorParameters.
derekpierre Sep 20, 2023
ea252bf
Remove publish option when executing setChildApplication during lynx …
derekpierre Sep 20, 2023
f35d14d
Allow publish to be specified during call to prepare_deployment. The …
derekpierre Sep 20, 2023
8399b1d
Code and style optimization; Use pure helper functions that do not re…
KPrasch Sep 21, 2023
81018f4
relocates constructor parameter JSON files and deployment artifacts t…
KPrasch Sep 21, 2023
c831402
Include an eager registry output filepath check to prevent unintentio…
KPrasch Sep 21, 2023
c07d970
Facility for contract registry name 'remapping'; Code optimization fo…
KPrasch Sep 21, 2023
cfa0e7e
Assorted docstrings and code style cleanup
KPrasch Sep 21, 2023
4c4cd00
Eager validation of ETHERSCAN_API_KEY length
KPrasch Sep 21, 2023
733ea89
relocates constants to constants.py
KPrasch Sep 21, 2023
74a8f6f
track deployments/artifacts
KPrasch Sep 21, 2023
115f33d
just-in-time constructor parameter name and length ABI validation
KPrasch Sep 21, 2023
effda85
perform abi input name and position validation eagerly
KPrasch Sep 21, 2023
5081b40
Only check for etherscan plugin for non-local deployments.
derekpierre Sep 21, 2023
fb996f2
Add validation of ABI types for constructor param values.
derekpierre Sep 21, 2023
7639c68
Code style cleanup.
derekpierre Sep 21, 2023
70c5f1a
Handle lists of variables when validating abi type.
derekpierre Sep 21, 2023
ee5f5e3
Require the ape-infura plugin to execute scripts (prepares for deeper…
KPrasch Sep 21, 2023
442709a
Includes GlobalAllowList in lynx deployment script
KPrasch Sep 21, 2023
0023a64
skip infura plugin check during local development
KPrasch Sep 21, 2023
0a9d66b
Add code to merge two nucypher-style registries into one.
derekpierre Sep 22, 2023
ee531ec
Spread out deployment output using newlines.
derekpierre Sep 22, 2023
3d75c81
Removes the need for locals() context by accessing deployments via ap…
KPrasch Sep 22, 2023
924c81f
Indent json when writing registry file.
derekpierre Sep 22, 2023
34c10fa
Allow merge conflict resolution options when merging two contract reg…
derekpierre Sep 22, 2023
80b3de1
lynx-alpha-13-mumbai-registry.json
KPrasch Sep 22, 2023
8ae98d0
Adds missing or incorrect AGPL 3+ licenses
KPrasch Sep 22, 2023
dfc43ae
verify lynx contracts with standalone script
KPrasch Sep 22, 2023
d60d2ad
Deletes test registry
KPrasch Sep 22, 2023
4adf739
disables default ape 'publish' feature
KPrasch Sep 22, 2023
e702438
document september 22, 2023 mumbai deployment ape versions and launch…
KPrasch Sep 22, 2023
5bf960a
manually verify contracts with etherscan
KPrasch Sep 22, 2023
4ed3249
Add script to perform merging of contract registries for lynx.
derekpierre Sep 22, 2023
7e550c2
Add print statements when calling a function on deployed lynx contract.
derekpierre Sep 23, 2023
271652b
Update LynxRootApplication to implement functions to better match the…
derekpierre Sep 23, 2023
fa1f9ec
Check whether child application is set before calling.
derekpierre Sep 25, 2023
46b5d10
Implement authorizationIncreased properly.
derekpierre Sep 25, 2023
c6bdb17
Add LynxMockRoot to use on lynx with LynxChildApplication.
derekpierre Sep 25, 2023
e53f44b
Update LynxMockRootApplication to call a child application based on I…
derekpierre Sep 25, 2023
12bc24e
Create subfolder within artifacts and constructor-params folders to p…
derekpierre Sep 25, 2023
48c43e5
Allow empty bytes parameter to be specified as a SPECIAL_VARIABLE.
derekpierre Sep 25, 2023
3ab22f2
Modify our Lynx strategy so that TACoApplication can be deployed on G…
derekpierre Sep 25, 2023
3b72f9c
Force TestnetThresholdStaking to allow authorization increases.
derekpierre Sep 25, 2023
d3c43e1
Add confirmation prompt whenever null address is a deployment parameter.
derekpierre Sep 25, 2023
30876af
Handle proxy contracts as variables in deployment params file.
derekpierre Sep 25, 2023
4e35100
Update deployment of lynx child (mumbai deployments) to use proxy con…
derekpierre Sep 25, 2023
a42d2df
Update deploy lynx root (Goerli contracts) to proxy TACoApplication a…
derekpierre Sep 25, 2023
c298816
Rename constant that represents special value variables.
derekpierre Sep 25, 2023
2ca8ece
Adds LynxStakingToken to LynxSet.sol
KPrasch Sep 25, 2023
3298e71
track taco child implementation artifacts
KPrasch Sep 25, 2023
bc20e6f
deploy LynxStakingToken on root network as omck for T
KPrasch Sep 25, 2023
620cb85
ThresholdStakingForTACoApplicationMock -> TetsnetThresholdStaking
KPrasch Sep 25, 2023
a8cb1af
updates lynx deployment parameters
KPrasch Sep 25, 2023
b0630f6
Lynx root network registry
KPrasch Sep 25, 2023
e1ff014
Lynx child network registry
KPrasch Sep 25, 2023
4a45b68
deletes stale registries
KPrasch Sep 25, 2023
7bec4ef
deployment ape versioning and run command docstring updates
KPrasch Sep 25, 2023
67f67da
modifies standalone verification script to consume a registry
KPrasch Sep 25, 2023
2cb01a0
Update command comment.
derekpierre Sep 26, 2023
5f968cf
Make read_registry and get_contract_container public so that it could…
derekpierre Sep 26, 2023
45e3fa4
Fix script to properly name proxy contract in registry after deployment.
derekpierre Sep 26, 2023
7b576a0
Update merge lynx script by improving naming/annotations.
derekpierre Sep 26, 2023
45004cd
Add script to configure lynx stakes on goerli root application.
derekpierre Sep 26, 2023
9067693
removes 'deployments' section from ape-config.yml
KPrasch Sep 26, 2023
e9dff3e
removes ape-etherscan api_key field
KPrasch Sep 26, 2023
da3ca9c
Relocates custom logic into 'deploymnets' package; Removes stale scri…
KPrasch Sep 26, 2023
e060df3
Proper verification at the end of deploy_lynx_root.
derekpierre Sep 26, 2023
77eb119
Update merge_registries to use main method.
derekpierre Sep 26, 2023
70617af
Have contracts_from_registry return a dict of contract name -> contra…
derekpierre Sep 26, 2023
1aa8b0a
Add script to configure stakes/bonding for Lynx.
derekpierre Sep 26, 2023
580a221
Rename LynxMockTACoChildApplication -> MockPolygonRoot (for Goerli) a…
derekpierre Sep 26, 2023
c15126a
Update lynx alpha-13 root registry based on update made on Goerli to …
derekpierre Sep 26, 2023
eeb9782
Rename LynxMockTACoApplication to MockPolygonChild in child registry …
derekpierre Sep 26, 2023
59c2b12
Ensure that SubscriptionManager is still included in the child registry.
derekpierre Sep 26, 2023
a82cd49
Clarify manual bridge set up on Lynx within contract comments.
derekpierre Sep 26, 2023
94f7c57
Install dependencies and don't run deployment scripts as part of CI t…
derekpierre Sep 26, 2023
ca7e27a
Relock dependencies to include ape-infura. eth-ape is limited to <=0.…
derekpierre Sep 26, 2023
0ad8570
Add script to confirm operator addresses for Lynx nodes.
derekpierre Sep 26, 2023
34b5371
Update configure_staking script to use LYNX_NODES constant.
derekpierre Sep 26, 2023
dc9ffe1
Relock dependencies again - last relock seemed to use incorrect depen…
derekpierre Sep 26, 2023
49dd3e5
Use ape's ZERO_ADDRESS instead of local NULL_ADDRESS
KPrasch Sep 27, 2023
53838f7
use enviorment variables key names directly from ape plugins instead …
KPrasch Sep 27, 2023
9b396e3
Handle arbitrary bytes values as consructor parameters with hex.
KPrasch Sep 27, 2023
586f106
removes unused constant PODUCTION_ENVIORMENTS
KPrasch Sep 27, 2023
909cefc
Code reorg for handling of special variables; Stub for deployer accou…
KPrasch Sep 27, 2023
60b9e59
set updated special variables into constructor params
KPrasch Sep 27, 2023
682c3c0
Abstracts deployment into integrated Deployer object (formerly ApeDep…
KPrasch Sep 27, 2023
9b6ee71
Ingests ConstructorParameters into Deployer
KPrasch Sep 27, 2023
92541a7
(optionally) Ingest interactive account selection into Deployer
KPrasch Sep 27, 2023
2856a3b
Divides pre-deployment plugin and registry checks
KPrasch Sep 27, 2023
6164188
Utility functions for deployment scripting initilization functons and…
KPrasch Sep 27, 2023
b9d82dd
internalize registry success message into registry_from_ape_deployments.
KPrasch Sep 27, 2023
34b586b
improves proxy wrapping console log message
KPrasch Sep 27, 2023
1824eda
Have Deployer.transact take the contract instance to improve messaging.
derekpierre Sep 27, 2023
f403c5b
Validate transaction function ABIs, and humanize transaction argument…
KPrasch Sep 27, 2023
7688e60
Create Transactor class (parent of Deployer) for transaction executio…
derekpierre Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ black = "*"
coincurve = "*"
cryptography = "*"
eth-ape = "*"
# TODO eventually change to official release, issue #82, once fix is available
ape-solidity = ">=0.6.5"
ape-etherscan = "*"
ape-polygon = "*"
cygnusv marked this conversation as resolved.
Show resolved Hide resolved
flake8 = "*"
isort = "*"
nucypher-core = "*"
Expand Down
5,061 changes: 2,589 additions & 2,472 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions contracts/contracts/TestnetThresholdStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ contract TestnetThresholdStaking is Ownable {
return 0;
}

function authorizationIncreased(
address _stakingProvider,
uint96 _fromAmount,
uint96 _toAmount
) external onlyOwner {
application.authorizationIncreased(_stakingProvider, _fromAmount, _toAmount);
}

function setRoles(
address _stakingProvider,
address _owner,
Expand Down
2 changes: 2 additions & 0 deletions contracts/contracts/coordination/GlobalAllowList.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControlDefaultAdminRules.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
Expand Down
2 changes: 2 additions & 0 deletions contracts/contracts/coordination/IEncryptionAuthorizer.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;

interface IEncryptionAuthorizer {
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/coordination/TACoChildApplication.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;

Expand Down
84 changes: 84 additions & 0 deletions contracts/contracts/testnet/LynxSet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
cygnusv marked this conversation as resolved.
Show resolved Hide resolved

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "../coordination/ITACoRootToChild.sol";
import "../coordination/ITACoChildToRoot.sol";
import "../coordination/TACoChildApplication.sol";
import "../TACoApplication.sol";

contract LynxMockTACoChildApplication is Ownable, ITACoChildToRoot {
ITACoChildToRoot public immutable rootApplication;

constructor(ITACoChildToRoot _rootApplication) {
require(
address(_rootApplication) != address(0),
"Address for root application must be specified"
);
rootApplication = _rootApplication;
}

function confirmOperatorAddress(address operator) external override onlyOwner {
rootApplication.confirmOperatorAddress(operator);
}
}

// Goerli <---------> Mumbai ....
// LynxTACoApplication LynxMockTACoApplication <---> LynxTACoChildApplication
//
//
// Registry:
// ^ TACoApplication
// ^ TACoChildApplication
contract LynxMockTACoApplication is Ownable, ITACoChildToRoot, ITACoRootToChild {
ITACoRootToChild public childApplication;

function setChildApplication(ITACoRootToChild _childApplication) external onlyOwner {
childApplication = _childApplication;
}

function updateOperator(
address _stakingProvider,
address _operator
) external override onlyOwner {
childApplication.updateOperator(_stakingProvider, _operator);
}

function updateAuthorization(
address _stakingProvider,
uint96 _amount
) external override onlyOwner {
childApplication.updateAuthorization(_stakingProvider, _amount);
}

// solhint-disable-next-line no-empty-blocks
function confirmOperatorAddress(address _operator) external override {}
}

contract LynxTACoChildApplication is TACoChildApplication, Ownable {
constructor(ITACoChildToRoot _rootApplication) TACoChildApplication(_rootApplication) {}

function setCoordinator(address _coordinator) external onlyOwner {
require(_coordinator != address(0), "Coordinator must be specified");
require(
address(Coordinator(_coordinator).application()) == address(this),
"Invalid coordinator"
);
coordinator = _coordinator;
}
}

contract LynxRitualToken is ERC20("LynxRitualToken", "LRT") {
constructor(uint256 _totalSupplyOfTokens) {
_mint(msg.sender, _totalSupplyOfTokens);
}
}

contract LynxStakingToken is ERC20("LynxStakingToken", "LST") {
constructor(uint256 _totalSupplyOfTokens) {
_mint(msg.sender, _totalSupplyOfTokens);
}
}
2 changes: 1 addition & 1 deletion contracts/threshold/ITACoChildApplication.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;

Expand Down
3 changes: 2 additions & 1 deletion contracts/xchain/PolygonChild.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;

import "@fx-portal/contracts/tunnel/FxBaseChildTunnel.sol";
Expand Down
3 changes: 2 additions & 1 deletion contracts/xchain/PolygonRoot.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.0;

import "@fx-portal/contracts/tunnel/FxBaseRootTunnel.sol";
Expand Down
Loading
Loading