diff --git a/src/Components/Subpages/snippets.tsx b/src/Components/Subpages/snippets.tsx
index 95d85cf..26d7146 100644
--- a/src/Components/Subpages/snippets.tsx
+++ b/src/Components/Subpages/snippets.tsx
@@ -1,39 +1,42 @@
const sample = {
- interact: `const Web3 = require("web3");
- // set a provider in the ropsten testnet using infura
- const web3 = new Web3("https://ropsten.infura.io/v3/endpoint");
+ interact: `
+ import {Web3} from "web3";
- // interacting with the smart contract
- const abi = [
+ // set a provider in the sepolia testnet using node rpc url
+ const web3 = new Web3("https://rpc.sepolia.org");
+
+ // interacting with the smart contract
+ const abi = [
{
- outputs: [
+ outputs: [
{
- internalType: "uint256",
- name: "newValue",
- type: "uint256",
+ internalType: "uint256",
+ name: "randomNo",
+ type: "uint256",
},
- ],
- name: "getValue",
- stateMutability: "nonpayable",
- type: "function",
+ ],
+ name: "generateRandomNumber",
+ stateMutability: "nonpayable",
+ type: "function",
},
- ] as const;
-
- const address = "0xe435e2a3cb5dc62c75d8bb2dba8470771405911d";
-
- // create a new contract object, providing the ABI and address
- const contract = new web3.eth.Contract(abi, address);
-
- // using contract.methods to get value
- contract.methods
- .getValue()
+ ] as const;
+
+ const address = "0xA36432F7B12f160F685717c4Ab12EB883a682810";
+
+ // create a new contract object, providing the ABI and address
+ const contract = new web3.eth.Contract(abi, address);
+
+ // using contract.methods to get value
+ contract.methods
+ .generateRandomNumber()
.call()
.then(console.log);`,
- listen: `const Web3 = require("web3");
+ listen: `
+ import {Web3} from "web3";
- // set a provider in the ropsten testnet using infura
- const web3 = new Web3("https://ropsten.infura.io/v3/endpoint");
+ // set a provider to the sepolia testner using node rpc url
+ const web3 = new Web3("wss://sepolia.infura.io/ws/v3/API_KEY");
// interacting with the smart contract
const abi = [
@@ -41,48 +44,48 @@ const sample = {
inputs: [
{
internalType: "uint256",
- name: "newValue",
+ name: "randomNo",
type: "uint256",
},
],
- name: "VALUE_CHANGE",
+ name: "RandomNo",
type: "event",
},
] as const;
- const address = "0xe435e2a3cb5dc62c75d8bb2dba8470771405911d";
+ const address = "0xA36432F7B12f160F685717c4Ab12EB883a682810";
// create a new contract object, providing the ABI and address
const contract = new web3.eth.Contract(abi, address);
// using contract.methods to get value
-const subscription = await contract.events.VALUE_CHANGE();
+const subscription = contract.events.RandomNo()
subscription.on("data", console.log); // new value every time the event is emitted
`,
fetch: `
-const Web3 = require("web3")
+ import {Web3} from "web3"
-// set a provider such as using infura
-const web3 = new Web3("https://mainnet.infura.io/v3/endpoint")
-
-// Get the balance of an Ethereum address
-web3.eth.getBalance("0x1b3cB81E51011b549d78bf720b0d924ac763A7C2").then(console.log) // result: BigInt(560000000065000000000000)
-
-// Get the latest block number
- web3.eth.getBlockNumber().then(console.log) // result: BigInt(13497160)
+ // set a provider such as using infura
+ const web3 = new Web3("https://rpc.sepolia.org")
+
+ // Get the balance of an Ethereum address
+ web3.eth.getBalance("0xF8561Dc64E577B0CF53dd3FC11329e80B1A8343e").then(console.log) // result: 1.000.000 eth
+
+ // Get the latest block number
+ web3.eth.getBlockNumber().then(console.log) // result: BigInt(xxx)
`,
simplify: `
-const Web3 = require("web3")
-
-// Create a sha3 hash of a string input
-Web3.utils.sha3("example") // '0x6fd43e7cffc31bb581d7421c8698e29aa2bd8e7186a394b85299908b4eb9b175'
-
-// Convert any ether value into wei
- Web3.utils.toWei('1', 'ether') // 1000000000000000000
- Web3.utils.toWei('1', 'gwei') // 1000000000
+ import {Web3} from "web3";
-// Adds a padding on the left of a string, useful for adding paddings to HEX strings.
-Web3.utils.padLeft('0x3456ff', 20); // '0x000000000000003456ff'
+ // Create a sha3 hash of a string input
+ console.log(Web3.utils.sha3("example")) // '0x6fd43e7cffc31bb581d7421c8698e29aa2bd8e7186a394b85299908b4eb9b175'
+
+ // Convert any ether value into wei
+ console.log(Web3.utils.toWei('1', 'ether')) // 1000000000000000000
+ console.log(Web3.utils.toWei('1', 'gwei')) // 1000000000
+
+ // Adds a padding on the left of a string, useful for adding paddings to HEX strings.
+ console.log(Web3.utils.padLeft('0x3456ff', 20)); // '0x000000000000003456ff'
`,
};
diff --git a/src/assets/images/dydx.svg b/src/assets/images/dydx.svg
new file mode 100644
index 0000000..bfe1e10
--- /dev/null
+++ b/src/assets/images/dydx.svg
@@ -0,0 +1,23 @@
+
diff --git a/src/assets/images/embark.svg b/src/assets/images/embark.svg
new file mode 100644
index 0000000..d9f7ca6
--- /dev/null
+++ b/src/assets/images/embark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/images/ens.png b/src/assets/images/ens.png
deleted file mode 100644
index 0df6d15..0000000
Binary files a/src/assets/images/ens.png and /dev/null differ
diff --git a/src/assets/images/opensea.png b/src/assets/images/opensea.png
deleted file mode 100644
index 2059617..0000000
Binary files a/src/assets/images/opensea.png and /dev/null differ
diff --git a/src/assets/images/remix.png b/src/assets/images/remix.png
new file mode 100644
index 0000000..1d6bcd0
Binary files /dev/null and b/src/assets/images/remix.png differ
diff --git a/src/assets/images/yearn.png b/src/assets/images/yearn.png
deleted file mode 100644
index bf61a67..0000000
Binary files a/src/assets/images/yearn.png and /dev/null differ
diff --git a/src/urls.ts b/src/urls.ts
new file mode 100644
index 0000000..a6e451a
--- /dev/null
+++ b/src/urls.ts
@@ -0,0 +1,4 @@
+export const discordUrl = "https://discord.gg/yhHVtK5Wqt"
+export const docsUrl = "https://docs.web3js.org/"
+export const npmUrl = "https://www.npmjs.com/package/web3"
+export const blogUrl = "https://blog.chainsafe.io/tagged/web3js"
\ No newline at end of file