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

feat: Adding staker upgradeable contract #74

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# DEV - ZKSYNC - LOCAL
PRIVATE_KEY="0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"
POLYGON_PROVIDER_URL="https://endpoints.omniatech.io/v1/matic/mumbai/public"
POLYGONSCAN_API_KEY="YOUR_API_KEY"
WEB3_INFURA_PROJECT_ID="PID HERE"
DIAMOND_ADDRESS="0x016FB524A14ABDd7044f91121A665ad7D0103B0f"
Expand All @@ -13,4 +14,5 @@ AUTO_VERIFY=false
ERC20_TOKEN_ADDRESS="0xA79498e38264330603F00AfEC577539B4b5D6F51"
ACHIEVO_BASE_URL="https://staging-api.achievo.xyz"
ACHIEVO_AUTH_TOKEN="token"
ENCRYPTION_KEY=""
ENCRYPTION_KEY=""
POLYGON_ALCHEMY_PROVIDER="https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}"
231 changes: 231 additions & 0 deletions .openzeppelin/polygon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0xA462B6d56d318052C6bBb9C22a56d46141C51a5B",
"txHash": "0x81262c53b6c9889d47ea7883598361266a94d3b74d3f37883ba2c9284ebf49d0"
},
"proxies": [
{
"address": "0x21c4bc3bCF9F6Cc2702b31f2d76D777733e48923",
"txHash": "0xe5198aee8a0e28ea17a743680b0ecd6b8633872cff44808cbf9eec9aaeb03b34",
"kind": "transparent"
},
{
"address": "0xf35175d46d99D573429539D41fa46dc8C89371ea",
"txHash": "0x75ba9c8fe799e3b96d0c2b3257454799c0d6216a7db75cf4d798a2e1e9bb6e60",
"kind": "transparent"
}
],
"impls": {
"08bcc47a5b1c169beb620ac16dba52a81347158d302fa518caf1e7646de484ac": {
"address": "0x2b7126D411c496C9579582e8FFbFc375F50A9957",
"txHash": "0xf20bbcb510ad768f47258dd4db0abe4c95e42a6ec6b85e6fe4eef9a401b30a42",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
},
{
"label": "_paused",
"offset": 0,
"slot": "51",
"type": "t_bool",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116"
},
{
"label": "_status",
"offset": 0,
"slot": "101",
"type": "t_uint256",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38"
},
{
"label": "__gap",
"offset": 0,
"slot": "102",
"type": "t_array(t_uint256)49_storage",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:88"
},
{
"label": "__gap",
"offset": 0,
"slot": "151",
"type": "t_array(t_uint256)50_storage",
"contract": "ERC165Upgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41"
},
{
"label": "_roles",
"offset": 0,
"slot": "201",
"type": "t_mapping(t_bytes32,t_struct(RoleData)34_storage)",
"contract": "AccessControlUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62"
},
{
"label": "__gap",
"offset": 0,
"slot": "202",
"type": "t_array(t_uint256)49_storage",
"contract": "AccessControlUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260"
},
{
"label": "whitelistSigners",
"offset": 0,
"slot": "251",
"type": "t_mapping(t_address,t_bool)",
"contract": "ERCWhitelistSignatureUpgradeable",
"src": "contracts/upgradeables/ERCWhitelistSignatureUpgradeable.sol:28"
},
{
"label": "usedSignatures",
"offset": 0,
"slot": "252",
"type": "t_mapping(t_bytes_memory_ptr,t_bool)",
"contract": "ERCWhitelistSignatureUpgradeable",
"src": "contracts/upgradeables/ERCWhitelistSignatureUpgradeable.sol:29"
},
{
"label": "__gap",
"offset": 0,
"slot": "253",
"type": "t_array(t_uint256)48_storage",
"contract": "ERCWhitelistSignatureUpgradeable",
"src": "contracts/upgradeables/ERCWhitelistSignatureUpgradeable.sol:92"
},
{
"label": "stakeToken",
"offset": 0,
"slot": "301",
"type": "t_contract(IERC20Burnable)2959",
"contract": "StakerV1",
"src": "contracts/upgradeables/StakerV1.sol:43"
},
{
"label": "regularToken",
"offset": 0,
"slot": "302",
"type": "t_contract(IERC20Decimals)2971",
"contract": "StakerV1",
"src": "contracts/upgradeables/StakerV1.sol:44"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)48_storage": {
"label": "uint256[48]",
"numberOfBytes": "1536"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_bytes_memory_ptr": {
"label": "bytes",
"numberOfBytes": "32"
},
"t_contract(IERC20Burnable)2959": {
"label": "contract IERC20Burnable",
"numberOfBytes": "20"
},
"t_contract(IERC20Decimals)2971": {
"label": "contract IERC20Decimals",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_struct(RoleData)34_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes_memory_ptr,t_bool)": {
"label": "mapping(bytes => bool)",
"numberOfBytes": "32"
},
"t_struct(RoleData)34_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "members",
"type": "t_mapping(t_address,t_bool)",
"offset": 0,
"slot": "0"
},
{
"label": "adminRole",
"type": "t_bytes32",
"offset": 0,
"slot": "1"
}
],
"numberOfBytes": "64"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
},
"t_bytes_storage": {
"label": "bytes"
}
},
"namespaces": {}
}
}
}
}
15 changes: 15 additions & 0 deletions constants/constructor-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum TENANT {
ZkSync = 'zkSync',
HyperPlay = 'HyperPlay',
Summon = 'Summon',
ETHDenver = 'ETHDenver',
}

