package main import ( "fmt" "os" ) func main() { address := "0xbad1568bf8d55f5f808edec0cd7394ebd8d51d0e" fromBlock := 6974800 toBlock := 6974900 result := searchBlock(address, fromBlock, toBlock) if result < fromBlock || result > toBlock { fmt.Printf("error: result must be between %d and %d (actual: %d)\n", fromBlock, toBlock, result) os.Exit(1) } fmt.Printf("result = %d\n", result) } // Find the block where the balance of the given address changed. func searchBlock(address string, fromBlock, toBlock int) int { // TODO return 0 } // Return the balance of an address at a given block. // // Example with curl: // curl -XPOST -H "Content-Type: application/json" https://goerli.infura.io/v3/1958344898c54b909598f1d0b8457805 \ // -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xbad1568bf8d55f5f808edec0cd7394ebd8d51d0e", "0x6a6ec1"],"id":1}' func getBalance(address string, blockId int) string { // TODO return "0" }