Skip to content

Commit

Permalink
feat: redploy and configure game controller
Browse files Browse the repository at this point in the history
  • Loading branch information
RasenGUY committed Dec 5, 2023
1 parent b120cb8 commit a356dc3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions deployed-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"address": "0x0000000000000000000000000000000000000000"
},
"WegaGameController": {
"address": "0x4114E9Fcb0D2Ba2480A6041CDEaBe315dc5063b4",
"address": "0x15aeA3c65Cec3F7525e611fd12D6476439aF789b",
"legacyAddresses": [],
"deploymentBlock": null,
"implementation": "0x5911a010941F892FB150AA83A65A327bAa7c12C0"
"implementation": "0x721059fe3dd1c18d1926Eb36Ed792008339e4Ba9"
},
"WegaRandomizerController": {
"address": "0x724611c7dEB9a9D753aDDFF2f305c902FCbA02C8",
Expand Down
2 changes: 1 addition & 1 deletion src/components/CreateGameCard/CreateCoinFlipGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const CreateCoinFlipGameCard = ({
/>
<NormalText tw="dark:text-shinishi">{wagerUSDValue.loading ? 'loading...' : wagerUSDValue.value} USD</NormalText>
<SmallText> Balance: {
isWagerbalanceLoading ? "Retrieving balance..." : userWagerBalance?.formatted
isWagerbalanceLoading ? "Retrieving balance..." : parseFloat(userWagerBalance?.formatted as string).toFixed(2)
} </SmallText>
{/* useBalance from wagmi can be used here */}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/CreateGameCard/CreateDiceGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export const CreateDiceGameCard = ({

const navigateToGameUi = useNavigateTo()
useEffect(() => {
console.log(userWagerBalance)

if(playerAddress && tokenAddress){
allowanceQuery.refetch();
if(createGameStatus === 'fulfilled' && createGameResponse) {
Expand Down Expand Up @@ -194,7 +196,7 @@ export const CreateDiceGameCard = ({
{/* should receive wager amount as input */}
<NormalText tw="dark:text-shinishi">{wagerUSDValue.loading ? 'loading...' : wagerUSDValue.value} USD</NormalText>
<SmallText> Balance: {
isWagerbalanceLoading ? "Retrieving balance..." : userWagerBalance ? userWagerBalance?.formatted : String(0)
isWagerbalanceLoading ? "Retrieving balance..." : userWagerBalance ? parseFloat(userWagerBalance?.formatted as string).toFixed(2) : String(0)
} </SmallText>
{/* useBalance from wagmi can be used here */}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/JoinGameCard/JoinCoinFlipGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const JoinCoinFlipGameCard = ({
/>
<NormalText tw="dark:text-shinishi">{wagerUSDValue.loading ? 'loading...' : wagerUSDValue.value} USD</NormalText>
<SmallText> Balance: {
isWagerbalanceLoading ? "Retrieving balance..." : userWagerBalance?.formatted + ' ' + userWagerBalance?.symbol
isWagerbalanceLoading ? "Retrieving balance..." : parseFloat(userWagerBalance?.formatted as string).toFixed(2)
} </SmallText>
{/* useBalance from wagmi can be used here */}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/JoinGameCard/JoinDiceGamecard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const JoinGameDiceCard: React.FC<JoinDiceGameCardProps> = ({
/>
<NormalText tw="dark:text-shinishi">{wagerUSDValue.loading ? 'loading...' : wagerUSDValue.value} USD</NormalText>
<SmallText> Balance: {
isWagerbalanceLoading ? "Retrieving balance..." : userWagerBalance?.formatted + ' ' + userWagerBalance?.symbol
isWagerbalanceLoading ? "Retrieving balance..." : parseFloat(userWagerBalance?.formatted as string).toFixed(2)
} </SmallText>
{/* useBalance from wagmi can be used here */}
</div>
Expand Down
17 changes: 7 additions & 10 deletions src/hooks/useCreateGameParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ export function useCreateGameParams({

useEffect(() => {
if(wallet && wallet.isConnected && user && network) {
if(!(getTokenAddress() && getPlayerAddress() && getUserUuid())) {
setTokenAddress(SupportedWagerTokenAddresses[currencyType][network?.id as number] as HexishString);
setPlayerAddress(wallet.address as HexishString);
setUserUuid(user.uuid as string);
}
setTokenAddress(SupportedWagerTokenAddresses[currencyType][network?.id as number] as HexishString);
setPlayerAddress(wallet.address as HexishString);
setUserUuid(user.uuid as string);
setTokenAddress(SupportedWagerTokenAddresses[currencyType][network?.id as number] as HexishString);
} else {
if(getTokenAddress() && getPlayerAddress() && getUserUuid()) {
setTokenAddress(SupportedWagerTokenAddresses[currencyType][network?.id as number] as HexishString);
setPlayerAddress(undefined);
setUserUuid(undefined);
}
setTokenAddress(SupportedWagerTokenAddresses[currencyType][network?.id as number] as HexishString);
setPlayerAddress(undefined);
setUserUuid(undefined);
}
}, [network?.id, wallet?.isConnected, user?.uuid, currencyType]);
return {
Expand Down
10 changes: 5 additions & 5 deletions src/utils/abis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/[email protected] on 12/5/2023 at 1:37:37 PM
// Generated by @wagmi/[email protected] on 12/5/2023 at 3:08:33 PM

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AccessControlUpgradeable
Expand Down Expand Up @@ -4649,7 +4649,7 @@ export const wegaFeeAdminRoleABI = [
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x4114E9Fcb0D2Ba2480A6041CDEaBe315dc5063b4)
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x15aeA3c65Cec3F7525e611fd12D6476439aF789b)
* -
* - [__View Contract on Polygon Mumbai Polygon Scan__](https://mumbai.polygonscan.com/address/0x39e851282C11AefE20B149F4509702B2DC8aEB73)
* - [__View Contract on Skale Calypso Nft Hub Testnet Skale Explorer__](https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com/address/0x0000000000000000000000000000000000000000)
Expand Down Expand Up @@ -5164,20 +5164,20 @@ export const wegaGameControllerABI = [
] as const

/**
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x4114E9Fcb0D2Ba2480A6041CDEaBe315dc5063b4)
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x15aeA3c65Cec3F7525e611fd12D6476439aF789b)
* -
* - [__View Contract on Polygon Mumbai Polygon Scan__](https://mumbai.polygonscan.com/address/0x39e851282C11AefE20B149F4509702B2DC8aEB73)
* - [__View Contract on Skale Calypso Nft Hub Testnet Skale Explorer__](https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com/address/0x0000000000000000000000000000000000000000)
*/
export const wegaGameControllerAddress = {
137: "0x4114E9Fcb0D2Ba2480A6041CDEaBe315dc5063b4",
137: "0x15aeA3c65Cec3F7525e611fd12D6476439aF789b",
1337: "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE",
80001: "0x39e851282C11AefE20B149F4509702B2DC8aEB73",
344106930: "0x0000000000000000000000000000000000000000"
} as const

/**
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x4114E9Fcb0D2Ba2480A6041CDEaBe315dc5063b4)
* - [__View Contract on Polygon Polygon Scan__](https://polygonscan.com/address/0x15aeA3c65Cec3F7525e611fd12D6476439aF789b)
* -
* - [__View Contract on Polygon Mumbai Polygon Scan__](https://mumbai.polygonscan.com/address/0x39e851282C11AefE20B149F4509702B2DC8aEB73)
* - [__View Contract on Skale Calypso Nft Hub Testnet Skale Explorer__](https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com/address/0x0000000000000000000000000000000000000000)
Expand Down

0 comments on commit a356dc3

Please sign in to comment.