export enum CONTRACT_TYPE {
Expand All @@ -14,6 +15,7 @@ export enum CONTRACT_TYPE {
Paymaster = 'Paymaster',
GameSummary = 'GameSummary',
ERC20 = 'ERC20',
Staker = 'Staker',
}

export interface ConstructorArgs {
Expand Down Expand Up @@ -256,3 +258,16 @@ export const GameSummaryArgs = {
_uri: 'FILL_ME',
},
};

export const StakerV1Args = {
MAINNET: {
developerAdmin: 'DEPLOYER_WALLET',
stakeToken: '0x058d96BAa6f9D16853970b333ed993aCC0c35aDd',
regularToken: '0x9ca6a77c8b38159fd2da9bd25bc3e259c33f5e39',
},
TESTNET: {
developerAdmin: 'FILL_ME',
stakeToken: 'FILL_ME',
regularToken: 'FILL_ME',
},
};
20 changes: 20 additions & 0 deletions constants/deployments/deployments-polygon-mainnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { DeploymentContract } from '../../types/deployment-type';
import { TENANT, CONTRACT_TYPE } from '../constructor-args';
import { NETWORK_TYPE, NetworkName } from '../network';

const chain = NetworkName.Polygon;
const networkType = NETWORK_TYPE.MAINNET;

export const POLYGON_MAINNET_CONTRACTS: DeploymentContract[] = [
{
contractName: 'StakerV1',
type: CONTRACT_TYPE.Staker,
chain,
networkType,
tenants: [TENANT.ETHDenver],
verify: true,
upgradable: true,
dependencies: [],
functionCalls: [],
},
];
20 changes: 20 additions & 0 deletions constants/deployments/deployments-polygon-mumbai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { DeploymentContract } from '../../types/deployment-type';
import { TENANT, CONTRACT_TYPE } from '../constructor-args';
import { NETWORK_TYPE, NetworkName } from '../network';

const chain = NetworkName.PolygonMumbai;
const networkType = NETWORK_TYPE.TESTNET;

export const POLYGON_MUMBAI_CONTRACTS: DeploymentContract[] = [
{
contractName: 'StakerV1',
type: CONTRACT_TYPE.Staker,
chain,
networkType,
tenants: [TENANT.ETHDenver],
verify: true,
upgradable: true,
dependencies: [],
functionCalls: [],
},
];
20 changes: 20 additions & 0 deletions constants/deployments/deployments-polygon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { DeploymentContract } from '../../types/deployment-type';
import { TENANT, CONTRACT_TYPE } from '../constructor-args';
import { NETWORK_TYPE, NetworkName } from '../network';

const chain = NetworkName.MantleWadsley;
const networkType = NETWORK_TYPE.TESTNET;

export const POLYGON_MUMBAI_CONTRACTS: DeploymentContract[] = [
{
contractName: 'StakerSwapV1',
type: CONTRACT_TYPE.Staker,
chain,
networkType,
tenants: [TENANT.ETHDenver],
verify: true,
upgradable: true,
dependencies: [],
functionCalls: [],
},
];
4 changes: 4 additions & 0 deletions constants/deployments/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { MANTLE_WADSLEY_CONTRACTS } from './deployments-mantle-wadsley';
import { POLYGON_MAINNET_CONTRACTS } from './deployments-polygon-mainnet';
import { POLYGON_MUMBAI_CONTRACTS } from './deployments-polygon-mumbai';
import { SEPOLIA_CONTRACTS } from './deployments-sepolia';
import { ZKSYNC_GOERLI_CONTRACTS } from './deployments-zksync-goerli';
import { ZKSYNC_MAINNET_CONTRACTS } from './deployments-zksync-mainnet';
import { ZKSYNC_SEPOLIA_CONTRACTS } from './deployments-zksync-sepolia';

export const CONTRACTS = [
...POLYGON_MAINNET_CONTRACTS,
...POLYGON_MUMBAI_CONTRACTS,
...ZKSYNC_MAINNET_CONTRACTS,
...ZKSYNC_GOERLI_CONTRACTS,
...ZKSYNC_SEPOLIA_CONTRACTS,
Expand Down
Loading
Loading