Skip to content

Instantly share code, notes, and snippets.

View yorhodes's full-sized avatar
hyper

Yorke Rhodes yorhodes

hyper
View GitHub Profile
@yorhodes
yorhodes / AnvilRPC.sol
Last active May 26, 2024 16:28
Forge Anvil cheatcodes
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import "forge-std/Vm.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
library AnvilRPC {
using Strings for address;
using Strings for uint256;
Traces:
[4853700] ezETH::run()
├─ [0] VM::selectFork(0)
│ └─ ← [Return]
├─ [2250871] → new HypXERC20Lockbox@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
│ ├─ [9495] 0xC8140dA31E6bCa19b287cC35531c2212763C2059::ERC20()
│ │ ├─ [2359] 0xEEadA1F6061E30bb1501319BBFFb44Fdf7037Ca8::ERC20() [delegatecall]
│ │ │ └─ ← [Return] 0xbf5495Efe5DB9ce00f80364C8B423567e58d2110
│ │ └─ ← [Return] 0xbf5495Efe5DB9ce00f80364C8B423567e58d2110
│ ├─ [7552] 0xc005dc82818d67AF737725bD4bf75435d065D239::localDomain() [staticcall]
@yorhodes
yorhodes / SchemaParser.ts
Last active May 22, 2024 23:03
Parses a zod schema from stdin via inquirer prompts
import { checkbox, confirm, input, select } from '@inquirer/prompts';
import { z } from 'zod';
export function promptBoolean<S extends z.ZodBoolean>(
_schema: S,
options: Parameters<typeof confirm>[0],
): () => Promise<boolean> {
return () => confirm(options);
}
@yorhodes
yorhodes / README.md
Created January 2, 2024 21:44
Deploy hyperlane cosmwasm warp route instructions
  1. Build and install the CosmWasm tooling
$ git clone https://github.com/many-things/cw-hyperlane
$ cd cw-hyperlane && cargo build && cargo wasm
$ cd scripts && pnpm install
  1. Deploy warp route contracts:
// SPDX-License-Identifier: MIT OR Apache-2.0
// Sources flattened with hardhat v2.16.1 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol@v4.8.0
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
@yorhodes
yorhodes / NoopIsm.sol
Last active September 23, 2023 20:43
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {IInterchainSecurityModule} from "@hyperlane-xyz/core/contracts/interfaces/IInterchainSecurityModule.sol";
contract NoopIsm is IInterchainSecurityModule {
uint8 public constant override moduleType = uint8(Types.NULL);
function verify(bytes calldata, bytes calldata) public pure override returns (bool) {
return true;

Open this in zkREPL →

This file can be included into other zkREPLs with include "gist:f3b1607e2acd2602c169e0e1f7464e7c";

@yorhodes
yorhodes / mainnet-flattened.sol
Created July 8, 2022 22:24
Abacus Mainnet Core contracts flattened
// Sources flattened with hardhat v2.9.9 https://hardhat.org
// SPDX-License-Identifier: MIT
// File interfaces/IMailbox.sol
// pragma solidity >=0.6.11;
pragma abicoder v2;
@yorhodes
yorhodes / gist:2cc003756779b46a3e781fb588f5fb89
Created June 9, 2022 18:08
Hello World deployment output
DEBUG=* yarn ts-node scripts/deploy-helloworld.ts
abacus:RouterDeployer Start Deploy +0ms
abacus:RouterDeployer Deploying to alfajores... +1ms
abacus:RouterDeployer Deploy router on alfajores +0ms
abacus:RouterDeployer Initializing alfajores's router with 0xc41169650335Ad274157Ea5116Cdf227430A68a3 +7s
abacus:RouterDeployer Deploying to kovan... +2s
abacus:RouterDeployer Deploy router on kovan +1ms
abacus:RouterDeployer Initializing kovan's router with 0xfA1fBF362144ae1bEf2E33409948dA1FB812bb41 +6s
abacus:RouterDeployer Deploying to fuji... +2s
abacus:RouterDeployer Deploy router on fuji +1ms

Overview

Please see our Understanding ReleaseGold docs.

Balances

The Celo Rosetta service exposes 3 types of ReleaseGold balances on the /account/balance endpoint.

ReleaseGoldVested