Skip to content

Instantly share code, notes, and snippets.

View Olanetsoft's full-sized avatar
😉

Idris Olubisi Olanetsoft

😉
View GitHub Profile
@Olanetsoft
Olanetsoft / onesignal-node.js
Created May 19, 2021 01:24 — forked from mulhoon/onesignal-node.js
Send a push notification in node with OneSignal
var request = require('request');
var sendMessage = function(device, message){
var restKey = '****';
var appID = '****';
request(
{
method:'POST',
uri:'https://onesignal.com/api/v1/notifications',
headers: {
@Olanetsoft
Olanetsoft / README.txt
Created November 20, 2021 13:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
import React, { useEffect, useState } from "react";
import { ToastContainer, toast } from "react-toastify";
import { ethers } from "ethers";
import "react-toastify/dist/ReactToastify.css";
import Head from "next/head";
export default function Home() {
/**
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract CoffeePortal {
uint256 totalCoffee;
address payable public owner;
@Olanetsoft
Olanetsoft / run.js
Last active December 1, 2021 21:52
const main = async () => {
const coffeeContractFactory = await hre.ethers.getContractFactory(
"CoffeePortal"
);
const coffeeContract = await coffeeContractFactory.deploy({
value: hre.ethers.utils.parseEther("0.1"),
});
await coffeeContract.deployed();
console.log("Coffee Contract deployed to:", coffeeContract.address);
const main = async () => {
const [deployer] = await hre.ethers.getSigners();
const accountBalance = await deployer.getBalance();
console.log("Deploying contracts with account: ", deployer.address);
console.log("Account balance: ", accountBalance.toString());
const Token = await hre.ethers.getContractFactory("CoffeePortal");
const portal = await Token.deploy({
value: hre.ethers.utils.parseEther("0.1"),
@Olanetsoft
Olanetsoft / NewsFeed.sol
Created April 26, 2022 09:39
Build a Decentralized News Feed using Reactjs, TailwindCSS, Etherjs, IPFS & Solidity
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract NewsFeed {
uint256 totalFeeds;
using Counters for Counters.Counter;
@Olanetsoft
Olanetsoft / feed-test.js
Created April 26, 2022 09:43
Build a Decentralized News Feed using Reactjs, TailwindCSS, Etherjs, IPFS & Solidity
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("NewsFeed", function () {
this.timeout(0);
let NewsFeed;
let newsFeedContract;
before(async () => {
@Olanetsoft
Olanetsoft / Getting-started-with-dapps.md
Last active January 1, 2024 17:56
Series 1: Mara Blockchain Masterclass - Nigeria

Series 1: Mara Blockchain Masterclass - Nigeria

This workshop is targeted at developers who are transitioning from Web2 to Web3 or have just recently gotten into Web3 and are looking to have a well-rounded foundation.

This first workshop is Series 1 in the three-part series that aims to introduce you to the blockchain and how to build on the blockchain.

Steps to set up a project, build and deploy a smart contract.

Step 1

@Olanetsoft
Olanetsoft / index.js
Created October 5, 2022 21:42
Setup provider - Getting Started on StarkNet with Infura
import dotenv from "dotenv";
import fs from "fs";
import { Account, Contract, ec, json, stark, Provider, number } from "starknet";
import readline from "readline";
dotenv.config();
// Initialize provider
const url = process.env.STARKNET_TESTNET_ENDPOINT;