-
Notifications
You must be signed in to change notification settings - Fork 2
[5.] Replacing the meowToken with zToken #117
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
Changes from 12 commits
a335e6b
951d05a
86e766f
6f3ae07
c11f696
ceee4f9
22ec8f6
ad4e75f
1d97890
95c99bc
53ab216
561d44c
7ecd641
76182b3
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 |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ docker*.tgz | |
|
|
||
| # We don't ever use the generated manifests | ||
| .openzeppelin | ||
| /.vscode | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.26; | ||
|
|
||
| import { ZToken } from "@zero-tech/z-token/contracts/ZToken.sol"; | ||
|
|
||
|
|
||
| contract ZTokenMock is ZToken { | ||
| constructor( | ||
| string memory _name, | ||
| string memory _symbol, | ||
| address _defaultAdmin, | ||
| uint48 _initialAdminDelay, | ||
| address _minter, | ||
| address _mintBeneficiary, | ||
| uint256 _initialSupplyBase, | ||
| uint16[] memory _inflationRates, | ||
| uint16 _finalInflationRate | ||
| ) ZToken( | ||
| _name, | ||
| _symbol, | ||
| _defaultAdmin, | ||
| _initialAdminDelay, | ||
| _minter, | ||
| _mintBeneficiary, | ||
| _initialSupplyBase, | ||
| _inflationRates, | ||
| _finalInflationRate | ||
| ) {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,14 @@ import { | |
| INVALID_CURVE_ERR, | ||
| MONGO_URI_ERR, | ||
| INVALID_ENV_ERR, NO_ZERO_VAULT_ERR, | ||
| INITIAL_ADMIN_DELAY_DEFAULT, | ||
| INITIAL_SUPPLY_DEFAULT, | ||
| INFLATION_RATES_DEFAULT, | ||
| FINAL_INFLATION_RATE_DEFAULT, | ||
| } from "../../../test/helpers"; | ||
| import { ethers } from "ethers"; | ||
| import { ICurvePriceConfig } from "../missions/types"; | ||
| import { MeowMainnet } from "../missions/contracts/meow-token/mainnet-data"; | ||
| import { ICurvePriceConfig, IZTokenConfig } from "../missions/types"; | ||
| import { MeowMainnet } from "../missions/contracts/z-token/mainnet-data"; | ||
|
|
||
|
|
||
| const getCustomAddresses = ( | ||
|
|
@@ -88,6 +92,14 @@ export const getConfig = async ({ | |
| zeroVaultAddressConf = process.env.ZERO_VAULT_ADDRESS; | ||
| } | ||
|
|
||
| process.env.MOCK_Z_TOKEN === "true"; | ||
|
||
| const zConfig = { | ||
| initialAdminDelay: INITIAL_ADMIN_DELAY_DEFAULT, | ||
| initialSupplyBase: INITIAL_SUPPLY_DEFAULT, | ||
| inflationRates: INFLATION_RATES_DEFAULT, | ||
| finalInflationRate: FINAL_INFLATION_RATE_DEFAULT, | ||
| }; | ||
|
|
||
| // Domain Token Values | ||
| const royaltyReceiver = process.env.ENV_LEVEL !== "dev" ? process.env.ROYALTY_RECEIVER! : zeroVaultAddressConf; | ||
| const royaltyFraction = | ||
|
|
@@ -113,8 +125,9 @@ export const getConfig = async ({ | |
| defaultRoyaltyFraction: royaltyFraction, | ||
| }, | ||
| rootPriceConfig: priceConfig, | ||
| zTokenConfig: zConfig, | ||
| zeroVaultAddress: zeroVaultAddressConf as string, | ||
| mockMeowToken: process.env.MOCK_MEOW_TOKEN === "true", | ||
| mockZToken: !!process.env.MOCK_Z_TOKEN, | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| stakingTokenAddress: process.env.STAKING_TOKEN_ADDRESS!, | ||
| postDeploy: { | ||
| tenderlyProjectSlug: process.env.TENDERLY_PROJECT_SLUG!, | ||
|
|
@@ -146,8 +159,8 @@ export const validateEnv = ( | |
| if (envLevel === "dev") return priceConfig; | ||
|
|
||
| if (envLevel === "test" || envLevel === "dev") { | ||
| if (process.env.MOCK_MEOW_TOKEN === "false" && !process.env.STAKING_TOKEN_ADDRESS) { | ||
| throw new Error("Must provide a staking token address if not mocking MEOW token in `dev` environment"); | ||
| if (!process.env.MOCK_Z_TOKEN && !process.env.STAKING_TOKEN_ADDRESS) { | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| throw new Error("Must provide a staking token address if not mocking Z token in `dev` environment"); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -172,16 +185,16 @@ export const validateEnv = ( | |
|
|
||
| // Mainnet | ||
| if (envLevel === "prod") { | ||
| requires(process.env.MOCK_MEOW_TOKEN === "false", NO_MOCK_PROD_ERR); | ||
| requires(process.env.STAKING_TOKEN_ADDRESS === MeowMainnet.address, STAKING_TOKEN_ERR); | ||
| requires(!process.env.MONGO_DB_URI.includes("localhost"), MONGO_URI_ERR); | ||
| requires(!process.env.MOCK_Z_TOKEN, NO_MOCK_PROD_ERR); | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| requires(process.env.STAKING_TOKEN_ADDRESS === MeowMainnet.address, STAKING_TOKEN_ERR); | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| if (process.env.VERIFY_CONTRACTS === "true") { | ||
| if (process.env.VERIFY_CONTRACTS) { | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| requires(!!process.env.ETHERSCAN_API_KEY, "Must provide an Etherscan API Key to verify contracts"); | ||
| } | ||
|
|
||
| if (process.env.MONITOR_CONTRACTS === "true") { | ||
| if (process.env.MONITOR_CONTRACTS) { | ||
MichaelKorchagin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| requires(!!process.env.TENDERLY_PROJECT_SLUG, "Must provide a Tenderly Project Slug to monitor contracts"); | ||
| requires(!!process.env.TENDERLY_ACCOUNT_ID, "Must provide a Tenderly Account ID to monitor contracts"); | ||
| requires(!!process.env.TENDERLY_ACCESS_KEY, "Must provide a Tenderly Access Key to monitor contracts"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.