Skip to content

Commit

Permalink
Merge pull request #80 from lets-fucking-game/dev
Browse files Browse the repository at this point in the history
feat: add updating game feature
  • Loading branch information
0xGeegZ authored Nov 30, 2022
2 parents 05b7d78 + 665268b commit 7f2c49e
Show file tree
Hide file tree
Showing 88 changed files with 2,010 additions and 1,160 deletions.
4 changes: 2 additions & 2 deletions packages/dapp/src/components/Loader/PageLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components'
import { Spinner } from '@pancakeswap/uikit'
import Loading from 'components/Loading'
import Page from '../Layout/Page'

const Wrapper = styled(Page)`
Expand All @@ -11,7 +11,7 @@ const Wrapper = styled(Page)`
const PageLoader: React.FC<React.PropsWithChildren<unknown>> = () => {
return (
<Wrapper>
<Spinner />
<Loading />
</Wrapper>
)
}
Expand Down
3 changes: 2 additions & 1 deletion packages/dapp/src/config/constants/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const getPathList = (t: ContextApi['t']): PathList => {
'/': { title: t('Home') },
'/games': { title: t('Games') },
'/game': { title: t('Game') },
'/create-game': { title: t('Create Game') },
'/game/:id/update': { title: t('Update Game') },
'/game/create': { title: t('Create Game') },
},
defaultTitleSuffix: t("Let's F*#@$* Game"),
}
Expand Down
19 changes: 6 additions & 13 deletions packages/dapp/src/config/internal/gameConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import { BigNumber } from '@ethersproject/bignumber'
import { parseEther } from '@ethersproject/units'

export const range = (start, end) =>
Array.from(Array(end + 1).keys()).slice(start)
export const range = (start, end) => Array.from(Array(end + 1).keys()).slice(start)

