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 NFTContractBuild from 'contracts/NFT.json'; | |
import Web3 from 'web3'; | |
let selectedAccount; | |
let isInitialized = false; | |
let nftContract; | |
let provider = window.ethereum; | |
// sample init function. This runs everytime we need to connect to blockchain. | |
const init = async () => { |
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 express = require('express'); | |
const jwt = require('jsonwebtoken'); | |
const app = express(); | |
app.get('/api',(req,res) =>{ | |
res.json({ | |
message:'Welcome to the API' | |
}) | |
}) |
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 mongoose = require("mongoose"); | |
const passportLocalMongoose = require("passport-local-mongoose"); | |
const userSchema = new mongoose.Schema({ | |
email: { | |
type: String, | |
required: true, | |
unique: true, | |
}, | |
username: { |
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 express = require("express"); | |
const app = express(); | |
require("dotenv").config(); | |
const mongoose = require("mongoose"); | |
const user = require("./models/user"); | |
app.use(express.json()); | |
app.use(express.urlencoded({ extended: true })); | |
mongoose.connect(process.env.MONGODB_URI, { |
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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) | |
pragma solidity ^0.8.0; | |
import "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to |
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.6.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/access/Ownable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol"; | |
contract Allowance is Ownable { | |
using SafeMath for uint; | |
event AllowanceChanged(address indexed _forWho, address indexed _byWhom, uint _oldAmount , uint _newAmount); | |
mapping(address => uint) public allowance; |
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.6.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/access/Ownable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol"; | |
import "./Allowance.sol"; | |
contract SharedWallet is Ownable, Allowance { | |
event MoneySent(address indexed _beneficiary, uint _amount); | |
event MoneyReceived(address indexed _from, uint _amount); |