Skip to content

Commit

Permalink
Test: Fix test names for the adminsoulbound1155 -> accessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
ogarciarevett committed Oct 25, 2024
1 parent d8f2232 commit 288687b
Show file tree
Hide file tree
Showing 17 changed files with 1,506 additions and 536 deletions.
51 changes: 40 additions & 11 deletions constants/constructor-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,32 @@ export const ERC20DecimalsAgs = {
export const RewardsArgs = {
MAINNET: {
_devWallet: '0x85f56764F58F595D08252b98942554bFB5Eea390',
_managerWallet: 'FAIL',
_minterWallet: 'FAIL',
_rewardTokenAddress: `CONTRACT_${CONTRACT_NAME.RewardAccessTokenG7}`,
},
TESTNET: {
_devWallet: 'DEPLOYER_WALLET',
_managerWallet: 'DEPLOYER_WALLET',
_minterWallet: 'DEPLOYER_WALLET',
_rewardTokenAddress: `CONTRACT_${CONTRACT_NAME.RewardToken}`,
_rewardTokenAddress: `CONTRACT_${CONTRACT_NAME.RewardAccessToken}`,
},
};

export const RewardsNativeG7Args = {
MAINNET: {
_devWallet: '0x85f56764F58F595D08252b98942554bFB5Eea390',
_adminWallet: 'FAIL',
_managerWallet: 'FAIL',
_minterWallet: 'FAIL',
_rewardTokenAddress: `CONTRACT_${CONTRACT_NAME.RewardAccessTokenG7}`,
},
TESTNET: {
_devWallet: 'DEPLOYER_WALLET',
_adminWallet: 'DEPLOYER_WALLET',
_managerWallet: 'DEPLOYER_WALLET',
_minterWallet: 'DEPLOYER_WALLET',
_rewardTokenAddress: `CONTRACT_${CONTRACT_NAME.RewardAccessTokenG7}`,
},
};

Expand All @@ -305,20 +325,29 @@ export const HelloWorldArgs = {

export const RewardTokenArgs = {
MAINNET: {
_name: 'RewardToken',
_symbol: 'RT',
_defaultTokenURI: 'FILL_ME',
_contractURI: 'FILL_ME',
_name: 'AccessToken',
_symbol: 'AT',
_defaultTokenURI: 'NO_VALUE',
_contractURI: 'NO_VALUE',
_devWallet: 'DEPLOYER_WALLET',
_rewardAddress: `CONTRACT_${CONTRACT_NAME.Rewards}`,
},
TESTNET: {
_name: 'AccessToken',
_symbol: 'AT',
_defaultTokenURI: 'NO_VALUE',
_contractURI: 'NO_VALUE',
_devWallet: 'DEPLOYER_WALLET',
_rewardAddress: `CONTRACT_${CONTRACT_NAME.Rewards}`,
},
};

export const AccessTokenG7Args = {
MAINNET: {
_devWallet: 'DEPLOYER_WALLET',
_lootDropAddress: `CONTRACT_${CONTRACT_NAME.Rewards}`,
},
TESTNET: {
_name: 'RainToken',
_symbol: 'RT',
_defaultTokenURI: 'FILL_ME',
_contractURI: 'FILL_ME',
_devWallet: 'DEPLOYER_WALLET',
_lootDropAddress: `CONTRACT_${CONTRACT_NAME.Rewards}`,
},
};

Expand Down
9 changes: 6 additions & 3 deletions constants/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export enum CONTRACT_TYPE {
DETERMINISTIC_FACTORY_CONTRACT = 'DeterministicDeployFactory',
Rewards = 'Rewards',
HelloWorld = 'HelloWorld',
RewardToken = 'RewardToken',
RewardAccessToken = 'RewardAccessToken',
DirectListingExtension = 'DirectListingExtension',
Marketplace = 'Marketplace',
EnglishAuctionsExtension = 'EnglishAuctionsExtension',
Expand Down Expand Up @@ -53,7 +53,7 @@ export enum CONTRACT_FILE_NAME {
DETERMINISTIC_FACTORY_CONTRACT = 'DeterministicDeployFactory',
Rewards = 'Rewards',
HelloWorld = 'HelloWorld',
AdminERC1155Soulbound = 'AdminERC1155Soulbound',
AccessToken = 'AccessToken',
DirectListingsExtension = 'DirectListingsLogic',
ERC20 = 'MockERC20',
Marketplace = 'Marketplace',
Expand All @@ -62,6 +62,7 @@ export enum CONTRACT_FILE_NAME {
DirectListingsAddonExtension = 'DirectListingsAddon',
Martins = 'Martins',
Forwarder = 'Forwarder',
RewardsNative = 'RewardsNative',
}

export enum CONTRACT_UPGRADABLE_FILE_NAME {
Expand Down Expand Up @@ -98,7 +99,8 @@ export enum CONTRACT_NAME {
DETERMINISTIC_FACTORY_CONTRACT = 'DeterministicDeployFactory',
Rewards = 'Rewards',
HelloWorld = 'HelloWorld',
RewardToken = 'RewardToken',
RewardAccessToken = 'RewardAccessToken',
RewardAccessTokenG7 = 'RewardAccessTokenG7',
DirectListingExtension = 'DirectListingExtension',
MartinsToken = 'Martins',
Marketplace = 'Marketplace',
Expand All @@ -109,6 +111,7 @@ export enum CONTRACT_NAME {
Staker = 'Staker',
MiddlewareStaker = 'MiddlewareStakerG7',
Forwarder = 'Forwarder',
RewardsNativeG7 = 'RewardsNativeG7',
}

export enum CONTRACT_UPGRADABLE_NAME {
Expand Down
55 changes: 53 additions & 2 deletions constants/deployments/deployments-g7-testnet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { AvatarBoundV1Args, ItemBoundArgs, LevelsBoundV1Args } from '@constants/constructor-args';
import { CONTRACT_TYPE, CONTRACT_UPGRADABLE_NAME, CONTRACT_UPGRADABLE_FILE_NAME } from '@constants/contract';
import {
AccessTokenG7Args,
AvatarBoundV1Args,
ItemBoundArgs,
LevelsBoundV1Args,
RewardsNativeG7Args,
} from '@constants/constructor-args';
import {
CONTRACT_TYPE,
CONTRACT_UPGRADABLE_NAME,
CONTRACT_UPGRADABLE_FILE_NAME,
CONTRACT_FILE_NAME,
CONTRACT_NAME,
} from '@constants/contract';
import { TENANT } from '@constants/tenant';

import { DeploymentContract } from '../../types/deployment-type';
Expand Down Expand Up @@ -70,4 +82,43 @@ export const G7_TESTNET_CONTRACTS: DeploymentContract[] = [
dependencies: [CONTRACT_UPGRADABLE_NAME.Items, CONTRACT_UPGRADABLE_NAME.Avatars],
args: LevelsBoundV1Args.TESTNET,
},
{
contractFileName: CONTRACT_FILE_NAME.AccessToken,
type: CONTRACT_TYPE.RewardAccessToken,
name: CONTRACT_NAME.RewardAccessTokenG7,
chain,
networkType,
tenants: [TENANT.Game7],
verify: true,
upgradable: false,
dependencies: [],
functionCalls: [
{
contractName: CONTRACT_NAME.RewardAccessTokenG7,
functionName: 'initialize',
args: [
'AccessToken',
'AT',
'NO_VALUE',
'NO_VALUE',
'DEPLOYER_WALLET',
/* this should be the minterContract -> RewardsNativeG7 */ 'MINTER_ROLE',
],
},
],
args: AccessTokenG7Args.TESTNET,
},
{
contractFileName: CONTRACT_FILE_NAME.RewardsNative,
type: CONTRACT_TYPE.Rewards,
name: CONTRACT_NAME.RewardsNativeG7,
chain,
networkType,
tenants: [TENANT.Game7],
verify: true,
upgradable: false,
dependencies: [CONTRACT_NAME.RewardAccessTokenG7],
functionCalls: [],
args: RewardsNativeG7Args.TESTNET,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { LibItems } from "../libraries/LibItems.sol";
error AddressIsZero();
error NotOwnerOrApproved();

contract AdminERC1155Soulbound is
contract AccessToken is
ERC1155Burnable,
ERC1155Supply,
Summon1155Soulbound,
Expand Down Expand Up @@ -100,19 +100,18 @@ contract AdminERC1155Soulbound is
string memory _defaultTokenURI,
string memory _contractURI,
address devWallet,
address minter
address minterContract
) external initializer onlyRole(DEFAULT_ADMIN_ROLE) {
if (devWallet == address(0) || minter == address(0)) {
if (devWallet == address(0)) {
revert AddressIsZero();
}

_grantRole(DEFAULT_ADMIN_ROLE, devWallet);
_grantRole(MANAGER_ROLE, devWallet);
_grantRole(DEV_CONFIG_ROLE, devWallet);
_grantRole(DEV_CONFIG_ROLE, minter);
_grantRole(MINTER_ROLE, minter);

_updateWhitelistAddress(minter, true);
_grantRole(MINTER_ROLE, minterContract);
_grantRole(DEV_CONFIG_ROLE, minterContract);
_updateWhitelistAddress(minterContract, true);

name = _name;
symbol = _symbol;
Expand Down
Loading

0 comments on commit 288687b

Please sign in to comment.