const randomNumber = () => {
return Math.floor(Math.random() * (10000 - 1) + 1)
Expand Down Expand Up @@ -60,9 +59,7 @@ export const defaultGameConfig: GameConfig = {

REGISTRATION_AMOUNT_DEFAULT: parseEther('0.0001'),
REGISTRATION_AMOUNT_FREE: parseEther('0'),
AUTHORIZED_REGISTRATION_AMOUNTS: [
0, 0.0001, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.5, 2, 5, 10,
],
AUTHORIZED_REGISTRATION_AMOUNTS: [0, 0.0001, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.5, 2, 5, 10],

PRIZEPOOL_NUMBER: 0.01,
PRIZEPOOL_AMOUNT: parseEther('0.01'),
Expand All @@ -72,11 +69,11 @@ export const defaultGameConfig: GameConfig = {

PRIZETYPE: ['ERC20', 'ERC721', 'ERC1155'],

TREASURY_FEE_DEFAULT: 100,
TREASURY_FEE_DEFAULT: 300,
TREASURY_FEE_MIN: 0,
TREASURY_FEE_MAX: 100,
AUTHORIZED_TREASURY_FEE: [...range(3, 10)],
CREATOR_FEE_DEFAULT: 300,
CREATOR_FEE_DEFAULT: 100,
CREATOR_FEE_MIN: 0,
CREATOR_FEE_MAX: 500,
AUTHORIZED_CREATOR_FEE: [...range(0, 5)],
Expand All @@ -88,9 +85,7 @@ export const gameConfig: Record<string, GameConfig | null> = {
'56': {
...defaultGameConfig,
GAME_CREATION_AMOUNT: parseEther('0.5'),
AUTHORIZED_REGISTRATION_AMOUNTS: [
0, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.5, 2, 5, 10,
],
AUTHORIZED_REGISTRATION_AMOUNTS: [0, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.5, 2, 5, 10],
REGISTRATION_AMOUNT_DEFAULT: parseEther('0.1'),
},
'97': {
Expand All @@ -109,9 +104,7 @@ export const gameConfig: Record<string, GameConfig | null> = {
GAME_CREATION_AMOUNT: parseEther('0.01'),
// GAME_CREATION_AMOUNT: parseEther('50'),
PLAYERS_DEFAULT: 5,
AUTHORIZED_REGISTRATION_AMOUNTS: [
0, 0.0001, 0.5, 1, 2, 5, 10, 100, 200, 250,
],
AUTHORIZED_REGISTRATION_AMOUNTS: [0, 0.0001, 0.5, 1, 2, 5, 10, 100, 200, 250],
},
}

Expand Down
35 changes: 35 additions & 0 deletions packages/dapp/src/config/types/typechain/contracts/GameV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export interface GameV1Interface extends utils.Interface {
"setEncodedCron(string)": FunctionFragment;
"setMaxPlayers(uint256)": FunctionFragment;
"setName(bytes32)": FunctionFragment;
"setPlayTimeRange(uint256)": FunctionFragment;
"setTreasuryFee(uint256)": FunctionFragment;
"startGame()": FunctionFragment;
"transferAdminOwnership(address)": FunctionFragment;
Expand Down Expand Up @@ -306,6 +307,7 @@ export interface GameV1Interface extends utils.Interface {
| "setEncodedCron"
| "setMaxPlayers"
| "setName"
| "setPlayTimeRange"
| "setTreasuryFee"
| "startGame"
| "transferAdminOwnership"
Expand Down Expand Up @@ -457,6 +459,10 @@ export interface GameV1Interface extends utils.Interface {
functionFragment: "setName",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "setPlayTimeRange",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "setTreasuryFee",
values: [PromiseOrValue<BigNumberish>]
Expand Down Expand Up @@ -601,6 +607,10 @@ export interface GameV1Interface extends utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setName", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setPlayTimeRange",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setTreasuryFee",
data: BytesLike
Expand Down Expand Up @@ -1163,6 +1173,11 @@ export interface GameV1 extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1364,6 +1379,11 @@ export interface GameV1 extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1555,6 +1575,11 @@ export interface GameV1 extends BaseContract {
overrides?: CallOverrides
): Promise<void>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
Expand Down Expand Up @@ -1912,6 +1937,11 @@ export interface GameV1 extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -2102,6 +2132,11 @@ export interface GameV1 extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export interface GameV1InterfaceInterface extends utils.Interface {
"setEncodedCron(string)": FunctionFragment;
"setMaxPlayers(uint256)": FunctionFragment;
"setName(bytes32)": FunctionFragment;
"setPlayTimeRange(uint256)": FunctionFragment;
"setTreasuryFee(uint256)": FunctionFragment;
"startGame()": FunctionFragment;
"transferAdminOwnership(address)": FunctionFragment;
Expand Down Expand Up @@ -265,6 +266,7 @@ export interface GameV1InterfaceInterface extends utils.Interface {
| "setEncodedCron"
| "setMaxPlayers"
| "setName"
| "setPlayTimeRange"
| "setTreasuryFee"
| "startGame"
| "transferAdminOwnership"
Expand Down Expand Up @@ -358,6 +360,10 @@ export interface GameV1InterfaceInterface extends utils.Interface {
functionFragment: "setName",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "setPlayTimeRange",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "setTreasuryFee",
values: [PromiseOrValue<BigNumberish>]
Expand Down Expand Up @@ -450,6 +456,10 @@ export interface GameV1InterfaceInterface extends utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setName", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setPlayTimeRange",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setTreasuryFee",
data: BytesLike
Expand Down Expand Up @@ -921,6 +931,11 @@ export interface GameV1Interface extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1052,6 +1067,11 @@ export interface GameV1Interface extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1173,6 +1193,11 @@ export interface GameV1Interface extends BaseContract {
overrides?: CallOverrides
): Promise<void>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
Expand Down Expand Up @@ -1474,6 +1499,11 @@ export interface GameV1Interface extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1612,6 +1642,11 @@ export interface GameV1Interface extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

setPlayTimeRange(
_playTimeRange: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

setTreasuryFee(
_treasuryFee: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const _abi = [
];

const _bytecode =
"0x608060405234801561001057600080fd5b5061023e806100206000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318160ddd811461005b57806370a0823114610082578063a9059cbb146100b0575b600080fd5b34801561006757600080fd5b506100706100f5565b60408051918252519081900360200190f35b34801561008e57600080fd5b5061007073ffffffffffffffffffffffffffffffffffffffff600435166100fb565b3480156100bc57600080fd5b506100e173ffffffffffffffffffffffffffffffffffffffff60043516602435610123565b604080519115158252519081900360200190f35b60005481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b33600090815260016020526040812054610143908363ffffffff6101ed16565b336000908152600160205260408082209290925573ffffffffffffffffffffffffffffffffffffffff851681522054610182908363ffffffff6101ff16565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000828211156101f957fe5b50900390565b8181018281101561020c57fe5b929150505600a165627a7a723058201d31d6ba28793df76a1fc5ac28ef17e84c171549fe4fdff783fe871eaa33ad750029";
"0x608060405234801561001057600080fd5b5061038e806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a9059cbb146100de575b600080fd5b34801561006857600080fd5b50610071610143565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610149565b6040518082815260200191505060405180910390f35b3480156100ea57600080fd5b50610129600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610192565b604051808215151515815260200191505060405180910390f35b60005481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006101e682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461032d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061027b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461034690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561033b57fe5b818303905092915050565b6000818301905082811015151561035957fe5b809050929150505600a165627a7a723058209331fa707938f7ca0e52bf3a62c3b191026670c8ff8375575cd6e851816f39820029";

type BasicTokenConstructorParams =
| [signer?: Signer]
Expand Down
Loading

1 comment on commit 7f2c49e

@vercel
Copy link

@vercel vercel bot commented on 7f2c49e Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.