This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Importing the crypto module for cryptographic functions | |
const crypto = require('crypto'); | |
// Importing the bs58check module for Base58Check encoding | |
const bs58check = require('bs58check'); | |
/** | |
* Generates a public key using elliptic curve cryptography (ECC). | |
* ECC uses smaller keys compared to non-ECC cryptography to provide equivalent security. | |
*/ | |
const generatePublicKey = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bitcore = require("bitcore-lib"); | |
const axios = require("axios"); | |
exports.childPaysForParent = async (req, res) => { | |
try { | |
// Load the Bitcoin private key | |
const privateKey = new bitcore.PrivateKey.fromWIF(process.env.BITCOIN_PRIVATE_KEY, testnet); | |
const address = privateKey.toAddress(testnet); | |
// Fetch the unspent transaction outputs (UTXOs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.7.0; | |
// NOTE: This contract is just a suggestion and should not be used as-is. | |
// It is important to thoroughly review and test any smart contract before using it. | |
contract MedicalRecord { | |
// The address of the owner of the contract. | |
address private owner; | |
// The medical records that are being stored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import Box from '@mui/material/Box'; | |
import Grid from '@mui/material/Grid'; | |
import { useTheme } from '@mui/material/styles'; | |
import Main from 'layouts/Main'; | |
import Container from 'components/Container'; | |
import Hero from 'components/Hero'; | |
import Contact from 'components/Newsletter'; | |
import FundraiserCard from 'blocks/FundraiserCard'; | |
import FundraiserFactory from 'contracts/FundraiserFactory.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { Link } from 'react-router-dom'; | |
import { alpha, useTheme } from '@mui/material/styles'; | |
import { | |
Box, | |
Button, | |
Stack, | |
Typography, | |
Grid, | |
Card, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import FundraiserCard from 'blocks/FundraiserCard'; | |
export default function Projects() { | |
... | |
const dispalyFundraiser = () => { | |
return ( | |
funds.map((item) => | |
return <FundraisersCard fundraiser={funds} key={funds}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { Link } from 'react-router-dom'; | |
import ReceiptIcon from '@mui/icons-material/Receipt'; | |
import { | |
Box, | |
Button, | |
Typography, | |
} from '@mui/material'; | |
import FundraiserContract from 'contracts/Fundraiser.json'; | |
import Web3 from 'web3'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import Web3 from 'web3'; | |
import Web3Modal from 'web3modal'; | |
export default function Projects() { | |
const [funds, setFunds] = useState([]); | |
const [contract, setContract] = useState(null); | |
const [accounts, setAccounts] = useState(null); | |
useEffect(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { useFormik } from 'formik'; | |
import * as yup from 'yup'; | |
import { | |
Box, | |
Grid, | |
TextField, | |
Typography, | |
IconButton, | |
Collapse, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleSubmit() { | |
try { | |
const transaction = await contract.methods | |
.createFundraiser(name, image, description, goalAmount, beneficiary) | |
.send({ from: accounts[0] }); | |
console.log(transaction.transactionHash); | |
} catch (error) { | |
alert(error); | |
} | |
} |
NewerOlder