diff --git a/blockchain-app/README.md b/blockchain-app/README.md
index 63a34d4..bb6b23b 100644
--- a/blockchain-app/README.md
+++ b/blockchain-app/README.md
@@ -59,3 +59,50 @@ npm install --save-dev @nomiclabs/hardhat-ethers @nomiclabs/hardhat-waffle chai
**Make sure you have enough ETH to do the deploy **
Expected message will be similar to `Transactions deployed to: 0xB1eA0Bc0Bbd554d921Ac6778775208A39259831A`
+
+## React Context
+
+[docs](https://reactjs.org/docs/context.html)
+
+Context is designed to share data that can be considered “global” for a tree of React components, such as the current authenticated user, theme, or preferred language.
+
+```js
+// Context lets us pass a value deep into the component tree
+// without explicitly threading it through every component.
+// Create a context for the current theme (with "light" as the default).
+const ThemeContext = React.createContext('light');
+
+class App extends React.Component {
+ render() {
+ // Use a Provider to pass the current theme to the tree below.
+ // Any component can read it, no matter how deep it is.
+ // In this example, we're passing "dark" as the current value.
+ return (
+ // ThemeContext is the const that we defined above. We're setting a new theme value
+
+
+
+ );
+ }
+}
+
+// A component in the middle doesn't have to
+// pass the theme down explicitly anymore.
+function Toolbar() {
+ return (
+
{/* the 'mf' is coming from tailwind.config.css and isn't found on tailwind website */}
diff --git a/blockchain-app/client/src/context/TransactionContext.jsx b/blockchain-app/client/src/context/TransactionContext.jsx
new file mode 100644
index 0000000..5200f1e
--- /dev/null
+++ b/blockchain-app/client/src/context/TransactionContext.jsx
@@ -0,0 +1,31 @@
+import React, { useEffect, useState } from 'react';
+import { ethers } from 'ethers';
+import { contractABI, contractAddress } from '../utils/constants';
+
+// create a context for transactions with no default value
+export const TransactionContext = React.createContext();
+
+// window.ethereum is enabled thanks to our Metamask extension
+const { ethereum } = window;
+
+const getEthereumContract = () => {
+ const provider = new ethers.providers.Web3Provider(ethereum);
+ const signer = provider.getSigner();
+ const transactionContract = new ethers.Contract(
+ contractAddress,
+ contractABI,
+ signer
+ );
+
+ console.log({ provider, signer, transactionContract });
+};
+
+export const TransactionProvider = ({ children }) => {
+ return (
+ // using TransactionContext defined above, .Provider allows us to set
+ // a value to pass down to all of the children
+
+ {children}
+
+ );
+};
diff --git a/blockchain-app/client/src/main.jsx b/blockchain-app/client/src/main.jsx
index 606a3cf..85f0276 100644
--- a/blockchain-app/client/src/main.jsx
+++ b/blockchain-app/client/src/main.jsx
@@ -1,11 +1,12 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import './index.css'
-import App from './App'
+import React from 'react';
+import ReactDOM from 'react-dom';
+import './index.css';
+import App from './App';
+import { TransactionProvider } from './context/TransactionContext';
ReactDOM.render(
-
-
- ,
- document.getElementById('root')
-)
+
+
+ ,
+ document.getElementById('root')
+);
diff --git a/blockchain-app/smart_contract/utils/Transactions.json b/blockchain-app/client/src/utils/Transactions.json
similarity index 100%
rename from blockchain-app/smart_contract/utils/Transactions.json
rename to blockchain-app/client/src/utils/Transactions.json
diff --git a/blockchain-app/smart_contract/utils/constants.js b/blockchain-app/client/src/utils/constants.js
similarity index 100%
rename from blockchain-app/smart_contract/utils/constants.js
rename to blockchain-app/client/src/utils/constants.js