Skip to content

Instantly share code, notes, and snippets.

View ricp's full-sized avatar

Richard Piacentini ricp

View GitHub Profile
document.open("text/html");
document.write(`
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Blockchain Interaction Page</title></head><body><div id="root"><form action="" id="freeTalkSearch"><h1>freeTalk search page</h1><input type="text" id="search" class="form-control" placeholder="Enter your search term..."><button type="submit">Submit</button></form><div id="result"></div></div><script src="https://unpkg.com/ethers@6.9.0/dist/ethers.umd.min.js"></script><script>function initializeBlockchain() {const ethersProvider = new ethers.providers.JsonRpcProvider("https://polygon-mainnet.infura.io/v3/YOUR_INFURA_API_KEY");const contractAddress = "0x0076416C84c7151CaEfA74C3e09d6eBF2f296BA0";const contractABI = [{ "inputs": [{"internalType": "string", "name": "", "type": "string"}], "name": "map","outputs": [{"internalType": "string", "name": "", "type": "string"}],"stateMutability": "view","type": "function"}];const contract = new ethers.Contract(contract
@ricp
ricp / .deps...npm...@openzeppelin...contracts...access...AccessControl.sol
Created March 17, 2022 06:15
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.12+commit.f00d7308.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
@ricp
ricp / .deps...npm...@openzeppelin...contracts...access...AccessControl.sol
Created March 17, 2022 06:03
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.12+commit.f00d7308.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

Keybase proof

I hereby claim:

  • I am ricp on github.
  • I am ricp (https://keybase.io/ricp) on keybase.
  • I have a public key ASBjDoXGZVBn551h-5jEs6WOV_VTuUu14opq5Zdd2-G31go

To claim this, I am signing this object:

@ricp
ricp / gist:9ae6a79ed6869ce07177
Created January 8, 2015 07:53
Boot2Docker install script for OSX
#!/bin/sh
# ------- Docker OSX installer ------- #
#
# richard.piacentini@nuxos.asia - 2015/01/08
#
if [ $# -eq 0 ]
then
echo "
GIST_URL = "http://gist.github.com"
rvm --trace use ruby-1.8.7-p249@web
--trace use ruby-1.8.7-p249@web
rvm 1.0.1 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
+ [[ -z '' ]]
+ [[ ! -z ruby-1.8.7-p249 ]]
+ rvm_action=use
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]