Skip to content

Instantly share code, notes, and snippets.

@adrianhajdin
Last active March 25, 2024 15:13
Show Gist options
  • Save adrianhajdin/5f6cc61fa04de7b8fa250eb295db62fd to your computer and use it in GitHub Desktop.
Save adrianhajdin/5f6cc61fa04de7b8fa250eb295db62fd to your computer and use it in GitHub Desktop.
Build and Deploy a Modern Web 3.0 Blockchain App | Solidity, Smart Contracts
npm install --save-dev hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
const commonStyles = "min-h-[70px] sm:px-0 px-2 sm:min-w-[120px] flex justify-center items-center border-[0.5px] border-gray-400 text-sm font-light text-white";
const main = async () => {
const transactionsFactory = await hre.ethers.getContractFactory("Transactions");
const transactionsContract = await transactionsFactory.deploy({ value: hre.ethers.utils.parseEther("0.001") });
await transactionsContract.deployed();
console.log("Transactions address: ", transactionsContract.address);
};
const runMain = async () => {
try {
await main();
process.exit(0);
} catch (error) {
console.error(error);
process.exit(1);
}
};
runMain();
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");
* html {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Open Sans", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.gradient-bg-welcome {
background-color:#0f0e13;
background-image:
radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%),
radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
}
.gradient-bg-services {
background-color:#0f0e13;
background-image:
radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
radial-gradient(at 50% 100%, hsla(225,39%,25%,1) 0, transparent 50%);
}
.gradient-bg-transactions {
background-color: #0f0e13;
background-image:
radial-gradient(at 0% 100%, hsla(253,16%,7%,1) 0, transparent 50%),
radial-gradient(at 50% 0%, hsla(225,39%,25%,1) 0, transparent 50%);
}
.gradient-bg-footer {
background-color: #0f0e13;
background-image:
radial-gradient(at 0% 100%, hsla(253,16%,7%,1) 0, transparent 53%),
radial-gradient(at 50% 150%, hsla(339,49%,30%,1) 0, transparent 50%);
}
.blue-glassmorphism {
background: rgb(39, 51, 89, 0.4);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(0, 0, 0, 0.3);
}
/* white glassmorphism */
.white-glassmorphism {
background: rgba(255, 255, 255, 0.05);
border-radius: 16px;
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(255, 255, 255, 0.3);
}
.eth-card {
background-color:#a099ff;
background-image:
radial-gradient(at 83% 67%, rgb(152, 231, 156) 0, transparent 58%),
radial-gradient(at 67% 20%, hsla(357,94%,71%,1) 0, transparent 59%),
radial-gradient(at 88% 35%, hsla(222,81%,65%,1) 0, transparent 50%),
radial-gradient(at 31% 91%, hsla(9,61%,61%,1) 0, transparent 52%),
radial-gradient(at 27% 71%, hsla(336,91%,65%,1) 0, transparent 49%),
radial-gradient(at 74% 89%, hsla(30,98%,65%,1) 0, transparent 51%),
radial-gradient(at 53% 75%, hsla(174,94%,68%,1) 0, transparent 45%);
}
.text-gradient {
background-color: #fff;
background-image: radial-gradient(at 4% 36%, hsla(0,0%,100%,1) 0, transparent 53%), radial-gradient(at 100% 60%, rgb(0, 0, 0) 0, transparent 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
module.exports = {
purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"],
mode: "jit",
darkMode: false, // or 'media' or 'class'
theme: {
fontFamily: {
display: ["Open Sans", "sans-serif"],
body: ["Open Sans", "sans-serif"],
},
extend: {
screens: {
mf: "990px",
},
keyframes: {
"slide-in": {
"0%": {
"-webkit-transform": "translateX(120%)",
transform: "translateX(120%)",
},
"100%": {
"-webkit-transform": "translateX(0%)",
transform: "translateX(0%)",
},
},
},
animation: {
"slide-in": "slide-in 0.5s ease-out",
},
},
},
variants: {
extend: {},
},
plugins: [require("@tailwindcss/forms")],
};
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract Transactions {
uint256 transactionCount;
event Transfer(address from, address receiver, uint amount, string message, uint256 timestamp, string account, string keyword);
struct TransferStruct {
address sender;
address receiver;
uint amount;
string message;
uint256 timestamp;
string account;
string keyword;
}
TransferStruct[] transactions;
function transfer(address payable receiver, uint amount, string memory message, string memory account, string memory keyword) public {
transactionCount += 1;
transactions.push(TransferStruct(msg.sender, receiver, amount, message, block.timestamp, account, keyword));
emit Transfer(msg.sender, receiver, amount, message, block.timestamp, account, keyword);
receiver.transfer(amount);
}
function getAllTransactions() public view returns (TransferStruct[] memory) {
return transactions;
}
function getTransactionCount() public view returns (uint256) {
return transactionCount;
}
}
@coder-elvish
Copy link

Screenshot 2023-05-12 at 7 11 26 PM I have the exact same one, any solutions?

waiting for someone to answer. if you found the solution first please do share here

I couldn't find a solution, so I went with Web3.js instead of ethers.js, which works fine.

Hey...!!
I'm getting the same error in my console so can you please guide me to convert ethers.js to Web3.js
Or any another kind of solution

@PGoyal-06
Copy link

Hey... I was recreating this application by following the tutorial but I keep getting the following error message in the final stage of the project:

image
image

Here is the code:

image
image

Could someone help me please?

@Isaiah-Essien
Copy link

Hey... I was recreating this application by following the tutorial but I keep getting the following error message in the final stage of the project:

image image

Here is the code:

image image

Could someone help me please?

Hello, Man. Please can you book a session with me and have a look at my project? I have not been able to get past the Hardhat installation phase. God bless you.

My email is : i.essien@alustudent.com

@JACKTHER1PPE6
Copy link

Screenshot_36 Screenshot_35
why my css copy paste code is not working?

I have the same problem, can someone help???

@danielzx600 I know it's a long time ago but how did you solve this problem, i am stuck in it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment