Skip to content

Instantly share code, notes, and snippets.

View critesjosh's full-sized avatar
🥸

josh crites critesjosh

🥸
View GitHub Profile
{
"bridgeConfigs": [
{
"numTxs": 40,
"gas": 500000,
"bridgeAddressId": 1,
"permittedAssets": [
1
]
},
@critesjosh
critesjosh / docker-compose.fork.yml
Last active January 11, 2023 20:05
A docker compose script to start an Ethereum mainnet fork with anvil and the Aztec stack locally, use chain id 3567
version: '3'
services:
fork:
image: ghcr.io/foundry-rs/foundry:nightly-8c4294c1d2321e20a3543fbd9a813d47053a8303
entrypoint: 'anvil -p=8545 --host 0.0.0.0 --fork-url ${FORK_URL} --chain-id ${CHAIN_ID}'
ports:
- '8545:8545'
contracts:
platform: linux/amd64
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec.
pragma solidity >=0.8.4;
import {BaseDeployment} from "../base/BaseDeployment.s.sol";
import {AddressRegistry} from "../../bridges/registry/AddressRegistry.sol";
contract AddressRegistryDeployment is BaseDeployment {
function deploy() public returns (address) {
@critesjosh
critesjosh / docker-compose.dev.yml
Last active January 5, 2023 01:16
A docker compose script to start the Aztec stack locally (no bridges), chain id 31337
version: '3'
services:
contracts:
platform: linux/amd64
image: aztecprotocol/contracts:latest
environment:
ETHEREUM_HOST: ${ETHEREUM_HOST:-}
PORT: 8547
command: ./scripts/start_e2e.sh
ports:
@critesjosh
critesjosh / cUSD_abi.json
Last active December 26, 2022 13:27
An example script for watching for events emitted by a Celo contract via Forno
[{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"string","name":""}],"name":"name","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"approve","inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"value"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"validatorSignerAddressFromCurrentSet","inputs":[{"type":"uint256","name":"index"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"valueToUnits","inputs":[{"type":"uint256","name":"value"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"initialized","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"totalSupp
@critesjosh
critesjosh / EIP20Factory.sol
Created February 22, 2018 16:03
erc20 token factory
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.18;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
@critesjosh
critesjosh / lookup.js
Last active October 13, 2022 21:46
A node script to run a phone number lookup with ODIS on the Celo blockchain
// 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/identity').OdisUtils
// 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
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = function override(config) {
let fallback = config.resolve.fallback || {};
// These fallbacks are required for the @aztec/sdk v2.1.0-testnet.30 or greater
Object.assign(fallback, {
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
@critesjosh
critesjosh / rollupprocessor.json
Created June 6, 2022 19:15
aztec rollup processor abi
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_escapeBlockLowerBound",
"type": "uint256"
},
{
"internalType": "uint256",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_verifierAddress",
"type": "address"
},
{
"internalType": "uint256",