Skip to content

Commit bd277a5

Browse files
refactor home page, split logic into 3 hooks, add invite write flow
1 parent 31661b3 commit bd277a5

File tree

14 files changed

+5765
-106
lines changed

14 files changed

+5765
-106
lines changed

.DS_Store

0 Bytes
Binary file not shown.

hardhat/.DS_Store

0 Bytes
Binary file not shown.

hardhat/contracts/Web3DevToken.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contract Web3DevToken is ERC20 {
1818
require(balanceOf(msg.sender) > 0, "You are not invited");
1919
require(msg.sender != to, "You can't invite yourself");
2020
require(inviteCount[msg.sender] < MAX_INVITES, "You can't invite more than 3 people");
21-
require(balanceOf(to) >= inviteAmount, "Address alreayd invited");
21+
// require(balanceOf(to) > inviteAmount, "Address alreayd invited");
2222

2323
_mint(to, inviteAmount);
2424
inviteCount[msg.sender]++;

hardhat/scripts/interact.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import hre from 'hardhat'
33
// quero um script para convidar o endereço 0xA9BC6d9681Ca08a90fe9b79c79D7660A6936F4c3
44

55
const WEB3DEVTOKEN_ADDRESS = '0x5fbdb2315678afecb367f032d93f642f64180aa3'
6-
const METAMASK_WALLET_ADDRESS = '0xA9BC6d9681Ca08a90fe9b79c79D7660A6936F4c3'
6+
const METAMASK_WALLET_ADDRESS = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' //'0xA9BC6d9681Ca08a90fe9b79c79D7660A6936F4c3'
77

88
async function main() {
99
const [account] = await hre.viem.getWalletClients()
@@ -16,15 +16,16 @@ async function main() {
1616
// const balance = await web3devToken.read.balanceOf([METAMASK_WALLET_ADDRESS])
1717
// console.log('Balance of 1', balance.toString())
1818

19-
const inviteCount = await web3devToken.read.getInviteCount([
20-
account.account.address,
21-
])
19+
// const inviteCount = await web3devToken.read.getInviteCount([
20+
// account.account.address,
21+
// ])
2222

23-
console.log('Invite count', inviteCount.toString())
23+
// console.log('Invite count', inviteCount.toString())
2424

25-
// const inviteTxnHash = await web3devToken.write.invite([
26-
// METAMASK_WALLET_ADDRESS,
27-
// ])
25+
const inviteTxnHash = await web3devToken.write.invite([
26+
METAMASK_WALLET_ADDRESS,
27+
])
28+
console.log('hash', inviteTxnHash)
2829

2930
// const inviteTxnHash2 = await web3devToken.write.invite([
3031
// METAMASK_WALLET_ADDRESS,

w3c-fe/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
"dependencies": {
1212
"@rainbow-me/rainbowkit": "^2.1.7",
1313
"@tanstack/react-query": "^5.59.0",
14+
"jsonwebtoken": "^9.0.2",
1415
"next": "14.2.14",
1516
"react": "^18",
1617
"react-dom": "^18",
1718
"viem": "^2.21.19",
1819
"wagmi": "^2.12.17"
1920
},
2021
"devDependencies": {
22+
"@types/jsonwebtoken": "^9.0.7",
2123
"@types/node": "^20",
2224
"@types/react": "^18",
2325
"@types/react-dom": "^18",

0 commit comments

Comments
 (0)