Skip to content

Commit

Permalink
Merge branch 'dev' into week4-cross-user-staking
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostffcode authored Aug 5, 2022
2 parents d1c87a6 + facfdf1 commit ebf66e2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ artifacts
# misc
.DS_Store
.env*
*.lock

# debug
npm-debug.log*
Expand Down
9 changes: 9 additions & 0 deletions packages/hardhat/contracts/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
4 changes: 2 additions & 2 deletions packages/react-app/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion packages/react-app/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==

[email protected]:
version "0.1.2"
resolved "https://registry.yarnpkg.com/moniker/-/moniker-0.1.2.tgz#872dfba575dcea8fa04a5135b13d5f24beccc97e"
Expand Down

0 comments on commit ebf66e2

Please sign in to comment.