Skip to content

Commit

Permalink
Merge pull request nucypher#251 from derekpierre/tapir-amoy
Browse files Browse the repository at this point in the history
Migrate Tapir from Polygon Mumbai to Polygon Amoy
  • Loading branch information
derekpierre authored Apr 9, 2024
2 parents f01d2c5 + f5c2f83 commit 410f621
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 256 deletions.
526 changes: 285 additions & 241 deletions deployment/artifacts/tapir.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ artifacts:

constants:
# See deployment/artifacts/tapir.json
COORDINATOR_PROXY: "0xdED71c37e4e17aF2c825c2A4441Dd6BF5A98D194"
COORDINATOR_PROXY: "0xE690b6bCC0616Dc5294fF84ff4e00335cA52C388"

# tapir deployer account
EXECUTOR: "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600"
Expand Down
8 changes: 4 additions & 4 deletions deployment/constructor_params/tapir/upgrade-child.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
deployment:
name: tapir-child-upgrade
chain_id: 80001
chain_id: 80002

artifacts:
dir: ./deployment/artifacts/
filename: tapir-child-upgrade.json

constants:
FORTY_THOUSAND_TOKENS_IN_WEI_UNITS: 40000000000000000000000
MOCK_POLYGON_CHILD: "0xBD367FeeB095D6612724814E27F3fbc7BCCFd80D"
TAPIR_RITUAL_TOKEN: "0xc154D3D874664792c145d055Cc0C3BC961a75aA6"
MOCK_POLYGON_CHILD: "0x970b5f6A299813cA9DC45Be8446929b6513903f9"
TAPIR_RITUAL_TOKEN: "0xf91afFE7cf1d9c367Cb56eDd70C0941a4E8570d9"

contracts:
- TACoChildApplication:
Expand All @@ -18,6 +18,6 @@ contracts:
_minimumAuthorization: $FORTY_THOUSAND_TOKENS_IN_WEI_UNITS
- Coordinator:
constructor:
_application: "0x3a0Cd9EeF5A812Dc62f81D3b705daAf21561E33c"
_application: "0x489287Ed5BdF7a35fEE411FBdCc47331093D0769"
_currency: $TAPIR_RITUAL_TOKEN
_feeRatePerSecond: 1
11 changes: 6 additions & 5 deletions scripts/tapir/configure_staking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python3

from ape import networks, project

from deployment.constants import ARTIFACTS_DIR, TAPIR_NODES
from deployment.params import Transactor
from deployment.registry import contracts_from_registry
Expand Down Expand Up @@ -45,10 +46,10 @@ def configure_sepolia_root(transactor: Transactor) -> int:
return min_stake_size


def configure_mumbai_root(transactor: Transactor, stake_size: int):
"""Configures MockTACoApplication on Mumbai."""
# Set up Tapir stakes on Mumbai
poly_network = networks.polygon.mumbai
def configure_amoy_root(transactor: Transactor, stake_size: int):
"""Configures MockTACoApplication on Amoy."""
# Set up Tapir stakes on Amoy
poly_network = networks.polygon.amoy
with poly_network.use_provider("infura"):
deployments = contracts_from_registry(
filepath=TAPIR_REGISTRY_FILEPATH, chain_id=poly_network.chain_id
Expand All @@ -72,4 +73,4 @@ def main():
check_plugins()
transactor = Transactor()
stake_size = configure_sepolia_root(transactor)
configure_mumbai_root(transactor, stake_size)
configure_amoy_root(transactor, stake_size)
8 changes: 8 additions & 0 deletions scripts/tapir/deploy_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def main():
ape-polygon 0.6.6
ape-solidity 0.6.9
eth-ape 0.6.19
April 2nd, 2024
ape run tapir deploy_child --network polygon:amoy:infura
ape-etherscan 0.7.0
ape-infura 0.7.2
ape-polygon 0.7.2
ape-solidity 0.7.1
eth-ape 0.7.7
"""

deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY)
Expand Down
4 changes: 2 additions & 2 deletions scripts/tapir/upgrade_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

def main():
"""
This script upgrades TACoChildApplication and Coordinator on Tapir/Mumbai.
This script upgrades TACoChildApplication and Coordinator on Tapir/Amoy.
"""

deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY)
instances = contracts_from_registry(filepath=ARTIFACTS_DIR / "tapir.json", chain_id=80001)
instances = contracts_from_registry(filepath=ARTIFACTS_DIR / "tapir.json", chain_id=80002)

child_application = deployer.upgrade(
project.TACoChildApplication,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const domainRegistry: Record<string, ContractRegistry> = {

export type Domain = "mainnet" | "oryx" | "tapir" | "lynx";

export type ChainId = 1 | 5 | 137 | 80001 | 80002;
export type ChainId = 1 | 5 | 137 | 80002;

export type ChecksumAddress = `0x${string}`;

Expand Down
4 changes: 2 additions & 2 deletions test/registry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChainId, type ContractName, contractNames, type Domain, getContract } f

const testCases: Array<[string, number, ContractName]> = contractNames.flatMap((contract) => [
["lynx", 80002, contract],
["tapir", 80001, contract],
["tapir", 80002, contract],
["mainnet", 137, contract],
]);

Expand Down Expand Up @@ -37,7 +37,7 @@ describe("registry", () => {

it("should return different contract addresses for different domains", () => {
const contractAddress1 = getContract("lynx", 80002, "Coordinator");
const contractAddress2 = getContract("tapir", 80001, "Coordinator");
const contractAddress2 = getContract("tapir", 80002, "Coordinator");
expect(contractAddress1).not.toEqual(contractAddress2);
});
});

0 comments on commit 410f621

Please sign in to comment.