go mev-geth example. signTx,send transaction to relay.

go-mev-geth

go mev-geth example. signTx,send transaction to relay.

sample smart contract

/eth/contract/mevtransfer/mevtransfer.sol

pragma solidity 0.6.6;
interface IChiToken {
    function freeFromUpTo(address from, uint256 value) external;
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);
}

contract MevTransfer{
    IChiToken constant public chi = IChiToken(0x0000000000004946c0e9F43F4Dee607b0eF1fA1c);

    modifier discountCHI {
        uint gasStart = gasleft();
        _;
        uint gasSpent = 21000 + gasStart - gasleft() + 16 * msg.data.length;
        uint chiToUse = (gasSpent + 14154) / 41947;
        if (chiToUse > 0 && chi.balanceOf(msg.sender) >= chiToUse && chi.allowance(msg.sender,address(this)) >= chiToUse){
            chi.freeFromUpTo(msg.sender, (gasSpent + 14154) / 41947);
        }
    }

    function transfer(uint bribe)  external payable discountCHI {
        block.coinbase.transfer(bribe);
        msg.sender.transfer(address(this).balance);
    }
}

a sample contract to 1. give bribe 2. use chi token 3. do a sample transfer.

use abigen to get go binding code.

sign & send tx

/bundle/bundle.go

build tx

/bundle/bundle_test.go

how to use

change sender & contract var in TestBundle_Simulate and run test.

the sender is the EOA to send the tx.

the contract is the mevTransfer.sol address after deploy.

Owner
Similar Resources

Learn-Nakama - An example project template on how to set up and write custom logic in Nakama server

Nakama Project Template An example project template on how to set up and write c

Apr 18, 2022

A software architecture style example for APIs that utilizes the features of SOLID-Principle.

A software architecture style example for APIs that utilizes the features of SOLID-Principle.

Engelbyte's Waterbyte Clean Architecture A software architecture style example for APIs that utilizes the features of SOLID-Principle. The example sho

Feb 9, 2022

Node is where client will send data to, create block send to miner, create block send to parent and receive tick from validator and do validate

Node Receive Tick from validator Validate POH of tick send result to validator Receive confirm block from validator Send Checked block to validator Ho

Dec 31, 2021

Eth2-MEV project with liquid staking (Flashbots-Lido-Nethermind)

Eth2-MEV project with liquid staking (Flashbots-Lido-Nethermind)

Ray Tracing Eth2-MEV project with liquid staking (Flashbots-Lido-Nethermind). Notes | Slides What you need to setup: Eth2 validator with Rayonism enab

Jan 2, 2023

An easy tool to apply transactions to the current EVM state. Optimized for MEV.

sibyl A more embedded version of fxfactorial/run-evm-code. This tool makes it easy to apply transactions to the current EVM state. Call it a transacti

Dec 25, 2022

Mev-boost: A middleware server written in Go

mev-boost A middleware server written in Go, that sits between an ethereum PoS consensus client and an execution client. It allows consensus clients t

Dec 28, 2022

Reverse Proxy for geth node

Reverse Proxy for geth node

geth-proxy Reverse Proxy for geth node gcr.io/moonrhythm-containers/geth-proxy Features Health check base on last synced block timestamp Merge websock

Jul 26, 2022

Geth client which picks the most profitable blocks to mine using a greedy algorithm

Greeden-Geth Greeden-Geth is a protocol-agnostic client which uses a greedy algorithm to pick the most profitable blocks to submit to the network out

Nov 16, 2022

An easy to setup local crypto wallet based on Geth

CryptoWallet An easy to setup local crypto wallet based on Geth To run. go run CrytoWallet This will expose a set a api's. To Create new Wallet curl

Oct 15, 2021

This bot require you to run the GETH client + use ethers framework.

Mad Liquidity Sniper This bot require you to run the GETH client + use ethers framework. All addresses and private keys contained have been changed fo

Oct 19, 2021

EVM Liquidity Sniper Bot consuming GETH txs through the mempool

AX-50 Liquidity Sniper This bot requires you to run the GETH client + use ethers framework. Supports any EVM environment and UniSwapV2 forked AMM seem

Jan 6, 2023

Berylbit PoW chain using Ethash, EPI-Burn and geth. The chain will be using bot congestion flashbot bundles through nodes

Berylbit PoW chain using Ethash, EPI-Burn and geth. The chain will be using bot congestion flashbot bundles through nodes. Soon, We will work towards

Jun 30, 2022

🔥 Golang live stream lib/client/server. support RTMP/RTSP/HLS/HTTP[S]-FLV/HTTP-TS, H264/H265/AAC, relay, cluster, record, HTTP API/Notify, GOP cache. 官方文档见 https://pengrl.com/lal

