Skip to content

Instantly share code, notes, and snippets.

@cwhinfrey
cwhinfrey / message-taxonomy.md
Last active April 9, 2024 16:14
An Incomplete Taxonomy of Cross-Chain Messages

An Incomplete Taxonomy of Cross-Chain Messages

Single or Batched

Single Messages - Single messages have a single target address, target chainId, and data payload. The vast majority of cross-chain messages today are single messages.

Example:

function dispatchMessage(uint256 toChainId, address to, bytes calldata data) external payable returns (bytes32 messageId);
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active April 26, 2024 07:12
Bridge Hack List
@cwhinfrey
cwhinfrey / GasBurner.sol
Created April 24, 2020 22:08
GasBurner.sol
contract GasBurner {
uint[] nums;
function doSomethingHeavy() public {
for( uint i = 0; i < 50; i++ ) {
nums.push(i);
}
}
}
@cwhinfrey
cwhinfrey / IAuthereumAccount.sol
Created March 13, 2020 21:53
Full Authereum Interface
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
contract IAuthereumAccount {
function () external payable;
// getters
function authereumVersion() external view returns(string memory);
@cwhinfrey
cwhinfrey / 3box
Last active February 4, 2020 07:00
3box
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreighubmjjux4mh55yaqer6fsfeyg2lozjtpjr7kygwv27vz2sqwn3i ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@cwhinfrey
cwhinfrey / IAuthereumAccount.sol
Last active February 17, 2020 03:52
Authereum Account Contract Interface
pragma experimental ABIEncoderV2;
interface IAuthereumAccount {
// This is required for funds sent to this contract
function () external payable;
/// @dev Get the number of authKeys
/// @return The number of authKeys
function numAuthKeys() external view returns (uint);
@cwhinfrey
cwhinfrey / UpgradabilityPatterns.sol
Last active October 19, 2019 00:14
UpgradabilityPatterns.sol
pragma solidity ^0.5.10;
// V1
contract AccountV1Storage {
uint lastInitializedVersion;
uint a;
}
contract AccountV1 is AccountV1Storage {
@cwhinfrey
cwhinfrey / BasicProxy.sol
Created October 17, 2019 02:30
BasicProxy.sol
pragma solidity ^0.5.0;
contract BasicProxy {
address public implementation = 0xB6Eb4245eF5626E3505c6223D3157FCE3CE8d0AE;
function () external payable {
address target = implementation;
assembly {
@cwhinfrey
cwhinfrey / Create2.sol
Created July 8, 2019 01:19
Create2 Library
/**
* @title Create2
*
* @dev Utility library for deploying contracts with the CREATE2 EVM opcode and
* computing the contract address of CREATE2 deployments
*/
library Create2 {
/**
* @dev Function to compute the address of a contract created with CREATE2.
* @param _salt The salt used to the contract address computation
pragma solidity ^0.5.8;
contract Channels {
function deposit(address _participant) public payable;
}
contract Bouncer {
Channels channelContract;
address participant;