-
-
Save adrianhajdin/5f6cc61fa04de7b8fa250eb295db62fd to your computer and use it in GitHub Desktop.
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; | |
} | |
} |
I get this error after trying to confirm the transaction in Metamask's mini window that pops up after clicking Send Now.
Anyone else know how to fix this??? No amount of googling has resulted in finding anything about not supporting sending transactions
@Isaiah-Essien
check this
https://gist.github.com/adrianhajdin/5f6cc61fa04de7b8fa250eb295db62fd?permalink_comment_id=4830795#gistcomment-4830795I copied and pasted the Package.json file, ran npm, and ran the installation command, but it still did not work. I am still having the same issue:
Hey, I'm sepolia and I followed the project properly and also carried out the changes mentioned above, my transactions are working correctly. But the loader isn't working and the latest transactions are also not displayed.
I'm getting the above errors in the console.
And this is my code:-
Transaction Context--------------
Transaction.jsx--------------
Welcome.jsx--------------
If anyone knows the solutions, kindly please help!
Hey..!!
When i click send now button i also getting the same kind of error have you solved it..
if yes please reply me...
this is the screenshot of my errors..!!
I am getting the same error
The main issue is version compatibility, when you are trying to call sendTransaction( ) function, This will not work because you have not found the Ethereum object.
First, you must check which version of ether.js is installed in your application.
if you are using the latest version like - 6.1 or something, then your code will not work, because you have done it in TransactionContext.js according to version 5.0 of ether.js.
Check Package.json first, then install the version the same as the YouTube tutorial video is referring to.
as you can see down below packege.json of the tutorial GitHub repo...
you have to install the same version as the one given in package.json for ether.js
Second way: you have to do the change in TrasactionContext.js according to your installed version of ether.js (6.10 version)
Follow the documentation as given below.
for version v5
for version v6
Hi, @arpit3210. I'm afraid you keep giving me vague answers. I currently have the version of ethers 5.7 in my package.json. But still, the issue is persisting.
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
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:
Here is the code:
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
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
I copied and pasted the Package.json file, ran npm, and ran the installation command, but it still did
not work. I am still having the same issue: