Skip to content

Instantly share code, notes, and snippets.

@akerbabber
akerbabber / test.sol
Last active January 10, 2024 14:34
Gelato test
(uint8 v, bytes32 r, bytes32 s) = _signERC2771(privateKey, address(contractAddress), data);
(bool success, bytes memory nonceBytes) =
TRUSTED_FORWARDER.call(abi.encodeWithSignature("userNonce(address)", signer));
//convert nonce to uint
uint256 nonce = abi.decode(nonceBytes, (uint256));
require(success, "userNonce failed");
vm.startPrank(relay);
(bool success2, bytes memory result) = (0xd8253782c45a12053594b9deB72d8e8aB2Fca54c).call(
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_hausesToken",
"type": "address"
}
],
"stateMutability": "nonpayable",
@akerbabber
akerbabber / app.js
Created December 15, 2022 00:26
Optimism bridge hack detector
#! /usr/local/bin/node
// Transfers between L1 and L2 using the Optimism SDK
const ethers = require("ethers");
const optimismSDK = require("@eth-optimism/sdk");
const axios = require("axios");
require("dotenv").config();
const l1BridgeAddress = "0x99c9fc46f92e8a1c0dec1b1747d010903e884be1";
// test that the owner IS actually the owner!!
// test that tokens can't be stolen!!!!
// test that user is verified
// test that deposit amount does not exceed maximum deposit
// test that withdrawl amount does not exceed maximum withdrawl
// test that payment is successfull
// test that user/or other external contract can't invoke addSeed function
// test that user/other external contract can't invoke addUser function
// test that expiry date is not less than shelf life minus now/block.timestamp
// USE EVENTS OR DEBUGGER to sort of CONSOLE LOG stuff
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
@akerbabber
akerbabber / DividendEngine.sol
Created June 19, 2019 09:28
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
import "./ERC20Mintable.sol";
import "./DividendPayingTokenInterface.sol";
import "./SafeMathUint.sol";
import "./SafeMathInt.sol";
/// @title Dividend-Paying Token
/// @author Roger Wu (https://github.com/roger-wu)
/// @dev A mintable ERC20 token that allows anyone to pay and distribute ether
@akerbabber
akerbabber / DividendEngine.sol
Created June 18, 2019 16:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
import "./ERC20Mintable.sol";
import "./DividendPayingTokenInterface.sol";
import "./SafeMathUint.sol";
import "./SafeMathInt.sol";
/// @title Dividend-Paying Token
/// @author Roger Wu (https://github.com/roger-wu)
/// @dev A mintable ERC20 token that allows anyone to pay and distribute ether
Verifying my Blockstack ID is secured with the address 12GhvaS6tZ9kL3mbnkVzMxsMypQ6BYM9j6 https://explorer.blockstack.org/address/12GhvaS6tZ9kL3mbnkVzMxsMypQ6BYM9j6