Skip to content

Commit

Permalink
Add .env.example for starksheet-cairo (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter authored Jul 10, 2023
1 parent fcc3266 commit 1747f8d
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 65 deletions.
20 changes: 20 additions & 0 deletions packages/starksheet-cairo/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
INFURA_KEY=

TESTNET2_ACCOUNT_ADDRESS=
TESTNET2_PRIVATE_KEY=

DEVNET_ACCOUNT_ADDRESS=0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a
DEVNET_PRIVATE_KEY=0xe3e70682c2094cac629f6fbed82c07cd

KATANA_ACCOUNT_ADDRESS=0x03ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0
KATANA_PRIVATE_KEY=0x0300001800000000300000180000000000030000000000003006001800006600

MADARA_ACCOUNT_ADDRESS=0x3
MADARA_PRIVATE_KEY=0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d

SHARINGAN_ACCOUNT_ADDRESS=
SHARINGAN_PRIVATE_KEY=
SHARINGAN_RPC_URL=

ACCOUNT_ADDRESS=
PRIVATE_KEY=
9 changes: 9 additions & 0 deletions packages/starksheet-cairo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ pytest .

## Deployment

Make sure to have a `.env` file set up at the root of the project:

```bash
cp .env.example .env
```

The `.env.example` is pre populated for devnet like networks (madara, katana,
starknet-devnet). For other networks, make sure to fill it before.

The [deploy folder](./deploy/) contains several deployment scripts but only the
[starksheet one](./deploy/starksheet.py) is really required.

Expand Down
16 changes: 8 additions & 8 deletions packages/starksheet-cairo/deployments/madara/deployments.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"BasicCellRenderer": {
"address": "0x6044a44f38403d7a431c5fdf0aa263b84fc43c4f108f3bca25b74791304d621",
"tx": "0x36f0ff5d2ec0ca09e93c79864262ffc12b44bb65484784051fd086e70e8e058",
"address": "0x7aaaf70d3154b71750665b89fd8dd86e79ea7e9f673f2f33a0e3ea025a2bc90",
"tx": "0x4335f368647ba65b1588bd6d71c6a9cfeb40e9b12119dfef0eb8d12531b8227",
"artifact": "build/BasicCellRenderer.json",
"alias": "basic_cell_renderer"
},
"math": {
"address": "0x139d628181d24816a62f2ef59614ae7cf3e95bf418908dbebb7c4049437f938",
"tx": "0x205930aa018fbe73a7c0db63f23ff1bc00dfc7ea989d6daaf3e48884c883508",
"address": "0x7e28503600cc4533145d53db41fd975a424d198982178c34f1f15870fde281b",
"tx": "0x4e4a10da785f9a0ad6e8ba06a16146563316e550320e13da72512fb83fca38e",
"artifact": "build/math.json",
"alias": "math"
},
"execute": {
"address": "0x69ebcd182d2d93afe0bab7f22d8b508ad20722c4098c38805bc662c8ce5d6cb",
"tx": "0x10b70fdc5526182e88395ba38db70e549fbeb5c903680765e672d288192f59c",
"address": "0x138d4e2d306c0a9ef84dff00f6cc5e4d7b6f2329c9f88690ec6b8057e5e72f3",
"tx": "0x3448424346bc091ece116155d291b64c7a7f1028b76ca62cf65c71c1ddeae4e",
"artifact": "build/execute.json",
"alias": "execute"
},
"Starksheet": {
"address": "0x61839cbd6cdc2628f3293f7fb288e0b3bcb3253059e306fa805e77d88177ef6",
"tx": "0x4c437fc3ac1f318436cc7a2e7f541fc59d7b5bac6560f4bbbfc70f9583ab5e0",
"address": "0x4c60a51592fb92fdc7a70cd07efcd31ccced5d67bba5d153ffce673ed29e389",
"tx": "0x7ee5b01be2972ed6391cb6a3f002ac18aa72725c721c0de9522b36dccd73e2c",
"artifact": "build/Starksheet.json",
"alias": "starksheet"
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/starksheet-webapp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Starksheet webapp
# Onsheet webapp

This is the starksheet webapp as deployed in
This is the onsheet webapp as deployed for example for Starknet at
[app.starksheet.xyz](app.starksheet.xyz).

## Installation
Expand All @@ -21,7 +21,7 @@ devnet. Depending on your need, it may be enough to target the testnet or even
the mainnet for final testing.

The ENV variable `REACT_APP_NETWORK` is used to select the target network. By
default (not set), it will target the devnet, see
default (not set), it will target the starknet-devnet, see
[Starksheet cairo README](../starksheet-cairo/README.md#deployment).

The app will automatically uses the latest deployments made in
Expand Down
3 changes: 2 additions & 1 deletion packages/starksheet-webapp/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CELL_BORDER_WIDTH, CELL_HEIGHT, N_ROW } from "../../config";
import { AccountContext } from "../../contexts/AccountContext";
import { OnsheetContext } from "../../contexts/OnsheetContext";
import { useChainProvider } from "../../hooks/useChainProvider";
import { chainConfig } from "../../provider/chains";
import GreyCell from "../GreyCell/GreyCell";
import { SheetButton } from "../SheetButton/SheetButton";
import githubLogo from "./github.svg";
Expand All @@ -26,7 +27,7 @@ function Footer({ sx }: FooterProps) {

const addSheetOnClick = async () => {
if (!accountAddress) {
enqueueSnackbar(`Connect your wallet to use Starksheet`, {
enqueueSnackbar(`Connect your wallet to use ${chainConfig.appName}`, {
variant: "info",
});
return;
Expand Down
4 changes: 3 additions & 1 deletion packages/starksheet-webapp/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function Header() {
const [isOpenWidget, setOpenWidget] = React.useState<boolean>(false);
return (
<Box sx={{ display: "flex" }}>
<GreyCell sx={{ textIndent: "20px", flex: 1 }}>Starksheet</GreyCell>
<GreyCell sx={{ textIndent: "20px", flex: 1 }}>
{chainConfig.appName}
</GreyCell>
<Button
sx={{ marginLeft: `-${CELL_BORDER_WIDTH}px`, width: "191px" }}
onClick={() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AppStatusContext } from "../../contexts/AppStatusContext";
import { CellValuesContext } from "../../contexts/CellValuesContext";
import { OnsheetContext } from "../../contexts/OnsheetContext";
import { useSheetContract } from "../../hooks/useSheetContract";
import { chainConfig } from "../../provider/chains";
import { Cell, CellData, CellRendered } from "../../types";
import { RC_BOUND } from "../../utils/constants";
import { bn2hex } from "../../utils/hexUtils";
Expand Down Expand Up @@ -189,7 +190,7 @@ const SheetTable = ({ sx }: SheetTableProps) => {
})
.catch((error) => {
error = true;
finalMessage = `Error: Starksheet cannot render sheet at address ${address}
finalMessage = `Error: ${chainConfig.appName} cannot render sheet at address ${address}
<br />
<br />
Double check address or create a new sheet by clicking on the + button`;
Expand Down
9 changes: 9 additions & 0 deletions packages/starksheet-webapp/src/provider/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type SupportedChains =

const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
goerli: {
appName: "Evmsheet",
chainId: ChainId.ETHEREUM_TESTNET,
chainType: ChainType.EVM,
explorerBaseUrl: "https://goerli.etherscan.io/address/",
Expand All @@ -24,6 +25,7 @@ const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
rpcUrl: `https://goerli.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
},
anvil: {
appName: "Evmsheet",
chainId: ChainId.ANVIL,
chainType: ChainType.EVM,
explorerBaseUrl: "https://goerli.etherscan.io/address/",
Expand All @@ -32,6 +34,7 @@ const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
rpcUrl: "http://0.0.0.0:8545",
},
mainnet: {
appName: "Starksheet",
chainId: ChainId.STARKNET_MAINNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "https://starkscan.co/contract/",
Expand All @@ -40,6 +43,7 @@ const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
gateway: "mainnet-alpha",
},
testnet: {
appName: "Starksheet",
chainId: ChainId.STARKNET_TESTNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "https://testnet.starkscan.co/contract/",
Expand All @@ -48,6 +52,7 @@ const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
gateway: "goerli-alpha",
},
testnet2: {
appName: "Starksheet",
chainId: ChainId.STARKNET_TESTNET2,
chainType: ChainType.STARKNET,
explorerBaseUrl: "https://testnet-2.starkscan.co/contract/",
Expand All @@ -56,27 +61,31 @@ const chainConfigs: Record<SupportedChains, Omit<ChainConfig, "addresses">> = {
gateway: "goerli-alpha-2",
},
devnet: {
appName: "Starksheet",
chainId: ChainId.STARKNET_TESTNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "https://devnet.starkscan.co/contract/",
nftBaseUrl: "",
rpcUrl: "http://127.0.0.1:5050/rpc",
},
katana: {
appName: "Starksheet",
chainId: ChainId.STARKNET_TESTNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "",
nftBaseUrl: "",
rpcUrl: "http://127.0.0.1:5050",
},
madara: {
appName: "Madsheet",
chainId: ChainId.STARKNET_TESTNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "",
nftBaseUrl: "",
rpcUrl: "http://127.0.0.1:9944",
},
sharingan: {
appName: "Madsheet",
chainId: ChainId.STARKNET_TESTNET,
chainType: ChainType.STARKNET,
explorerBaseUrl: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ChainConfig {
nftBaseUrl: string;
rpcUrl: string;
gateway?: NetworkName;
appName: string;
addresses: {
spreadsheet: string;
multisend?: string;
Expand Down

0 comments on commit 1747f8d

Please sign in to comment.