diff --git a/.gitignore b/.gitignore index f3196b9..e2f66ab 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,7 @@ artifacts # misc .DS_Store .env* +*.lock # debug npm-debug.log* diff --git a/packages/hardhat/contracts/Staking.sol b/packages/hardhat/contracts/Staking.sol index 0aa988c..f316bbf 100644 --- a/packages/hardhat/contracts/Staking.sol +++ b/packages/hardhat/contracts/Staking.sol @@ -29,4 +29,13 @@ contract Staking { { return stakes[roundId][user]; } + + function getUserStakeFromLatestRound(address user) + public + view + ///roundExists(roundId) + returns (uint256) + { + return rounds[latestRound].stakes[user]; + } } diff --git a/packages/react-app/src/App.jsx b/packages/react-app/src/App.jsx index 9898c8e..36eaa2e 100644 --- a/packages/react-app/src/App.jsx +++ b/packages/react-app/src/App.jsx @@ -46,7 +46,7 @@ const { ethers } = require("ethers"); */ /// 📡 What chain are your contracts deployed to? -const initialNetwork = NETWORKS.localhost; // <------- select your target frontend network (localhost, rinkeby, xdai, mainnet) +const initialNetwork = NETWORKS.goerli; // <------- select your target frontend network (localhost, rinkeby, xdai, mainnet) // 😬 Sorry for all the console logging const DEBUG = true; @@ -70,7 +70,7 @@ function App(props) { const [injectedProvider, setInjectedProvider] = useState(); const [address, setAddress] = useState(); - const [selectedNetwork, setSelectedNetwork] = useState(networkOptions[0]); + const [selectedNetwork, setSelectedNetwork] = useState(networkOptions[3]); const location = useLocation(); const targetNetwork = NETWORKS[selectedNetwork]; diff --git a/packages/react-app/src/constants.js b/packages/react-app/src/constants.js index 809bbb8..23c788a 100644 --- a/packages/react-app/src/constants.js +++ b/packages/react-app/src/constants.js @@ -10,7 +10,7 @@ export const BLOCKNATIVE_DAPPID = "0b58206a-f3c0-4701-a62f-73c7243e8c77"; export const ALCHEMY_KEY = "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF"; const localRpcUrl = process.env.REACT_APP_CODESPACES - ? `https://${window.location.hostname.replace("3000", "8545")}` + ? `https://${window.location.hostname.replace("3001", "8545")}` : "http://" + (global.window ? window.location.hostname : "localhost") + ":8545"; export const NETWORKS = { diff --git a/yarn.lock b/yarn.lock index 73acbd5..f4c93b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15947,6 +15947,11 @@ moment@^2.24.0, moment@^2.25.3: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4" integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg== +moment@^2.29.4: + version "2.29.4" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" + integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== + moniker@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/moniker/-/moniker-0.1.2.tgz#872dfba575dcea8fa04a5135b13d5f24beccc97e"