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/sepolia #575

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
384b937
begin implementation
starknetdev Jan 22, 2024
3072a37
Merge branch 'main' into feat/sepolia
starknetdev Jan 22, 2024
ee9ebe7
continue
starknetdev Jan 23, 2024
0c31f1a
continue
starknetdev Jan 23, 2024
6420623
continue
starknetdev Jan 23, 2024
29b1a45
continue
starknetdev Jan 23, 2024
13dd221
continue
starknetdev Jan 23, 2024
8e3630e
continue
starknetdev Jan 23, 2024
040e8eb
continue
starknetdev Jan 23, 2024
059c795
- update starknet-react
starknetdev Jan 23, 2024
67ee3a8
fix build
starknetdev Jan 23, 2024
5a2b42e
fix prefund amount for sepolia
starknetdev Jan 23, 2024
7d397f6
fix to sepolia indexer
starknetdev Jan 23, 2024
dbd19dc
update game and GT addresses
starknetdev Jan 23, 2024
f4f78f7
update indexer game address
starknetdev Jan 23, 2024
1ceb38c
Merge branch 'main' into feat/sepolia
starknetdev Mar 18, 2024
d1fa751
- update sepolia fees
starknetdev Apr 2, 2024
12300ca
LS V1.1 (#574)
starknetdev Apr 17, 2024
315a27d
change env
ponderingdemocritus Apr 17, 2024
ad5b81f
test change
ponderingdemocritus Apr 17, 2024
92b945b
faucet
ponderingdemocritus Apr 17, 2024
19b018d
change testnet from goerli to sepolia
loothero Apr 27, 2024
3f8faa8
Merge pull request #576 from BibliothecaDAO/change-testnet-to-sepolia
ponderingdemocritus Apr 27, 2024
f8981a5
fixes #577 number out of bounds during optimistic start
loothero Apr 27, 2024
276730e
interface
ponderingdemocritus Apr 27, 2024
2ac6e1c
merge
ponderingdemocritus Apr 27, 2024
39d07e7
Merge pull request #578 from BibliothecaDAO/577-optimistic-start-bug
ponderingdemocritus Apr 27, 2024
ad5bd3e
- add break page for sepolia
starknetdev May 20, 2024
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
Prev Previous commit
Next Next commit
continue
starknetdev committed Jan 23, 2024
commit ee9ebe75822d0a003487a179301f2b09468d1255
2 changes: 1 addition & 1 deletion indexer/env-mainnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GAME="0x03c10537fa0073b2dd5120242697dbf76d6173eb9f384d3bf3d284d53388a0b0"
START=368800
START=388900
MONGO_CONNECTION_STRING="mongodb://mongo:mongo@mongo:27017"
MONGO_DB="mongo"
STREAM_URL="https://mainnet.starknet.a5a.ch"
7 changes: 0 additions & 7 deletions indexer/scripts/run_adventurers.sh

This file was deleted.

7 changes: 0 additions & 7 deletions indexer/scripts/run_battles.sh

This file was deleted.

7 changes: 0 additions & 7 deletions indexer/scripts/run_beasts.sh

This file was deleted.

7 changes: 0 additions & 7 deletions indexer/scripts/run_discoveries.sh

This file was deleted.

7 changes: 0 additions & 7 deletions indexer/scripts/run_items.sh

This file was deleted.

7 changes: 0 additions & 7 deletions indexer/scripts/run_scores.sh

This file was deleted.

16 changes: 8 additions & 8 deletions ui/.env.sepolia
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ NEXT_PUBLIC_RPC_API_KEY=efb20d63-c5e0-4f5d-ab72-ef7add92779f
NEXT_PUBLIC_LS_GQL_URL=https://survivor-goerli-indexer.realms.world/graphql
NEXT_PUBLIC_TOKENS_GQL_URL=https://testnet.realms.world/api/graphql
NEXT_PUBLIC_ETH_ADDRESS=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
NEXT_PUBLIC_GAME_ADDRESS=0x071d07b1217cdcc334739a3f28da75db05d62672ad04b9204ee11b88f2f9f61c
NEXT_PUBLIC_OLD_GAME_ADDRESS=0x07bece3541ac11d53d470910f2d2c19be2dbc856ae0624c9df27936c2ed16a54
NEXT_PUBLIC_LORDS_ADDRESS=0x05e367ac160e5f90c5775089b582dfc987dd148a5a2f977c49def2a6644f724b
NEXT_PUBLIC_BEASTS_ADDRESS=0x05c909139dbef784180eef8ce7a2f5bf52afe567aa73aaa77b8d8243ad5b6b96
NEXT_PUBLIC_GOLDEN_TOKEN_ADDRESS=0x003583470A8943479F8609192Da4427caC45BdF66a58C84043c7Ab2FC722C0C0
NEXT_PUBLIC_ARCADE_ACCOUNT_CLASS_HASH=0x0715b5e10bf63c36e69c402a81e1eb96b9107ef56eb5e821b00893e39bdcf545
NEXT_PUBLIC_DAO_ADDRESS=0x0628d41075659afebfc27aa2aab36237b08ee0b112debd01e56d037f64f6082a
NEXT_PUBLIC_APP_URL=https://goerli-survivor.realms.world/
NEXT_PUBLIC_GAME_ADDRESS=0x01ed813d434db0854fbae8ff92339173024549b0430b15af04aeb2b1c5c1c4ef
NEXT_PUBLIC_OLD_GAME_ADDRESS=0x0
NEXT_PUBLIC_LORDS_ADDRESS=0x044e6bcc627e6201ce09f781d1aae44ea4c21c2fdef299e34fce55bef2d02210
NEXT_PUBLIC_BEASTS_ADDRESS=0x03065c1db93be057c40fe92c9cba7f898de8d3622693d128e4e97fdc957808a3
NEXT_PUBLIC_GOLDEN_TOKEN_ADDRESS=0x0167c7eecd9d2ecf1f64e6cf18d95b96237b00e2e113a64d1d4215018bbe5905
NEXT_PUBLIC_ARCADE_ACCOUNT_CLASS_HASH=0x0251830adc3d8b4d818c2c309d71f1958308e8c745212480c26e01120c69ee49
NEXT_PUBLIC_DAO_ADDRESS=0x0314924118945405ac0bcd6181457712795c0effc29d8dd3be86d3f3ec62adc1
NEXT_PUBLIC_APP_URL=https://sepolia-survivor.realms.world/
NEXT_PUBLIC_BEASTS_VIEWER_URL=https://testnet.realms.world/collection/beasts
NEXT_PUBLIC_GOLDEN_TOKEN_MINT_URL=https://testnet.realms.world/collection/goldenToken
NEXT_PUBLIC_BLOCK_EXPLORER_URL=https://goerli.voyager.online/
4 changes: 3 additions & 1 deletion ui/src/app/components/TopUpDialog.tsx
Original file line number Diff line number Diff line change
@@ -66,8 +66,10 @@ export const TopUpDialog = ({
);

const onMainnet = process.env.NEXT_PUBLIC_NETWORK === "mainnet";
const onSepolia = process.env.NEXT_PUBLIC_NETWORK === "sepolia";

const notEnoughDefaultBalance = ethBalance < 0.01 * 10 ** 18;
const notEnoughDefaultBalance =
ethBalance < (onMainnet || onSepolia ? 0.01 : 0.001) * 10 ** 18;
const notEnoughCustomBalance = ethBalance < inputValue * 10 ** 18;

return (
3 changes: 1 addition & 2 deletions ui/src/app/hooks/useTransactionCartStore.ts
Original file line number Diff line number Diff line change
@@ -53,8 +53,7 @@ const useTransactionCartStore = create<TransactionCartState>((set) => {
showTopUpDialog: (show: boolean) => void,
setTopUpAccount: (account: string) => void
) => {
const onMainnet = process.env.NEXT_PUBLIC_NETWORK === "mainnet";
const maxFee = onMainnet ? MAX_FEE_CHECK : MAX_FEE_CHECK / 10;
const maxFee = MAX_FEE_CHECK;
try {
let tx;
if (isArcade) {
6 changes: 5 additions & 1 deletion ui/src/app/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -24,6 +24,9 @@ export const notificationAnimations = [
{ name: "slide", startFrame: 24, frameCount: 5 },
];

let onMainnet = process.env.NEXT_PUBLIC_NETWORK === "mainnet";
let onSepolia = process.env.NEXT_PUBLIC_NETWORK === "sepolia";

// ---- CONTRACT PARAMS
// Penalty time is 12 blocks, where each block is ~ 15 seconds
export const penaltyTime = 420;
@@ -38,7 +41,8 @@ export const MIN_BALANCE = 100000000000000; // 0.00001ETH or $0.15
export const TRANSACTION_WAIT_RETRY_INTERVAL = 6000; // 6 seconds
export const ETH_INCREMENT = 0.001;
export const LORDS_INCREMENT = 5;
export const MAX_FEE_CHECK = 0.003 * 10 ** 18; // 0.03ETH
export const MAX_FEE_CHECK =
onMainnet || onSepolia ? 0.003 * 10 ** 18 : 0.0003 * 10 ** 18; // 0.003ETH on mainnet or sepolia, 0.0003ETH on goerli

export const deathMessages = [
{
3 changes: 3 additions & 0 deletions ui/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import {
useContract,
Connector,
} from "@starknet-react/core";
import { sepolia } from "@starknet-react/chains";
import { InjectedConnector } from "starknetkit/injected";
import { ArgentMobileConnector } from "starknetkit/argentMobile";
import { WebWalletConnector } from "starknetkit/webwallet";
@@ -493,6 +494,8 @@ function Home({ updateConnectors }: HomeProps) {
accountChainId !==
(process.env.NEXT_PUBLIC_NETWORK === "mainnet"
? constants.StarknetChainId.SN_MAIN
: process.env.NEXT_PUBLIC_NETWORK === "sepolia"
? "0x" + sepolia.id.toString(16)
: constants.StarknetChainId.SN_GOERLI);
setIsWrongNetwork(isWrongNetwork);
}, [account, accountChainId, isConnected]);
8 changes: 5 additions & 3 deletions ui/src/app/provider.tsx
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@ import {
StarknetConfig,
alchemyProvider,
blastProvider,
publicProvider,
} from "@starknet-react/core";
import { goerli, mainnet } from "@starknet-react/chains";
import { goerli, mainnet, sepolia } from "@starknet-react/chains";

export function StarknetProvider({
connectors,
@@ -17,15 +18,16 @@ export function StarknetProvider({
}) {
const apiKey = process.env.NEXT_PUBLIC_RPC_API_KEY!;
const onMainnet = process.env.NEXT_PUBLIC_NETWORK === "mainnet";
const onSepolia = process.env.NEXT_PUBLIC_NETWORK === "sepolia";
const provider = onMainnet
? alchemyProvider({ apiKey })
: blastProvider({ apiKey });
const chains = onMainnet ? [mainnet] : [goerli];
const chains = onMainnet ? [mainnet] : onSepolia ? [sepolia] : [goerli];
return (
<StarknetConfig
connectors={connectors}
autoConnect
provider={provider}
provider={publicProvider()}
chains={chains}
>
{children}