Skip to content

Instantly share code, notes, and snippets.

View jboetticher's full-sized avatar
🎠
<- horsey 😃

jboetticher

🎠
<- horsey 😃
View GitHub Profile
@jboetticher
jboetticher / AxelarGasServiceMock.sol
Created October 3, 2023 02:05
Mechanics of Cross-Chain Transfers (Polkadot Talk)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
contract AxelarGasServiceMock {
// This is called on the source chain before calling the gateway to execute a remote contract.
function payNativeGasForContractCall(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
@jboetticher
jboetticher / HelloWorld.sol
Created June 22, 2023 02:27
A HelloWorld smart contract for Hyperlane
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
import { Router } from "https://raw.githubusercontent.com/hyperlane-xyz/hyperlane-monorepo/main/solidity/contracts/Router.sol";
contract HelloWorld is Router {
function initialize(address _mailbox, address _interchainGasPaymaster) external initializer {
__Router_initialize(
_mailbox,
_interchainGasPaymaster
@jboetticher
jboetticher / gas-estimation-issue.js
Created March 31, 2023 14:13
Gas estimation error
const ethers = require('ethers');
// Alice account
const YOUR_PRIVATE_KEY = '0x28194e8ddb4a2f2b110ee69eaba1ee1f35e88da2222b5a7d6e3afa14cf7a3347';
const USE_LEGACY = true;
const LEGACY_GAS_PRICE_MULTIPLIER = 1.1;
// Create provider & wallet
const providerRPC = {
moonbase: {
@jboetticher
jboetticher / ClientIssue.sol
Created March 14, 2023 00:54
Attempting to replicate eth_getBlockByHash issue
pragma solidity ^0.8.12;
contract ClientIssue {
event LogEvent();
function causeEvent() external {
emit LogEvent();
}
}
@jboetticher
jboetticher / HelloWorld.sol
Created January 20, 2023 16:01
Moonbuilder's Academy Connected Contract for LayerZero
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
import "https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/lzApp/NonblockingLzApp.sol";
contract HelloWorld is NonblockingLzApp {
constructor(address _lzEndpoint) NonblockingLzApp(_lzEndpoint) {}
function sendMessage(string memory message, uint16 destChainId) external payable {
@jboetticher
jboetticher / SimpleGeneralMessage.sol
Last active November 16, 2022 19:30
Wormhole SimpleGeneralMessage
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "https://github.com/wormhole-foundation/wormhole/blob/dev.v2/ethereum/contracts/interfaces/IWormhole.sol";
contract SimpleGeneralMessage {
mapping(address => string) public lastMessage;
IWormhole immutable core_bridge;
@jboetticher
jboetticher / SimpleGeneralMessage.sol
Created November 1, 2022 17:29
Hello World Contract for Wormhole
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "https://github.com/wormhole-foundation/wormhole/blob/dev.v2/ethereum/contracts/interfaces/IWormhole.sol";
contract SimpleGeneralMessage {
mapping(address => string) public lastMessage;
// 0xc8e is only on Moonbeam
@jboetticher
jboetticher / SimpleGeneralMessage.sol
Created October 28, 2022 18:22
Hyperlane SimpleGeneralMessage
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
// ============ External Imports ============
import {Router} from "@hyperlane-xyxz/app/contracts/Router.sol";
contract SimpleGeneralMessage is Router {
mapping(address => string) public lastMessage;
@jboetticher
jboetticher / SimpleGeneralMessage.sol
Last active June 14, 2023 22:39
A contract that sends and stores a string between chains using LayerZero.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/lzApp/NonblockingLzApp.sol";
contract SimpleGeneralMessage is NonblockingLzApp {
using BytesLib for bytes;
mapping(address => string) public lastMessage;
@jboetticher
jboetticher / BatchToken.sol
Created July 21, 2022 03:55
World hunger solver for batch precompile (Approve + Send demonstration)
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// At Address
// 0x4391990EDE738d143923D8240c093b9c2D97ddA3
// Be sure to show your current balance
contract BatchToken is ERC20 {