Skip to content

Instantly share code, notes, and snippets.

View crazyrabbitLTC's full-sized avatar

Dennison Bertram crazyrabbitLTC

View GitHub Profile
@crazyrabbitLTC
crazyrabbitLTC / App.js
Created August 18, 2019 20:40
BerlinWorkshop Front End Code
import React, { useState, useEffect, useCallback } from "react";
import { useWeb3Network } from "@openzeppelin/network";
const PROVIDER_URL = "http://127.0.0.1:8545";
function App() {
// get GSN web3
const context = useWeb3Network(PROVIDER_URL, {
gsn: { dev: true }
});
@crazyrabbitLTC
crazyrabbitLTC / GSNCOUNTER.sol
Last active August 23, 2019 08:21
GSN Enabled Counter for Workshop
pragma solidity ^0.5.0;
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";
contract Counter is GSNRecipient {
uint256 public value;
function increase() public {
value += 1;
}
@crazyrabbitLTC
crazyrabbitLTC / GSNBouncerSignature.sol
Created September 16, 2019 21:43
GSNBouncerSignature for Tutorial
pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./GSNBouncerBase.sol";
import "../../cryptography/ECDSA.sol";
contract GSNBouncerSignature is Initializable, GSNBouncerBase {
using ECDSA for bytes32;
// We use a random storage slot to allow proxy contracts to enable GSN support in an upgrade without changing their
@crazyrabbitLTC
crazyrabbitLTC / index.js
Created September 17, 2019 15:55
Express server for GSNSignatureBouncer Tutorial
require("dotenv").config();
const port = process.env.PORT || 3000;
const express = require("express");
const asyncHandler = require("express-async-handler");
const app = express();
const { signMessage } = require("./utils/signUtils.js");
const {
getDatabase,
addUser,
deleteUser,
{
"activeTab": {
"title": "How To Get Logs And Help MetaMask Support and Diagnose Your Issue – MetaMask",
"origin": "metamask.zendesk.com",
"protocol": "https:",
"url": "https://metamask.zendesk.com/hc/en-us/articles/360015290092-How-To-Get-Logs-And-Help-MetaMask-Support-and-Diagnose-Your-Issue"
},
"metamask": {
"isInitialized": true,
"isUnlocked": true,
@crazyrabbitLTC
crazyrabbitLTC / 3box
Created November 29, 2019 23:51
3box validation
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:muport:QmPAW4V6FfY9UfXQbuysa4Vyov7ioutnKtKvzBjuTYNH7B ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@crazyrabbitLTC
crazyrabbitLTC / DH-Public Method no Arguments
Created January 31, 2020 18:44
DappHero: Public Method with no Arguments Example
<!------------------------ Custom Contract: Public Method: important ------------------------
This method takes no arguments and should return a value. The user should be able to choose
to auto-invote this value on page-load or by using a button manually
-->
<!--Auto-Invoke-->
<div id="dh" data-dh-feature="customContract" data-dh-property-contract-name="DappHeroTest"
data-dh-property-method-name="important">
Placeholder Value to be Replaced
</div>
@crazyrabbitLTC
crazyrabbitLTC / viewNoArgsMultipleReturn.html
Created January 31, 2020 18:56
DappHero: Public Method: No arguments, multiple return arguments
<!------------------------ Custom Contract: Public Method: viewNoArgsMultipleReturn ------------------------
This method takes no arguments and should return multiple values. The user should be able to choose
to auto-invoke this value on page-load or by using a button manually.
Note: users are not required to use all returned arguments.
-->
<!--Implicit-Auto-Invoke-->
<div id="dh" data-dh-feature="customContract" data-dh-property-contract-name="DappHeroTest"
data-dh-property-method-name="viewNoArgsMultipleReturn" data-dh-id="someUniqueId-2">
</div>
@crazyrabbitLTC
crazyrabbitLTC / MutipleArgumentswithMultipleReturnValues.html
Created January 31, 2020 19:11
DappHero: Public Method: Multiple Arguments with Multiple return
<!------------------------ Custom Contract: Public Method: viewMultipleArgsMultipleReturn ------------------------
This method takes any number of input arguments and should return multiple values. All input arguments are required.
Note: users are not required to use all returned arguments.
-->
<!--Implicit-Auto-Invoke-->
<div id="dh" data-dh-feature="customContract" data-dh-property-contract-name="DappHeroTest"
data-dh-property-method-name="viewMultipleArgsMultipleReturn" data-dh-id="someUniqueId-4">
</div>
@crazyrabbitLTC
crazyrabbitLTC / SendEthToMethodNoArgs.html
Last active January 31, 2020 20:35
DappHero: Example of how to send ETH to a method with no arguments
<!------------------------ Custom Contract: Transaction: send Eth with no ARgs ------------------------
This method takes no arguments but sends a transaction to a contract and allows the user to send ETH with the
transaction to the contract method. (Methods with no arguments do exist)
Sending transactions should not Auto-Invoke.
-->
<!-- Value for Ether Amount from a form input -->
<div id="dh" data-dh-feature="customContract" data-dh-property-contract-name="DappHeroTest"
data-dh-property-method-name="sendEthNoArgs" data-dh-id="someUniqueId-7"></div>