Skip to content

Instantly share code, notes, and snippets.


Josh critesjosh

View GitHub Profile
critesjosh / lookup.js
Created Sep 28, 2020
A node script to run a phone number lookup with ODIS on the Celo blockchain
View lookup.js
// In this example, we will go over how to look up a Celo address that is registered with a phone number with ODIS
// 1. Import the appropriate packages
const ContractKit = require('@celo/contractkit')
const OdisUtils = require('@celo/contractkit').OdisUtils
const AuthSigner = require('@celo/contractkit/lib/identity/odis/query').AuthSigner
// 2. Import these packages to help with private key management for the example
const privateKeyToAddress = require('@celo/utils/lib/address').privateKeyToAddress
const normalizeAddressWith0x = require('@celo/utils/lib/address').normalizeAddressWith0x
critesjosh / CELOtransfer.js
Created Sep 21, 2020
Celo token native transfer and ERC20 transfer using contractkit
View CELOtransfer.js
// Import ContractKit
const ContractKit = require('@celo/contractkit')
// Create a new instance of ContractKit, connecting to a local Celo node
//const contractKit = ContractKit.newKit('http://localhost:8545')
const contractKit = ContractKit.newKit('')
// Specify an arbitrary recipient of the transaction
const recipient = '0xB9727f7f1e1f4a5229a49E260fBBBD410d10f2Ff'
const privateKey = '3a26ebc37944c305670a21ea6a5d16c1084db2f18bc6635ba95f487e5c59868f'
critesjosh / index.js
Last active May 6, 2020
This script is a demo of how to use the ContractKit to send a transaction on the Celo network (
View index.js
#!/usr/bin/env node
This script is a demo of how to use the ContractKit to send a transaction on the Celo network (
With npm installed, run this script with the command:
// Import ContractKit
const ContractKit = require('@celo/contractkit')
critesjosh / getInfo.js
Created Apr 9, 2020
A node.js script to print details about the Celo blockchain that is connected at http://localhost:8545
View getInfo.js
// Run this script in a npm project with contractkit installed
const Kit = require('@celo/contractkit')
const CeloContract = Kit.CeloContract
const kit = Kit.newKit('http://localhost:8545')
async function wrapper(){
let accounts = await kit.web3.eth.getAccounts()
View SimpleBank.sol
This exercise has been updated to use Solidity version 0.5
Breaking changes from 0.4 to 0.5 can be found here:
Reference Docs:
pragma solidity ^0.5.0;
View SimpleStorage.sol
pragma solidity >=0.4.0 <0.7.0;
// Rinkeby address: 0x49Bb098E781eD5C50D85E82d85cbA1a6F03FD3e6
contract SimpleStorage {
uint storedData;
event storageUpdate(uint newValue, address updatedBy);
function set(uint x) public {
View ProjectSubmission.sol
pragma solidity ^0.5.0; // Step 1
contract ProjectSubmission { // Step 1
address owner; // Step 1 (state variable)
uint ownerBalance; // Step 4 (state variable)
modifier onlyOwner() { // Step 1
require(msg.sender == owner, "Only the owner can do this.");
critesjosh / Cert721_ABI.json
Created Oct 11, 2019
mint a bunch of NFTs, waiting for each txn to process before sending the next one
View Cert721_ABI.json
"constant": false,
"inputs": [
"internalType": "address",
"name": "account",
"type": "address"
View SimpleStorage.json
"contractName": "SimpleStorage",
"abi": [
"constant": false,
"inputs": [
"name": "x",
"type": "uint256"
critesjosh / Non-transferable ERC 721
Last active Sep 27, 2019
This contract describes a non-transferable ERC 721 token with an update-able token URI data
View Non-transferable ERC 721
pragma solidity ^0.5.0;
import "";
import "";
contract Cert721 is ERC721MetadataMintable, ERC721Enumerable {
constructor (string memory name, string memory symbol)
ERC721Metadata(name, symbol)
You can’t perform that action at this time.