
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
github.com/adzil/bundlerpc
BundleRPC implements Flashbots JSON-RPC client that is compatible with the standard Go-Ethereum data types.
For more information about Flashbots RPC, please visit their documentation website.
The following code snippet is incomplete and cannot be run as-is. However, it can be used as the starting point for interacting with the Flashbots RPC.
package main
import (
"fmt"
"github.com/adzil/bundlerpc"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
)
func main() {
// Create random private key for signing the Flashbots JSON-RPC payload.
// Consider using stored private key for long-term usage to build
// reputation with the Flashbots relay.
flashbotsKey, err := crypto.GenerateKey()
if err != nil {
panic(err)
}
// Create new JSON-RPC client using the previously generated private key.
flashbots, err := bundlerpc.Dial("https://relay.flashbots.net", flashbotsKey)
if err != nil {
panic(err)
}
// Instantiate the Eth client to obtain the latest block number.
ethrpc, err := rpc.Dial("http://localhost:8545")
if err != nil {
panic(err)
}
defer ethrpc.Close()
eth := ethclient.NewClient(ethrpc)
// ...Build the actual transactions here...
var txOne, txTwo *types.Transaction
// Get the latest block number.
blockNumber, err := eth.BlockNumber(context.Background())
if err != nil {
panic(err)
}
// Send transaction bundle of txOne and txTwo using Flashbots relay. Note
// that you must explicitly set NoSend field in the bind.TransactionOpts to
// prevent sending them into the public mempool.
bundle, err := flashbots.SendBundle(context.Background(), bundlerpc.SendBundleParam{
Txs: []*types.Transaction{
txOne,
txTwo,
},
BlockNumber: blockNumber,
})
if err != nil {
panic(err)
}
// Print the resulting bundle hash.
fmt.Printf("%#v\n", bundle)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.