🔥 Golang live stream lib/client/server. support RTMP/RTSP/HLS/HTTP[S]-FLV/HTTP-TS, H264/H265/AAC, relay, cluster, record, HTTP API/Notify, GOP cache. 官方文档见 https://pengrl.com/lal

lal是一个开源GoLang直播流媒体网络传输项目,包含三个主要组成部分: lalserver:流媒体转发服务器。类似于nginx-rtmp-module等应用,但支持更多的协议,提供更丰富的功能。lalserver简介 demo:一些小应用,比如推、拉流客户端,压测工具,流分析工具,调度示例程序等

Jan 1, 2023

Celer cBridge relay node implementation in Golang

cBridge Relay Node Official implementation of cBridge relay node in Golang. Prerequisites Prepare Machine To run a cBridge relay node, it is recommend

Sep 27, 2022

gRelay is an open source project written in Go that provides the circuit break pattern with a relay idea behind.

gRelay is an open source project written in Go that provides the circuit break pattern with a relay idea behind.

gRELAY gRelay is an open source project written in Go that provides: Circuit Break ✔️ Circuit Break + Relay ✔️ Concurrecny Safe ✔️ Getting start Insta

Sep 30, 2022

Minimal go library to relay webhook events back to an arbitrary service.

hookrelay Minimal go library to relay webhook events back to an arbitrary service. With the use of a primary HTTP mux router, we are able to register

Nov 3, 2021

An easy to use relay for cftools webhook events piped to Discord when filter rules match.

CFTools Relay CFTools Relay is an easy-to-use, still in development, tool that allows you to subscribe to CFTools Cloud Webhook events and forward the

Nov 22, 2022

Server and relay side infrastructure for RDA

BitterJohn Server and relay side infrastructure for RDA. Usage install sudo ./BitterJohn install -g systemctl enable --now BitterJohn upgrade sudo ./B

Dec 14, 2022

A relay for VMess

Naruse A relay for VMess.

Oct 13, 2022
Comments
  • no error but not success either

    no error but not success either

    problem

    I use this repo to build & sign tx, send it to relay, the http code is 200(which means the header X-Flashbots-Signature is good), and no error msg gets from the relay(no matter eth_callBundle or eth_sendBundle).

    from etherscan I know the tx is not mined also.

    I have test in mainnet as well as goerli testnet, same result.

    repsonse from the relay:

    {[] {0xc00023a000} }

    payload

    this is my payload

    {
        "jsonrpc":"2.0",
        "method":"eth_callBundle",
        "params":[
            [
                "0xf88582018b80828474945392b5fe24367d4d8079de9c3c6e2b7b2eb632a701a412514bba000000000000000000000000000000000000000000000000000000000000000026a0d7ef58fc03c0d5be4d3c98631dec94d72a76e7052515805e964852c8852f2724a039093501bf27df3d6acfdcccab9144c1a7bb6d0b9e488ecf37d5fb415635ef91",
                "0xf88c82018c8082a96b945392b5fe24367d4d8079de9c3c6e2b7b2eb632a7872386f26fc10001a412514bba000000000000000000000000000000000000000000000000002386f26fc1000026a0053d00e9fa9627ded5d7f85c1eb1808198d60170b5c4198ec289ea7bb909b7b8a05d9d5cf0ad7f0da4da95d1f3fb397f17a6f5197670fc0ac9ce5acbadac635ac2"
            ],
            "0xbb858b",
            0,
            0
        ],
        "id":1
    }
    
Example repository for embedding Litestream in a Go application.

Litestream as Library This repository is an example of embedding Litestream as a library in a Go application. The Litestream API is not stable so you

Dec 6, 2022
Example code for my Cadence Intro Workshop

Temporal Intro Workshop This repository contains example code for my Temporal Intro Workshop. Prerequisites Git, Make, etc. Make sure you have the lat

Dec 18, 2022
Example resource for alt:V Go module

Example resource for alt:V Go module

Dec 9, 2022
Example go clean architecture folder pattern

Golang Clean Architecture (Maintenance) Berikut ini adalah folder structure pattern yang biasa saya gunakan, walaupun tidak semua nya saya terapkan di

Dec 21, 2022
Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

Oct 29, 2021
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Dec 5, 2022
Questions and answers example project.

Question Answer Service REST Service for questions and answers Database modeling Directory tree pkg: Here is the main source code. sql: Here are all t

Dec 17, 2021
Go realworld example

TODOs Users and Authentication POST /user/login: Existing user login POST /users: Register a new user GET /user: Get current user PUT /user: Update cu

Dec 8, 2022
A golang example of gRPCtutorials.

A golang example of gRPCtutorials.

Nov 20, 2021
At this example project, I'm trying to learn Golang with Clean structure and come up with a reusable

Learning Golang Language In Clean Structure At this example project, I'm trying to learn Golang with Clean structure and come up with a reusable, nice

Sep 25, 2022